Remove c_str calls when using stream APIs.

Use an ad-hoc clang tool for matching the calls which should be
ported.
This commit is contained in:
Stephen Kelly 2014-03-11 13:35:32 +01:00
parent 21c573f682
commit af8a1643c1
49 changed files with 297 additions and 297 deletions

View File

@ -444,13 +444,13 @@ int cmCPackDebGenerator::createDeb()
std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
tmpFile += "/Deb.log"; tmpFile += "/Deb.log";
cmGeneratedFileStream ofs(tmpFile.c_str()); cmGeneratedFileStream ofs(tmpFile.c_str());
ofs << "# Run command: " << cmd.c_str() << std::endl ofs << "# Run command: " << cmd << std::endl
<< "# Working directory: " << toplevel << std::endl << "# Working directory: " << toplevel << std::endl
<< "# Output:" << std::endl << "# Output:" << std::endl
<< output.c_str() << std::endl; << output << std::endl;
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem running tar command: " cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem running tar command: "
<< cmd.c_str() << std::endl << cmd << std::endl
<< "Please check " << tmpFile.c_str() << " for errors" << std::endl); << "Please check " << tmpFile << " for errors" << std::endl);
return 0; return 0;
} }
@ -528,13 +528,13 @@ int cmCPackDebGenerator::createDeb()
std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
tmpFile += "/Deb.log"; tmpFile += "/Deb.log";
cmGeneratedFileStream ofs(tmpFile.c_str()); cmGeneratedFileStream ofs(tmpFile.c_str());
ofs << "# Run command: " << cmd.c_str() << std::endl ofs << "# Run command: " << cmd << std::endl
<< "# Working directory: " << toplevel << std::endl << "# Working directory: " << toplevel << std::endl
<< "# Output:" << std::endl << "# Output:" << std::endl
<< output.c_str() << std::endl; << output << std::endl;
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem running tar command: " cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem running tar command: "
<< cmd.c_str() << std::endl << cmd << std::endl
<< "Please check " << tmpFile.c_str() << " for errors" << std::endl); << "Please check " << tmpFile << " for errors" << std::endl);
return 0; return 0;
} }

View File

@ -285,7 +285,7 @@ int cmCPackGenerator::InstallProjectViaInstallCommands(
it != installCommandsVector.end(); it != installCommandsVector.end();
++it ) ++it )
{ {
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Execute: " << it->c_str() cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Execute: " << *it
<< std::endl); << std::endl);
std::string output; std::string output;
int retVal = 1; int retVal = 1;
@ -296,12 +296,12 @@ int cmCPackGenerator::InstallProjectViaInstallCommands(
std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
tmpFile += "/InstallOutput.log"; tmpFile += "/InstallOutput.log";
cmGeneratedFileStream ofs(tmpFile.c_str()); cmGeneratedFileStream ofs(tmpFile.c_str());
ofs << "# Run command: " << it->c_str() << std::endl ofs << "# Run command: " << *it << std::endl
<< "# Output:" << std::endl << "# Output:" << std::endl
<< output.c_str() << std::endl; << output << std::endl;
cmCPackLogger(cmCPackLog::LOG_ERROR, cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem running install command: " << it->c_str() << std::endl "Problem running install command: " << *it << std::endl
<< "Please check " << tmpFile.c_str() << " for errors" << "Please check " << tmpFile << " for errors"
<< std::endl); << std::endl);
return 0; return 0;
} }
@ -329,7 +329,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
++it ) ++it )
{ {
cmCPackLogger(cmCPackLog::LOG_VERBOSE, cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"Create ignore files regex for: " << it->c_str() << std::endl); "Create ignore files regex for: " << *it << std::endl);
ignoreFilesRegex.push_back(it->c_str()); ignoreFilesRegex.push_back(it->c_str());
} }
} }
@ -385,7 +385,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
if ( regIt->find(inFile.c_str()) ) if ( regIt->find(inFile.c_str()) )
{ {
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Ignore file: " cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Ignore file: "
<< inFile.c_str() << std::endl); << inFile << std::endl);
skip = true; skip = true;
} }
} }
@ -397,7 +397,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
filePath += "/" + subdir + "/" filePath += "/" + subdir + "/"
+ cmSystemTools::RelativePath(top.c_str(), gfit->c_str()); + cmSystemTools::RelativePath(top.c_str(), gfit->c_str());
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Copy file: " cmCPackLogger(cmCPackLog::LOG_DEBUG, "Copy file: "
<< inFile.c_str() << " -> " << filePath.c_str() << std::endl); << inFile << " -> " << filePath << std::endl);
/* If the file is a symlink we will have to re-create it */ /* If the file is a symlink we will have to re-create it */
if ( cmSystemTools::FileIsSymlink(inFile.c_str())) if ( cmSystemTools::FileIsSymlink(inFile.c_str()))
{ {
@ -416,7 +416,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
) ) ) )
{ {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem copying file: " cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem copying file: "
<< inFile.c_str() << " -> " << filePath.c_str() << std::endl); << inFile << " -> " << filePath << std::endl);
return 0; return 0;
} }
} }
@ -663,14 +663,14 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
tmpFile += "/PreinstallOutput.log"; tmpFile += "/PreinstallOutput.log";
cmGeneratedFileStream ofs(tmpFile.c_str()); cmGeneratedFileStream ofs(tmpFile.c_str());
ofs << "# Run command: " << buildCommandStr.c_str() << std::endl ofs << "# Run command: " << buildCommandStr << std::endl
<< "# Directory: " << installDirectory.c_str() << std::endl << "# Directory: " << installDirectory << std::endl
<< "# Output:" << std::endl << "# Output:" << std::endl
<< output.c_str() << std::endl; << output << std::endl;
cmCPackLogger(cmCPackLog::LOG_ERROR, cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem running install command: " << buildCommandStr.c_str() "Problem running install command: " << buildCommandStr
<< std::endl << std::endl
<< "Please check " << tmpFile.c_str() << " for errors" << "Please check " << tmpFile << " for errors"
<< std::endl); << std::endl);
return 0; return 0;
} }
@ -1001,7 +1001,7 @@ void cmCPackGenerator::SetOption(const std::string& op, const char* value)
int cmCPackGenerator::DoPackage() int cmCPackGenerator::DoPackage()
{ {
cmCPackLogger(cmCPackLog::LOG_OUTPUT, cmCPackLogger(cmCPackLog::LOG_OUTPUT,
"Create package using " << this->Name.c_str() << std::endl); "Create package using " << this->Name << std::endl);
// Prepare CPack internal name and check // Prepare CPack internal name and check
// values for many CPACK_xxx vars // values for many CPACK_xxx vars
@ -1269,7 +1269,7 @@ std::string cmCPackGenerator::FindTemplate(const char* name)
<< (name ? name : "(NULL)") << std::endl); << (name ? name : "(NULL)") << std::endl);
std::string ffile = this->MakefileMap->GetModulesFile(name); std::string ffile = this->MakefileMap->GetModulesFile(name);
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Found template: " cmCPackLogger(cmCPackLog::LOG_DEBUG, "Found template: "
<< ffile.c_str() << std::endl); << ffile << std::endl);
return ffile; return ffile;
} }

View File

@ -169,27 +169,27 @@ void cmCPackLog::Log(int tag, const char* file, int line,
{ {
if ( error && !this->ErrorPrefix.empty() ) if ( error && !this->ErrorPrefix.empty() )
{ {
*this->DefaultError << this->ErrorPrefix.c_str(); *this->DefaultError << this->ErrorPrefix;
} }
else if ( warning && !this->WarningPrefix.empty() ) else if ( warning && !this->WarningPrefix.empty() )
{ {
*this->DefaultError << this->WarningPrefix.c_str(); *this->DefaultError << this->WarningPrefix;
} }
else if ( output && !this->OutputPrefix.empty() ) else if ( output && !this->OutputPrefix.empty() )
{ {
*this->DefaultOutput << this->OutputPrefix.c_str(); *this->DefaultOutput << this->OutputPrefix;
} }
else if ( verbose && !this->VerbosePrefix.empty() ) else if ( verbose && !this->VerbosePrefix.empty() )
{ {
*this->DefaultOutput << this->VerbosePrefix.c_str(); *this->DefaultOutput << this->VerbosePrefix;
} }
else if ( debug && !this->DebugPrefix.empty() ) else if ( debug && !this->DebugPrefix.empty() )
{ {
*this->DefaultOutput << this->DebugPrefix.c_str(); *this->DefaultOutput << this->DebugPrefix;
} }
else if ( !this->Prefix.empty() ) else if ( !this->Prefix.empty() )
{ {
*this->DefaultOutput << this->Prefix.c_str(); *this->DefaultOutput << this->Prefix;
} }
if ( useFileAndLine ) if ( useFileAndLine )
{ {

View File

@ -83,10 +83,10 @@ int cmCPackNSISGenerator::PackageFiles()
fileN = fileN.substr(fileN.find('/')+1, std::string::npos); fileN = fileN.substr(fileN.find('/')+1, std::string::npos);
} }
cmSystemTools::ReplaceString(fileN, "/", "\\"); cmSystemTools::ReplaceString(fileN, "/", "\\");
str << " Delete \"$INSTDIR\\" << fileN.c_str() << "\"" << std::endl; str << " Delete \"$INSTDIR\\" << fileN << "\"" << std::endl;
} }
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Uninstall Files: " cmCPackLogger(cmCPackLog::LOG_DEBUG, "Uninstall Files: "
<< str.str().c_str() << std::endl); << str.str() << std::endl);
this->SetOptionIfNotSet("CPACK_NSIS_DELETE_FILES", str.str().c_str()); this->SetOptionIfNotSet("CPACK_NSIS_DELETE_FILES", str.str().c_str());
std::vector<std::string> dirs; std::vector<std::string> dirs;
this->GetListOfSubdirectories(toplevel.c_str(), dirs); this->GetListOfSubdirectories(toplevel.c_str(), dirs);
@ -117,14 +117,14 @@ int cmCPackNSISGenerator::PackageFiles()
} }
} }
cmSystemTools::ReplaceString(fileN, "/", "\\"); cmSystemTools::ReplaceString(fileN, "/", "\\");
dstr << " RMDir \"$INSTDIR\\" << fileN.c_str() << "\"" << std::endl; dstr << " RMDir \"$INSTDIR\\" << fileN << "\"" << std::endl;
if (!componentName.empty()) if (!componentName.empty())
{ {
this->Components[componentName].Directories.push_back(fileN); this->Components[componentName].Directories.push_back(fileN);
} }
} }
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Uninstall Dirs: " cmCPackLogger(cmCPackLog::LOG_DEBUG, "Uninstall Dirs: "
<< dstr.str().c_str() << std::endl); << dstr.str() << std::endl);
this->SetOptionIfNotSet("CPACK_NSIS_DELETE_DIRECTORIES", this->SetOptionIfNotSet("CPACK_NSIS_DELETE_DIRECTORIES",
dstr.str().c_str()); dstr.str().c_str());
@ -320,7 +320,7 @@ int cmCPackNSISGenerator::PackageFiles()
std::string nsisCmd = "\""; std::string nsisCmd = "\"";
nsisCmd += this->GetOption("CPACK_INSTALLER_PROGRAM"); nsisCmd += this->GetOption("CPACK_INSTALLER_PROGRAM");
nsisCmd += "\" \"" + nsisFileName + "\""; nsisCmd += "\" \"" + nsisFileName + "\"";
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Execute: " << nsisCmd.c_str() cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Execute: " << nsisCmd
<< std::endl); << std::endl);
std::string output; std::string output;
int retVal = 1; int retVal = 1;
@ -329,12 +329,12 @@ int cmCPackNSISGenerator::PackageFiles()
if ( !res || retVal ) if ( !res || retVal )
{ {
cmGeneratedFileStream ofs(tmpFile.c_str()); cmGeneratedFileStream ofs(tmpFile.c_str());
ofs << "# Run command: " << nsisCmd.c_str() << std::endl ofs << "# Run command: " << nsisCmd << std::endl
<< "# Output:" << std::endl << "# Output:" << std::endl
<< output.c_str() << std::endl; << output << std::endl;
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem running NSIS command: " cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem running NSIS command: "
<< nsisCmd.c_str() << std::endl << nsisCmd << std::endl
<< "Please check " << tmpFile.c_str() << " for errors" << std::endl); << "Please check " << tmpFile << " for errors" << std::endl);
return 0; return 0;
} }
return 1; return 1;
@ -427,7 +427,7 @@ int cmCPackNSISGenerator::InitializeInternal()
std::string nsisCmd = "\"" + nsisPath + "\" " NSIS_OPT "VERSION"; std::string nsisCmd = "\"" + nsisPath + "\" " NSIS_OPT "VERSION";
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Test NSIS version: " cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Test NSIS version: "
<< nsisCmd.c_str() << std::endl); << nsisCmd << std::endl);
std::string output; std::string output;
int retVal = 1; int retVal = 1;
bool resS = cmSystemTools::RunSingleCommand(nsisCmd.c_str(), bool resS = cmSystemTools::RunSingleCommand(nsisCmd.c_str(),
@ -442,13 +442,13 @@ int cmCPackNSISGenerator::InitializeInternal()
std::string tmpFile = topDir ? topDir : "."; std::string tmpFile = topDir ? topDir : ".";
tmpFile += "/NSISOutput.log"; tmpFile += "/NSISOutput.log";
cmGeneratedFileStream ofs(tmpFile.c_str()); cmGeneratedFileStream ofs(tmpFile.c_str());
ofs << "# Run command: " << nsisCmd.c_str() << std::endl ofs << "# Run command: " << nsisCmd << std::endl
<< "# Output:" << std::endl << "# Output:" << std::endl
<< output.c_str() << std::endl; << output << std::endl;
cmCPackLogger(cmCPackLog::LOG_ERROR, cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem checking NSIS version with command: " "Problem checking NSIS version with command: "
<< nsisCmd.c_str() << std::endl << nsisCmd << std::endl
<< "Please check " << tmpFile.c_str() << " for errors" << std::endl); << "Please check " << tmpFile << " for errors" << std::endl);
return 0; return 0;
} }
if ( versionRex.find(output)) if ( versionRex.find(output))
@ -470,7 +470,7 @@ int cmCPackNSISGenerator::InitializeInternal()
{ {
// No version check for NSIS cvs build // No version check for NSIS cvs build
cmCPackLogger(cmCPackLog::LOG_DEBUG, "NSIS Version: CVS " cmCPackLogger(cmCPackLog::LOG_DEBUG, "NSIS Version: CVS "
<< versionRexCVS.match(1).c_str() << std::endl); << versionRexCVS.match(1) << std::endl);
} }
this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM", nsisPath.c_str()); this->SetOptionIfNotSet("CPACK_INSTALLER_PROGRAM", nsisPath.c_str());
this->SetOptionIfNotSet("CPACK_NSIS_EXECUTABLES_DIRECTORY", "bin"); this->SetOptionIfNotSet("CPACK_NSIS_EXECUTABLES_DIRECTORY", "bin");
@ -844,12 +844,12 @@ CreateComponentDescription(cmCPackComponent *component,
std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
tmpFile += "/CompressZip.log"; tmpFile += "/CompressZip.log";
cmGeneratedFileStream ofs(tmpFile.c_str()); cmGeneratedFileStream ofs(tmpFile.c_str());
ofs << "# Run command: " << cmd.c_str() << std::endl ofs << "# Run command: " << cmd << std::endl
<< "# Output:" << std::endl << "# Output:" << std::endl
<< output.c_str() << std::endl; << output << std::endl;
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem running zip command: " cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem running zip command: "
<< cmd.c_str() << std::endl << cmd << std::endl
<< "Please check " << tmpFile.c_str() << " for errors" << std::endl); << "Please check " << tmpFile << " for errors" << std::endl);
return ""; return "";
} }
@ -891,7 +891,7 @@ CreateComponentDescription(cmCPackComponent *component,
path = *pathIt; path = *pathIt;
cmSystemTools::ReplaceString(path, "/", "\\"); cmSystemTools::ReplaceString(path, "/", "\\");
macrosOut << " Delete \"$INSTDIR\\" macrosOut << " Delete \"$INSTDIR\\"
<< path.c_str() << path
<< "\"\n"; << "\"\n";
} }
for (pathIt = component->Directories.begin(); for (pathIt = component->Directories.begin();
@ -901,7 +901,7 @@ CreateComponentDescription(cmCPackComponent *component,
path = *pathIt; path = *pathIt;
cmSystemTools::ReplaceString(path, "/", "\\"); cmSystemTools::ReplaceString(path, "/", "\\");
macrosOut << " RMDir \"$INSTDIR\\" macrosOut << " RMDir \"$INSTDIR\\"
<< path.c_str() << path
<< "\"\n"; << "\"\n";
} }
macrosOut << " noremove_" << component->Name << ":\n"; macrosOut << " noremove_" << component->Name << ":\n";

View File

@ -43,7 +43,7 @@ int cmCPackSTGZGenerator::InitializeInternal()
if ( inFile.empty() ) if ( inFile.empty() )
{ {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find template file: " cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find template file: "
<< inFile.c_str() << std::endl); << inFile << std::endl);
return 0; return 0;
} }
this->SetOptionIfNotSet("CPACK_STGZ_HEADER_FILE", inFile.c_str()); this->SetOptionIfNotSet("CPACK_STGZ_HEADER_FILE", inFile.c_str());
@ -134,6 +134,6 @@ int cmCPackSTGZGenerator::GenerateHeader(std::ostream* os)
cmSystemTools::ReplaceString(res, headerLengthTag, buffer); cmSystemTools::ReplaceString(res, headerLengthTag, buffer);
// Write in file // Write in file
*os << res.c_str(); *os << res;
return this->Superclass::GenerateHeader(os); return this->Superclass::GenerateHeader(os);
} }

