summaryrefslogtreecommitdiffstats
path: root/Source/CPack
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2016-06-06 21:53:32 (GMT)
committerDaniel Pfeifer <daniel@pfeifer-mail.de>2016-06-06 21:53:32 (GMT)
commitfa277b29e41a8de43913f0a63b273bb3dbc759e8 (patch)
treef3b7bf879516bb09d46fad80ddd7e22fafa1a77f /Source/CPack
parentba5fb16519d095051ea90e642cbf41a28be6a03d (diff)
downloadCMake-fa277b29e41a8de43913f0a63b273bb3dbc759e8.zip
CMake-fa277b29e41a8de43913f0a63b273bb3dbc759e8.tar.gz
CMake-fa277b29e41a8de43913f0a63b273bb3dbc759e8.tar.bz2
Remove c_str() calls from stream arguments.
Mostly automated: git grep -l '.c_str() <<' | xargs sed -i 's|\.c_str() <<| <<|g'
Diffstat (limited to 'Source/CPack')
-rw-r--r--Source/CPack/OSXScriptLauncher.cxx2
-rw-r--r--Source/CPack/cmCPackBundleGenerator.cxx8
-rw-r--r--Source/CPack/cmCPackOSXX11Generator.cxx22
-rw-r--r--Source/CPack/cmCPackPKGGenerator.cxx15
-rw-r--r--Source/CPack/cmCPackPackageMakerGenerator.cxx26
-rw-r--r--Source/CPack/cmCPackProductBuildGenerator.cxx16
6 files changed, 43 insertions, 46 deletions
diff --git a/Source/CPack/OSXScriptLauncher.cxx b/Source/CPack/OSXScriptLauncher.cxx
index 19204a2..a233e76 100644
--- a/Source/CPack/OSXScriptLauncher.cxx
+++ b/Source/CPack/OSXScriptLauncher.cxx
@@ -72,7 +72,7 @@ int main(int argc, char* argv[])
std::string scriptDirectory =
cmsys::SystemTools::GetFilenamePath(fullScriptPath);
- ofs << fullScriptPath.c_str() << std::endl;
+ ofs << fullScriptPath << std::endl;
std::vector<const char*> args;
args.push_back(fullScriptPath.c_str());
int cc;
diff --git a/Source/CPack/cmCPackBundleGenerator.cxx b/Source/CPack/cmCPackBundleGenerator.cxx
index 1164021..9276e3a 100644
--- a/Source/CPack/cmCPackBundleGenerator.cxx
+++ b/Source/CPack/cmCPackBundleGenerator.cxx
@@ -232,12 +232,12 @@ int cmCPackBundleGenerator::SignBundle(const std::string& src_dir)
temp_sign_file_cmd << this->GetOption("CPACK_APPLE_BUNDLE_ID");
temp_sign_file_cmd << " \"";
temp_sign_file_cmd << bundle_path;
- temp_sign_file_cmd << it->c_str() << "\"";
+ temp_sign_file_cmd << *it << "\"";
if (!this->RunCommand(temp_sign_file_cmd, &output)) {
- cmCPackLogger(cmCPackLog::LOG_ERROR, "Error signing file:"
- << bundle_path << it->c_str() << std::endl
- << output << std::endl);
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "Error signing file:" << bundle_path << *it << std::endl
+ << output << std::endl);
return 0;
}
diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx
index d5691be..c0d2553 100644
--- a/Source/CPack/cmCPackOSXX11Generator.cxx
+++ b/Source/CPack/cmCPackOSXX11Generator.cxx
@@ -158,11 +158,10 @@ int cmCPackOSXX11Generator::PackageFiles()
tmpFile += "/hdiutilOutput.log";
std::ostringstream dmgCmd;
dmgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM_DISK_IMAGE")
- << "\" create -ov -format UDZO -srcfolder \""
- << diskImageDirectory.c_str() << "\" \"" << packageFileNames[0]
- << "\"";
+ << "\" create -ov -format UDZO -srcfolder \"" << diskImageDirectory
+ << "\" \"" << packageFileNames[0] << "\"";
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Compress disk image using command: "
- << dmgCmd.str().c_str() << std::endl);
+ << dmgCmd.str() << std::endl);
// since we get random dashboard failures with this one
// try running it more than once
int retVal = 1;
@@ -181,12 +180,12 @@ int cmCPackOSXX11Generator::PackageFiles()
}
if (!res || retVal) {
cmGeneratedFileStream ofs(tmpFile.c_str());
- ofs << "# Run command: " << dmgCmd.str().c_str() << std::endl
+ ofs << "# Run command: " << dmgCmd.str() << std::endl
<< "# Output:" << std::endl
- << output.c_str() << std::endl;
+ << output << std::endl;
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem running hdiutil command: "
- << dmgCmd.str().c_str() << std::endl
- << "Please check " << tmpFile.c_str() << " for errors"
+ << dmgCmd.str() << std::endl
+ << "Please check " << tmpFile << " for errors"
<< std::endl);
return 0;
}
@@ -249,7 +248,7 @@ bool cmCPackOSXX11Generator::CopyCreateResourceFile(const std::string& name)
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: "
<< (inFileName ? inFileName : "(NULL)")
- << " to " << destFileName.c_str() << std::endl);
+ << " to " << destFileName << std::endl);
this->ConfigureFile(inFileName, destFileName.c_str());
return true;
}
@@ -277,9 +276,8 @@ bool cmCPackOSXX11Generator::CopyResourcePlistFile(
destFileName += "/";
destFileName += outputFileName;
- cmCPackLogger(cmCPackLog::LOG_VERBOSE,
- "Configure file: " << inFileName.c_str() << " to "
- << destFileName.c_str() << std::endl);
+ cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: "
+ << inFileName << " to " << destFileName << std::endl);
this->ConfigureFile(inFileName.c_str(), destFileName.c_str(), copyOnly);
return true;
}
diff --git a/Source/CPack/cmCPackPKGGenerator.cxx b/Source/CPack/cmCPackPKGGenerator.cxx
index ff0fa8c..7bc05d0 100644
--- a/Source/CPack/cmCPackPKGGenerator.cxx
+++ b/Source/CPack/cmCPackPKGGenerator.cxx
@@ -316,9 +316,9 @@ bool cmCPackPKGGenerator::CopyCreateResourceFile(
this->SetOption(("CPACK_RESOURCE_FILE_" + uname + "_NOPATH").c_str(),
(name + ext).c_str());
- cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: "
- << (inFileName ? inFileName : "(NULL)") << " to "
- << destFileName.c_str() << std::endl);
+ cmCPackLogger(cmCPackLog::LOG_VERBOSE,
+ "Configure file: " << (inFileName ? inFileName : "(NULL)")
+ << " to " << destFileName << std::endl);
this->ConfigureFile(inFileName, destFileName.c_str());
return true;
}
@@ -344,9 +344,8 @@ bool cmCPackPKGGenerator::CopyResourcePlistFile(
destFileName += "/";
destFileName += outName;
- cmCPackLogger(cmCPackLog::LOG_VERBOSE,
- "Configure file: " << inFileName.c_str() << " to "
- << destFileName.c_str() << std::endl);
+ cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: "
+ << inFileName << " to " << destFileName << std::endl);
this->ConfigureFile(inFileName.c_str(), destFileName.c_str());
return true;
}
@@ -360,8 +359,8 @@ int cmCPackPKGGenerator::CopyInstallScript(const std::string& resdir,
dst += name;
cmSystemTools::CopyFileAlways(script.c_str(), dst.c_str());
cmSystemTools::SetPermissions(dst.c_str(), 0777);
- cmCPackLogger(cmCPackLog::LOG_VERBOSE, "copy script : "
- << script << "\ninto " << dst.c_str() << std::endl);
+ cmCPackLogger(cmCPackLog::LOG_VERBOSE,
+ "copy script : " << script << "\ninto " << dst << std::endl);
return 1;
}
diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx
index 5bb24c0..891d0f4 100644
--- a/Source/CPack/cmCPackPackageMakerGenerator.cxx
+++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx
@@ -101,7 +101,7 @@ int cmCPackPackageMakerGenerator::PackageFiles()
if (!cmsys::SystemTools::MakeDirectory(preflightDirName.c_str())) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem creating installer directory: "
- << preflightDirName.c_str() << std::endl);
+ << preflightDirName << std::endl);
return 0;
}
}
@@ -109,7 +109,7 @@ int cmCPackPackageMakerGenerator::PackageFiles()
if (!cmsys::SystemTools::MakeDirectory(postflightDirName.c_str())) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem creating installer directory: "
- << postflightDirName.c_str() << std::endl);
+ << postflightDirName << std::endl);
return 0;
}
}
@@ -137,7 +137,7 @@ int cmCPackPackageMakerGenerator::PackageFiles()
if (!cmsys::SystemTools::MakeDirectory(packageDir.c_str())) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem creating component packages directory: "
- << packageDir.c_str() << std::endl);
+ << packageDir << std::endl);
return 0;
}
@@ -147,7 +147,7 @@ int cmCPackPackageMakerGenerator::PackageFiles()
cmCPackLogger(
cmCPackLog::LOG_ERROR,
"Problem creating component PostFlight Packages directory: "
- << packageFileDir.c_str() << std::endl);
+ << packageFileDir << std::endl);
return 0;
}
std::string packageFile =
@@ -169,7 +169,7 @@ int cmCPackPackageMakerGenerator::PackageFiles()
if (!cmsys::SystemTools::MakeDirectory(basePackageDir.c_str())) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem creating component packages directory: "
- << basePackageDir.c_str() << std::endl);
+ << basePackageDir << std::endl);
return 0;
}
@@ -314,12 +314,12 @@ int cmCPackPackageMakerGenerator::PackageFiles()
}
if (!res || retVal) {
cmGeneratedFileStream ofs(tmpFile.c_str());
- ofs << "# Run command: " << dmgCmd.str().c_str() << std::endl
+ ofs << "# Run command: " << dmgCmd.str() << std::endl
<< "# Output:" << std::endl
- << output.c_str() << std::endl;
+ << output << std::endl;
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem running hdiutil command: "
- << dmgCmd.str().c_str() << std::endl
- << "Please check " << tmpFile.c_str() << " for errors"
+ << dmgCmd.str() << std::endl
+ << "Please check " << tmpFile << " for errors"
<< std::endl);
return 0;
}
@@ -382,7 +382,7 @@ int cmCPackPackageMakerGenerator::InitializeInternal()
if (!cmSystemTools::FileExists(versionFile.c_str())) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Cannot find PackageMaker compiler version file: "
- << versionFile.c_str() << std::endl);
+ << versionFile << std::endl);
return 0;
}
@@ -416,7 +416,7 @@ int cmCPackPackageMakerGenerator::InitializeInternal()
if (!cmSystemTools::GetLineFromStream(ifs, line) || !rexVersion.find(line)) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem reading the PackageMaker compiler version file: "
- << versionFile.c_str() << std::endl);
+ << versionFile << std::endl);
return 0;
}
this->PackageMakerVersion = atof(rexVersion.match(1).c_str());
@@ -481,11 +481,11 @@ bool cmCPackPackageMakerGenerator::RunPackageMaker(const char* command,
cmGeneratedFileStream ofs(tmpFile.c_str());
ofs << "# Run command: " << command << std::endl
<< "# Output:" << std::endl
- << output.c_str() << std::endl;
+ << output << std::endl;
cmCPackLogger(
cmCPackLog::LOG_ERROR, "Problem running PackageMaker command: "
<< command << std::endl
- << "Please check " << tmpFile.c_str() << " for errors" << std::endl);
+ << "Please check " << tmpFile << " for errors" << std::endl);
return false;
}
// sometimes the command finishes but the directory is not yet
diff --git a/Source/CPack/cmCPackProductBuildGenerator.cxx b/Source/CPack/cmCPackProductBuildGenerator.cxx
index c1f63cc..aa9a27d 100644
--- a/Source/CPack/cmCPackProductBuildGenerator.cxx
+++ b/Source/CPack/cmCPackProductBuildGenerator.cxx
@@ -47,7 +47,7 @@ int cmCPackProductBuildGenerator::PackageFiles()
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem creating component packages directory: "
- << basePackageDir.c_str() << std::endl);
+ << basePackageDir << std::endl);
return 0;
}
@@ -153,12 +153,12 @@ bool cmCPackProductBuildGenerator::RunProductBuild(
{
cmGeneratedFileStream ofs(tmpFile.c_str());
ofs << "# Run command: " << command << std::endl
- << "# Output:" << std::endl
- << output.c_str() << std::endl;
+ << "# Output:" << std::endl
+ << output << std::endl;
cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Problem running command: " << command
- << std::endl << "Please check " << tmpFile.c_str() << " for errors"
- << std::endl);
+ "Problem running command: " << command << std::endl
+ << "Please check " << tmpFile
+ << " for errors" << std::endl);
return false;
}
return true;
@@ -194,8 +194,8 @@ bool cmCPackProductBuildGenerator::GenerateComponentPackage(
if ( !cmsys::SystemTools::MakeDirectory(scriptDir.c_str()))
{
cmCPackLogger(cmCPackLog::LOG_ERROR,
- "Problem creating installer directory: "
- << scriptDir.c_str() << std::endl);
+ "Problem creating installer directory: " << scriptDir
+ << std::endl);
return 0;
}