summaryrefslogtreecommitdiff
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2002-06-19 15:21:49 -0400
committerBrad King <brad.king@kitware.com>2002-06-19 15:21:49 -0400
commit07d35e662dc76fa7702d54f4a9b3ced3dac3c969 (patch)
tree9cde169f2d59b54ac0a779e0ef55d6260452f84c /Source/cmSystemTools.cxx
parent27a2cad0fcaa0c3733c0adf532d59df7ba3cde29 (diff)
downloadcmake-07d35e662dc76fa7702d54f4a9b3ced3dac3c969.tar.gz
ENH: Added cmStringStream class to wrap std::stringstream or std::strstream depending on the platform. The interface is that of std::stringstream, so no "ends" or "rdbuf()->freeze(0)" lines are needed.
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx19
1 files changed, 7 insertions, 12 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index c357c3e5ef..5730eb8b07 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -1068,12 +1068,11 @@ bool cmSystemTools::FilesDiffer(const char* source,
if(statSource.st_size != static_cast<long>(finSource.gcount()) ||
statSource.st_size != static_cast<long>(finDestination.gcount()))
{
- std::strstream msg;
+ cmStringStream msg;
msg << "FilesDiffer failed to read files (allocated: "
<< statSource.st_size << ", read source: " << finSource.gcount()
- << ", read dest: " << finDestination.gcount() << std::ends;
- cmSystemTools::Error(msg.str());
- delete [] msg.str();
+ << ", read dest: " << finDestination.gcount();
+ cmSystemTools::Error(msg.str().c_str());
delete [] source_buf;
delete [] dest_buf;
return false;
@@ -1176,12 +1175,10 @@ void cmSystemTools::cmCopyFile(const char* source,
if (statSource.st_size != statDestination.st_size)
{
- std::strstream msg;
+ cmStringStream msg;
msg << "CopyFile failed to copy files (sizes differ, source: "
- << statSource.st_size << " , dest: " << statDestination.st_size
- << std::ends;
- cmSystemTools::Error(msg.str());
- delete [] msg.str();
+ << statSource.st_size << " , dest: " << statDestination.st_size;
+ cmSystemTools::Error(msg.str().c_str());
}
}
@@ -1427,7 +1424,7 @@ bool cmSystemTools::RunCommand(const char* command,
if (WIFSIGNALED(retVal))
{
retVal = WTERMSIG(retVal);
- std::strstream error;
+ cmStringStream error;
error << "\nProcess terminated due to ";
switch (retVal)
{
@@ -1455,9 +1452,7 @@ bool cmSystemTools::RunCommand(const char* command,
error << "signal " << retVal;
break;
}
- error << std::ends;
output += error.str();
- error.rdbuf()->freeze(0);
}
return false;
#endif