View File

@ -91,7 +91,7 @@ int cpackDefinitionArgument(const char* argument, const char* cValue,
value = value.c_str() + pos + 1; value = value.c_str() + pos + 1;
def->Map[key] = value; def->Map[key] = value;
cmCPack_Log(def->Log, cmCPackLog::LOG_DEBUG, "Set CPack variable: " cmCPack_Log(def->Log, cmCPackLog::LOG_DEBUG, "Set CPack variable: "
<< key.c_str() << " to \"" << value.c_str() << "\"" << std::endl); << key << " to \"" << value << "\"" << std::endl);
return 1; return 1;
} }
@ -195,7 +195,7 @@ int main (int argc, char const* const* argv)
} }
cmCPack_Log(&log, cmCPackLog::LOG_VERBOSE, cmCPack_Log(&log, cmCPackLog::LOG_VERBOSE,
"Read CPack config file: " << cpackConfigFile.c_str() << std::endl); "Read CPack config file: " << cpackConfigFile << std::endl);
cmake cminst; cmake cminst;
cminst.RemoveUnscriptableCommands(); cminst.RemoveUnscriptableCommands();
@ -262,20 +262,20 @@ int main (int argc, char const* const* argv)
cpackConfigFile = cpackConfigFile =
cmSystemTools::CollapseFullPath(cpackConfigFile.c_str()); cmSystemTools::CollapseFullPath(cpackConfigFile.c_str());
cmCPack_Log(&log, cmCPackLog::LOG_VERBOSE, cmCPack_Log(&log, cmCPackLog::LOG_VERBOSE,
"Read CPack configuration file: " << cpackConfigFile.c_str() "Read CPack configuration file: " << cpackConfigFile
<< std::endl); << std::endl);
if ( !globalMF->ReadListFile(0, cpackConfigFile.c_str()) ) if ( !globalMF->ReadListFile(0, cpackConfigFile.c_str()) )
{ {
cmCPack_Log(&log, cmCPackLog::LOG_ERROR, cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
"Problem reading CPack config file: \"" "Problem reading CPack config file: \""
<< cpackConfigFile.c_str() << "\"" << std::endl); << cpackConfigFile << "\"" << std::endl);
return 1; return 1;
} }
} }
else if ( cpackConfigFileSpecified ) else if ( cpackConfigFileSpecified )
{ {
cmCPack_Log(&log, cmCPackLog::LOG_ERROR, cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
"Cannot find CPack config file: \"" << cpackConfigFile.c_str() "Cannot find CPack config file: \"" << cpackConfigFile
<< "\"" << std::endl); << "\"" << std::endl);
return 1; return 1;
} }

View File

@ -134,7 +134,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
cmakeBuildAdditionalFlags ? cmakeBuildAdditionalFlags : "", true); cmakeBuildAdditionalFlags ? cmakeBuildAdditionalFlags : "", true);
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"SetMakeCommand:" "SetMakeCommand:"
<< buildCommand.c_str() << "\n"); << buildCommand << "\n");
this->CTest->SetCTestConfiguration("MakeCommand", buildCommand.c_str()); this->CTest->SetCTestConfiguration("MakeCommand", buildCommand.c_str());
} }
else else

View File

@ -409,7 +409,7 @@ int cmCTestBuildHandler::ProcessHandler()
for ( it = strings.begin(); it != strings.end(); ++it ) \ for ( it = strings.begin(); it != strings.end(); ++it ) \
{ \ { \
cmCTestLog(this->CTest, DEBUG, "Add " #strings ": " \ cmCTestLog(this->CTest, DEBUG, "Add " #strings ": " \
<< it->c_str() << std::endl); \ << *it << std::endl); \
regexes.push_back(it->c_str()); \ regexes.push_back(it->c_str()); \
} }
cmCTestBuildHandlerPopulateRegexVector( cmCTestBuildHandlerPopulateRegexVector(

View File

@ -76,7 +76,7 @@ int cmCTestConfigureHandler::ProcessHandler()
cmGeneratedFileStream ofs; cmGeneratedFileStream ofs;
this->StartLogFile("Configure", ofs); this->StartLogFile("Configure", ofs);
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Configure with command: " cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Configure with command: "
<< cCommand.c_str() << std::endl); << cCommand << std::endl);
res = this->CTest->RunMakeCommand(cCommand.c_str(), &output, res = this->CTest->RunMakeCommand(cCommand.c_str(), &output,
&retVal, buildDirectory.c_str(), &retVal, buildDirectory.c_str(),
0, ofs); 0, ofs);
@ -99,7 +99,7 @@ int cmCTestConfigureHandler::ProcessHandler()
{ {
os << retVal; os << retVal;
} }
os << "<ConfigureCommand>" << cCommand.c_str() << "</ConfigureCommand>" os << "<ConfigureCommand>" << cCommand << "</ConfigureCommand>"
<< std::endl; << std::endl;
cmCTestLog(this->CTest, DEBUG, "End" << std::endl); cmCTestLog(this->CTest, DEBUG, "End" << std::endl);
os << "<Log>" << cmXMLSafe(output) << "</Log>" << std::endl; os << "<Log>" << cmXMLSafe(output) << "</Log>" << std::endl;

View File

@ -269,7 +269,7 @@ bool cmCTestCoverageHandler::ShouldIDoCoverage(const char* file,
fFile.c_str(), checkDir.c_str()); fFile.c_str(), checkDir.c_str());
if ( ndc.size() ) if ( ndc.size() )
{ {
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Found: " << ndc.c_str() cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Found: " << ndc
<< " so skip coverage of " << file << std::endl); << " so skip coverage of " << file << std::endl);
return false; return false;
} }
@ -308,7 +308,7 @@ bool cmCTestCoverageHandler::ShouldIDoCoverage(const char* file,
fFile.c_str(), checkDir.c_str()); fFile.c_str(), checkDir.c_str());
if ( ndc.size() ) if ( ndc.size() )
{ {
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Found: " << ndc.c_str() cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Found: " << ndc
<< " so skip coverage of: " << file << std::endl); << " so skip coverage of: " << file << std::endl);
return false; return false;
} }
@ -477,7 +477,7 @@ int cmCTestCoverageHandler::ProcessHandler()
{ {
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
".NoDartCoverage found, so skip coverage check for: " ".NoDartCoverage found, so skip coverage check for: "
<< fullFileName.c_str() << fullFileName
<< std::endl); << std::endl);
continue; continue;
} }
@ -488,7 +488,7 @@ int cmCTestCoverageHandler::ProcessHandler()
if ( !cmSystemTools::FileExists(fullFileName.c_str()) ) if ( !cmSystemTools::FileExists(fullFileName.c_str()) )
{ {
cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot find file: " cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot find file: "
<< fullFileName.c_str() << std::endl); << fullFileName << std::endl);
continue; continue;
} }
@ -516,7 +516,7 @@ int cmCTestCoverageHandler::ProcessHandler()
if ( !ifs) if ( !ifs)
{ {
cmOStringStream ostr; cmOStringStream ostr;
ostr << "Cannot open source file: " << fullFileName.c_str(); ostr << "Cannot open source file: " << fullFileName;
errorsWhileAccumulating.push_back(ostr.str()); errorsWhileAccumulating.push_back(ostr.str());
error ++; error ++;
continue; continue;
@ -535,7 +535,7 @@ int cmCTestCoverageHandler::ProcessHandler()
cc != fcov.size() -1 ) cc != fcov.size() -1 )
{ {
cmOStringStream ostr; cmOStringStream ostr;
ostr << "Problem reading source file: " << fullFileName.c_str() ostr << "Problem reading source file: " << fullFileName
<< " line:" << cc << " out total: " << fcov.size()-1; << " line:" << cc << " out total: " << fcov.size()-1;
errorsWhileAccumulating.push_back(ostr.str()); errorsWhileAccumulating.push_back(ostr.str());
error ++; error ++;
@ -605,7 +605,7 @@ int cmCTestCoverageHandler::ProcessHandler()
if (!ifs) if (!ifs)
{ {
cmOStringStream ostr; cmOStringStream ostr;
ostr << "Cannot open source file: " << fullPath.c_str(); ostr << "Cannot open source file: " << fullPath;
errorsWhileAccumulating.push_back(ostr.str()); errorsWhileAccumulating.push_back(ostr.str());
error ++; error ++;
continue; continue;
@ -613,7 +613,7 @@ int cmCTestCoverageHandler::ProcessHandler()
int untested = 0; int untested = 0;
std::string line; std::string line;
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Actually performing coverage for: " << i->c_str() << std::endl); "Actually performing coverage for: " << *i << std::endl);
while (cmSystemTools::GetLineFromStream(ifs, line)) while (cmSystemTools::GetLineFromStream(ifs, line))
{ {
covLogFile << "\t\t<Line Number=\"" << untested << "\" Count=\"0\">" covLogFile << "\t\t<Line Number=\"" << untested << "\" Count=\"0\">"
@ -647,7 +647,7 @@ int cmCTestCoverageHandler::ProcessHandler()
++ erIt ) ++ erIt )
{ {
cmCTestLog(this->CTest, ERROR_MESSAGE, cmCTestLog(this->CTest, ERROR_MESSAGE,
" " << erIt->c_str() << std::endl); " " << *erIt << std::endl);
} }
} }
@ -719,13 +719,13 @@ void cmCTestCoverageHandler::PopulateCustomVectors(cmMakefile *mf)
++ it ) ++ it )
{ {
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Add coverage exclude: " cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Add coverage exclude: "
<< it->c_str() << std::endl); << *it << std::endl);
} }
for ( it = this->ExtraCoverageGlobs.begin(); for ( it = this->ExtraCoverageGlobs.begin();
it != this->ExtraCoverageGlobs.end(); ++it) it != this->ExtraCoverageGlobs.end(); ++it)
{ {
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Add coverage glob: " cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Add coverage glob: "
<< it->c_str() << std::endl); << *it << std::endl);
} }
} }
@ -959,17 +959,17 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
std::string output = ""; std::string output = "";
std::string errors = ""; std::string errors = "";
int retVal = 0; int retVal = 0;
*cont->OFS << "* Run coverage for: " << fileDir.c_str() << std::endl; *cont->OFS << "* Run coverage for: " << fileDir << std::endl;
*cont->OFS << " Command: " << command.c_str() << std::endl; *cont->OFS << " Command: " << command << std::endl;
int res = this->CTest->RunCommand(command.c_str(), &output, &errors, int res = this->CTest->RunCommand(command.c_str(), &output, &errors,
&retVal, tempDir.c_str(), 0 /*this->TimeOut*/); &retVal, tempDir.c_str(), 0 /*this->TimeOut*/);
*cont->OFS << " Output: " << output.c_str() << std::endl; *cont->OFS << " Output: " << output << std::endl;
*cont->OFS << " Errors: " << errors.c_str() << std::endl; *cont->OFS << " Errors: " << errors << std::endl;
if ( ! res ) if ( ! res )
{ {
cmCTestLog(this->CTest, ERROR_MESSAGE, cmCTestLog(this->CTest, ERROR_MESSAGE,
"Problem running coverage on file: " << it->c_str() << std::endl); "Problem running coverage on file: " << *it << std::endl);
cmCTestLog(this->CTest, ERROR_MESSAGE, cmCTestLog(this->CTest, ERROR_MESSAGE,
"Command produced error: " << errors << std::endl); "Command produced error: " << errors << std::endl);
cont->Error ++; cont->Error ++;
@ -978,7 +978,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
if ( retVal != 0 ) if ( retVal != 0 )
{ {
cmCTestLog(this->CTest, ERROR_MESSAGE, "Coverage command returned: " cmCTestLog(this->CTest, ERROR_MESSAGE, "Coverage command returned: "
<< retVal << " while processing: " << it->c_str() << std::endl); << retVal << " while processing: " << *it << std::endl);
cmCTestLog(this->CTest, ERROR_MESSAGE, cmCTestLog(this->CTest, ERROR_MESSAGE,
"Command produced error: " << cont->Error << std::endl); "Command produced error: " << cont->Error << std::endl);
} }
@ -999,7 +999,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
std::string sourceFile; std::string sourceFile;
std::string gcovFile; std::string gcovFile;
cmCTestLog(this->CTest, DEBUG, "Line: [" << line->c_str() << "]" cmCTestLog(this->CTest, DEBUG, "Line: [" << *line << "]"
<< std::endl); << std::endl);
if ( line->size() == 0 ) if ( line->size() == 0 )
@ -1145,7 +1145,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
!cmSystemTools::StringStartsWith(line->c_str(), "Removing ")) !cmSystemTools::StringStartsWith(line->c_str(), "Removing "))
{ {
cmCTestLog(this->CTest, ERROR_MESSAGE, cmCTestLog(this->CTest, ERROR_MESSAGE,
"Unknown gcov output line: [" << line->c_str() << "]" "Unknown gcov output line: [" << *line << "]"
<< std::endl); << std::endl);
cont->Error ++; cont->Error ++;
//abort(); //abort();
@ -1238,8 +1238,8 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
if ( IsFileInDir(sourceFile, cont->SourceDir) ) if ( IsFileInDir(sourceFile, cont->SourceDir) )
{ {
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " produced s: " cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " produced s: "
<< sourceFile.c_str() << std::endl); << sourceFile << std::endl);
*cont->OFS << " produced in source dir: " << sourceFile.c_str() *cont->OFS << " produced in source dir: " << sourceFile
<< std::endl; << std::endl;
actualSourceFile actualSourceFile
= cmSystemTools::CollapseFullPath(sourceFile.c_str()); = cmSystemTools::CollapseFullPath(sourceFile.c_str());
@ -1247,8 +1247,8 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
else if ( IsFileInDir(sourceFile, cont->BinaryDir) ) else if ( IsFileInDir(sourceFile, cont->BinaryDir) )
{ {
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " produced b: " cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " produced b: "
<< sourceFile.c_str() << std::endl); << sourceFile << std::endl);
*cont->OFS << " produced in binary dir: " << sourceFile.c_str() *cont->OFS << " produced in binary dir: " << sourceFile
<< std::endl; << std::endl;
actualSourceFile actualSourceFile
= cmSystemTools::CollapseFullPath(sourceFile.c_str()); = cmSystemTools::CollapseFullPath(sourceFile.c_str());
@ -1262,19 +1262,19 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
"Something went wrong" << std::endl); "Something went wrong" << std::endl);
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Cannot find file: [" "Cannot find file: ["
<< sourceFile.c_str() << "]" << std::endl); << sourceFile << "]" << std::endl);
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
" in source dir: [" " in source dir: ["
<< cont->SourceDir.c_str() << "]" << cont->SourceDir << "]"
<< std::endl); << std::endl);
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
" or binary dir: [" " or binary dir: ["
<< cont->BinaryDir.size() << "]" << cont->BinaryDir.size() << "]"
<< std::endl); << std::endl);
*cont->OFS << " Something went wrong. Cannot find file: " *cont->OFS << " Something went wrong. Cannot find file: "
<< sourceFile.c_str() << sourceFile
<< " in source dir: " << cont->SourceDir.c_str() << " in source dir: " << cont->SourceDir
<< " or binary dir: " << cont->BinaryDir.c_str() << std::endl; << " or binary dir: " << cont->BinaryDir << std::endl;
missingFiles.insert(sourceFile); missingFiles.insert(sourceFile);
} }
@ -1364,24 +1364,24 @@ int cmCTestCoverageHandler::HandleTracePyCoverage(
{ {
cmCTestLog(this->CTest, ERROR_MESSAGE, cmCTestLog(this->CTest, ERROR_MESSAGE,
"Cannot find source Python file corresponding to: " "Cannot find source Python file corresponding to: "
<< fileIt->c_str() << std::endl); << *fileIt << std::endl);
continue; continue;
} }
std::string actualSourceFile std::string actualSourceFile
= cmSystemTools::CollapseFullPath(fileName.c_str()); = cmSystemTools::CollapseFullPath(fileName.c_str());
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
" Check coverage for file: " << actualSourceFile.c_str() " Check coverage for file: " << actualSourceFile
<< std::endl); << std::endl);
cmCTestCoverageHandlerContainer::SingleFileCoverageVector* vec cmCTestCoverageHandlerContainer::SingleFileCoverageVector* vec
= &cont->TotalCoverage[actualSourceFile]; = &cont->TotalCoverage[actualSourceFile];
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
" in file: " << fileIt->c_str() << std::endl); " in file: " << *fileIt << std::endl);
cmsys::ifstream ifile(fileIt->c_str()); cmsys::ifstream ifile(fileIt->c_str());
if ( ! ifile ) if ( ! ifile )
{ {
cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot open file: " cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot open file: "
<< fileIt->c_str() << std::endl); << *fileIt << std::endl);
} }
else else
{ {
@ -1429,7 +1429,7 @@ int cmCTestCoverageHandler::HandleTracePyCoverage(
// So, this will be set to 0. // So, this will be set to 0.
cov = 0; cov = 0;
} }
cmCTestLog(this->CTest, DEBUG, "Prefix: " << prefix.c_str() cmCTestLog(this->CTest, DEBUG, "Prefix: " << prefix
<< " cov: " << cov << " cov: " << cov
<< std::endl); << std::endl);
// Read the line number starting at the 10th character of the gcov // Read the line number starting at the 10th character of the gcov
@ -1542,7 +1542,7 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
{ {
cmCTestLog(this->CTest, ERROR_MESSAGE, cmCTestLog(this->CTest, ERROR_MESSAGE,
"Cannot open coverage file: " << "Cannot open coverage file: " <<
outputFile.c_str() << std::endl); outputFile << std::endl);
return 0; return 0;
} }
std::map<std::string, std::string> fileMap; std::map<std::string, std::string> fileMap;
@ -1602,7 +1602,7 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
count++; count++;
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Produce coverage for file: " "Produce coverage for file: "
<< file.c_str() << " " << count << file << " " << count
<< std::endl); << std::endl);
// start the file output // start the file output
covLogFile << "\t<File Name=\"" covLogFile << "\t<File Name=\""
@ -1663,12 +1663,12 @@ int cmCTestCoverageHandler::RunBullseyeCommand(
if(arg) if(arg)
{ {
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Run : " << program.c_str() << " " << arg << "\n"); "Run : " << program << " " << arg << "\n");
} }
else else
{ {
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Run : " << program.c_str() << "\n"); "Run : " << program << "\n");
} }
// create a process object and start it // create a process object and start it
cmCTestRunProcess runCoverageSrc; cmCTestRunProcess runCoverageSrc;
@ -1686,7 +1686,7 @@ int cmCTestCoverageHandler::RunBullseyeCommand(
if(!runCoverageSrc.StartProcess()) if(!runCoverageSrc.StartProcess())
{ {
cmCTestLog(this->CTest, ERROR_MESSAGE, "Could not run : " cmCTestLog(this->CTest, ERROR_MESSAGE, "Could not run : "
<< program.c_str() << " " << arg << "\n" << program << " " << arg << "\n"
<< "kwsys process state : " << "kwsys process state : "
<< runCoverageSrc.GetProcessState()); << runCoverageSrc.GetProcessState());
return 0; return 0;
@ -1755,7 +1755,7 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
{ {
cmCTestLog(this->CTest, ERROR_MESSAGE, cmCTestLog(this->CTest, ERROR_MESSAGE,
"Cannot open coverage summary file: " << "Cannot open coverage summary file: " <<
outputFile.c_str() << std::endl); outputFile << std::endl);
return 0; return 0;
} }
std::set<std::string> coveredFileNames; std::set<std::string> coveredFileNames;
@ -1796,14 +1796,14 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
{ {
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
".NoDartCoverage found, so skip coverage check for: " ".NoDartCoverage found, so skip coverage check for: "
<< file.c_str() << file
<< std::endl); << std::endl);
continue; continue;
} }
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Doing coverage for: " "Doing coverage for: "
<< file.c_str() << file
<< std::endl); << std::endl);
coveredFiles.push_back(sourceFile); coveredFiles.push_back(sourceFile);
@ -1830,7 +1830,7 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
cmet /= 2.0f; cmet /= 2.0f;
} }
cmet /= 100.0f; cmet /= 100.0f;
tmpLog << stdline.c_str() << "\n"; tmpLog << stdline << "\n";
tmpLog << fileName << "\n"; tmpLog << fileName << "\n";
tmpLog << "functionsCalled: " << functionsCalled/100 << "\n"; tmpLog << "functionsCalled: " << functionsCalled/100 << "\n";
tmpLog << "totalFunctions: " << totalFunctions/100 << "\n"; tmpLog << "totalFunctions: " << totalFunctions/100 << "\n";
@ -1957,7 +1957,7 @@ bool cmCTestCoverageHandler::ParseBullsEyeCovsrcLine(
if(pos == inputLine.npos) if(pos == inputLine.npos)
{ {
cmCTestLog(this->CTest, ERROR_MESSAGE, "Error parsing string : " cmCTestLog(this->CTest, ERROR_MESSAGE, "Error parsing string : "
<< inputLine.c_str() << "\n"); << inputLine << "\n");
return false; return false;
} }
// the source file has "" around it so extract out the file name // the source file has "" around it so extract out the file name
@ -1991,7 +1991,7 @@ bool cmCTestCoverageHandler::ParseBullsEyeCovsrcLine(
if(pos != inputLine.npos) if(pos != inputLine.npos)
{ {
cmCTestLog(this->CTest, ERROR_MESSAGE, "Error parsing input : " cmCTestLog(this->CTest, ERROR_MESSAGE, "Error parsing input : "
<< inputLine.c_str() << " last pos not npos = " << pos << << inputLine << " last pos not npos = " << pos <<
"\n"); "\n");
} }
return true; return true;

View File

@ -25,7 +25,7 @@ bool cmCTestEmptyBinaryDirectoryCommand
if ( !cmCTestScriptHandler::EmptyBinaryDirectory(args[0].c_str()) ) if ( !cmCTestScriptHandler::EmptyBinaryDirectory(args[0].c_str()) )
{ {
cmOStringStream ostr; cmOStringStream ostr;
ostr << "problem removing the binary directory: " << args[0].c_str(); ostr << "problem removing the binary directory: " << args[0];
this->SetError(ostr.str()); this->SetError(ostr.str());
return false; return false;
} }

View File

@ -124,7 +124,7 @@ bool cmCTestGenericHandler::StartResultingXML(cmCTest::Part part,
ostr.str(), xofs, true) ) ostr.str(), xofs, true) )
{ {
cmCTestLog(this->CTest, ERROR_MESSAGE, cmCTestLog(this->CTest, ERROR_MESSAGE,
"Cannot create resulting XML file: " << ostr.str().c_str() "Cannot create resulting XML file: " << ostr.str()
<< std::endl); << std::endl);
return false; return false;
} }
@ -156,7 +156,7 @@ bool cmCTestGenericHandler::StartLogFile(const char* name,
if( !this->CTest->OpenOutputFile("Temporary", ostr.str(), xofs) ) if( !this->CTest->OpenOutputFile("Temporary", ostr.str(), xofs) )
{ {
cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot create log file: " cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot create log file: "
<< ostr.str().c_str() << std::endl); << ostr.str() << std::endl);
return false; return false;
} }
return true; return true;

View File

@ -514,7 +514,7 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
cmCTestLog(this->CTest, ERROR_MESSAGE, cmCTestLog(this->CTest, ERROR_MESSAGE,
"Cannot find memory checker suppression file: " "Cannot find memory checker suppression file: "
<< this->CTest->GetCTestConfiguration( << this->CTest->GetCTestConfiguration(
"MemoryCheckSuppressionFile").c_str() << std::endl); "MemoryCheckSuppressionFile") << std::endl);
return false; return false;
} }
std::string suppressions = "--suppressions=" std::string suppressions = "--suppressions="
@ -569,7 +569,7 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
} }
default: default:
cmCTestLog(this->CTest, ERROR_MESSAGE, cmCTestLog(this->CTest, ERROR_MESSAGE,
"Do not understand memory checker: " << this->MemoryTester.c_str() "Do not understand memory checker: " << this->MemoryTester
<< std::endl); << std::endl);
return false; return false;
} }
@ -885,7 +885,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckBoundsCheckerOutput(
else if(!parser.ParseChunk(theLine.c_str(), theLine.size())) else if(!parser.ParseChunk(theLine.c_str(), theLine.size()))
{ {
cmCTestLog(this->CTest, ERROR_MESSAGE, cmCTestLog(this->CTest, ERROR_MESSAGE,
"Error in ParseChunk: " << theLine.c_str() "Error in ParseChunk: " << theLine
<< std::endl); << std::endl);
} }
} }
@ -916,7 +916,7 @@ cmCTestMemCheckHandler::PostProcessBoundsCheckerTest(cmCTestTestResult& res,
{ {
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"PostProcessBoundsCheckerTest for : " "PostProcessBoundsCheckerTest for : "
<< res.Name.c_str() << std::endl); << res.Name << std::endl);
std::string ofile = testOutputFileName(test); std::string ofile = testOutputFileName(test);
if ( ofile.empty() ) if ( ofile.empty() )
{ {
@ -943,10 +943,10 @@ cmCTestMemCheckHandler::PostProcessBoundsCheckerTest(cmCTestTestResult& res,
cmSystemTools::Delay(1000); cmSystemTools::Delay(1000);
cmSystemTools::RemoveFile(this->BoundsCheckerDPBDFile.c_str()); cmSystemTools::RemoveFile(this->BoundsCheckerDPBDFile.c_str());
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Remove: " cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Remove: "
<< this->BoundsCheckerDPBDFile.c_str() << std::endl); << this->BoundsCheckerDPBDFile << std::endl);
cmSystemTools::RemoveFile(this->BoundsCheckerXMLFile.c_str()); cmSystemTools::RemoveFile(this->BoundsCheckerXMLFile.c_str());
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Remove: " cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Remove: "
<< this->BoundsCheckerXMLFile.c_str() << std::endl); << this->BoundsCheckerXMLFile << std::endl);
} }
void void
@ -955,7 +955,7 @@ cmCTestMemCheckHandler::PostProcessPurifyTest(cmCTestTestResult& res,
{ {
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"PostProcessPurifyTest for : " "PostProcessPurifyTest for : "
<< res.Name.c_str() << std::endl); << res.Name << std::endl);
appendMemTesterOutput(res, test); appendMemTesterOutput(res, test);
} }
@ -965,7 +965,7 @@ cmCTestMemCheckHandler::PostProcessValgrindTest(cmCTestTestResult& res,
{ {
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"PostProcessValgrindTest for : " "PostProcessValgrindTest for : "
<< res.Name.c_str() << std::endl); << res.Name << std::endl);
appendMemTesterOutput(res, test); appendMemTesterOutput(res, test);
} }

View File

@ -672,7 +672,7 @@ void cmCTestMultiProcessHandler::PrintTestList()
indexStr << " #" << p.Index << ":"; indexStr << " #" << p.Index << ":";
cmCTestLog(this->CTest, HANDLER_OUTPUT, cmCTestLog(this->CTest, HANDLER_OUTPUT,
std::setw(3 + getNumWidth(this->TestHandler->GetMaxIndex())) std::setw(3 + getNumWidth(this->TestHandler->GetMaxIndex()))
<< indexStr.str().c_str()); << indexStr.str());
cmCTestLog(this->CTest, HANDLER_OUTPUT, " "); cmCTestLog(this->CTest, HANDLER_OUTPUT, " ");
cmCTestLog(this->CTest, HANDLER_OUTPUT, p.Name.c_str() << std::endl); cmCTestLog(this->CTest, HANDLER_OUTPUT, p.Name.c_str() << std::endl);
//pop working dir //pop working dir

View File

@ -334,9 +334,9 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
*this->TestHandler->LogFile << "Test Failed.\n"; *this->TestHandler->LogFile << "Test Failed.\n";
} }
} }
*this->TestHandler->LogFile << "\"" << this->TestProperties->Name.c_str() *this->TestHandler->LogFile << "\"" << this->TestProperties->Name
<< "\" end time: " << this->CTest->CurrentTime() << std::endl << "\" end time: " << this->CTest->CurrentTime() << std::endl
<< "\"" << this->TestProperties->Name.c_str() << "\" time elapsed: " << "\"" << this->TestProperties->Name << "\" time elapsed: "
<< buffer << std::endl << buffer << std::endl
<< "----------------------------------------------------------" << "----------------------------------------------------------"
<< std::endl << std::endl; << std::endl << std::endl;
@ -388,8 +388,8 @@ void cmCTestRunTest::MemCheckPostProcess()
} }
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, this->Index cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, this->Index
<< ": process test output now: " << ": process test output now: "
<< this->TestProperties->Name.c_str() << " " << this->TestProperties->Name << " "
<< this->TestResult.Name.c_str() << std::endl); << this->TestResult.Name << std::endl);
cmCTestMemCheckHandler * handler = static_cast<cmCTestMemCheckHandler*> cmCTestMemCheckHandler * handler = static_cast<cmCTestMemCheckHandler*>
(this->TestHandler); (this->TestHandler);
switch ( handler->MemoryTesterStyle ) switch ( handler->MemoryTesterStyle )
@ -465,9 +465,9 @@ bool cmCTestRunTest::StartTest(size_t total)
//Required file was not found //Required file was not found
this->TestProcess = new cmProcess; this->TestProcess = new cmProcess;
*this->TestHandler->LogFile << "Unable to find required file: " *this->TestHandler->LogFile << "Unable to find required file: "
<< file.c_str() << std::endl; << file << std::endl;
cmCTestLog(this->CTest, ERROR_MESSAGE, "Unable to find required file: " cmCTestLog(this->CTest, ERROR_MESSAGE, "Unable to find required file: "
<< file.c_str() << std::endl); << file << std::endl);
this->TestResult.Output = "Unable to find required file: " + file; this->TestResult.Output = "Unable to find required file: " + file;
this->TestResult.FullCommandLine = ""; this->TestResult.FullCommandLine = "";
this->TestResult.CompletionStatus = "Not Run"; this->TestResult.CompletionStatus = "Not Run";
@ -482,9 +482,9 @@ bool cmCTestRunTest::StartTest(size_t total)
// that has that information // that has that information
this->TestProcess = new cmProcess; this->TestProcess = new cmProcess;
*this->TestHandler->LogFile << "Unable to find executable: " *this->TestHandler->LogFile << "Unable to find executable: "
<< args[1].c_str() << std::endl; << args[1] << std::endl;
cmCTestLog(this->CTest, ERROR_MESSAGE, "Unable to find executable: " cmCTestLog(this->CTest, ERROR_MESSAGE, "Unable to find executable: "
<< args[1].c_str() << std::endl); << args[1] << std::endl);
this->TestResult.Output = "Unable to find executable: " + args[1]; this->TestResult.Output = "Unable to find executable: " + args[1];
this->TestResult.FullCommandLine = ""; this->TestResult.FullCommandLine = "";
this->TestResult.CompletionStatus = "Not Run"; this->TestResult.CompletionStatus = "Not Run";
@ -711,7 +711,7 @@ void cmCTestRunTest::WriteLogOutputTop(size_t completed, size_t total)
indexStr << " #" << this->Index << ":"; indexStr << " #" << this->Index << ":";
cmCTestLog(this->CTest, HANDLER_OUTPUT, cmCTestLog(this->CTest, HANDLER_OUTPUT,
std::setw(3 + getNumWidth(this->TestHandler->GetMaxIndex())) std::setw(3 + getNumWidth(this->TestHandler->GetMaxIndex()))
<< indexStr.str().c_str()); << indexStr.str());
cmCTestLog(this->CTest, HANDLER_OUTPUT, " "); cmCTestLog(this->CTest, HANDLER_OUTPUT, " ");
const int maxTestNameWidth = this->CTest->GetMaxTestNameWidth(); const int maxTestNameWidth = this->CTest->GetMaxTestNameWidth();
std::string outname = this->TestProperties->Name + " "; std::string outname = this->TestProperties->Name + " ";
@ -722,18 +722,18 @@ void cmCTestRunTest::WriteLogOutputTop(size_t completed, size_t total)
<< this->TestProperties->Name << std::endl; << this->TestProperties->Name << std::endl;
*this->TestHandler->LogFile << this->TestProperties->Index << "/" *this->TestHandler->LogFile << this->TestProperties->Index << "/"
<< this->TestHandler->TotalNumberOfTests << this->TestHandler->TotalNumberOfTests
<< " Test: " << this->TestProperties->Name.c_str() << std::endl; << " Test: " << this->TestProperties->Name << std::endl;
*this->TestHandler->LogFile << "Command: \"" << this->ActualCommand << "\""; *this->TestHandler->LogFile << "Command: \"" << this->ActualCommand << "\"";
for (std::vector<std::string>::iterator i = this->Arguments.begin(); for (std::vector<std::string>::iterator i = this->Arguments.begin();
i != this->Arguments.end(); ++i) i != this->Arguments.end(); ++i)
{ {
*this->TestHandler->LogFile *this->TestHandler->LogFile
<< " \"" << i->c_str() << "\""; << " \"" << *i << "\"";
} }
*this->TestHandler->LogFile << std::endl *this->TestHandler->LogFile << std::endl
<< "Directory: " << this->TestProperties->Directory << std::endl << "Directory: " << this->TestProperties->Directory << std::endl
<< "\"" << this->TestProperties->Name.c_str() << "\" start time: " << "\"" << this->TestProperties->Name << "\" start time: "
<< this->StartTime << std::endl; << this->StartTime << std::endl;
*this->TestHandler->LogFile *this->TestHandler->LogFile
@ -741,9 +741,9 @@ void cmCTestRunTest::WriteLogOutputTop(size_t completed, size_t total)
<< "----------------------------------------------------------" << "----------------------------------------------------------"
<< std::endl; << std::endl;
*this->TestHandler->LogFile *this->TestHandler->LogFile
<< this->ProcessOutput.c_str() << "<end of output>" << std::endl; << this->ProcessOutput << "<end of output>" << std::endl;
cmCTestLog(this->CTest, HANDLER_OUTPUT, outname.c_str()); cmCTestLog(this->CTest, HANDLER_OUTPUT, outname.c_str());
cmCTestLog(this->CTest, DEBUG, "Testing " cmCTestLog(this->CTest, DEBUG, "Testing "
<< this->TestProperties->Name.c_str() << " ... "); << this->TestProperties->Name << " ... ");
} }

View File

@ -426,7 +426,7 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg)
cmSystemTools::GetErrorOccuredFlag()) cmSystemTools::GetErrorOccuredFlag())
{ {
cmCTestLog(this->CTest, ERROR_MESSAGE, "Error in read:" cmCTestLog(this->CTest, ERROR_MESSAGE, "Error in read:"
<< systemFile.c_str() << "\n"); << systemFile << "\n");
return 2; return 2;
} }
@ -444,7 +444,7 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg)
cmSystemTools::GetErrorOccuredFlag()) cmSystemTools::GetErrorOccuredFlag())
{ {
cmCTestLog(this->CTest, ERROR_MESSAGE, "Error in read script: " cmCTestLog(this->CTest, ERROR_MESSAGE, "Error in read script: "
<< script.c_str() << script
<< std::endl); << std::endl);
// Reset the error flag so that it can run more than // Reset the error flag so that it can run more than
// one script with an error when you // one script with an error when you
@ -781,7 +781,7 @@ int cmCTestScriptHandler::PerformExtraUpdates()
output = ""; output = "";
retVal = 0; retVal = 0;
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Run Update: " cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Run Update: "
<< fullCommand.c_str() << std::endl); << fullCommand << std::endl);
res = cmSystemTools::RunSingleCommand(fullCommand.c_str(), &output, res = cmSystemTools::RunSingleCommand(fullCommand.c_str(), &output,
&retVal, cvsArgs[0].c_str(), &retVal, cvsArgs[0].c_str(),
this->HandlerVerbose, 0 /*this->TimeOut*/); this->HandlerVerbose, 0 /*this->TimeOut*/);
@ -902,7 +902,7 @@ int cmCTestScriptHandler::RunConfigurationDashboard()
command += "\""; command += "\"";
retVal = 0; retVal = 0;
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Run cmake command: " cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Run cmake command: "
<< command.c_str() << std::endl); << command << std::endl);
res = cmSystemTools::RunSingleCommand(command.c_str(), &output, res = cmSystemTools::RunSingleCommand(command.c_str(), &output,
&retVal, this->BinaryDir.c_str(), &retVal, this->BinaryDir.c_str(),
this->HandlerVerbose, 0 /*this->TimeOut*/); this->HandlerVerbose, 0 /*this->TimeOut*/);
@ -916,7 +916,7 @@ int cmCTestScriptHandler::RunConfigurationDashboard()
} }
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Write CMake output to file: " << cmakeOutputFile.c_str() "Write CMake output to file: " << cmakeOutputFile
<< std::endl); << std::endl);
cmGeneratedFileStream fout(cmakeOutputFile.c_str()); cmGeneratedFileStream fout(cmakeOutputFile.c_str());
if ( fout ) if ( fout )
@ -927,7 +927,7 @@ int cmCTestScriptHandler::RunConfigurationDashboard()
{ {
cmCTestLog(this->CTest, ERROR_MESSAGE, cmCTestLog(this->CTest, ERROR_MESSAGE,
"Cannot open CMake output file: " "Cannot open CMake output file: "
<< cmakeOutputFile.c_str() << " for writing" << std::endl); << cmakeOutputFile << " for writing" << std::endl);
} }
} }
if (!res || retVal != 0) if (!res || retVal != 0)
@ -948,7 +948,7 @@ int cmCTestScriptHandler::RunConfigurationDashboard()
output = ""; output = "";
retVal = 0; retVal = 0;
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Run ctest command: " cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Run ctest command: "
<< command.c_str() << std::endl); << command << std::endl);
res = cmSystemTools::RunSingleCommand(command.c_str(), &output, res = cmSystemTools::RunSingleCommand(command.c_str(), &output,
&retVal, this->BinaryDir.c_str(), this->HandlerVerbose, &retVal, this->BinaryDir.c_str(), this->HandlerVerbose,
0 /*this->TimeOut*/); 0 /*this->TimeOut*/);
@ -962,13 +962,13 @@ int cmCTestScriptHandler::RunConfigurationDashboard()
{ {
cmCTestLog(this->CTest, ERROR_MESSAGE, cmCTestLog(this->CTest, ERROR_MESSAGE,
"Unable to run cmake:" << std::endl "Unable to run cmake:" << std::endl
<< cmakeFailedOuput.c_str() << std::endl); << cmakeFailedOuput << std::endl);
return 10; return 10;
} }
cmCTestLog(this->CTest, ERROR_MESSAGE, cmCTestLog(this->CTest, ERROR_MESSAGE,
"Unable to run ctest:" << std::endl "Unable to run ctest:" << std::endl
<< "command: " << command.c_str() << std::endl << "command: " << command << std::endl
<< "output: " << output.c_str() << std::endl); << "output: " << output << std::endl);
if (!res) if (!res)
{ {
return 11; return 11;

View File

@ -229,18 +229,18 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix,
if ( ::stat(local_file.c_str(), &st) ) if ( ::stat(local_file.c_str(), &st) )
{ {
cmCTestLog(this->CTest, ERROR_MESSAGE, " Cannot find file: " cmCTestLog(this->CTest, ERROR_MESSAGE, " Cannot find file: "
<< local_file.c_str() << std::endl); << local_file << std::endl);
::curl_easy_cleanup(curl); ::curl_easy_cleanup(curl);
::curl_global_cleanup(); ::curl_global_cleanup();
return false; return false;
} }
ftpfile = cmsys::SystemTools::Fopen(local_file.c_str(), "rb"); ftpfile = cmsys::SystemTools::Fopen(local_file.c_str(), "rb");
*this->LogFile << "\tUpload file: " << local_file.c_str() << " to " *this->LogFile << "\tUpload file: " << local_file << " to "
<< upload_as.c_str() << std::endl; << upload_as << std::endl;
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Upload file: " cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Upload file: "
<< local_file.c_str() << " to " << local_file << " to "
<< upload_as.c_str() << std::endl); << upload_as << std::endl);
::curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); ::curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
@ -290,11 +290,11 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix,
{ {
cmCTestLog(this->CTest, ERROR_MESSAGE, cmCTestLog(this->CTest, ERROR_MESSAGE,
" Error when uploading file: " " Error when uploading file: "
<< local_file.c_str() << std::endl); << local_file << std::endl);
cmCTestLog(this->CTest, ERROR_MESSAGE, " Error message was: " cmCTestLog(this->CTest, ERROR_MESSAGE, " Error message was: "
<< error_buffer << std::endl); << error_buffer << std::endl);
*this->LogFile << " Error when uploading file: " *this->LogFile << " Error when uploading file: "
<< local_file.c_str() << local_file
<< std::endl << std::endl
<< " Error message was: " << " Error message was: "
<< error_buffer << std::endl << error_buffer << std::endl
@ -422,8 +422,8 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
std::string remote_file std::string remote_file
= remoteprefix + cmSystemTools::GetFilenameName(*file); = remoteprefix + cmSystemTools::GetFilenameName(*file);
*this->LogFile << "\tUpload file: " << local_file.c_str() << " to " *this->LogFile << "\tUpload file: " << local_file << " to "
<< remote_file.c_str() << std::endl; << remote_file << std::endl;
std::string ofile = ""; std::string ofile = "";
for ( kk = 0; kk < remote_file.size(); kk ++ ) for ( kk = 0; kk < remote_file.size(); kk ++ )
@ -470,7 +470,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
if ( ::stat(local_file.c_str(), &st) ) if ( ::stat(local_file.c_str(), &st) )
{ {
cmCTestLog(this->CTest, ERROR_MESSAGE, " Cannot find file: " cmCTestLog(this->CTest, ERROR_MESSAGE, " Cannot find file: "
<< local_file.c_str() << std::endl); << local_file << std::endl);
::curl_easy_cleanup(curl); ::curl_easy_cleanup(curl);
::curl_global_cleanup(); ::curl_global_cleanup();
return false; return false;
@ -478,8 +478,8 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
ftpfile = cmsys::SystemTools::Fopen(local_file.c_str(), "rb"); ftpfile = cmsys::SystemTools::Fopen(local_file.c_str(), "rb");
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Upload file: " cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Upload file: "
<< local_file.c_str() << " to " << local_file << " to "
<< upload_as.c_str() << " Size: " << st.st_size << std::endl); << upload_as << " Size: " << st.st_size << std::endl);
// specify target // specify target
::curl_easy_setopt(curl,CURLOPT_URL, upload_as.c_str()); ::curl_easy_setopt(curl,CURLOPT_URL, upload_as.c_str());
@ -595,11 +595,11 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
{ {
cmCTestLog(this->CTest, ERROR_MESSAGE, cmCTestLog(this->CTest, ERROR_MESSAGE,
" Error when uploading file: " " Error when uploading file: "
<< local_file.c_str() << std::endl); << local_file << std::endl);
cmCTestLog(this->CTest, ERROR_MESSAGE, " Error message was: " cmCTestLog(this->CTest, ERROR_MESSAGE, " Error message was: "
<< error_buffer << std::endl); << error_buffer << std::endl);
*this->LogFile << " Error when uploading file: " *this->LogFile << " Error when uploading file: "
<< local_file.c_str() << local_file
<< std::endl << std::endl
<< " Error message was: " << error_buffer << " Error message was: " << error_buffer
<< std::endl; << std::endl;
@ -750,15 +750,15 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(
std::string turl std::string turl
= url + ((url.find("?",0) == std::string::npos) ? "?" : "&") = url + ((url.find("?",0) == std::string::npos) ? "?" : "&")
+ "xmlfile=" + ofile; + "xmlfile=" + ofile;
*this->LogFile << "Trigger url: " << turl.c_str() << std::endl; *this->LogFile << "Trigger url: " << turl << std::endl;
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Trigger url: " cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Trigger url: "
<< turl.c_str() << std::endl); << turl << std::endl);
curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY); curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_easy_setopt(curl, CURLOPT_URL, turl.c_str()); curl_easy_setopt(curl, CURLOPT_URL, turl.c_str());
if ( curl_easy_perform(curl) ) if ( curl_easy_perform(curl) )
{ {
cmCTestLog(this->CTest, ERROR_MESSAGE, " Error when triggering: " cmCTestLog(this->CTest, ERROR_MESSAGE, " Error when triggering: "
<< turl.c_str() << std::endl); << turl << std::endl);
cmCTestLog(this->CTest, ERROR_MESSAGE, " Error message was: " cmCTestLog(this->CTest, ERROR_MESSAGE, " Error message was: "
<< error_buffer << std::endl); << error_buffer << std::endl);
*this->LogFile << "\tTriggering failed with error: " << error_buffer *this->LogFile << "\tTriggering failed with error: " << error_buffer
@ -932,8 +932,8 @@ bool cmCTestSubmitHandler::SubmitUsingCP(
std::string rfname = destination + "/" + remoteprefix + *file; std::string rfname = destination + "/" + remoteprefix + *file;
cmSystemTools::CopyFileAlways(lfname.c_str(), rfname.c_str()); cmSystemTools::CopyFileAlways(lfname.c_str(), rfname.c_str());
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Copy file: " cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Copy file: "
<< lfname.c_str() << " to " << lfname << " to "
<< rfname.c_str() << std::endl); << rfname << std::endl);
} }
std::string tagDoneFile = destination + "/" + remoteprefix + "DONE"; std::string tagDoneFile = destination + "/" + remoteprefix + "DONE";
cmSystemTools::Touch(tagDoneFile.c_str(), true); cmSystemTools::Touch(tagDoneFile.c_str(), true);
@ -1183,7 +1183,7 @@ int cmCTestSubmitHandler::ProcessHandler()
= buildDirectory + "/Testing/" + this->CTest->GetCurrentTag(); = buildDirectory + "/Testing/" + this->CTest->GetCurrentTag();
std::string::size_type glen = gpath.size() + 1; std::string::size_type glen = gpath.size() + 1;
gpath = gpath + "/CoverageLog*"; gpath = gpath + "/CoverageLog*";
cmCTestLog(this->CTest, DEBUG, "Globbing for: " << gpath.c_str() cmCTestLog(this->CTest, DEBUG, "Globbing for: " << gpath
<< std::endl); << std::endl);
if ( cmSystemTools::SimpleGlob(gpath, gfiles, 1) ) if ( cmSystemTools::SimpleGlob(gpath, gfiles, 1) )
{ {
@ -1191,7 +1191,7 @@ int cmCTestSubmitHandler::ProcessHandler()
for ( cc = 0; cc < gfiles.size(); cc ++ ) for ( cc = 0; cc < gfiles.size(); cc ++ )
{ {
gfiles[cc] = gfiles[cc].substr(glen); gfiles[cc] = gfiles[cc].substr(glen);
cmCTestLog(this->CTest, DEBUG, "Glob file: " << gfiles[cc].c_str() cmCTestLog(this->CTest, DEBUG, "Glob file: " << gfiles[cc]
<< std::endl); << std::endl);
this->CTest->AddSubmitFile(cmCTest::PartCoverage, gfiles[cc].c_str()); this->CTest->AddSubmitFile(cmCTest::PartCoverage, gfiles[cc].c_str());
} }
@ -1232,7 +1232,7 @@ int cmCTestSubmitHandler::ProcessHandler()
cmCTest::SetOfStrings::iterator it; cmCTest::SetOfStrings::iterator it;
for ( it = files.begin(); it != files.end(); ++ it ) for ( it = files.begin(); it != files.end(); ++ it )
{ {
ofs << cnt << "\t" << it->c_str() << std::endl; ofs << cnt << "\t" << *it << std::endl;
cnt ++; cnt ++;
} }
} }
@ -1448,7 +1448,7 @@ int cmCTestSubmitHandler::ProcessHandler()
oldWorkingDirectory = cmSystemTools::GetCurrentWorkingDirectory(); oldWorkingDirectory = cmSystemTools::GetCurrentWorkingDirectory();
cmSystemTools::ChangeDirectory(buildDirectory.c_str()); cmSystemTools::ChangeDirectory(buildDirectory.c_str());
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Change directory: " cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Change directory: "
<< buildDirectory.c_str() << std::endl); << buildDirectory << std::endl);
if ( !this->SubmitUsingCP( if ( !this->SubmitUsingCP(
"Testing/"+this->CTest->GetCurrentTag(), "Testing/"+this->CTest->GetCurrentTag(),

View File

@ -616,7 +616,7 @@ int cmCTestTestHandler::ProcessHandler()
ofs << ftit->TestCount << ":" << ftit->Name << std::endl; ofs << ftit->TestCount << ":" << ftit->Name << std::endl;
cmCTestLog(this->CTest, HANDLER_OUTPUT, "\t" << std::setw(3) cmCTestLog(this->CTest, HANDLER_OUTPUT, "\t" << std::setw(3)
<< ftit->TestCount << " - " << ftit->TestCount << " - "
<< ftit->Name.c_str() << " (" << ftit->Name << " ("
<< this->GetTestStatus(ftit->Status) << ")" << this->GetTestStatus(ftit->Status) << ")"
<< std::endl); << std::endl);
} }
@ -1022,7 +1022,7 @@ bool cmCTestTestHandler::GetValue(const char* tag,
{ {
cmCTestLog(this->CTest, ERROR_MESSAGE, cmCTestLog(this->CTest, ERROR_MESSAGE,
"parse error: missing tag: " "parse error: missing tag: "
<< tag << " found [" << line.c_str() << "]" << std::endl); << tag << " found [" << line << "]" << std::endl);
ret = false; ret = false;
} }
return ret; return ret;
@ -1223,7 +1223,7 @@ void cmCTestTestHandler::GenerateDartOutput(std::ostream& os)
{ {
os os
<< "\t\t\t<NamedMeasurement type=\"text/string\" " << "\t\t\t<NamedMeasurement type=\"text/string\" "
<< "name=\"" << measureIt->first.c_str() << "\"><Value>" << "name=\"" << measureIt->first << "\"><Value>"
<< cmXMLSafe(measureIt->second) << cmXMLSafe(measureIt->second)
<< "</Value></NamedMeasurement>\n"; << "</Value></NamedMeasurement>\n";
} }
@ -1820,7 +1820,7 @@ void cmCTestTestHandler::ExpandTestsToRunInformationForRerunFailed()
else if ( !this->CTest->GetShowOnly() && !this->CTest->ShouldPrintLabels() ) else if ( !this->CTest->GetShowOnly() && !this->CTest->ShouldPrintLabels() )
{ {
cmCTestLog(this->CTest, ERROR_MESSAGE, "Problem reading file: " cmCTestLog(this->CTest, ERROR_MESSAGE, "Problem reading file: "
<< lastTestsFailedLog.c_str() << << lastTestsFailedLog <<
" while generating list of previously failed tests." << std::endl); " while generating list of previously failed tests." << std::endl);
} }
} }
@ -1960,7 +1960,7 @@ std::string cmCTestTestHandler::GenerateRegressionImages(
<< " " << k1 << "=\"" << v1 << "\"" << " " << k1 << "=\"" << v1 << "\""
<< " " << k2 << "=\"" << v2 << "\"" << " " << k2 << "=\"" << v2 << "\""
<< " encoding=\"none\"" << " encoding=\"none\""
<< "><Value>Image " << filename.c_str() << "><Value>Image " << filename
<< " is empty</Value></NamedMeasurement>"; << " is empty</Value></NamedMeasurement>";
} }
else else
@ -2014,10 +2014,10 @@ std::string cmCTestTestHandler::GenerateRegressionImages(
<< "\t\t\t<NamedMeasurement" << "\t\t\t<NamedMeasurement"
<< " name=\"" << measurementfile.match(idx) << "\"" << " name=\"" << measurementfile.match(idx) << "\""
<< " text=\"text/string\"" << " text=\"text/string\""
<< "><Value>File " << filename.c_str() << "><Value>File " << filename
<< " not found</Value></NamedMeasurement>" << " not found</Value></NamedMeasurement>"
<< std::endl; << std::endl;
cmCTestLog(this->CTest, HANDLER_OUTPUT, "File \"" << filename.c_str() cmCTestLog(this->CTest, HANDLER_OUTPUT, "File \"" << filename
<< "\" not found." << std::endl); << "\" not found." << std::endl);
} }
cxml.erase(measurementfile.start(), cxml.erase(measurementfile.start(),

View File

@ -331,7 +331,7 @@ int cmCTestUpdateHandler::DetectVCS(const char* dir)
{ {
std::string sourceDirectory = dir; std::string sourceDirectory = dir;
cmCTestLog(this->CTest, DEBUG, "Check directory: " cmCTestLog(this->CTest, DEBUG, "Check directory: "
<< sourceDirectory.c_str() << std::endl); << sourceDirectory << std::endl);
sourceDirectory += "/.svn"; sourceDirectory += "/.svn";
if ( cmSystemTools::FileExists(sourceDirectory.c_str()) ) if ( cmSystemTools::FileExists(sourceDirectory.c_str()) )
{ {

View File

@ -64,7 +64,7 @@ int cmCTestUploadHandler::ProcessHandler()
for ( it = this->Files.begin(); it != this->Files.end(); it ++ ) for ( it = this->Files.begin(); it != this->Files.end(); it ++ )
{ {
cmCTestLog(this->CTest, OUTPUT, cmCTestLog(this->CTest, OUTPUT,
"\tUpload file: " << it->c_str() << std::endl); "\tUpload file: " << *it << std::endl);
ofs << "<File filename=\"" << cmXMLSafe(*it) << "\">\n" ofs << "<File filename=\"" << cmXMLSafe(*it) << "\">\n"
<< "<Content encoding=\"base64\">\n"; << "<Content encoding=\"base64\">\n";
ofs << this->CTest->Base64EncodeFile(*it); ofs << this->CTest->Base64EncodeFile(*it);

View File

@ -286,7 +286,7 @@ bool cmAddCustomCommandCommand
// No command for this output exists. // No command for this output exists.
cmOStringStream e; cmOStringStream e;
e << "given APPEND option with output \"" << output[0].c_str() e << "given APPEND option with output \"" << output[0]
<< "\" which is not already a custom command output."; << "\" which is not already a custom command output.";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;

View File

@ -79,7 +79,7 @@ bool cmCMakeMinimumRequired
&required_patch, &required_tweak) < 2) &required_patch, &required_tweak) < 2)
{ {
cmOStringStream e; cmOStringStream e;
e << "could not parse VERSION \"" << version_string.c_str() << "\"."; e << "could not parse VERSION \"" << version_string << "\".";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
} }
@ -98,7 +98,7 @@ bool cmCMakeMinimumRequired
{ {
// The current version is too low. // The current version is too low.
cmOStringStream e; cmOStringStream e;
e << "CMake " << version_string.c_str() e << "CMake " << version_string
<< " or higher is required. You are running version " << " or higher is required. You are running version "
<< cmVersion::GetCMakeVersion(); << cmVersion::GetCMakeVersion();
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());

View File

@ -78,7 +78,7 @@ struct tm* cmCTest::GetNightlyTime(std::string str,
lctime->tm_mday, lctime->tm_mday,
str.c_str()); str.c_str());
cmCTestLog(this, OUTPUT, "Determine Nightly Start Time" << std::endl cmCTestLog(this, OUTPUT, "Determine Nightly Start Time" << std::endl
<< " Specified time: " << str.c_str() << std::endl); << " Specified time: " << str << std::endl);
//Convert the nightly start time to seconds. Since we are //Convert the nightly start time to seconds. Since we are
//providing only a time and a timezone, the current date of //providing only a time and a timezone, the current date of
//the local machine is assumed. Consequently, nightlySeconds //the local machine is assumed. Consequently, nightlySeconds
@ -681,7 +681,7 @@ bool cmCTest::InitializeFromCommand(cmCTestStartCommand* command)
if ( !fname.empty() ) if ( !fname.empty() )
{ {
cmCTestLog(this, OUTPUT, " Reading ctest configuration file: " cmCTestLog(this, OUTPUT, " Reading ctest configuration file: "
<< fname.c_str() << std::endl); << fname << std::endl);
bool readit = mf->ReadListFile(mf->GetCurrentListFile(), bool readit = mf->ReadListFile(mf->GetCurrentListFile(),
fname.c_str() ); fname.c_str() );
if(!readit) if(!readit)
@ -696,10 +696,10 @@ bool cmCTest::InitializeFromCommand(cmCTestStartCommand* command)
{ {
cmCTestLog(this, WARNING, cmCTestLog(this, WARNING,
"Cannot locate CTest configuration: in BuildDirectory: " "Cannot locate CTest configuration: in BuildDirectory: "
<< bld_dir_fname.c_str() << std::endl); << bld_dir_fname << std::endl);
cmCTestLog(this, WARNING, cmCTestLog(this, WARNING,
"Cannot locate CTest configuration: in SourceDirectory: " "Cannot locate CTest configuration: in SourceDirectory: "
<< src_dir_fname.c_str() << std::endl); << src_dir_fname << std::endl);
} }
this->SetCTestConfigurationFromCMakeVariable(mf, "NightlyStartTime", this->SetCTestConfigurationFromCMakeVariable(mf, "NightlyStartTime",
@ -748,13 +748,13 @@ bool cmCTest::UpdateCTestConfiguration()
} }
} }
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "UpdateCTestConfiguration from :" cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "UpdateCTestConfiguration from :"
<< fileName.c_str() << "\n"); << fileName << "\n");
if ( !cmSystemTools::FileExists(fileName.c_str()) ) if ( !cmSystemTools::FileExists(fileName.c_str()) )
{ {
// No need to exit if we are not producing XML // No need to exit if we are not producing XML
if ( this->ProduceXML ) if ( this->ProduceXML )
{ {
cmCTestLog(this, ERROR_MESSAGE, "Cannot find file: " << fileName.c_str() cmCTestLog(this, ERROR_MESSAGE, "Cannot find file: " << fileName
<< std::endl); << std::endl);
return false; return false;
} }
@ -762,7 +762,7 @@ bool cmCTest::UpdateCTestConfiguration()
else else
{ {
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "Parse Config file:" cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "Parse Config file:"
<< fileName.c_str() << "\n"); << fileName << "\n");
// parse the dart test file // parse the dart test file
cmsys::ifstream fin(fileName.c_str()); cmsys::ifstream fin(fileName.c_str());
@ -1346,7 +1346,7 @@ int cmCTest::RunTest(std::vector<const char*> argv,
*output += oss.str(); *output += oss.str();
if ( log ) if ( log )
{ {
*log << output->c_str(); *log << *output;
} }
cmSystemTools::ChangeDirectory(oldpath.c_str()); cmSystemTools::ChangeDirectory(oldpath.c_str());
@ -1562,7 +1562,7 @@ void cmCTest::AddSiteProperties(std::ostream& ostr)
for(std::vector<std::string>::iterator i = args.begin(); for(std::vector<std::string>::iterator i = args.begin();
i != args.end(); ++i) i != args.end(); ++i)
{ {
ostr << " <Label>" << i->c_str() << "</Label>\n"; ostr << " <Label>" << *i << "</Label>\n";
} }
ostr << " </Labels>\n"; ostr << " </Labels>\n";
} }
@ -1606,7 +1606,7 @@ int cmCTest::GenerateCTestNotesOutput(std::ostream& os,
for ( it = files.begin(); it != files.end(); it ++ ) for ( it = files.begin(); it != files.end(); it ++ )
{ {
cmCTestLog(this, OUTPUT, "\tAdd file: " << it->c_str() << std::endl); cmCTestLog(this, OUTPUT, "\tAdd file: " << *it << std::endl);
std::string note_time = this->CurrentTime(); std::string note_time = this->CurrentTime();
os << "<Note Name=\"" << cmXMLSafe(*it) << "\">\n" os << "<Note Name=\"" << cmXMLSafe(*it) << "\">\n"
<< "<Time>" << cmSystemTools::GetTime() << "</Time>\n" << "<Time>" << cmSystemTools::GetTime() << "</Time>\n"
@ -1624,8 +1624,8 @@ int cmCTest::GenerateCTestNotesOutput(std::ostream& os,
} }
else else
{ {
os << "Problem reading file: " << it->c_str() << std::endl; os << "Problem reading file: " << *it << std::endl;
cmCTestLog(this, ERROR_MESSAGE, "Problem reading file: " << it->c_str() cmCTestLog(this, ERROR_MESSAGE, "Problem reading file: " << *it
<< " while creating notes" << std::endl); << " while creating notes" << std::endl);
} }
os << "</Text>\n" os << "</Text>\n"
@ -1732,7 +1732,7 @@ bool cmCTest::SubmitExtraFiles(const VectorOfStrings &files)
if ( !cmSystemTools::FileExists(it->c_str()) ) if ( !cmSystemTools::FileExists(it->c_str()) )
{ {
cmCTestLog(this, ERROR_MESSAGE, "Cannot find extra file: " cmCTestLog(this, ERROR_MESSAGE, "Cannot find extra file: "
<< it->c_str() << " to submit." << *it << " to submit."
<< std::endl;); << std::endl;);
return false; return false;
} }
@ -2319,7 +2319,7 @@ int cmCTest::Run(std::vector<std::string> &args, std::string* output)
executeTests = false; executeTests = false;
cmCTestLog(this, ERROR_MESSAGE, cmCTestLog(this, ERROR_MESSAGE,
"CTest -T called with incorrect option: " "CTest -T called with incorrect option: "
<< args[i].c_str() << std::endl); << args[i] << std::endl);
cmCTestLog(this, ERROR_MESSAGE, "Available options are:" << std::endl cmCTestLog(this, ERROR_MESSAGE, "Available options are:" << std::endl
<< " " << ctestExec << " -T all" << std::endl << " " << ctestExec << " -T all" << std::endl
<< " " << ctestExec << " -T start" << std::endl << " " << ctestExec << " -T start" << std::endl
@ -2356,7 +2356,7 @@ int cmCTest::Run(std::vector<std::string> &args, std::string* output)
{ {
executeTests = false; executeTests = false;
cmCTestLog(this, ERROR_MESSAGE, cmCTestLog(this, ERROR_MESSAGE,
"CTest -M called with incorrect option: " << str.c_str() "CTest -M called with incorrect option: " << str
<< std::endl); << std::endl);
cmCTestLog(this, ERROR_MESSAGE, "Available options are:" << std::endl cmCTestLog(this, ERROR_MESSAGE, "Available options are:" << std::endl
<< " " << ctestExec << " -M Continuous" << std::endl << " " << ctestExec << " -M Continuous" << std::endl
@ -2527,11 +2527,11 @@ int cmCTest::ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf)
std::string fname = dir; std::string fname = dir;
fname += "/CTestCustom.cmake"; fname += "/CTestCustom.cmake";
cmCTestLog(this, DEBUG, "* Check for file: " cmCTestLog(this, DEBUG, "* Check for file: "
<< fname.c_str() << std::endl); << fname << std::endl);
if ( cmSystemTools::FileExists(fname.c_str()) ) if ( cmSystemTools::FileExists(fname.c_str()) )
{ {
cmCTestLog(this, DEBUG, "* Read custom CTest configuration file: " cmCTestLog(this, DEBUG, "* Read custom CTest configuration file: "
<< fname.c_str() << std::endl); << fname << std::endl);
bool erroroc = cmSystemTools::GetErrorOccuredFlag(); bool erroroc = cmSystemTools::GetErrorOccuredFlag();
cmSystemTools::ResetErrorOccuredFlag(); cmSystemTools::ResetErrorOccuredFlag();
@ -2540,7 +2540,7 @@ int cmCTest::ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf)
{ {
cmCTestLog(this, ERROR_MESSAGE, cmCTestLog(this, ERROR_MESSAGE,
"Problem reading custom configuration: " "Problem reading custom configuration: "
<< fname.c_str() << std::endl); << fname << std::endl);
} }
found = true; found = true;
if ( erroroc ) if ( erroroc )
@ -2552,7 +2552,7 @@ int cmCTest::ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf)
std::string rexpr = dir; std::string rexpr = dir;
rexpr += "/CTestCustom.ctest"; rexpr += "/CTestCustom.ctest";
cmCTestLog(this, DEBUG, "* Check for file: " cmCTestLog(this, DEBUG, "* Check for file: "
<< rexpr.c_str() << std::endl); << rexpr << std::endl);
if ( !found && cmSystemTools::FileExists(rexpr.c_str()) ) if ( !found && cmSystemTools::FileExists(rexpr.c_str()) )
{ {
cmsys::Glob gl; cmsys::Glob gl;
@ -2564,13 +2564,13 @@ int cmCTest::ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf)
++ fileIt ) ++ fileIt )
{ {
cmCTestLog(this, DEBUG, "* Read custom CTest configuration file: " cmCTestLog(this, DEBUG, "* Read custom CTest configuration file: "
<< fileIt->c_str() << std::endl); << *fileIt << std::endl);
if ( !mf->ReadListFile(0, fileIt->c_str()) || if ( !mf->ReadListFile(0, fileIt->c_str()) ||
cmSystemTools::GetErrorOccuredFlag() ) cmSystemTools::GetErrorOccuredFlag() )
{ {
cmCTestLog(this, ERROR_MESSAGE, cmCTestLog(this, ERROR_MESSAGE,
"Problem reading custom configuration: " "Problem reading custom configuration: "
<< fileIt->c_str() << std::endl); << *fileIt << std::endl);
} }
} }
found = true; found = true;
@ -2584,7 +2584,7 @@ int cmCTest::ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf)
{ {
cmCTestLog(this, DEBUG, cmCTestLog(this, DEBUG,
"* Read custom CTest configuration vectors for handler: " "* Read custom CTest configuration vectors for handler: "
<< it->first.c_str() << " (" << it->second << ")" << std::endl); << it->first << " (" << it->second << ")" << std::endl);
it->second->PopulateCustomVectors(mf); it->second->PopulateCustomVectors(mf);
} }
} }
@ -2610,7 +2610,7 @@ void cmCTest::PopulateCustomVector(cmMakefile* mf, const std::string& def,
for ( it = slist.begin(); it != slist.end(); ++it ) for ( it = slist.begin(); it != slist.end(); ++it )
{ {
cmCTestLog(this, DEBUG, " -- " << it->c_str() << std::endl); cmCTestLog(this, DEBUG, " -- " << *it << std::endl);
vec.push_back(*it); vec.push_back(*it);
} }
} }
@ -2849,7 +2849,7 @@ void cmCTest::AddCTestConfigurationOverwrite(const std::string& overStr)
"CTest configuration overwrite specified in the wrong format." "CTest configuration overwrite specified in the wrong format."
<< std::endl << std::endl
<< "Valid format is: --overwrite key=value" << std::endl << "Valid format is: --overwrite key=value" << std::endl
<< "The specified was: --overwrite " << overStr.c_str() << std::endl); << "The specified was: --overwrite " << overStr << std::endl);
return; return;
} }
std::string key = overStr.substr(0, epos); std::string key = overStr.substr(0, epos);

View File

@ -644,7 +644,7 @@ void cmCacheManager::OutputHelpString(std::ostream& fout,
fout << "\\n"; fout << "\\n";
} }
oneLine = helpString.substr(pos, i - pos); oneLine = helpString.substr(pos, i - pos);
fout << oneLine.c_str() << "\n"; fout << oneLine << "\n";
pos = i; pos = i;
} }
} }
@ -698,7 +698,7 @@ void cmCacheManager::PrintCache(std::ostream& out) const
{ {
if((*i).second.Type != INTERNAL) if((*i).second.Type != INTERNAL)
{ {
out << (*i).first.c_str() << " = " << (*i).second.Value.c_str() out << (*i).first << " = " << (*i).second.Value
<< std::endl; << std::endl;
} }
} }

View File

@ -293,7 +293,7 @@ int cmCommandArgumentParserHelper::ParseString(const char* str, int verb)
if ( Verbose ) if ( Verbose )
{ {
std::cerr << "Expanding [" << str << "] produced: [" std::cerr << "Expanding [" << str << "] produced: ["
<< this->Result.c_str() << "]" << std::endl; << this->Result << "]" << std::endl;
} }
return 1; return 1;
} }

View File

@ -284,7 +284,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
{ {
cmOStringStream e; cmOStringStream e;
e << "Failed to open\n" e << "Failed to open\n"
<< " " << outFileName.c_str() << "\n" << " " << outFileName << "\n"
<< cmSystemTools::GetLastSystemError(); << cmSystemTools::GetLastSystemError();
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
return -1; return -1;
@ -519,9 +519,9 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
{ {
cmOStringStream emsg; cmOStringStream emsg;
emsg << "Cannot copy output executable\n" emsg << "Cannot copy output executable\n"
<< " '" << this->OutputFile.c_str() << "'\n" << " '" << this->OutputFile << "'\n"
<< "to destination specified by COPY_FILE:\n" << "to destination specified by COPY_FILE:\n"
<< " '" << copyFile.c_str() << "'\n"; << " '" << copyFile << "'\n";
if(!this->FindErrorMessage.empty()) if(!this->FindErrorMessage.empty())
{ {
emsg << this->FindErrorMessage.c_str(); emsg << this->FindErrorMessage.c_str();

View File

@ -278,7 +278,7 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources,
cmLocalGenerator::HOME_OUTPUT, cmLocalGenerator::HOME_OUTPUT,
cmLocalGenerator::MAKEFILE) cmLocalGenerator::MAKEFILE)
<< std::endl; << std::endl;
internalDepends << " " << i->c_str() << std::endl; internalDepends << " " << *i << std::endl;
} }
makeDepends << std::endl; makeDepends << std::endl;

View File

@ -453,7 +453,7 @@ cmDependsFortran
cmLocalGenerator::HOME_OUTPUT, cmLocalGenerator::HOME_OUTPUT,
cmLocalGenerator::MAKEFILE) cmLocalGenerator::MAKEFILE)
<< std::endl; << std::endl;
internalDepends << " " << i->c_str() << std::endl; internalDepends << " " << *i << std::endl;
} }
makeDepends << std::endl; makeDepends << std::endl;
@ -666,7 +666,7 @@ bool cmDependsFortran::CopyModule(const std::vector<std::string>& args)
if(!cmSystemTools::CopyFileAlways(mod_upper.c_str(), stamp.c_str())) if(!cmSystemTools::CopyFileAlways(mod_upper.c_str(), stamp.c_str()))
{ {
std::cerr << "Error copying Fortran module from \"" std::cerr << "Error copying Fortran module from \""
<< mod_upper.c_str() << "\" to \"" << stamp.c_str() << mod_upper << "\" to \"" << stamp
<< "\".\n"; << "\".\n";
return false; return false;
} }
@ -681,7 +681,7 @@ bool cmDependsFortran::CopyModule(const std::vector<std::string>& args)
if(!cmSystemTools::CopyFileAlways(mod_lower.c_str(), stamp.c_str())) if(!cmSystemTools::CopyFileAlways(mod_lower.c_str(), stamp.c_str()))
{ {
std::cerr << "Error copying Fortran module from \"" std::cerr << "Error copying Fortran module from \""
<< mod_lower.c_str() << "\" to \"" << stamp.c_str() << mod_lower << "\" to \"" << stamp
<< "\".\n"; << "\".\n";
return false; return false;
} }
@ -689,9 +689,9 @@ bool cmDependsFortran::CopyModule(const std::vector<std::string>& args)
return true; return true;
} }
std::cerr << "Error copying Fortran module \"" << args[2].c_str() std::cerr << "Error copying Fortran module \"" << args[2]
<< "\". Tried \"" << mod_upper.c_str() << "\". Tried \"" << mod_upper
<< "\" and \"" << mod_lower.c_str() << "\".\n"; << "\" and \"" << mod_lower << "\".\n";
return false; return false;
} }

View File

@ -262,7 +262,7 @@ void cmDependsJavaParserHelper::PrintClasses()
sit != files.end(); sit != files.end();
++ sit ) ++ sit )
{ {
std::cout << " " << sit->c_str() << ".class" << std::endl; std::cout << " " << *sit << ".class" << std::endl;
} }
} }
@ -308,7 +308,7 @@ int cmDependsJavaParserHelper::ParseString(const char* str, int verb)
if ( this->CurrentPackage.size() > 0 ) if ( this->CurrentPackage.size() > 0 )
{ {
std::cout << "Current package is: " << std::cout << "Current package is: " <<
this->CurrentPackage.c_str() << std::endl; this->CurrentPackage << std::endl;
} }
std::cout << "Imports packages:"; std::cout << "Imports packages:";
if ( this->PackagesImport.size() > 0 ) if ( this->PackagesImport.size() > 0 )
@ -318,7 +318,7 @@ int cmDependsJavaParserHelper::ParseString(const char* str, int verb)
it != this->PackagesImport.end(); it != this->PackagesImport.end();
++ it ) ++ it )
{ {
std::cout << " " << it->c_str(); std::cout << " " << *it;
} }
} }
std::cout << std::endl; std::cout << std::endl;
@ -330,7 +330,7 @@ int cmDependsJavaParserHelper::ParseString(const char* str, int verb)
it != this->ClassesFound.end(); it != this->ClassesFound.end();
++ it ) ++ it )
{ {
std::cout << " " << it->c_str(); std::cout << " " << *it;
} }
} }
std::cout << std::endl; std::cout << std::endl;

View File

@ -693,7 +693,7 @@ bool cmDocumentation::PrintHelpOneManual(std::ostream& os)
return true; return true;
} }
// Argument was not a manual. Complain. // Argument was not a manual. Complain.
os << "Argument \"" << this->CurrentArgument.c_str() os << "Argument \"" << this->CurrentArgument
<< "\" to --help-manual is not an available manual. " << "\" to --help-manual is not an available manual. "
<< "Use --help-manual-list to see all available manuals.\n"; << "Use --help-manual-list to see all available manuals.\n";
return false; return false;
@ -715,7 +715,7 @@ bool cmDocumentation::PrintHelpOneCommand(std::ostream& os)
return true; return true;
} }
// Argument was not a command. Complain. // Argument was not a command. Complain.
os << "Argument \"" << this->CurrentArgument.c_str() os << "Argument \"" << this->CurrentArgument
<< "\" to --help-command is not a CMake command. " << "\" to --help-command is not a CMake command. "
<< "Use --help-command-list to see all commands.\n"; << "Use --help-command-list to see all commands.\n";
return false; return false;
@ -737,7 +737,7 @@ bool cmDocumentation::PrintHelpOneModule(std::ostream& os)
return true; return true;
} }
// Argument was not a module. Complain. // Argument was not a module. Complain.
os << "Argument \"" << this->CurrentArgument.c_str() os << "Argument \"" << this->CurrentArgument
<< "\" to --help-module is not a CMake module.\n"; << "\" to --help-module is not a CMake module.\n";
return false; return false;
} }
@ -772,7 +772,7 @@ bool cmDocumentation::PrintHelpOneProperty(std::ostream& os)
return true; return true;
} }
// Argument was not a property. Complain. // Argument was not a property. Complain.
os << "Argument \"" << this->CurrentArgument.c_str() os << "Argument \"" << this->CurrentArgument
<< "\" to --help-property is not a CMake property. " << "\" to --help-property is not a CMake property. "
<< "Use --help-property-list to see all properties.\n"; << "Use --help-property-list to see all properties.\n";
return false; return false;
@ -796,7 +796,7 @@ bool cmDocumentation::PrintHelpOnePolicy(std::ostream& os)
} }
// Argument was not a policy. Complain. // Argument was not a policy. Complain.
os << "Argument \"" << this->CurrentArgument.c_str() os << "Argument \"" << this->CurrentArgument
<< "\" to --help-policy is not a CMake policy.\n"; << "\" to --help-policy is not a CMake policy.\n";
return false; return false;
} }
@ -817,7 +817,7 @@ bool cmDocumentation::PrintHelpOneVariable(std::ostream& os)
return true; return true;
} }
// Argument was not a variable. Complain. // Argument was not a variable. Complain.
os << "Argument \"" << this->CurrentArgument.c_str() os << "Argument \"" << this->CurrentArgument
<< "\" to --help-variable is not a defined variable. " << "\" to --help-variable is not a defined variable. "
<< "Use --help-variable-list to see all defined variables.\n"; << "Use --help-variable-list to see all defined variables.\n";
return false; return false;

View File

@ -271,7 +271,7 @@ cmExportInstallFileGenerator::GenerateImportFileConfig(
{ {
std::string se = cmSystemTools::GetLastSystemError(); std::string se = cmSystemTools::GetLastSystemError();
cmOStringStream e; cmOStringStream e;
e << "cannot write to file \"" << fileName.c_str() e << "cannot write to file \"" << fileName
<< "\": " << se; << "\": " << se;
cmSystemTools::Error(e.str().c_str()); cmSystemTools::Error(e.str().c_str());
return false; return false;

View File

@ -499,7 +499,7 @@ void cmExtraCodeBlocksGenerator
sit!=otherFiles.end(); sit!=otherFiles.end();
++sit) ++sit)
{ {
fout<<" <Unit filename=\""<< sit->c_str() <<"\">\n" fout<<" <Unit filename=\""<< *sit <<"\">\n"
" </Unit>\n"; " </Unit>\n";
} }
@ -653,7 +653,7 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
dirIt != uniqIncludeDirs.end(); dirIt != uniqIncludeDirs.end();
++dirIt) ++dirIt)
{ {
fout <<" <Add directory=\"" << dirIt->c_str() << "\" />\n"; fout <<" <Add directory=\"" << *dirIt << "\" />\n";
} }
fout<<" </Compiler>\n"; fout<<" </Compiler>\n";

View File

@ -311,7 +311,7 @@ void cmExtraCodeLiteGenerator
{ {
std::string relativePath = std::string relativePath =
cmSystemTools::RelativePath(projectPath.c_str(), sit->first.c_str()); cmSystemTools::RelativePath(projectPath.c_str(), sit->first.c_str());
fout<< " <File Name=\"" << relativePath.c_str() << "\"/>\n"; fout<< " <File Name=\"" << relativePath << "\"/>\n";
} }
fout<< " </VirtualDirectory>\n"; fout<< " </VirtualDirectory>\n";
fout<< " <VirtualDirectory Name=\"include\">\n"; fout<< " <VirtualDirectory Name=\"include\">\n";
@ -322,7 +322,7 @@ void cmExtraCodeLiteGenerator
{ {
std::string relativePath = std::string relativePath =
cmSystemTools::RelativePath(projectPath.c_str(), sit->c_str()); cmSystemTools::RelativePath(projectPath.c_str(), sit->c_str());
fout << " <File Name=\"" << relativePath.c_str() << "\"/>\n"; fout << " <File Name=\"" << relativePath << "\"/>\n";
} }
fout << " </VirtualDirectory>\n"; fout << " </VirtualDirectory>\n";

View File

@ -1292,7 +1292,7 @@ void cmExtraEclipseCDT4Generator::AppendTarget(cmGeneratedFileStream& fout,
std::string pathXml = cmExtraEclipseCDT4Generator::EscapeForXML(path); std::string pathXml = cmExtraEclipseCDT4Generator::EscapeForXML(path);
fout << fout <<
"<target name=\"" << prefix << targetXml << "\"" "<target name=\"" << prefix << targetXml << "\""
" path=\"" << pathXml.c_str() << "\"" " path=\"" << pathXml << "\""
" targetID=\"org.eclipse.cdt.make.MakeTargetBuilder\">\n" " targetID=\"org.eclipse.cdt.make.MakeTargetBuilder\">\n"
"<buildCommand>" "<buildCommand>"
<< cmExtraEclipseCDT4Generator::GetEclipsePath(make) << cmExtraEclipseCDT4Generator::GetEclipsePath(make)

View File

@ -268,7 +268,7 @@ bool cmFindPackageCommand
else else
{ {
cmOStringStream e; cmOStringStream e;
e << "called with invalid argument \"" << args[i].c_str() << "\""; e << "called with invalid argument \"" << args[i] << "\"";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
} }

View File

@ -2318,7 +2318,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
it != componentsSet->end(); it != componentsSet->end();
++ it ) ++ it )
{ {
ostr << " \"" << it->c_str() << "\""; ostr << " \"" << *it << "\"";
} }
} }
else else

View File

@ -360,7 +360,7 @@ void cmGlobalKdevelopGenerator
if (strstr(line, "<general>")) if (strstr(line, "<general>"))
{ {
fout<< " <projectmanagement>KDevCustomProject</projectmanagement>\n"; fout<< " <projectmanagement>KDevCustomProject</projectmanagement>\n";
fout<< " <projectdirectory>" <<projectDir.c_str() fout<< " <projectdirectory>" <<projectDir
<< "</projectdirectory>\n"; //this one is important << "</projectdirectory>\n"; //this one is important
fout<<" <absoluteprojectpath>true</absoluteprojectpath>\n"; fout<<" <absoluteprojectpath>true</absoluteprojectpath>\n";
//and this one //and this one
@ -368,14 +368,14 @@ void cmGlobalKdevelopGenerator
// inside kdevcustomproject the <filelistdirectory> must be put // inside kdevcustomproject the <filelistdirectory> must be put
if (strstr(line, "<kdevcustomproject>")) if (strstr(line, "<kdevcustomproject>"))
{ {
fout<<" <filelistdirectory>"<<outputDir.c_str() fout<<" <filelistdirectory>"<<outputDir
<<"</filelistdirectory>\n"; <<"</filelistdirectory>\n";
} }
// buildtool and builddir go inside <build> // buildtool and builddir go inside <build>
if (strstr(line, "<build>")) if (strstr(line, "<build>"))
{ {
fout<<" <buildtool>make</buildtool>\n"; fout<<" <buildtool>make</buildtool>\n";
fout<<" <builddir>"<<outputDir.c_str()<<"</builddir>\n"; fout<<" <builddir>"<<outputDir<<"</builddir>\n";
} }
} }
} }
@ -417,7 +417,7 @@ void cmGlobalKdevelopGenerator
" <projectmanagement>KDevCustomProject</projectmanagement>\n" " <projectmanagement>KDevCustomProject</projectmanagement>\n"
" <primarylanguage>" << primaryLanguage << "</primarylanguage>\n" " <primarylanguage>" << primaryLanguage << "</primarylanguage>\n"
" <ignoreparts/>\n" " <ignoreparts/>\n"
" <projectdirectory>" << projectDir.c_str() << " <projectdirectory>" << projectDir <<
"</projectdirectory>\n"; //this one is important "</projectdirectory>\n"; //this one is important
fout<<" <absoluteprojectpath>true</absoluteprojectpath>\n"; //and this one fout<<" <absoluteprojectpath>true</absoluteprojectpath>\n"; //and this one
@ -444,12 +444,12 @@ void cmGlobalKdevelopGenerator
fout<<" </general>\n" fout<<" </general>\n"
" <kdevcustomproject>\n" " <kdevcustomproject>\n"
" <filelistdirectory>" << outputDir.c_str() << " <filelistdirectory>" << outputDir <<
"</filelistdirectory>\n" "</filelistdirectory>\n"
" <run>\n" " <run>\n"
" <mainprogram>" << executable.c_str() << "</mainprogram>\n" " <mainprogram>" << executable << "</mainprogram>\n"
" <directoryradio>custom</directoryradio>\n" " <directoryradio>custom</directoryradio>\n"
" <customdirectory>"<<outputDir.c_str()<<"</customdirectory>\n" " <customdirectory>"<<outputDir<<"</customdirectory>\n"
" <programargs></programargs>\n" " <programargs></programargs>\n"
" <terminal>false</terminal>\n" " <terminal>false</terminal>\n"
" <autocompile>true</autocompile>\n" " <autocompile>true</autocompile>\n"
@ -457,7 +457,7 @@ void cmGlobalKdevelopGenerator
" </run>\n" " </run>\n"
" <build>\n" " <build>\n"
" <buildtool>make</buildtool>\n"; //this one is important " <buildtool>make</buildtool>\n"; //this one is important
fout<<" <builddir>"<<outputDir.c_str()<<"</builddir>\n"; //and this one fout<<" <builddir>"<<outputDir<<"</builddir>\n"; //and this one
fout<<" </build>\n" fout<<" </build>\n"
" <make>\n" " <make>\n"
" <abortonerror>false</abortonerror>\n" " <abortonerror>false</abortonerror>\n"
@ -480,7 +480,7 @@ void cmGlobalKdevelopGenerator
dirIt != this->Blacklist.end(); dirIt != this->Blacklist.end();
++dirIt) ++dirIt)
{ {
fout<<" <path>" << dirIt->c_str() << "</path>\n"; fout<<" <path>" << *dirIt << "</path>\n";
} }
fout<<" </blacklist>\n"; fout<<" </blacklist>\n";
@ -558,7 +558,7 @@ void cmGlobalKdevelopGenerator
// command // command
fout<<" <kdevfileview>\n" fout<<" <kdevfileview>\n"
" <groups>\n" " <groups>\n"
" <group pattern=\"" << cmakeFilePattern.c_str() << " <group pattern=\"" << cmakeFilePattern <<
"\" name=\"CMake\" />\n"; "\" name=\"CMake\" />\n";
if (enableCxx) if (enableCxx)
@ -601,7 +601,7 @@ void cmGlobalKdevelopGenerator
"<!DOCTYPE KDevPrjSession>\n" "<!DOCTYPE KDevPrjSession>\n"
"<KDevPrjSession>\n" "<KDevPrjSession>\n"
" <DocsAndViews NumberOfDocuments=\"1\" >\n" " <DocsAndViews NumberOfDocuments=\"1\" >\n"
" <Doc0 NumberOfViews=\"1\" URL=\"file://" << fileToOpen.c_str() << " <Doc0 NumberOfViews=\"1\" URL=\"file://" << fileToOpen <<
"\" >\n" "\" >\n"
" <View0 line=\"0\" Type=\"Source\" />\n" " <View0 line=\"0\" Type=\"Source\" />\n"
" </Doc0>\n" " </Doc0>\n"

View File

@ -357,13 +357,13 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
<< "set(CMAKE_MAKEFILE_DEPENDS\n" << "set(CMAKE_MAKEFILE_DEPENDS\n"
<< " \"" << " \""
<< lg->Convert(cache, << lg->Convert(cache,
cmLocalGenerator::START_OUTPUT).c_str() << "\"\n"; cmLocalGenerator::START_OUTPUT) << "\"\n";
for(std::vector<std::string>::const_iterator i = lfiles.begin(); for(std::vector<std::string>::const_iterator i = lfiles.begin();
i != lfiles.end(); ++i) i != lfiles.end(); ++i)
{ {
cmakefileStream cmakefileStream
<< " \"" << " \""
<< lg->Convert(*i, cmLocalGenerator::START_OUTPUT).c_str() << lg->Convert(*i, cmLocalGenerator::START_OUTPUT)
<< "\"\n"; << "\"\n";
} }
cmakefileStream cmakefileStream
@ -380,10 +380,10 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
<< "set(CMAKE_MAKEFILE_OUTPUTS\n" << "set(CMAKE_MAKEFILE_OUTPUTS\n"
<< " \"" << " \""
<< lg->Convert(makefileName, << lg->Convert(makefileName,
cmLocalGenerator::START_OUTPUT).c_str() << "\"\n" cmLocalGenerator::START_OUTPUT) << "\"\n"
<< " \"" << " \""
<< lg->Convert(check, << lg->Convert(check,
cmLocalGenerator::START_OUTPUT).c_str() << "\"\n"; cmLocalGenerator::START_OUTPUT) << "\"\n";
cmakefileStream << " )\n\n"; cmakefileStream << " )\n\n";
// CMake must rerun if a byproduct is missing. // CMake must rerun if a byproduct is missing.
@ -397,7 +397,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
k != outfiles.end(); ++k) k != outfiles.end(); ++k)
{ {
cmakefileStream << " \"" << cmakefileStream << " \"" <<
lg->Convert(*k,cmLocalGenerator::HOME_OUTPUT).c_str() lg->Convert(*k,cmLocalGenerator::HOME_OUTPUT)
<< "\"\n"; << "\"\n";
} }
@ -411,7 +411,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
tmpStr += cmake::GetCMakeFilesDirectory(); tmpStr += cmake::GetCMakeFilesDirectory();
tmpStr += "/CMakeDirectoryInformation.cmake"; tmpStr += "/CMakeDirectoryInformation.cmake";
cmakefileStream << " \"" << cmakefileStream << " \"" <<
lg->Convert(tmpStr,cmLocalGenerator::HOME_OUTPUT).c_str() lg->Convert(tmpStr,cmLocalGenerator::HOME_OUTPUT)
<< "\"\n"; << "\"\n";
} }
cmakefileStream << " )\n\n"; cmakefileStream << " )\n\n";
@ -450,7 +450,7 @@ void cmGlobalUnixMakefileGenerator3
std::string tname = lg->GetRelativeTargetDirectory(l->second); std::string tname = lg->GetRelativeTargetDirectory(l->second);
tname += "/DependInfo.cmake"; tname += "/DependInfo.cmake";
cmSystemTools::ConvertToUnixSlashes(tname); cmSystemTools::ConvertToUnixSlashes(tname);
cmakefileStream << " \"" << tname.c_str() << "\"\n"; cmakefileStream << " \"" << tname << "\"\n";
} }
} }
} }

View File

@ -349,8 +349,8 @@ void cmGraphVizWriter::WriteConnections(const std::string& targetName,
this->WriteNode(libName, this->TargetPtrs.find(libName)->second, this->WriteNode(libName, this->TargetPtrs.find(libName)->second,
insertedNodes, str); insertedNodes, str);
str << " \"" << myNodeName.c_str() << "\" -> \"" str << " \"" << myNodeName << "\" -> \""
<< libNameIt->second.c_str() << "\""; << libNameIt->second << "\"";
str << " // " << targetName << " -> " << libName << std::endl; str << " // " << targetName << " -> " << libName << std::endl;
this->WriteConnections(libName, insertedNodes, insertedConnections, str); this->WriteConnections(libName, insertedNodes, insertedConnections, str);
} }
@ -455,7 +455,7 @@ void cmGraphVizWriter::WriteNode(const std::string& targetName,
std::map<std::string, std::string>::const_iterator nameIt = std::map<std::string, std::string>::const_iterator nameIt =
this->TargetNamesNodes.find(targetName); this->TargetNamesNodes.find(targetName);
str << " \"" << nameIt->second.c_str() << "\" [ label=\"" str << " \"" << nameIt->second << "\" [ label=\""
<< targetName << "\" shape=\"" << getShapeForTarget(target) << targetName << "\" shape=\"" << getShapeForTarget(target)
<< "\"];" << std::endl; << "\"];" << std::endl;
} }

View File

@ -91,7 +91,7 @@ void cmInstallGenerator
<< "${CMAKE_ABSOLUTE_DESTINATION_FILES}\")\n"; << "${CMAKE_ABSOLUTE_DESTINATION_FILES}\")\n";
os << indent << "endif()\n"; os << indent << "endif()\n";
} }
os << "file(INSTALL DESTINATION \"" << dest << "\" TYPE " << stype.c_str(); os << "file(INSTALL DESTINATION \"" << dest << "\" TYPE " << stype;
if(optional) if(optional)
{ {
os << " OPTIONAL"; os << " OPTIONAL";

View File

@ -503,7 +503,7 @@ void cmLocalGenerator::GenerateInstallRules()
{ {
std::string odir = (*ci)->GetMakefile()->GetStartOutputDirectory(); std::string odir = (*ci)->GetMakefile()->GetStartOutputDirectory();
cmSystemTools::ConvertToUnixSlashes(odir); cmSystemTools::ConvertToUnixSlashes(odir);
fout << " include(\"" << odir.c_str() fout << " include(\"" << odir
<< "/cmake_install.cmake\")" << std::endl; << "/cmake_install.cmake\")" << std::endl;
} }
} }
@ -523,12 +523,12 @@ void cmLocalGenerator::GenerateInstallRules()
"endif()\n\n"; "endif()\n\n";
fout fout
<< "file(WRITE \"" << "file(WRITE \""
<< homedir.c_str() << "/${CMAKE_INSTALL_MANIFEST}\" " << homedir << "/${CMAKE_INSTALL_MANIFEST}\" "
<< "\"\")" << std::endl; << "\"\")" << std::endl;
fout fout
<< "foreach(file ${CMAKE_INSTALL_MANIFEST_FILES})" << std::endl << "foreach(file ${CMAKE_INSTALL_MANIFEST_FILES})" << std::endl
<< " file(APPEND \"" << " file(APPEND \""
<< homedir.c_str() << "/${CMAKE_INSTALL_MANIFEST}\" " << homedir << "/${CMAKE_INSTALL_MANIFEST}\" "
<< "\"${file}\\n\")" << std::endl << "\"${file}\\n\")" << std::endl
<< "endforeach()" << std::endl; << "endforeach()" << std::endl;
} }

View File

@ -625,7 +625,7 @@ cmLocalUnixMakefileGenerator3
i != commands.end(); ++i) i != commands.end(); ++i)
{ {
replace = *i; replace = *i;
os << "\t" << replace.c_str() << "\n"; os << "\t" << replace << "\n";
} }
if(symbolic && !this->WatcomWMake) if(symbolic && !this->WatcomWMake)
{ {
@ -1933,7 +1933,7 @@ void cmLocalUnixMakefileGenerator3
for(ImplicitDependLanguageMap::const_iterator for(ImplicitDependLanguageMap::const_iterator
l = implicitLangs.begin(); l != implicitLangs.end(); ++l) l = implicitLangs.begin(); l != implicitLangs.end(); ++l)
{ {
cmakefileStream << " \"" << l->first.c_str() << "\"\n"; cmakefileStream << " \"" << l->first << "\"\n";
} }
cmakefileStream << " )\n"; cmakefileStream << " )\n";
@ -1944,7 +1944,7 @@ void cmLocalUnixMakefileGenerator3
l = implicitLangs.begin(); l != implicitLangs.end(); ++l) l = implicitLangs.begin(); l != implicitLangs.end(); ++l)
{ {
cmakefileStream cmakefileStream
<< "set(CMAKE_DEPENDS_CHECK_" << l->first.c_str() << "\n"; << "set(CMAKE_DEPENDS_CHECK_" << l->first << "\n";
ImplicitDependFileMap const& implicitPairs = l->second; ImplicitDependFileMap const& implicitPairs = l->second;
// for each file pair // for each file pair
@ -1968,7 +1968,7 @@ void cmLocalUnixMakefileGenerator3
if(cid && *cid) if(cid && *cid)
{ {
cmakefileStream cmakefileStream
<< "set(CMAKE_" << l->first.c_str() << "_COMPILER_ID \"" << "set(CMAKE_" << l->first << "_COMPILER_ID \""
<< cid << "\")\n"; << cid << "\")\n";
} }
} }

View File

@ -240,7 +240,7 @@ void cmMakefile::PrintStringVector(const char* s,
for(std::vector<std::string>::const_iterator i = v.begin(); for(std::vector<std::string>::const_iterator i = v.begin();
i != v.end(); ++i) i != v.end(); ++i)
{ {
std::cout << (*i).c_str() << " "; std::cout << *i << " ";
} }
std::cout << " )\n"; std::cout << " )\n";
} }
@ -253,7 +253,7 @@ void cmMakefile
for(std::vector<std::pair<std::string, bool> >::const_iterator i for(std::vector<std::pair<std::string, bool> >::const_iterator i
= v.begin(); i != v.end(); ++i) = v.begin(); i != v.end(); ++i)
{ {
std::cout << i->first.c_str() << " " << i->second; std::cout << i->first << " " << i->second;
} }
std::cout << " )\n"; std::cout << " )\n";
} }
@ -273,15 +273,15 @@ void cmMakefile::Print() const
} }
std::cout << " this->StartOutputDirectory; " << std::cout << " this->StartOutputDirectory; " <<
this->StartOutputDirectory.c_str() << std::endl; this->StartOutputDirectory << std::endl;
std::cout << " this->HomeOutputDirectory; " << std::cout << " this->HomeOutputDirectory; " <<
this->HomeOutputDirectory.c_str() << std::endl; this->HomeOutputDirectory << std::endl;
std::cout << " this->cmStartDirectory; " << std::cout << " this->cmStartDirectory; " <<
this->cmStartDirectory.c_str() << std::endl; this->cmStartDirectory << std::endl;
std::cout << " this->cmHomeDirectory; " << std::cout << " this->cmHomeDirectory; " <<
this->cmHomeDirectory.c_str() << std::endl; this->cmHomeDirectory << std::endl;
std::cout << " this->ProjectName; " std::cout << " this->ProjectName; "
<< this->ProjectName.c_str() << std::endl; << this->ProjectName << std::endl;
this->PrintStringVector("this->LinkDirectories", this->LinkDirectories); this->PrintStringVector("this->LinkDirectories", this->LinkDirectories);
#if defined(CMAKE_BUILD_WITH_CMAKE) #if defined(CMAKE_BUILD_WITH_CMAKE)
for( std::vector<cmSourceGroup>::const_iterator i = for( std::vector<cmSourceGroup>::const_iterator i =
@ -2619,7 +2619,7 @@ const char *cmMakefile::ExpandVariablesInString(std::string& source,
<< " " << filename << ":" << line << "\n"; << " " << filename << ":" << line << "\n";
} }
error << "when parsing string\n" error << "when parsing string\n"
<< " " << source.c_str() << "\n"; << " " << source << "\n";
error << emsg; error << emsg;
// If the parser failed ("res" is false) then this is a real // If the parser failed ("res" is false) then this is a real

View File

@ -353,7 +353,7 @@ void cmMakefileTargetGenerator::WriteTargetLanguageFlags()
std::string compiler = "CMAKE_"; std::string compiler = "CMAKE_";
compiler += *l; compiler += *l;
compiler += "_COMPILER"; compiler += "_COMPILER";
*this->FlagFileStream << "# compile " << l->c_str() << " with " << *this->FlagFileStream << "# compile " << *l << " with " <<
this->Makefile->GetSafeDefinition(compiler) << "\n"; this->Makefile->GetSafeDefinition(compiler) << "\n";
} }
@ -1353,7 +1353,7 @@ cmMakefileTargetGenerator
"_OBJECTS"); "_OBJECTS");
*this->BuildFileStream *this->BuildFileStream
<< "# Object files for target " << this->Target->GetName() << "\n" << "# Object files for target " << this->Target->GetName() << "\n"
<< variableName.c_str() << " ="; << variableName << " =";
std::string object; std::string object;
const char* objName = const char* objName =
this->Makefile->GetDefinition("CMAKE_NO_QUOTED_OBJECTS"); this->Makefile->GetDefinition("CMAKE_NO_QUOTED_OBJECTS");
@ -1390,7 +1390,7 @@ cmMakefileTargetGenerator
<< "\n" << "\n"
<< "# External object files for target " << "# External object files for target "
<< this->Target->GetName() << "\n" << this->Target->GetName() << "\n"
<< variableNameExternal.c_str() << " ="; << variableNameExternal << " =";
for(std::vector<std::string>::const_iterator i = for(std::vector<std::string>::const_iterator i =
this->ExternalObjects.begin(); this->ExternalObjects.begin();
i != this->ExternalObjects.end(); ++i) i != this->ExternalObjects.end(); ++i)

View File

@ -91,7 +91,7 @@ bool cmSourceGroupCommand
else else
{ {
cmOStringStream err; cmOStringStream err;
err << "Unknown argument \"" << args[i].c_str() << "\". " err << "Unknown argument \"" << args[i] << "\". "
<< "Perhaps the FILES keyword is missing.\n"; << "Perhaps the FILES keyword is missing.\n";
this->SetError(err.str()); this->SetError(err.str());
return false; return false;

View File

@ -107,12 +107,12 @@ CopyAndFullPathMesaHeader(const char* source,
if(glDirLine.find(includeFile.c_str())) if(glDirLine.find(includeFile.c_str()))
{ {
std::string gfile = glDirLine.match(3); std::string gfile = glDirLine.match(3);
fout << "#include \"" << outdir << "/" << gfile.c_str() << "\"\n"; fout << "#include \"" << outdir << "/" << gfile << "\"\n";
} }
else if(glLine.find(includeFile.c_str())) else if(glLine.find(includeFile.c_str()))
{ {
fout << "#include \"" << outdir << "/" << fout << "#include \"" << outdir << "/" <<
includeLine.match(1).c_str() << "\"\n"; includeLine.match(1) << "\"\n";
} }
else else
{ {

View File

@ -84,7 +84,7 @@ static void cmVariableWatchCommandVariableAccessed(
if ( !processed ) if ( !processed )
{ {
cmOStringStream msg; cmOStringStream msg;
msg << "Variable \"" << variable.c_str() << "\" was accessed using " msg << "Variable \"" << variable << "\" was accessed using "
<< accessString << " with value \"" << (newValue?newValue:"") << "\"."; << accessString << " with value \"" << (newValue?newValue:"") << "\".";
makefile->IssueMessage(cmake::LOG, msg.str()); makefile->IssueMessage(cmake::LOG, msg.str());
} }
@ -136,7 +136,7 @@ bool cmVariableWatchCommand
if ( variable == "CMAKE_CURRENT_LIST_FILE" ) if ( variable == "CMAKE_CURRENT_LIST_FILE" )
{ {
cmOStringStream ostr; cmOStringStream ostr;
ostr << "cannot be set on the variable: " << variable.c_str(); ostr << "cannot be set on the variable: " << variable;
this->SetError(ostr.str()); this->SetError(ostr.str());
return false; return false;
} }

View File

@ -433,7 +433,7 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
return false; return false;
} }
} }
std::cerr << "loading initial cache file " << path.c_str() << "\n"; std::cerr << "loading initial cache file " << path << "\n";
this->ReadListFile(args, path.c_str()); this->ReadListFile(args, path.c_str());
} }
else if(arg.find("-P",0) == 0) else if(arg.find("-P",0) == 0)
@ -1922,7 +1922,7 @@ int cmake::CheckBuildSystem()
{ {
cmOStringStream msg; cmOStringStream msg;
msg << "Re-run cmake missing file: " msg << "Re-run cmake missing file: "
<< this->CheckBuildSystemArgument.c_str() << "\n"; << this->CheckBuildSystemArgument << "\n";
cmSystemTools::Stdout(msg.str().c_str()); cmSystemTools::Stdout(msg.str().c_str());
} }
return 1; return 1;
@ -1942,7 +1942,7 @@ int cmake::CheckBuildSystem()
{ {
cmOStringStream msg; cmOStringStream msg;
msg << "Re-run cmake error reading : " msg << "Re-run cmake error reading : "
<< this->CheckBuildSystemArgument.c_str() << "\n"; << this->CheckBuildSystemArgument << "\n";
cmSystemTools::Stdout(msg.str().c_str()); cmSystemTools::Stdout(msg.str().c_str());
} }
// There was an error reading the file. Just rerun. // There was an error reading the file. Just rerun.
@ -2076,8 +2076,8 @@ int cmake::CheckBuildSystem()
if(verbose) if(verbose)
{ {
cmOStringStream msg; cmOStringStream msg;
msg << "Re-run cmake file: " << out_oldest.c_str() msg << "Re-run cmake file: " << out_oldest
<< " older than: " << dep_newest.c_str() << "\n"; << " older than: " << dep_newest << "\n";
cmSystemTools::Stdout(msg.str().c_str()); cmSystemTools::Stdout(msg.str().c_str());
} }
return 1; return 1;
@ -2351,8 +2351,8 @@ int cmake::GetSystemInformation(std::vector<std::string>& args)
// Copy file // Copy file
if(!cmSystemTools::cmCopyFile(inFile.c_str(), outFile.c_str())) if(!cmSystemTools::cmCopyFile(inFile.c_str(), outFile.c_str()))
{ {
std::cerr << "Error copying file \"" << inFile.c_str() std::cerr << "Error copying file \"" << inFile
<< "\" to \"" << outFile.c_str() << "\".\n"; << "\" to \"" << outFile << "\".\n";
return 1; return 1;
} }

View File

@ -102,8 +102,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
{ {
if(!cmSystemTools::cmCopyFile(args[2].c_str(), args[3].c_str())) if(!cmSystemTools::cmCopyFile(args[2].c_str(), args[3].c_str()))
{ {
std::cerr << "Error copying file \"" << args[2].c_str() std::cerr << "Error copying file \"" << args[2]
<< "\" to \"" << args[3].c_str() << "\".\n"; << "\" to \"" << args[3] << "\".\n";
return 1; return 1;
} }
return 0; return 0;
@ -116,7 +116,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
args[3].c_str())) args[3].c_str()))
{ {
std::cerr << "Error copying file (if different) from \"" std::cerr << "Error copying file (if different) from \""
<< args[2].c_str() << "\" to \"" << args[3].c_str() << args[2] << "\" to \"" << args[3]
<< "\".\n"; << "\".\n";
return 1; return 1;
} }
@ -129,7 +129,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
if(!cmSystemTools::CopyADirectory(args[2].c_str(), args[3].c_str())) if(!cmSystemTools::CopyADirectory(args[2].c_str(), args[3].c_str()))
{ {
std::cerr << "Error copying directory from \"" std::cerr << "Error copying directory from \""
<< args[2].c_str() << "\" to \"" << args[3].c_str() << args[2] << "\" to \"" << args[3]
<< "\".\n"; << "\".\n";
return 1; return 1;
} }
@ -143,7 +143,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
{ {
std::string e = cmSystemTools::GetLastSystemError(); std::string e = cmSystemTools::GetLastSystemError();
std::cerr << "Error renaming from \"" std::cerr << "Error renaming from \""
<< args[2].c_str() << "\" to \"" << args[3].c_str() << args[2] << "\" to \"" << args[3]
<< "\": " << e << "\n"; << "\": " << e << "\n";
return 1; return 1;
} }
@ -156,7 +156,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
if(cmSystemTools::FilesDiffer(args[2].c_str(), args[3].c_str())) if(cmSystemTools::FilesDiffer(args[2].c_str(), args[3].c_str()))
{ {
std::cerr << "Files \"" std::cerr << "Files \""
<< args[2].c_str() << "\" to \"" << args[3].c_str() << args[2] << "\" to \"" << args[3]
<< "\" are different.\n"; << "\" are different.\n";
return 1; return 1;
} }
@ -199,7 +199,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
std::vector<std::string>::iterator it; std::vector<std::string>::iterator it;
for ( it = env.begin(); it != env.end(); ++ it ) for ( it = env.begin(); it != env.end(); ++ it )
{ {
std::cout << it->c_str() << std::endl; std::cout << *it << std::endl;
} }
return 0; return 0;
} }
@ -209,7 +209,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
{ {
if(!cmSystemTools::MakeDirectory(args[2].c_str())) if(!cmSystemTools::MakeDirectory(args[2].c_str()))
{ {
std::cerr << "Error making directory \"" << args[2].c_str() std::cerr << "Error making directory \"" << args[2]
<< "\".\n"; << "\".\n";
return 1; return 1;
} }
@ -221,7 +221,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
if(cmSystemTools::FileIsDirectory(args[2].c_str()) && if(cmSystemTools::FileIsDirectory(args[2].c_str()) &&
!cmSystemTools::RemoveADirectory(args[2].c_str())) !cmSystemTools::RemoveADirectory(args[2].c_str()))
{ {
std::cerr << "Error removing directory \"" << args[2].c_str() std::cerr << "Error removing directory \"" << args[2]
<< "\".\n"; << "\".\n";
return 1; return 1;
} }
@ -1181,7 +1181,7 @@ bool cmcmd::RunCommand(const char* comment,
for(std::vector<std::string>::iterator i = command.begin(); for(std::vector<std::string>::iterator i = command.begin();
i != command.end(); ++i) i != command.end(); ++i)
{ {
std::cout << i->c_str() << " "; std::cout << *i << " ";
} }
std::cout << "\n"; std::cout << "\n";
} }
@ -1257,7 +1257,7 @@ int cmcmd::VisualStudioLinkIncremental(std::vector<std::string>& args,
resourceInputFile += ".resource.txt"; resourceInputFile += ".resource.txt";
if(verbose) if(verbose)
{ {
std::cout << "Create " << resourceInputFile.c_str() << "\n"; std::cout << "Create " << resourceInputFile << "\n";
} }
// Create input file for rc command // Create input file for rc command
cmsys::ofstream fout(resourceInputFile.c_str()); cmsys::ofstream fout(resourceInputFile.c_str());
@ -1269,7 +1269,7 @@ int cmcmd::VisualStudioLinkIncremental(std::vector<std::string>& args,
manifestFile += ".embed.manifest"; manifestFile += ".embed.manifest";
std::string fullPath= cmSystemTools::CollapseFullPath(manifestFile.c_str()); std::string fullPath= cmSystemTools::CollapseFullPath(manifestFile.c_str());
fout << type << " /* CREATEPROCESS_MANIFEST_RESOURCE_ID " fout << type << " /* CREATEPROCESS_MANIFEST_RESOURCE_ID "
"*/ 24 /* RT_MANIFEST */ " << "\"" << fullPath.c_str() << "\""; "*/ 24 /* RT_MANIFEST */ " << "\"" << fullPath << "\"";
fout.close(); fout.close();
manifestArg += tempManifest; manifestArg += tempManifest;
// add the manifest arg to the linkCommand // add the manifest arg to the linkCommand
@ -1281,7 +1281,7 @@ int cmcmd::VisualStudioLinkIncremental(std::vector<std::string>& args,
{ {
if(verbose) if(verbose)
{ {
std::cout << "Create empty: " << manifestFile.c_str() << "\n"; std::cout << "Create empty: " << manifestFile << "\n";
} }
cmsys::ofstream foutTmp(manifestFile.c_str()); cmsys::ofstream foutTmp(manifestFile.c_str());
} }