Port all cmOStringStream to std::ostringstream.

All compilers hosting CMake support the std class.
This commit is contained in:
Stephen Kelly 2015-01-05 20:31:31 +01:00
parent f194a009c8
commit 931e055d8c
127 changed files with 613 additions and 612 deletions

View File

@ -24,7 +24,7 @@
#endif #endif
#define cmCPackLogger(logType, msg) \ #define cmCPackLogger(logType, msg) \
do { \ do { \
cmOStringStream cmCPackLog_msg; \ std::ostringstream cmCPackLog_msg; \
cmCPackLog_msg << msg; \ cmCPackLog_msg << msg; \
if(Generator) { \ if(Generator) { \
Generator->Logger->Log(logType, __FILE__, __LINE__, \ Generator->Logger->Log(logType, __FILE__, __LINE__, \

View File

@ -25,7 +25,7 @@
#endif #endif
#define cmCPackLogger(logType, msg) \ #define cmCPackLogger(logType, msg) \
do { \ do { \
cmOStringStream cmCPackLog_msg; \ std::ostringstream cmCPackLog_msg; \
cmCPackLog_msg << msg; \ cmCPackLog_msg << msg; \
if(Generator) { \ if(Generator) { \
Generator->Logger->Log(logType, __FILE__, __LINE__, \ Generator->Logger->Log(logType, __FILE__, __LINE__, \

View File

@ -112,24 +112,24 @@ int cmCPackBundleGenerator::ConstructBundle()
// The staging directory contains everything that will end-up inside the // The staging directory contains everything that will end-up inside the
// final disk image ... // final disk image ...
cmOStringStream staging; std::ostringstream staging;
staging << toplevel; staging << toplevel;
cmOStringStream contents; std::ostringstream contents;
contents << staging.str() << "/" << cpack_bundle_name contents << staging.str() << "/" << cpack_bundle_name
<< ".app/" << "Contents"; << ".app/" << "Contents";
cmOStringStream application; std::ostringstream application;
application << contents.str() << "/" << "MacOS"; application << contents.str() << "/" << "MacOS";
cmOStringStream resources; std::ostringstream resources;
resources << contents.str() << "/" << "Resources"; resources << contents.str() << "/" << "Resources";
// Install a required, user-provided bundle metadata file ... // Install a required, user-provided bundle metadata file ...
cmOStringStream plist_source; std::ostringstream plist_source;
plist_source << cpack_bundle_plist; plist_source << cpack_bundle_plist;
cmOStringStream plist_target; std::ostringstream plist_target;
plist_target << contents.str() << "/" << "Info.plist"; plist_target << contents.str() << "/" << "Info.plist";
if(!this->CopyFile(plist_source, plist_target)) if(!this->CopyFile(plist_source, plist_target))
@ -142,10 +142,10 @@ int cmCPackBundleGenerator::ConstructBundle()
} }
// Install a user-provided bundle icon ... // Install a user-provided bundle icon ...
cmOStringStream icon_source; std::ostringstream icon_source;
icon_source << cpack_bundle_icon; icon_source << cpack_bundle_icon;
cmOStringStream icon_target; std::ostringstream icon_target;
icon_target << resources.str() << "/" << cpack_bundle_name << ".icns"; icon_target << resources.str() << "/" << cpack_bundle_name << ".icns";
if(!this->CopyFile(icon_source, icon_target)) if(!this->CopyFile(icon_source, icon_target))
@ -161,10 +161,10 @@ int cmCPackBundleGenerator::ConstructBundle()
// executable or a script) ... // executable or a script) ...
if(!cpack_bundle_startup_command.empty()) if(!cpack_bundle_startup_command.empty())
{ {
cmOStringStream command_source; std::ostringstream command_source;
command_source << cpack_bundle_startup_command; command_source << cpack_bundle_startup_command;
cmOStringStream command_target; std::ostringstream command_target;
command_target << application.str() << "/" << cpack_bundle_name; command_target << application.str() << "/" << cpack_bundle_name;
if(!this->CopyFile(command_source, command_target)) if(!this->CopyFile(command_source, command_target))
@ -231,7 +231,7 @@ int cmCPackBundleGenerator::SignBundle(const std::string& src_dir)
for(std::vector<std::string>::iterator it = relFiles.begin(); for(std::vector<std::string>::iterator it = relFiles.begin();
it != relFiles.end(); ++it) it != relFiles.end(); ++it)
{ {
cmOStringStream temp_sign_file_cmd; std::ostringstream temp_sign_file_cmd;
temp_sign_file_cmd << this->GetOption("CPACK_COMMAND_CODESIGN"); temp_sign_file_cmd << this->GetOption("CPACK_COMMAND_CODESIGN");
temp_sign_file_cmd << " --deep -f -s \"" << cpack_apple_cert_app; temp_sign_file_cmd << " --deep -f -s \"" << cpack_apple_cert_app;
temp_sign_file_cmd << "\" -i "; temp_sign_file_cmd << "\" -i ";
@ -251,7 +251,7 @@ int cmCPackBundleGenerator::SignBundle(const std::string& src_dir)
} }
// sign main binary // sign main binary
cmOStringStream temp_sign_binary_cmd; std::ostringstream temp_sign_binary_cmd;
temp_sign_binary_cmd << this->GetOption("CPACK_COMMAND_CODESIGN"); temp_sign_binary_cmd << this->GetOption("CPACK_COMMAND_CODESIGN");
temp_sign_binary_cmd << " --deep -f -s \"" << cpack_apple_cert_app; temp_sign_binary_cmd << " --deep -f -s \"" << cpack_apple_cert_app;
temp_sign_binary_cmd << "\" \"" << bundle_path << "\""; temp_sign_binary_cmd << "\" \"" << bundle_path << "\"";
@ -266,7 +266,7 @@ int cmCPackBundleGenerator::SignBundle(const std::string& src_dir)
} }
// sign app bundle // sign app bundle
cmOStringStream temp_codesign_cmd; std::ostringstream temp_codesign_cmd;
temp_codesign_cmd << this->GetOption("CPACK_COMMAND_CODESIGN"); temp_codesign_cmd << this->GetOption("CPACK_COMMAND_CODESIGN");
temp_codesign_cmd << " --deep -f -s \"" << cpack_apple_cert_app << "\""; temp_codesign_cmd << " --deep -f -s \"" << cpack_apple_cert_app << "\"";
if(this->GetOption("CPACK_BUNDLE_APPLE_ENTITLEMENTS")) if(this->GetOption("CPACK_BUNDLE_APPLE_ENTITLEMENTS"))

View File

@ -169,8 +169,8 @@ int cmCPackDragNDropGenerator::PackageFiles()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool cmCPackDragNDropGenerator::CopyFile(cmOStringStream& source, bool cmCPackDragNDropGenerator::CopyFile(std::ostringstream& source,
cmOStringStream& target) std::ostringstream& target)
{ {
if(!cmSystemTools::CopyFileIfDifferent( if(!cmSystemTools::CopyFileIfDifferent(
source.str().c_str(), source.str().c_str(),
@ -190,7 +190,7 @@ bool cmCPackDragNDropGenerator::CopyFile(cmOStringStream& source,
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
bool cmCPackDragNDropGenerator::RunCommand(cmOStringStream& command, bool cmCPackDragNDropGenerator::RunCommand(std::ostringstream& command,
std::string* output) std::string* output)
{ {
int exit_code = 1; int exit_code = 1;
@ -255,12 +255,12 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
// The staging directory contains everything that will end-up inside the // The staging directory contains everything that will end-up inside the
// final disk image ... // final disk image ...
cmOStringStream staging; std::ostringstream staging;
staging << src_dir; staging << src_dir;
// Add a symlink to /Applications so users can drag-and-drop the bundle // Add a symlink to /Applications so users can drag-and-drop the bundle
// into it // into it
cmOStringStream application_link; std::ostringstream application_link;
application_link << staging.str() << "/Applications"; application_link << staging.str() << "/Applications";
cmSystemTools::CreateSymlink("/Applications", cmSystemTools::CreateSymlink("/Applications",
application_link.str().c_str()); application_link.str().c_str());
@ -268,10 +268,10 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
// Optionally add a custom volume icon ... // Optionally add a custom volume icon ...
if(!cpack_package_icon.empty()) if(!cpack_package_icon.empty())
{ {
cmOStringStream package_icon_source; std::ostringstream package_icon_source;
package_icon_source << cpack_package_icon; package_icon_source << cpack_package_icon;
cmOStringStream package_icon_destination; std::ostringstream package_icon_destination;
package_icon_destination << staging.str() << "/.VolumeIcon.icns"; package_icon_destination << staging.str() << "/.VolumeIcon.icns";
if(!this->CopyFile(package_icon_source, package_icon_destination)) if(!this->CopyFile(package_icon_source, package_icon_destination))
@ -289,10 +289,10 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
// (e.g. for setting background/layout) ... // (e.g. for setting background/layout) ...
if(!cpack_dmg_ds_store.empty()) if(!cpack_dmg_ds_store.empty())
{ {
cmOStringStream package_settings_source; std::ostringstream package_settings_source;
package_settings_source << cpack_dmg_ds_store; package_settings_source << cpack_dmg_ds_store;
cmOStringStream package_settings_destination; std::ostringstream package_settings_destination;
package_settings_destination << staging.str() << "/.DS_Store"; package_settings_destination << staging.str() << "/.DS_Store";
if(!this->CopyFile(package_settings_source, package_settings_destination)) if(!this->CopyFile(package_settings_source, package_settings_destination))
@ -309,10 +309,10 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
// Optionally add a custom background image ... // Optionally add a custom background image ...
if(!cpack_dmg_background_image.empty()) if(!cpack_dmg_background_image.empty())
{ {
cmOStringStream package_background_source; std::ostringstream package_background_source;
package_background_source << cpack_dmg_background_image; package_background_source << cpack_dmg_background_image;
cmOStringStream package_background_destination; std::ostringstream package_background_destination;
package_background_destination << staging.str() << "/background.png"; package_background_destination << staging.str() << "/background.png";
if(!this->CopyFile(package_background_source, if(!this->CopyFile(package_background_source,
@ -326,7 +326,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
return 0; return 0;
} }
cmOStringStream temp_background_hiding_command; std::ostringstream temp_background_hiding_command;
temp_background_hiding_command << this->GetOption("CPACK_COMMAND_SETFILE"); temp_background_hiding_command << this->GetOption("CPACK_COMMAND_SETFILE");
temp_background_hiding_command << " -a V \""; temp_background_hiding_command << " -a V \"";
temp_background_hiding_command << package_background_destination.str(); temp_background_hiding_command << package_background_destination.str();
@ -346,7 +346,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
std::string temp_image = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); std::string temp_image = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
temp_image += "/temp.dmg"; temp_image += "/temp.dmg";
cmOStringStream temp_image_command; std::ostringstream temp_image_command;
temp_image_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); temp_image_command << this->GetOption("CPACK_COMMAND_HDIUTIL");
temp_image_command << " create"; temp_image_command << " create";
temp_image_command << " -ov"; temp_image_command << " -ov";
@ -368,9 +368,9 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
// Optionally set the custom icon flag for the image ... // Optionally set the custom icon flag for the image ...
if(!cpack_package_icon.empty()) if(!cpack_package_icon.empty())
{ {
cmOStringStream temp_mount; std::ostringstream temp_mount;
cmOStringStream attach_command; std::ostringstream attach_command;
attach_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); attach_command << this->GetOption("CPACK_COMMAND_HDIUTIL");
attach_command << " attach"; attach_command << " attach";
attach_command << " \"" << temp_image << "\""; attach_command << " \"" << temp_image << "\"";
@ -389,7 +389,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
mountpoint_regex.find(attach_output.c_str()); mountpoint_regex.find(attach_output.c_str());
temp_mount << mountpoint_regex.match(1); temp_mount << mountpoint_regex.match(1);
cmOStringStream setfile_command; std::ostringstream setfile_command;
setfile_command << this->GetOption("CPACK_COMMAND_SETFILE"); setfile_command << this->GetOption("CPACK_COMMAND_SETFILE");
setfile_command << " -a C"; setfile_command << " -a C";
setfile_command << " \"" << temp_mount.str() << "\""; setfile_command << " \"" << temp_mount.str() << "\"";
@ -403,7 +403,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
return 0; return 0;
} }
cmOStringStream detach_command; std::ostringstream detach_command;
detach_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); detach_command << this->GetOption("CPACK_COMMAND_HDIUTIL");
detach_command << " detach"; detach_command << " detach";
detach_command << " \"" << temp_mount.str() << "\""; detach_command << " \"" << temp_mount.str() << "\"";
@ -471,7 +471,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
std::string temp_udco = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); std::string temp_udco = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
temp_udco += "/temp-udco.dmg"; temp_udco += "/temp-udco.dmg";
cmOStringStream udco_image_command; std::ostringstream udco_image_command;
udco_image_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); udco_image_command << this->GetOption("CPACK_COMMAND_HDIUTIL");
udco_image_command << " convert \"" << temp_image << "\""; udco_image_command << " convert \"" << temp_image << "\"";
udco_image_command << " -format UDCO"; udco_image_command << " -format UDCO";
@ -488,7 +488,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
} }
// unflatten dmg // unflatten dmg
cmOStringStream unflatten_command; std::ostringstream unflatten_command;
unflatten_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); unflatten_command << this->GetOption("CPACK_COMMAND_HDIUTIL");
unflatten_command << " unflatten "; unflatten_command << " unflatten ";
unflatten_command << "\"" << temp_udco << "\""; unflatten_command << "\"" << temp_udco << "\"";
@ -503,7 +503,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
} }
// Rez the SLA // Rez the SLA
cmOStringStream embed_sla_command; std::ostringstream embed_sla_command;
embed_sla_command << this->GetOption("CPACK_COMMAND_REZ"); embed_sla_command << this->GetOption("CPACK_COMMAND_REZ");
const char* sysroot = this->GetOption("CPACK_OSX_SYSROOT"); const char* sysroot = this->GetOption("CPACK_OSX_SYSROOT");
if(sysroot && sysroot[0] != '\0') if(sysroot && sysroot[0] != '\0')
@ -524,7 +524,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
} }
// flatten dmg // flatten dmg
cmOStringStream flatten_command; std::ostringstream flatten_command;
flatten_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); flatten_command << this->GetOption("CPACK_COMMAND_HDIUTIL");
flatten_command << " flatten "; flatten_command << " flatten ";
flatten_command << "\"" << temp_udco << "\""; flatten_command << "\"" << temp_udco << "\"";
@ -543,7 +543,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
// Create the final compressed read-only disk image ... // Create the final compressed read-only disk image ...
cmOStringStream final_image_command; std::ostringstream final_image_command;
final_image_command << this->GetOption("CPACK_COMMAND_HDIUTIL"); final_image_command << this->GetOption("CPACK_COMMAND_HDIUTIL");
final_image_command << " convert \"" << temp_image << "\""; final_image_command << " convert \"" << temp_image << "\"";
final_image_command << " -format "; final_image_command << " -format ";

View File

@ -33,8 +33,8 @@ protected:
bool SupportsComponentInstallation() const; bool SupportsComponentInstallation() const;
bool CopyFile(cmOStringStream& source, cmOStringStream& target); bool CopyFile(std::ostringstream& source, std::ostringstream& target);
bool RunCommand(cmOStringStream& command, std::string* output = 0); bool RunCommand(std::ostringstream& command, std::string* output = 0);
std::string std::string
GetComponentInstallDirNameSuffix(const std::string& componentName); GetComponentInstallDirNameSuffix(const std::string& componentName);

View File

@ -160,7 +160,7 @@ int cmCPackGenerator::PrepareNames()
"Cannot open description file name: " << descFileName << std::endl); "Cannot open description file name: " << descFileName << std::endl);
return 0; return 0;
} }
cmOStringStream ostr; std::ostringstream ostr;
std::string line; std::string line;
cmCPackLogger(cmCPackLog::LOG_VERBOSE, cmCPackLogger(cmCPackLog::LOG_VERBOSE,

View File

@ -29,7 +29,7 @@
#define cmCPackLogger(logType, msg) \ #define cmCPackLogger(logType, msg) \
do { \ do { \
cmOStringStream cmCPackLog_msg; \ std::ostringstream cmCPackLog_msg; \
cmCPackLog_msg << msg; \ cmCPackLog_msg << msg; \
this->Logger->Log(logType, __FILE__, __LINE__,\ this->Logger->Log(logType, __FILE__, __LINE__,\
cmCPackLog_msg.str().c_str());\ cmCPackLog_msg.str().c_str());\

View File

@ -17,7 +17,7 @@
#define cmCPack_Log(ctSelf, logType, msg) \ #define cmCPack_Log(ctSelf, logType, msg) \
do { \ do { \
cmOStringStream cmCPackLog_msg; \ std::ostringstream cmCPackLog_msg; \
cmCPackLog_msg << msg; \ cmCPackLog_msg << msg; \
(ctSelf)->Log(logType, __FILE__, __LINE__, cmCPackLog_msg.str().c_str());\ (ctSelf)->Log(logType, __FILE__, __LINE__, cmCPackLog_msg.str().c_str());\
} while ( 0 ) } while ( 0 )

View File

@ -71,7 +71,7 @@ int cmCPackNSISGenerator::PackageFiles()
tmpFile += "/NSISOutput.log"; tmpFile += "/NSISOutput.log";
std::string nsisInstallOptions = nsisFileName + "/NSIS.InstallOptions.ini"; std::string nsisInstallOptions = nsisFileName + "/NSIS.InstallOptions.ini";
nsisFileName += "/project.nsi"; nsisFileName += "/project.nsi";
cmOStringStream str; std::ostringstream str;
std::vector<std::string>::const_iterator it; std::vector<std::string>::const_iterator it;
for ( it = files.begin(); it != files.end(); ++ it ) for ( it = files.begin(); it != files.end(); ++ it )
{ {
@ -91,7 +91,7 @@ int cmCPackNSISGenerator::PackageFiles()
std::vector<std::string> dirs; std::vector<std::string> dirs;
this->GetListOfSubdirectories(toplevel.c_str(), dirs); this->GetListOfSubdirectories(toplevel.c_str(), dirs);
std::vector<std::string>::const_iterator sit; std::vector<std::string>::const_iterator sit;
cmOStringStream dstr; std::ostringstream dstr;
for ( sit = dirs.begin(); sit != dirs.end(); ++ sit ) for ( sit = dirs.begin(); sit != dirs.end(); ++ sit )
{ {
std::string componentName; std::string componentName;
@ -190,7 +190,7 @@ int cmCPackNSISGenerator::PackageFiles()
std::string groupDescriptions; std::string groupDescriptions;
std::string installTypesCode; std::string installTypesCode;
std::string defines; std::string defines;
cmOStringStream macrosOut; std::ostringstream macrosOut;
bool anyDownloadedComponents = false; bool anyDownloadedComponents = false;
// Create installation types. The order is significant, so we first fill // Create installation types. The order is significant, so we first fill
@ -503,8 +503,8 @@ int cmCPackNSISGenerator::InitializeInternal()
<< "not set" << std::endl); << "not set" << std::endl);
} }
cmOStringStream str; std::ostringstream str;
cmOStringStream deleteStr; std::ostringstream deleteStr;
if ( cpackPackageExecutables ) if ( cpackPackageExecutables )
{ {
@ -565,8 +565,8 @@ int cmCPackNSISGenerator::InitializeInternal()
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void cmCPackNSISGenerator::CreateMenuLinks( cmOStringStream& str, void cmCPackNSISGenerator::CreateMenuLinks( std::ostringstream& str,
cmOStringStream& deleteStr) std::ostringstream& deleteStr)
{ {
const char* cpackMenuLinks const char* cpackMenuLinks
= this->GetOption("CPACK_NSIS_MENU_LINKS"); = this->GetOption("CPACK_NSIS_MENU_LINKS");
@ -694,7 +694,7 @@ bool cmCPackNSISGenerator::SupportsComponentInstallation() const
std::string std::string
cmCPackNSISGenerator:: cmCPackNSISGenerator::
CreateComponentDescription(cmCPackComponent *component, CreateComponentDescription(cmCPackComponent *component,
cmOStringStream& macrosOut) std::ostringstream& macrosOut)
{ {
// Basic description of the component // Basic description of the component
std::string componentCode = "Section "; std::string componentCode = "Section ";
@ -714,7 +714,7 @@ CreateComponentDescription(cmCPackComponent *component,
} }
else if (!component->InstallationTypes.empty()) else if (!component->InstallationTypes.empty())
{ {
cmOStringStream out; std::ostringstream out;
std::vector<cmCPackInstallationType *>::iterator installTypeIter; std::vector<cmCPackInstallationType *>::iterator installTypeIter;
for (installTypeIter = component->InstallationTypes.begin(); for (installTypeIter = component->InstallationTypes.begin();
installTypeIter != component->InstallationTypes.end(); installTypeIter != component->InstallationTypes.end();
@ -734,7 +734,7 @@ CreateComponentDescription(cmCPackComponent *component,
// Compute the name of the archive. // Compute the name of the archive.
std::string packagesDir = this->GetOption("CPACK_TEMPORARY_DIRECTORY"); std::string packagesDir = this->GetOption("CPACK_TEMPORARY_DIRECTORY");
packagesDir += ".dummy"; packagesDir += ".dummy";
cmOStringStream out; std::ostringstream out;
out << cmSystemTools::GetFilenameWithoutLastExtension(packagesDir) out << cmSystemTools::GetFilenameWithoutLastExtension(packagesDir)
<< "-" << component->Name << ".zip"; << "-" << component->Name << ".zip";
component->ArchiveFile = out.str(); component->ArchiveFile = out.str();
@ -859,7 +859,7 @@ CreateComponentDescription(cmCPackComponent *component,
{ {
totalSizeInKbytes = 1; totalSizeInKbytes = 1;
} }
cmOStringStream out; std::ostringstream out;
out << " AddSize " << totalSizeInKbytes << "\n" out << " AddSize " << totalSizeInKbytes << "\n"
<< " Push \"" << component->ArchiveFile << "\"\n" << " Push \"" << component->ArchiveFile << "\"\n"
<< " Call DownloadFile\n" << " Call DownloadFile\n"
@ -935,7 +935,7 @@ std::string cmCPackNSISGenerator::CreateSelectionDependenciesDescription
} }
visited.insert(component); visited.insert(component);
cmOStringStream out; std::ostringstream out;
std::vector<cmCPackComponent *>::iterator dependIt; std::vector<cmCPackComponent *>::iterator dependIt;
for (dependIt = component->Dependencies.begin(); for (dependIt = component->Dependencies.begin();
dependIt != component->Dependencies.end(); dependIt != component->Dependencies.end();
@ -967,7 +967,7 @@ std::string cmCPackNSISGenerator::CreateDeselectionDependenciesDescription
} }
visited.insert(component); visited.insert(component);
cmOStringStream out; std::ostringstream out;
std::vector<cmCPackComponent *>::iterator dependIt; std::vector<cmCPackComponent *>::iterator dependIt;
for (dependIt = component->ReverseDependencies.begin(); for (dependIt = component->ReverseDependencies.begin();
dependIt != component->ReverseDependencies.end(); dependIt != component->ReverseDependencies.end();
@ -992,7 +992,7 @@ std::string cmCPackNSISGenerator::CreateDeselectionDependenciesDescription
std::string std::string
cmCPackNSISGenerator:: cmCPackNSISGenerator::
CreateComponentGroupDescription(cmCPackComponentGroup *group, CreateComponentGroupDescription(cmCPackComponentGroup *group,
cmOStringStream& macrosOut) std::ostringstream& macrosOut)
{ {
if (group->Components.empty() && group->Subgroups.empty()) if (group->Components.empty() && group->Subgroups.empty())
{ {

View File

@ -38,8 +38,8 @@ public:
protected: protected:
virtual int InitializeInternal(); virtual int InitializeInternal();
void CreateMenuLinks( cmOStringStream& str, void CreateMenuLinks( std::ostringstream& str,
cmOStringStream& deleteStr); std::ostringstream& deleteStr);
int PackageFiles(); int PackageFiles();
virtual const char* GetOutputExtension() { return ".exe"; } virtual const char* GetOutputExtension() { return ".exe"; }
virtual const char* GetOutputPostfix() { return "win32"; } virtual const char* GetOutputPostfix() { return "win32"; }
@ -56,7 +56,7 @@ protected:
/// macrosOut. /// macrosOut.
std::string std::string
CreateComponentDescription(cmCPackComponent *component, CreateComponentDescription(cmCPackComponent *component,
cmOStringStream& macrosOut); std::ostringstream& macrosOut);
/// Produce NSIS code that selects all of the components that this component /// Produce NSIS code that selects all of the components that this component
/// depends on, recursively. /// depends on, recursively.
@ -75,7 +75,7 @@ protected:
/// added macros will be emitted via macrosOut. /// added macros will be emitted via macrosOut.
std::string std::string
CreateComponentGroupDescription(cmCPackComponentGroup *group, CreateComponentGroupDescription(cmCPackComponentGroup *group,
cmOStringStream& macrosOut); std::ostringstream& macrosOut);
/// Translations any newlines found in the string into \\r\\n, so that the /// Translations any newlines found in the string into \\r\\n, so that the
/// resulting string can be used within NSIS. /// resulting string can be used within NSIS.

View File

@ -45,8 +45,8 @@ int cmCPackOSXX11Generator::PackageFiles()
{ {
cmCPackLogger(cmCPackLog::LOG_DEBUG, "The cpackPackageExecutables: " cmCPackLogger(cmCPackLog::LOG_DEBUG, "The cpackPackageExecutables: "
<< cpackPackageExecutables << "." << std::endl); << cpackPackageExecutables << "." << std::endl);
cmOStringStream str; std::ostringstream str;
cmOStringStream deleteStr; std::ostringstream deleteStr;
std::vector<std::string> cpackPackageExecutablesVector; std::vector<std::string> cpackPackageExecutablesVector;
cmSystemTools::ExpandListArgument(cpackPackageExecutables, cmSystemTools::ExpandListArgument(cpackPackageExecutables,
cpackPackageExecutablesVector); cpackPackageExecutablesVector);
@ -165,7 +165,7 @@ int cmCPackOSXX11Generator::PackageFiles()
std::string output; std::string output;
std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
tmpFile += "/hdiutilOutput.log"; tmpFile += "/hdiutilOutput.log";
cmOStringStream dmgCmd; std::ostringstream dmgCmd;
dmgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM_DISK_IMAGE") dmgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM_DISK_IMAGE")
<< "\" create -ov -format UDZO -srcfolder \"" << "\" create -ov -format UDZO -srcfolder \""
<< diskImageDirectory.c_str() << diskImageDirectory.c_str()

View File

@ -325,7 +325,7 @@ int cmCPackPackageMakerGenerator::PackageFiles()
if (this->Components.empty()) if (this->Components.empty())
{ {
// Use PackageMaker to build the package. // Use PackageMaker to build the package.
cmOStringStream pkgCmd; std::ostringstream pkgCmd;
pkgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM") pkgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM")
<< "\" -build -p \"" << packageDirFileName << "\""; << "\" -build -p \"" << packageDirFileName << "\"";
if (this->Components.empty()) if (this->Components.empty())
@ -359,7 +359,7 @@ int cmCPackPackageMakerGenerator::PackageFiles()
std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY"); std::string tmpFile = this->GetOption("CPACK_TOPLEVEL_DIRECTORY");
tmpFile += "/hdiutilOutput.log"; tmpFile += "/hdiutilOutput.log";
cmOStringStream dmgCmd; std::ostringstream dmgCmd;
dmgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM_DISK_IMAGE") dmgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM_DISK_IMAGE")
<< "\" create -ov -format UDZO -srcfolder \"" << packageDirFileName << "\" create -ov -format UDZO -srcfolder \"" << packageDirFileName
<< "\" \"" << packageFileNames[0] << "\""; << "\" \"" << packageFileNames[0] << "\"";
@ -687,7 +687,7 @@ cmCPackPackageMakerGenerator::GetPackageName(const cmCPackComponent& component)
{ {
std::string packagesDir = this->GetOption("CPACK_TEMPORARY_DIRECTORY"); std::string packagesDir = this->GetOption("CPACK_TEMPORARY_DIRECTORY");
packagesDir += ".dummy"; packagesDir += ".dummy";
cmOStringStream out; std::ostringstream out;
out << cmSystemTools::GetFilenameWithoutLastExtension(packagesDir) out << cmSystemTools::GetFilenameWithoutLastExtension(packagesDir)
<< "-" << component.Name << ".pkg"; << "-" << component.Name << ".pkg";
return out.str(); return out.str();
@ -710,7 +710,7 @@ GenerateComponentPackage(const char *packageFile,
packageFile << std::endl); packageFile << std::endl);
// The command that will be used to run PackageMaker // The command that will be used to run PackageMaker
cmOStringStream pkgCmd; std::ostringstream pkgCmd;
if (this->PackageCompatibilityVersion < 10.5 || if (this->PackageCompatibilityVersion < 10.5 ||
this->PackageMakerVersion < 3.0) this->PackageMakerVersion < 3.0)
@ -800,7 +800,7 @@ WriteDistributionFile(const char* metapackageFile)
// Create the choice outline, which provides a tree-based view of // Create the choice outline, which provides a tree-based view of
// the components in their groups. // the components in their groups.
cmOStringStream choiceOut; std::ostringstream choiceOut;
choiceOut << "<choices-outline>" << std::endl; choiceOut << "<choices-outline>" << std::endl;
// Emit the outline for the groups // Emit the outline for the groups
@ -862,7 +862,8 @@ WriteDistributionFile(const char* metapackageFile)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void void
cmCPackPackageMakerGenerator:: cmCPackPackageMakerGenerator::
CreateChoiceOutline(const cmCPackComponentGroup& group, cmOStringStream& out) CreateChoiceOutline(const cmCPackComponentGroup& group,
std::ostringstream& out)
{ {
out << "<line choice=\"" << group.Name << "Choice\">" << std::endl; out << "<line choice=\"" << group.Name << "Choice\">" << std::endl;
std::vector<cmCPackComponentGroup*>::const_iterator groupIt; std::vector<cmCPackComponentGroup*>::const_iterator groupIt;
@ -885,7 +886,7 @@ CreateChoiceOutline(const cmCPackComponentGroup& group, cmOStringStream& out)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void void
cmCPackPackageMakerGenerator::CreateChoice(const cmCPackComponentGroup& group, cmCPackPackageMakerGenerator::CreateChoice(const cmCPackComponentGroup& group,
cmOStringStream& out) std::ostringstream& out)
{ {
out << "<choice id=\"" << group.Name << "Choice\" " out << "<choice id=\"" << group.Name << "Choice\" "
<< "title=\"" << group.DisplayName << "\" " << "title=\"" << group.DisplayName << "\" "
@ -903,7 +904,7 @@ cmCPackPackageMakerGenerator::CreateChoice(const cmCPackComponentGroup& group,
//---------------------------------------------------------------------- //----------------------------------------------------------------------
void void
cmCPackPackageMakerGenerator::CreateChoice(const cmCPackComponent& component, cmCPackPackageMakerGenerator::CreateChoice(const cmCPackComponent& component,
cmOStringStream& out) std::ostringstream& out)
{ {
std::string packageId = "com."; std::string packageId = "com.";
packageId += this->GetOption("CPACK_PACKAGE_VENDOR"); packageId += this->GetOption("CPACK_PACKAGE_VENDOR");
@ -989,7 +990,7 @@ void
cmCPackPackageMakerGenerator:: cmCPackPackageMakerGenerator::
AddDependencyAttributes(const cmCPackComponent& component, AddDependencyAttributes(const cmCPackComponent& component,
std::set<const cmCPackComponent *>& visited, std::set<const cmCPackComponent *>& visited,
cmOStringStream& out) std::ostringstream& out)
{ {
if (visited.find(&component) != visited.end()) if (visited.find(&component) != visited.end())
{ {
@ -1013,7 +1014,7 @@ void
cmCPackPackageMakerGenerator:: cmCPackPackageMakerGenerator::
AddReverseDependencyAttributes(const cmCPackComponent& component, AddReverseDependencyAttributes(const cmCPackComponent& component,
std::set<const cmCPackComponent *>& visited, std::set<const cmCPackComponent *>& visited,
cmOStringStream& out) std::ostringstream& out)
{ {
if (visited.find(&component) != visited.end()) if (visited.find(&component) != visited.end())
{ {

View File

@ -84,30 +84,30 @@ protected:
// dependency attributes for inter-component dependencies. // dependency attributes for inter-component dependencies.
void AddDependencyAttributes(const cmCPackComponent& component, void AddDependencyAttributes(const cmCPackComponent& component,
std::set<const cmCPackComponent *>& visited, std::set<const cmCPackComponent *>& visited,
cmOStringStream& out); std::ostringstream& out);
// Subroutine of WriteDistributionFile that writes out the // Subroutine of WriteDistributionFile that writes out the
// reverse dependency attributes for inter-component dependencies. // reverse dependency attributes for inter-component dependencies.
void void
AddReverseDependencyAttributes(const cmCPackComponent& component, AddReverseDependencyAttributes(const cmCPackComponent& component,
std::set<const cmCPackComponent *>& visited, std::set<const cmCPackComponent *>& visited,
cmOStringStream& out); std::ostringstream& out);
// Generates XML that encodes the hierarchy of component groups and // Generates XML that encodes the hierarchy of component groups and
// their components in a form that can be used by distribution // their components in a form that can be used by distribution
// metapackages. // metapackages.
void CreateChoiceOutline(const cmCPackComponentGroup& group, void CreateChoiceOutline(const cmCPackComponentGroup& group,
cmOStringStream& out); std::ostringstream& out);
/// Create the "choice" XML element to describe a component group /// Create the "choice" XML element to describe a component group
/// for the installer GUI. /// for the installer GUI.
void CreateChoice(const cmCPackComponentGroup& group, void CreateChoice(const cmCPackComponentGroup& group,
cmOStringStream& out); std::ostringstream& out);
/// Create the "choice" XML element to describe a component for the /// Create the "choice" XML element to describe a component for the
/// installer GUI. /// installer GUI.
void CreateChoice(const cmCPackComponent& component, void CreateChoice(const cmCPackComponent& component,
cmOStringStream& out); std::ostringstream& out);
// Escape the given string to make it usable as an XML attribute // Escape the given string to make it usable as an XML attribute
// value. // value.

View File

@ -426,7 +426,7 @@ int main (int argc, char const* const* argv)
= mf->GetDefinition("CPACK_PACKAGE_VERSION_MINOR"); = mf->GetDefinition("CPACK_PACKAGE_VERSION_MINOR");
const char* projVersionPatch const char* projVersionPatch
= mf->GetDefinition("CPACK_PACKAGE_VERSION_PATCH"); = mf->GetDefinition("CPACK_PACKAGE_VERSION_PATCH");
cmOStringStream ostr; std::ostringstream ostr;
ostr << projVersionMajor << "." << projVersionMinor << "." ostr << projVersionMajor << "." << projVersionMinor << "."
<< projVersionPatch; << projVersionPatch;
mf->AddDefinition("CPACK_PACKAGE_VERSION", mf->AddDefinition("CPACK_PACKAGE_VERSION",

View File

@ -55,7 +55,7 @@ int cmCTestBuildAndTestHandler::ProcessHandler()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring, int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring,
cmOStringStream &out, std::string &cmakeOutString, std::string &cwd, std::ostringstream &out, std::string &cmakeOutString, std::string &cwd,
cmake *cm) cmake *cm)
{ {
unsigned int k; unsigned int k;
@ -209,7 +209,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
std::string cmakeOutString; std::string cmakeOutString;
cmCTestBuildAndTestCaptureRAII captureRAII(cm, cmakeOutString); cmCTestBuildAndTestCaptureRAII captureRAII(cm, cmakeOutString);
static_cast<void>(captureRAII); static_cast<void>(captureRAII);
cmOStringStream out; std::ostringstream out;
if ( this->CTest->GetConfigType().size() == 0 && if ( this->CTest->GetConfigType().size() == 0 &&
this->ConfigSample.size()) this->ConfigSample.size())

View File

@ -50,7 +50,7 @@ public:
protected: protected:
///! Run CMake and build a test and then run it as a single test. ///! Run CMake and build a test and then run it as a single test.
int RunCMakeAndTest(std::string* output); int RunCMakeAndTest(std::string* output);
int RunCMake(std::string* outstring, cmOStringStream &out, int RunCMake(std::string* outstring, std::ostringstream &out,
std::string &cmakeOutString, std::string &cmakeOutString,
std::string &cwd, cmake *cm); std::string &cwd, cmake *cm);

View File

@ -148,7 +148,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
} }
else else
{ {
cmOStringStream ostr; std::ostringstream ostr;
ostr << "has no project to build. If this is a " ostr << "has no project to build. If this is a "
"\"built with CMake\" project, verify that CTEST_CMAKE_GENERATOR " "\"built with CMake\" project, verify that CTEST_CMAKE_GENERATOR "
"and CTEST_PROJECT_NAME are set." "and CTEST_PROJECT_NAME are set."
@ -181,7 +181,7 @@ bool cmCTestBuildCommand::InitialPass(std::vector<std::string> const& args,
bool ret = cmCTestHandlerCommand::InitialPass(args, status); bool ret = cmCTestHandlerCommand::InitialPass(args, status);
if ( this->Values[ctb_NUMBER_ERRORS] && *this->Values[ctb_NUMBER_ERRORS]) if ( this->Values[ctb_NUMBER_ERRORS] && *this->Values[ctb_NUMBER_ERRORS])
{ {
cmOStringStream str; std::ostringstream str;
str << this->Handler->GetTotalErrors(); str << this->Handler->GetTotalErrors();
this->Makefile->AddDefinition( this->Makefile->AddDefinition(
this->Values[ctb_NUMBER_ERRORS], str.str().c_str()); this->Values[ctb_NUMBER_ERRORS], str.str().c_str());
@ -189,7 +189,7 @@ bool cmCTestBuildCommand::InitialPass(std::vector<std::string> const& args,
if ( this->Values[ctb_NUMBER_WARNINGS] if ( this->Values[ctb_NUMBER_WARNINGS]
&& *this->Values[ctb_NUMBER_WARNINGS]) && *this->Values[ctb_NUMBER_WARNINGS])
{ {
cmOStringStream str; std::ostringstream str;
str << this->Handler->GetTotalWarnings(); str << this->Handler->GetTotalWarnings();
this->Makefile->AddDefinition( this->Makefile->AddDefinition(
this->Values[ctb_NUMBER_WARNINGS], str.str().c_str()); this->Values[ctb_NUMBER_WARNINGS], str.str().c_str());

View File

@ -66,7 +66,7 @@ cmCTestGenericHandler* cmCTestConfigureCommand::InitializeHandler()
const std::string cmakelists_file = source_dir + "/CMakeLists.txt"; const std::string cmakelists_file = source_dir + "/CMakeLists.txt";
if ( !cmSystemTools::FileExists(cmakelists_file.c_str()) ) if ( !cmSystemTools::FileExists(cmakelists_file.c_str()) )
{ {
cmOStringStream e; std::ostringstream e;
e << "CMakeLists.txt file does not exist [" e << "CMakeLists.txt file does not exist ["
<< cmakelists_file << "]"; << cmakelists_file << "]";
this->SetError(e.str()); this->SetError(e.str());

View File

@ -544,7 +544,7 @@ int cmCTestCoverageHandler::ProcessHandler()
cmsys::ifstream ifs(fullFileName.c_str()); cmsys::ifstream ifs(fullFileName.c_str());
if ( !ifs) if ( !ifs)
{ {
cmOStringStream ostr; std::ostringstream ostr;
ostr << "Cannot open source file: " << fullFileName; ostr << "Cannot open source file: " << fullFileName;
errorsWhileAccumulating.push_back(ostr.str()); errorsWhileAccumulating.push_back(ostr.str());
error ++; error ++;
@ -563,7 +563,7 @@ int cmCTestCoverageHandler::ProcessHandler()
if ( !cmSystemTools::GetLineFromStream(ifs, line) && if ( !cmSystemTools::GetLineFromStream(ifs, line) &&
cc != fcov.size() -1 ) cc != fcov.size() -1 )
{ {
cmOStringStream ostr; std::ostringstream ostr;
ostr << "Problem reading source file: " << fullFileName 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());
@ -584,7 +584,7 @@ int cmCTestCoverageHandler::ProcessHandler()
} }
if ( cmSystemTools::GetLineFromStream(ifs, line) ) if ( cmSystemTools::GetLineFromStream(ifs, line) )
{ {
cmOStringStream ostr; std::ostringstream ostr;
ostr << "Looks like there are more lines in the file: " << fullFileName; ostr << "Looks like there are more lines in the file: " << fullFileName;
errorsWhileAccumulating.push_back(ostr.str()); errorsWhileAccumulating.push_back(ostr.str());
} }
@ -633,7 +633,7 @@ int cmCTestCoverageHandler::ProcessHandler()
cmsys::ifstream ifs(fullPath.c_str()); cmsys::ifstream ifs(fullPath.c_str());
if (!ifs) if (!ifs)
{ {
cmOStringStream ostr; std::ostringstream ostr;
ostr << "Cannot open source file: " << fullPath; ostr << "Cannot open source file: " << fullPath;
errorsWhileAccumulating.push_back(ostr.str()); errorsWhileAccumulating.push_back(ostr.str());
error ++; error ++;

View File

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

View File

@ -103,7 +103,7 @@ bool cmCTestGenericHandler::StartResultingXML(cmCTest::Part part,
<< std::endl;); << std::endl;);
return false; return false;
} }
cmOStringStream ostr; std::ostringstream ostr;
ostr << name; ostr << name;
if ( this->SubmitIndex > 0 ) if ( this->SubmitIndex > 0 )
{ {
@ -142,7 +142,7 @@ bool cmCTestGenericHandler::StartLogFile(const char* name,
"Cannot create log file without providing the name" << std::endl;); "Cannot create log file without providing the name" << std::endl;);
return false; return false;
} }
cmOStringStream ostr; std::ostringstream ostr;
ostr << "Last" << name; ostr << "Last" << name;
if ( this->SubmitIndex > 0 ) if ( this->SubmitIndex > 0 )
{ {

View File

@ -46,7 +46,7 @@ bool cmCTestHandlerCommand
if(!this->CheckArgumentKeyword(args[i]) && if(!this->CheckArgumentKeyword(args[i]) &&
!this->CheckArgumentValue(args[i])) !this->CheckArgumentValue(args[i]))
{ {
cmOStringStream e; std::ostringstream e;
e << "called with unknown argument \"" << args[i] << "\"."; e << "called with unknown argument \"" << args[i] << "\".";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -141,7 +141,7 @@ bool cmCTestHandlerCommand
int res = handler->ProcessHandler(); int res = handler->ProcessHandler();
if ( this->Values[ct_RETURN_VALUE] && *this->Values[ct_RETURN_VALUE]) if ( this->Values[ct_RETURN_VALUE] && *this->Values[ct_RETURN_VALUE])
{ {
cmOStringStream str; std::ostringstream str;
str << res; str << res;
this->Makefile->AddDefinition( this->Makefile->AddDefinition(
this->Values[ct_RETURN_VALUE], str.str().c_str()); this->Values[ct_RETURN_VALUE], str.str().c_str());
@ -183,7 +183,7 @@ bool cmCTestHandlerCommand::CheckArgumentValue(std::string const& arg)
unsigned int k = this->ArgumentIndex; unsigned int k = this->ArgumentIndex;
if(this->Values[k]) if(this->Values[k])
{ {
cmOStringStream e; std::ostringstream e;
e << "Called with more than one value for " << this->Arguments[k]; e << "Called with more than one value for " << this->Arguments[k];
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
this->ArgumentDoing = ArgumentDoingError; this->ArgumentDoing = ArgumentDoingError;

View File

@ -75,7 +75,7 @@ public:
this->ParseError(atts); this->ParseError(atts);
} }
// Create the log // Create the log
cmOStringStream ostr; std::ostringstream ostr;
ostr << name << ":\n"; ostr << name << ":\n";
int i = 0; int i = 0;
for(; atts[i] != 0; i+=2) for(; atts[i] != 0; i+=2)
@ -198,7 +198,7 @@ void cmCTestMemCheckHandler::GenerateTestCommand(
{ {
std::vector<std::string>::size_type pp; std::vector<std::string>::size_type pp;
std::string index; std::string index;
cmOStringStream stream; std::ostringstream stream;
std::string memcheckcommand std::string memcheckcommand
= cmSystemTools::ConvertToOutputPath(this->MemoryTester.c_str()); = cmSystemTools::ConvertToOutputPath(this->MemoryTester.c_str());
stream << test; stream << test;
@ -834,7 +834,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckSanitizerOutput(
int defects = 0; int defects = 0;
std::vector<std::string> lines; std::vector<std::string> lines;
cmSystemTools::Split(str.c_str(), lines); cmSystemTools::Split(str.c_str(), lines);
cmOStringStream ostr; std::ostringstream ostr;
log = ""; log = "";
for( std::vector<std::string>::iterator i = lines.begin(); for( std::vector<std::string>::iterator i = lines.begin();
i != lines.end(); ++i) i != lines.end(); ++i)
@ -878,7 +878,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckPurifyOutput(
{ {
std::vector<std::string> lines; std::vector<std::string> lines;
cmSystemTools::Split(str.c_str(), lines); cmSystemTools::Split(str.c_str(), lines);
cmOStringStream ostr; std::ostringstream ostr;
log = ""; log = "";
cmsys::RegularExpression pfW("^\\[[WEI]\\] ([A-Z][A-Z][A-Z][A-Z]*): "); cmsys::RegularExpression pfW("^\\[[WEI]\\] ([A-Z][A-Z][A-Z][A-Z]*): ");
@ -941,7 +941,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput(
std::string::size_type cc; std::string::size_type cc;
cmOStringStream ostr; std::ostringstream ostr;
log = ""; log = "";
int defects = 0; int defects = 0;
@ -1269,7 +1269,7 @@ void cmCTestMemCheckHandler::TestOutputFileNames(int test,
files) files)
{ {
std::string index; std::string index;
cmOStringStream stream; std::ostringstream stream;
stream << test; stream << test;
index = stream.str(); index = stream.str();
std::string ofile = this->MemoryTesterOutputFile; std::string ofile = this->MemoryTesterOutputFile;

View File

@ -668,7 +668,7 @@ void cmCTestMultiProcessHandler::PrintTestList()
{ {
cmCTestLog(this->CTest, HANDLER_OUTPUT, " Test"); cmCTestLog(this->CTest, HANDLER_OUTPUT, " Test");
} }
cmOStringStream indexStr; std::ostringstream indexStr;
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()))

View File

@ -54,7 +54,7 @@ bool cmCTestRunScriptCommand
int ret; int ret;
cmCTestScriptHandler::RunScript(this->CTest, args[i].c_str(), !np, cmCTestScriptHandler::RunScript(this->CTest, args[i].c_str(), !np,
&ret); &ret);
cmOStringStream str; std::ostringstream str;
str << ret; str << ret;
this->Makefile->AddDefinition(returnVariable, str.str().c_str()); this->Makefile->AddDefinition(returnVariable, str.str().c_str());
} }

View File

@ -694,7 +694,7 @@ void cmCTestRunTest::WriteLogOutputTop(size_t completed, size_t total)
cmCTestLog(this->CTest, HANDLER_OUTPUT, "Test"); cmCTestLog(this->CTest, HANDLER_OUTPUT, "Test");
} }
cmOStringStream indexStr; std::ostringstream indexStr;
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()))

View File

@ -299,7 +299,7 @@ int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg)
cmsysProcess_Delete(cp); cmsysProcess_Delete(cp);
if(failed) if(failed)
{ {
cmOStringStream message; std::ostringstream message;
message << "Error running command: ["; message << "Error running command: [";
message << result << "] "; message << result << "] ";
for(std::vector<const char*>::iterator i = argv.begin(); for(std::vector<const char*>::iterator i = argv.begin();

View File

@ -126,7 +126,7 @@ bool cmCTestStartCommand
} }
if(!cmSystemTools::FileIsDirectory(sourceDir)) if(!cmSystemTools::FileIsDirectory(sourceDir))
{ {
cmOStringStream e; std::ostringstream e;
e << "given source path\n" e << "given source path\n"
<< " " << sourceDir << "\n" << " " << sourceDir << "\n"
<< "which is not an existing directory. " << "which is not an existing directory. "

View File

@ -212,7 +212,7 @@ bool cmCTestSubmitCommand::CheckArgumentValue(std::string const& arg)
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "Part name \"" << arg << "\" is invalid."; e << "Part name \"" << arg << "\" is invalid.";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
this->ArgumentDoing = ArgumentDoingError; this->ArgumentDoing = ArgumentDoingError;
@ -229,7 +229,7 @@ bool cmCTestSubmitCommand::CheckArgumentValue(std::string const& arg)
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "File \"" << filename << "\" does not exist. Cannot submit " e << "File \"" << filename << "\" does not exist. Cannot submit "
<< "a non-existent file."; << "a non-existent file.";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());

View File

@ -53,7 +53,7 @@ cmCTestGenericHandler* cmCTestTestCommand::InitializeHandler()
if ( this->Values[ctt_START] || this->Values[ctt_END] || if ( this->Values[ctt_START] || this->Values[ctt_END] ||
this->Values[ctt_STRIDE] ) this->Values[ctt_STRIDE] )
{ {
cmOStringStream testsToRunString; std::ostringstream testsToRunString;
if ( this->Values[ctt_START] ) if ( this->Values[ctt_START] )
{ {
testsToRunString << this->Values[ctt_START]; testsToRunString << this->Values[ctt_START];

View File

@ -1865,7 +1865,7 @@ std::string cmCTestTestHandler::GenerateRegressionImages(
SPACE_REGEX "*(name|type|encoding|compression)=\"([^\"]*)\"" SPACE_REGEX "*(name|type|encoding|compression)=\"([^\"]*)\""
SPACE_REGEX "*>([^<]*)</DartMeasurementFile>"); SPACE_REGEX "*>([^<]*)</DartMeasurementFile>");
cmOStringStream ostr; std::ostringstream ostr;
bool done = false; bool done = false;
std::string cxml = xml; std::string cxml = xml;
while ( ! done ) while ( ! done )
@ -2098,7 +2098,7 @@ bool cmCTestTestHandler::CleanTestOutput(std::string& output, size_t length)
output = output.substr(0, current - begin); output = output.substr(0, current - begin);
// Append truncation message. // Append truncation message.
cmOStringStream msg; std::ostringstream msg;
msg << "...\n" msg << "...\n"
"The rest of the test output was removed since it exceeds the threshold " "The rest of the test output was removed since it exceeds the threshold "
"of " << length << " bytes.\n"; "of " << length << " bytes.\n";

View File

@ -413,7 +413,7 @@ bool cmCTestUpdateHandler::SelectVCS()
} }
if (this->UpdateCommand.empty()) if (this->UpdateCommand.empty())
{ {
cmOStringStream e; std::ostringstream e;
e << "Cannot find UpdateCommand "; e << "Cannot find UpdateCommand ";
if (key) if (key)
{ {

View File

@ -55,7 +55,7 @@ bool cmCTestUploadCommand::CheckArgumentValue(std::string const& arg)
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "File \"" << filename << "\" does not exist. Cannot submit " e << "File \"" << filename << "\" does not exist. Cannot submit "
<< "a non-existent file."; << "a non-existent file.";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());

View File

@ -105,7 +105,7 @@ bool cmCTestVC::RunChild(char const* const* cmd, OutputParser* out,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::string cmCTestVC::ComputeCommandLine(char const* const* cmd) std::string cmCTestVC::ComputeCommandLine(char const* const* cmd)
{ {
cmOStringStream line; std::ostringstream line;
const char* sep = ""; const char* sep = "";
for(const char* const* arg = cmd; *arg; ++arg) for(const char* const* arg = cmd; *arg; ++arg)
{ {

View File

@ -305,7 +305,7 @@ bool cmAddCustomCommandCommand
} }
// No command for this output exists. // No command for this output exists.
cmOStringStream e; std::ostringstream e;
e << "given APPEND option with output \"" << output[0] 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());
@ -354,7 +354,7 @@ bool cmAddCustomCommandCommand
} }
if(!okay) if(!okay)
{ {
cmOStringStream e; std::ostringstream e;
e << "could not locate source file with a custom command producing \"" e << "could not locate source file with a custom command producing \""
<< output[0] << "\" even though this command tried to create it!"; << output[0] << "\" even though this command tried to create it!";
this->SetError(e.str()); this->SetError(e.str());
@ -375,7 +375,7 @@ bool cmAddCustomCommandCommand
else else
{ {
bool issueMessage = true; bool issueMessage = true;
cmOStringStream e; std::ostringstream e;
cmake::MessageType messageType = cmake::AUTHOR_WARNING; cmake::MessageType messageType = cmake::AUTHOR_WARNING;
switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0050)) switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0050))
{ {
@ -436,7 +436,7 @@ cmAddCustomCommandCommand
std::string::size_type pos = o->find_first_of("#<>"); std::string::size_type pos = o->find_first_of("#<>");
if(pos != o->npos) if(pos != o->npos)
{ {
cmOStringStream msg; std::ostringstream msg;
msg << "called with OUTPUT containing a \"" << (*o)[pos] msg << "called with OUTPUT containing a \"" << (*o)[pos]
<< "\". This character is not allowed."; << "\". This character is not allowed.";
this->SetError(msg.str()); this->SetError(msg.str());

View File

@ -30,7 +30,7 @@ bool cmAddCustomTargetCommand
// Check the target name. // Check the target name.
if(targetName.find_first_of("/\\") != targetName.npos) if(targetName.find_first_of("/\\") != targetName.npos)
{ {
cmOStringStream e; std::ostringstream e;
e << "called with invalid target name \"" << targetName e << "called with invalid target name \"" << targetName
<< "\". Target names may not contain a slash. " << "\". Target names may not contain a slash. "
<< "Use ADD_CUSTOM_COMMAND to generate files."; << "Use ADD_CUSTOM_COMMAND to generate files.";
@ -170,7 +170,7 @@ bool cmAddCustomTargetCommand
std::string::size_type pos = targetName.find_first_of("#<>"); std::string::size_type pos = targetName.find_first_of("#<>");
if(pos != targetName.npos) if(pos != targetName.npos)
{ {
cmOStringStream msg; std::ostringstream msg;
msg << "called with target name containing a \"" << targetName[pos] msg << "called with target name containing a \"" << targetName[pos]
<< "\". This character is not allowed."; << "\". This character is not allowed.";
this->SetError(msg.str()); this->SetError(msg.str());
@ -189,7 +189,7 @@ bool cmAddCustomTargetCommand
if (!nameOk) if (!nameOk)
{ {
cmake::MessageType messageType = cmake::AUTHOR_WARNING; cmake::MessageType messageType = cmake::AUTHOR_WARNING;
cmOStringStream e; std::ostringstream e;
bool issueMessage = false; bool issueMessage = false;
switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0037)) switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0037))
{ {

View File

@ -26,7 +26,7 @@ bool cmAddDependenciesCommand
std::string target_name = args[0]; std::string target_name = args[0];
if(this->Makefile->IsAlias(target_name)) if(this->Makefile->IsAlias(target_name))
{ {
cmOStringStream e; std::ostringstream e;
e << "Cannot add target-level dependencies to alias target \"" e << "Cannot add target-level dependencies to alias target \""
<< target_name << "\".\n"; << target_name << "\".\n";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
@ -35,7 +35,7 @@ bool cmAddDependenciesCommand
{ {
if (target->GetType() == cmTarget::INTERFACE_LIBRARY) if (target->GetType() == cmTarget::INTERFACE_LIBRARY)
{ {
cmOStringStream e; std::ostringstream e;
e << "Cannot add target-level dependencies to INTERFACE library " e << "Cannot add target-level dependencies to INTERFACE library "
"target \"" << target_name << "\".\n"; "target \"" << target_name << "\".\n";
this->SetError(e.str()); this->SetError(e.str());
@ -51,7 +51,7 @@ bool cmAddDependenciesCommand
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "Cannot add target-level dependencies to non-existent target \"" e << "Cannot add target-level dependencies to non-existent target \""
<< target_name << "\".\n" << target_name << "\".\n"
<< "The add_dependencies works for top-level logical targets created " << "The add_dependencies works for top-level logical targets created "

View File

@ -79,7 +79,7 @@ bool cmAddExecutableCommand
if (!nameOk) if (!nameOk)
{ {
cmake::MessageType messageType = cmake::AUTHOR_WARNING; cmake::MessageType messageType = cmake::AUTHOR_WARNING;
cmOStringStream e; std::ostringstream e;
bool issueMessage = false; bool issueMessage = false;
switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0037)) switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0037))
{ {
@ -149,7 +149,7 @@ bool cmAddExecutableCommand
} }
if(args.size() != 3) if(args.size() != 3)
{ {
cmOStringStream e; std::ostringstream e;
e << "ALIAS requires exactly one target argument."; e << "ALIAS requires exactly one target argument.";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -158,7 +158,7 @@ bool cmAddExecutableCommand
const char *aliasedName = s->c_str(); const char *aliasedName = s->c_str();
if(this->Makefile->IsAlias(aliasedName)) if(this->Makefile->IsAlias(aliasedName))
{ {
cmOStringStream e; std::ostringstream e;
e << "cannot create ALIAS target \"" << exename e << "cannot create ALIAS target \"" << exename
<< "\" because target \"" << aliasedName << "\" is itself an ALIAS."; << "\" because target \"" << aliasedName << "\" is itself an ALIAS.";
this->SetError(e.str()); this->SetError(e.str());
@ -168,7 +168,7 @@ bool cmAddExecutableCommand
this->Makefile->FindTargetToUse(aliasedName, true); this->Makefile->FindTargetToUse(aliasedName, true);
if(!aliasedTarget) if(!aliasedTarget)
{ {
cmOStringStream e; std::ostringstream e;
e << "cannot create ALIAS target \"" << exename e << "cannot create ALIAS target \"" << exename
<< "\" because target \"" << aliasedName << "\" does not already " << "\" because target \"" << aliasedName << "\" does not already "
"exist."; "exist.";
@ -178,7 +178,7 @@ bool cmAddExecutableCommand
cmTarget::TargetType type = aliasedTarget->GetType(); cmTarget::TargetType type = aliasedTarget->GetType();
if(type != cmTarget::EXECUTABLE) if(type != cmTarget::EXECUTABLE)
{ {
cmOStringStream e; std::ostringstream e;
e << "cannot create ALIAS target \"" << exename e << "cannot create ALIAS target \"" << exename
<< "\" because target \"" << aliasedName << "\" is not an " << "\" because target \"" << aliasedName << "\" is not an "
"executable."; "executable.";
@ -187,7 +187,7 @@ bool cmAddExecutableCommand
} }
if(aliasedTarget->IsImported()) if(aliasedTarget->IsImported())
{ {
cmOStringStream e; std::ostringstream e;
e << "cannot create ALIAS target \"" << exename e << "cannot create ALIAS target \"" << exename
<< "\" because target \"" << aliasedName << "\" is IMPORTED."; << "\" because target \"" << aliasedName << "\" is IMPORTED.";
this->SetError(e.str()); this->SetError(e.str());
@ -203,7 +203,7 @@ bool cmAddExecutableCommand
// Make sure the target does not already exist. // Make sure the target does not already exist.
if(this->Makefile->FindTargetToUse(exename)) if(this->Makefile->FindTargetToUse(exename))
{ {
cmOStringStream e; std::ostringstream e;
e << "cannot create imported target \"" << exename e << "cannot create imported target \"" << exename
<< "\" because another target with the same name already exists."; << "\" because another target with the same name already exists.";
this->SetError(e.str()); this->SetError(e.str());

View File

@ -51,7 +51,7 @@ bool cmAddLibraryCommand
{ {
if (type == cmTarget::INTERFACE_LIBRARY) if (type == cmTarget::INTERFACE_LIBRARY)
{ {
cmOStringStream e; std::ostringstream e;
e << "INTERFACE library specified with conflicting STATIC type."; e << "INTERFACE library specified with conflicting STATIC type.";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -64,7 +64,7 @@ bool cmAddLibraryCommand
{ {
if (type == cmTarget::INTERFACE_LIBRARY) if (type == cmTarget::INTERFACE_LIBRARY)
{ {
cmOStringStream e; std::ostringstream e;
e << "INTERFACE library specified with conflicting SHARED type."; e << "INTERFACE library specified with conflicting SHARED type.";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -77,7 +77,7 @@ bool cmAddLibraryCommand
{ {
if (type == cmTarget::INTERFACE_LIBRARY) if (type == cmTarget::INTERFACE_LIBRARY)
{ {
cmOStringStream e; std::ostringstream e;
e << "INTERFACE library specified with conflicting MODULE type."; e << "INTERFACE library specified with conflicting MODULE type.";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -90,7 +90,7 @@ bool cmAddLibraryCommand
{ {
if (type == cmTarget::INTERFACE_LIBRARY) if (type == cmTarget::INTERFACE_LIBRARY)
{ {
cmOStringStream e; std::ostringstream e;
e << "INTERFACE library specified with conflicting OBJECT type."; e << "INTERFACE library specified with conflicting OBJECT type.";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -103,7 +103,7 @@ bool cmAddLibraryCommand
{ {
if (type == cmTarget::INTERFACE_LIBRARY) if (type == cmTarget::INTERFACE_LIBRARY)
{ {
cmOStringStream e; std::ostringstream e;
e << "INTERFACE library specified with conflicting UNKNOWN type."; e << "INTERFACE library specified with conflicting UNKNOWN type.";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -116,7 +116,7 @@ bool cmAddLibraryCommand
{ {
if (type == cmTarget::INTERFACE_LIBRARY) if (type == cmTarget::INTERFACE_LIBRARY)
{ {
cmOStringStream e; std::ostringstream e;
e << "INTERFACE library specified with conflicting ALIAS type."; e << "INTERFACE library specified with conflicting ALIAS type.";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -128,21 +128,21 @@ bool cmAddLibraryCommand
{ {
if (haveSpecifiedType) if (haveSpecifiedType)
{ {
cmOStringStream e; std::ostringstream e;
e << "INTERFACE library specified with conflicting/multiple types."; e << "INTERFACE library specified with conflicting/multiple types.";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
} }
if (isAlias) if (isAlias)
{ {
cmOStringStream e; std::ostringstream e;
e << "INTERFACE library specified with conflicting ALIAS type."; e << "INTERFACE library specified with conflicting ALIAS type.";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
} }
if (excludeFromAll) if (excludeFromAll)
{ {
cmOStringStream e; std::ostringstream e;
e << "INTERFACE library may not be used with EXCLUDE_FROM_ALL."; e << "INTERFACE library may not be used with EXCLUDE_FROM_ALL.";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -155,7 +155,7 @@ bool cmAddLibraryCommand
{ {
if (type == cmTarget::INTERFACE_LIBRARY) if (type == cmTarget::INTERFACE_LIBRARY)
{ {
cmOStringStream e; std::ostringstream e;
e << "INTERFACE library may not be used with EXCLUDE_FROM_ALL."; e << "INTERFACE library may not be used with EXCLUDE_FROM_ALL.";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -175,7 +175,7 @@ bool cmAddLibraryCommand
} }
else if(type == cmTarget::INTERFACE_LIBRARY && *s == "GLOBAL") else if(type == cmTarget::INTERFACE_LIBRARY && *s == "GLOBAL")
{ {
cmOStringStream e; std::ostringstream e;
e << "GLOBAL option may only be used with IMPORTED libraries."; e << "GLOBAL option may only be used with IMPORTED libraries.";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -190,14 +190,14 @@ bool cmAddLibraryCommand
{ {
if (s != args.end()) if (s != args.end())
{ {
cmOStringStream e; std::ostringstream e;
e << "INTERFACE library requires no source arguments."; e << "INTERFACE library requires no source arguments.";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
} }
if (importGlobal && !importTarget) if (importGlobal && !importTarget)
{ {
cmOStringStream e; std::ostringstream e;
e << "INTERFACE library specified as GLOBAL, but not as IMPORTED."; e << "INTERFACE library specified as GLOBAL, but not as IMPORTED.";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -214,7 +214,7 @@ bool cmAddLibraryCommand
if (!nameOk) if (!nameOk)
{ {
cmake::MessageType messageType = cmake::AUTHOR_WARNING; cmake::MessageType messageType = cmake::AUTHOR_WARNING;
cmOStringStream e; std::ostringstream e;
bool issueMessage = false; bool issueMessage = false;
switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0037)) switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0037))
{ {
@ -267,7 +267,7 @@ bool cmAddLibraryCommand
} }
if(args.size() != 3) if(args.size() != 3)
{ {
cmOStringStream e; std::ostringstream e;
e << "ALIAS requires exactly one target argument."; e << "ALIAS requires exactly one target argument.";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -276,7 +276,7 @@ bool cmAddLibraryCommand
const char *aliasedName = s->c_str(); const char *aliasedName = s->c_str();
if(this->Makefile->IsAlias(aliasedName)) if(this->Makefile->IsAlias(aliasedName))
{ {
cmOStringStream e; std::ostringstream e;
e << "cannot create ALIAS target \"" << libName e << "cannot create ALIAS target \"" << libName
<< "\" because target \"" << aliasedName << "\" is itself an ALIAS."; << "\" because target \"" << aliasedName << "\" is itself an ALIAS.";
this->SetError(e.str()); this->SetError(e.str());
@ -286,7 +286,7 @@ bool cmAddLibraryCommand
this->Makefile->FindTargetToUse(aliasedName, true); this->Makefile->FindTargetToUse(aliasedName, true);
if(!aliasedTarget) if(!aliasedTarget)
{ {
cmOStringStream e; std::ostringstream e;
e << "cannot create ALIAS target \"" << libName e << "cannot create ALIAS target \"" << libName
<< "\" because target \"" << aliasedName << "\" does not already " << "\" because target \"" << aliasedName << "\" does not already "
"exist."; "exist.";
@ -300,7 +300,7 @@ bool cmAddLibraryCommand
&& aliasedType != cmTarget::OBJECT_LIBRARY && aliasedType != cmTarget::OBJECT_LIBRARY
&& aliasedType != cmTarget::INTERFACE_LIBRARY) && aliasedType != cmTarget::INTERFACE_LIBRARY)
{ {
cmOStringStream e; std::ostringstream e;
e << "cannot create ALIAS target \"" << libName e << "cannot create ALIAS target \"" << libName
<< "\" because target \"" << aliasedName << "\" is not a library."; << "\" because target \"" << aliasedName << "\" is not a library.";
this->SetError(e.str()); this->SetError(e.str());
@ -308,7 +308,7 @@ bool cmAddLibraryCommand
} }
if(aliasedTarget->IsImported()) if(aliasedTarget->IsImported())
{ {
cmOStringStream e; std::ostringstream e;
e << "cannot create ALIAS target \"" << libName e << "cannot create ALIAS target \"" << libName
<< "\" because target \"" << aliasedName << "\" is IMPORTED."; << "\" because target \"" << aliasedName << "\" is IMPORTED.";
this->SetError(e.str()); this->SetError(e.str());
@ -333,7 +333,7 @@ bool cmAddLibraryCommand
(this->Makefile->GetCMakeInstance()->GetPropertyAsBool( (this->Makefile->GetCMakeInstance()->GetPropertyAsBool(
"TARGET_SUPPORTS_SHARED_LIBS") == false)) "TARGET_SUPPORTS_SHARED_LIBS") == false))
{ {
cmOStringStream w; std::ostringstream w;
w << w <<
"ADD_LIBRARY called with " << "ADD_LIBRARY called with " <<
(type==cmTarget::SHARED_LIBRARY ? "SHARED" : "MODULE") << (type==cmTarget::SHARED_LIBRARY ? "SHARED" : "MODULE") <<
@ -364,7 +364,7 @@ bool cmAddLibraryCommand
{ {
if (!cmGeneratorExpression::IsValidTargetName(libName)) if (!cmGeneratorExpression::IsValidTargetName(libName))
{ {
cmOStringStream e; std::ostringstream e;
e << "Invalid name for IMPORTED INTERFACE library target: " << libName; e << "Invalid name for IMPORTED INTERFACE library target: " << libName;
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -374,7 +374,7 @@ bool cmAddLibraryCommand
// Make sure the target does not already exist. // Make sure the target does not already exist.
if(this->Makefile->FindTargetToUse(libName)) if(this->Makefile->FindTargetToUse(libName))
{ {
cmOStringStream e; std::ostringstream e;
e << "cannot create imported target \"" << libName e << "cannot create imported target \"" << libName
<< "\" because another target with the same name already exists."; << "\" because another target with the same name already exists.";
this->SetError(e.str()); this->SetError(e.str());
@ -413,7 +413,7 @@ bool cmAddLibraryCommand
if (!cmGeneratorExpression::IsValidTargetName(libName) if (!cmGeneratorExpression::IsValidTargetName(libName)
|| libName.find("::") != std::string::npos) || libName.find("::") != std::string::npos)
{ {
cmOStringStream e; std::ostringstream e;
e << "Invalid name for INTERFACE library target: " << libName; e << "Invalid name for INTERFACE library target: " << libName;
this->SetError(e.str()); this->SetError(e.str());
return false; return false;

View File

@ -81,7 +81,7 @@ bool cmAddSubDirectoryCommand::InitialPass
if(!cmSystemTools::IsSubDirectory(srcPath, if(!cmSystemTools::IsSubDirectory(srcPath,
this->Makefile->GetCurrentDirectory())) this->Makefile->GetCurrentDirectory()))
{ {
cmOStringStream e; std::ostringstream e;
e << "not given a binary directory but the given source directory " e << "not given a binary directory but the given source directory "
<< "\"" << srcPath << "\" is not a subdirectory of \"" << "\"" << srcPath << "\" is not a subdirectory of \""
<< this->Makefile->GetCurrentDirectory() << "\". " << this->Makefile->GetCurrentDirectory() << "\". "

View File

@ -51,7 +51,7 @@ bool cmAddTestCommand
// allow it to be duplicated. // allow it to be duplicated.
if(!test->GetOldStyle()) if(!test->GetOldStyle())
{ {
cmOStringStream e; std::ostringstream e;
e << " given test name \"" << args[0] e << " given test name \"" << args[0]
<< "\" which already exists in this directory."; << "\" which already exists in this directory.";
this->SetError(e.str()); this->SetError(e.str());
@ -135,7 +135,7 @@ bool cmAddTestCommand::HandleNameMode(std::vector<std::string> const& args)
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << " given unknown argument:\n " << args[i] << "\n"; e << " given unknown argument:\n " << args[i] << "\n";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -159,7 +159,7 @@ bool cmAddTestCommand::HandleNameMode(std::vector<std::string> const& args)
// Require a unique test name within the directory. // Require a unique test name within the directory.
if(this->Makefile->GetTest(name)) if(this->Makefile->GetTest(name))
{ {
cmOStringStream e; std::ostringstream e;
e << " given test NAME \"" << name e << " given test NAME \"" << name
<< "\" which already exists in this directory."; << "\" which already exists in this directory.";
this->SetError(e.str()); this->SetError(e.str());

View File

@ -18,7 +18,7 @@ bool cmBreakCommand::InitialPass(std::vector<std::string> const &args,
if(!this->Makefile->IsLoopBlock()) if(!this->Makefile->IsLoopBlock())
{ {
bool issueMessage = true; bool issueMessage = true;
cmOStringStream e; std::ostringstream e;
cmake::MessageType messageType = cmake::AUTHOR_WARNING; cmake::MessageType messageType = cmake::AUTHOR_WARNING;
switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0055)) switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0055))
{ {
@ -53,7 +53,7 @@ bool cmBreakCommand::InitialPass(std::vector<std::string> const &args,
if(!args.empty()) if(!args.empty())
{ {
bool issueMessage = true; bool issueMessage = true;
cmOStringStream e; std::ostringstream e;
cmake::MessageType messageType = cmake::AUTHOR_WARNING; cmake::MessageType messageType = cmake::AUTHOR_WARNING;
switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0055)) switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0055))
{ {

View File

@ -78,7 +78,7 @@ bool cmBuildCommand
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "unknown argument \"" << args[i] << "\""; e << "unknown argument \"" << args[i] << "\"";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;

View File

@ -78,7 +78,7 @@ bool cmCMakeMinimumRequired
&required_major, &required_minor, &required_major, &required_minor,
&required_patch, &required_tweak) < 2) &required_patch, &required_tweak) < 2)
{ {
cmOStringStream e; std::ostringstream e;
e << "could not parse VERSION \"" << version_string << "\"."; e << "could not parse VERSION \"" << version_string << "\".";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -97,7 +97,7 @@ bool cmCMakeMinimumRequired
current_tweak < required_tweak)) current_tweak < required_tweak))
{ {
// The current version is too low. // The current version is too low.
cmOStringStream e; std::ostringstream e;
e << "CMake " << version_string e << "CMake " << version_string
<< " or higher is required. You are running version " << " or higher is required. You are running version "
<< cmVersion::GetCMakeVersion(); << cmVersion::GetCMakeVersion();
@ -132,7 +132,7 @@ bool cmCMakeMinimumRequired::EnforceUnknownArguments()
{ {
if(!this->UnknownArguments.empty()) if(!this->UnknownArguments.empty())
{ {
cmOStringStream e; std::ostringstream e;
e << "called with unknown argument \"" e << "called with unknown argument \""
<< this->UnknownArguments[0] << "\"."; << this->UnknownArguments[0] << "\".";
this->SetError(e.str()); this->SetError(e.str());

View File

@ -56,7 +56,7 @@ bool cmCMakePolicyCommand
return this->HandleVersionMode(args); return this->HandleVersionMode(args);
} }
cmOStringStream e; std::ostringstream e;
e << "given unknown first argument \"" << args[0] << "\""; e << "given unknown first argument \"" << args[0] << "\"";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -82,7 +82,7 @@ bool cmCMakePolicyCommand::HandleSetMode(std::vector<std::string> const& args)
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "SET given unrecognized policy status \"" << args[2] << "\""; e << "SET given unrecognized policy status \"" << args[2] << "\"";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -113,7 +113,7 @@ bool cmCMakePolicyCommand::HandleGetMode(std::vector<std::string> const& args)
cmPolicies::PolicyID pid; cmPolicies::PolicyID pid;
if(!this->Makefile->GetPolicies()->GetPolicyID(id.c_str(), pid)) if(!this->Makefile->GetPolicies()->GetPolicyID(id.c_str(), pid))
{ {
cmOStringStream e; std::ostringstream e;
e << "GET given policy \"" << id << "\" which is not known to this " e << "GET given policy \"" << id << "\" which is not known to this "
<< "version of CMake."; << "version of CMake.";
this->SetError(e.str()); this->SetError(e.str());
@ -140,7 +140,7 @@ bool cmCMakePolicyCommand::HandleGetMode(std::vector<std::string> const& args)
case cmPolicies::REQUIRED_ALWAYS: case cmPolicies::REQUIRED_ALWAYS:
// The policy is required to be set before anything needs it. // The policy is required to be set before anything needs it.
{ {
cmOStringStream e; std::ostringstream e;
e << this->Makefile->GetPolicies()->GetRequiredPolicyError(pid) e << this->Makefile->GetPolicies()->GetRequiredPolicyError(pid)
<< "\n" << "\n"
<< "The call to cmake_policy(GET " << id << " ...) at which this " << "The call to cmake_policy(GET " << id << " ...) at which this "

View File

@ -769,7 +769,7 @@ void CCONV cmSourceFileSetName(void *arg, const char* name, const char* dir,
} }
} }
cmOStringStream e; std::ostringstream e;
e << "Cannot find source file \"" << pathname << "\""; e << "Cannot find source file \"" << pathname << "\"";
e << "\n\nTried extensions"; e << "\n\nTried extensions";
for( std::vector<std::string>::const_iterator ext = sourceExts.begin(); for( std::vector<std::string>::const_iterator ext = sourceExts.begin();

View File

@ -240,7 +240,7 @@ int cmCTest::HTTPRequest(std::string url, HTTPMethod method,
//---------------------------------------------------------------------- //----------------------------------------------------------------------
std::string cmCTest::MakeURLSafe(const std::string& str) std::string cmCTest::MakeURLSafe(const std::string& str)
{ {
cmOStringStream ost; std::ostringstream ost;
char buffer[10]; char buffer[10];
for ( std::string::size_type pos = 0; pos < str.size(); pos ++ ) for ( std::string::size_type pos = 0; pos < str.size(); pos ++ )
{ {
@ -1302,7 +1302,7 @@ int cmCTest::RunTest(std::vector<const char*> argv,
inst.TimeOut = timeout; inst.TimeOut = timeout;
// Capture output of the child ctest. // Capture output of the child ctest.
cmOStringStream oss; std::ostringstream oss;
inst.SetStreams(&oss, &oss); inst.SetStreams(&oss, &oss);
std::vector<std::string> args; std::vector<std::string> args;
@ -1316,7 +1316,7 @@ int cmCTest::RunTest(std::vector<const char*> argv,
if (strcmp(argv[i],"--build-generator") == 0 && timeout > 0) if (strcmp(argv[i],"--build-generator") == 0 && timeout > 0)
{ {
args.push_back("--test-timeout"); args.push_back("--test-timeout");
cmOStringStream msg; std::ostringstream msg;
msg << timeout; msg << timeout;
args.push_back(msg.str()); args.push_back(msg.str());
} }

View File

@ -27,7 +27,7 @@ class cmCTestStartCommand;
#define cmCTestLog(ctSelf, logType, msg) \ #define cmCTestLog(ctSelf, logType, msg) \
do { \ do { \
cmOStringStream cmCTestLog_msg; \ std::ostringstream cmCTestLog_msg; \
cmCTestLog_msg << msg; \ cmCTestLog_msg << msg; \
(ctSelf)->Log(cmCTest::logType, __FILE__, __LINE__,\ (ctSelf)->Log(cmCTest::logType, __FILE__, __LINE__,\
cmCTestLog_msg.str().c_str());\ cmCTestLog_msg.str().c_str());\

View File

@ -103,7 +103,7 @@ char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key,
} }
return this->EmptyVariable; return this->EmptyVariable;
} }
cmOStringStream e; std::ostringstream e;
e << "Syntax $" << key << "{} is not supported. " e << "Syntax $" << key << "{} is not supported. "
<< "Only ${}, $ENV{}, and $CACHE{} are allowed."; << "Only ${}, $ENV{}, and $CACHE{} are allowed.";
this->SetError(e.str()); this->SetError(e.str());
@ -118,7 +118,7 @@ char* cmCommandArgumentParserHelper::ExpandVariable(const char* var)
} }
if(this->FileLine >= 0 && strcmp(var, "CMAKE_CURRENT_LIST_LINE") == 0) if(this->FileLine >= 0 && strcmp(var, "CMAKE_CURRENT_LIST_LINE") == 0)
{ {
cmOStringStream ostr; std::ostringstream ostr;
ostr << this->FileLine; ostr << this->FileLine;
return this->AddString(ostr.str()); return this->AddString(ostr.str());
} }
@ -136,7 +136,7 @@ char* cmCommandArgumentParserHelper::ExpandVariable(const char* var)
cmSystemTools::IsSubDirectory(this->FileName, cmSystemTools::IsSubDirectory(this->FileName,
this->Makefile->GetHomeOutputDirectory())) this->Makefile->GetHomeOutputDirectory()))
{ {
cmOStringStream msg; std::ostringstream msg;
cmListFileBacktrace bt(this->Makefile->GetLocalGenerator()); cmListFileBacktrace bt(this->Makefile->GetLocalGenerator());
cmListFileContext lfc; cmListFileContext lfc;
lfc.FilePath = this->FileName; lfc.FilePath = this->FileName;
@ -253,7 +253,7 @@ bool cmCommandArgumentParserHelper::HandleEscapeSymbol
break; break;
default: default:
{ {
cmOStringStream e; std::ostringstream e;
e << "Invalid escape sequence \\" << symbol; e << "Invalid escape sequence \\" << symbol;
this->SetError(e.str()); this->SetError(e.str());
} }
@ -335,7 +335,7 @@ int cmCommandArgumentParserHelper::LexInput(char* buf, int maxlen)
void cmCommandArgumentParserHelper::Error(const char* str) void cmCommandArgumentParserHelper::Error(const char* str)
{ {
unsigned long pos = static_cast<unsigned long>(this->InputBufferPos); unsigned long pos = static_cast<unsigned long>(this->InputBufferPos);
cmOStringStream ostr; std::ostringstream ostr;
ostr << str << " (" << pos << ")"; ostr << str << " (" << pos << ")";
this->SetError(ostr.str()); this->SetError(ostr.str());
} }

View File

@ -710,7 +710,7 @@ void cmComputeLinkDepends::CleanConstraintGraph()
void cmComputeLinkDepends::DisplayConstraintGraph() void cmComputeLinkDepends::DisplayConstraintGraph()
{ {
// Display the graph nodes and their edges. // Display the graph nodes and their edges.
cmOStringStream e; std::ostringstream e;
for(unsigned int i=0; i < this->EntryConstraintGraph.size(); ++i) for(unsigned int i=0; i < this->EntryConstraintGraph.size(); ++i)
{ {
EdgeList const& nl = this->EntryConstraintGraph[i]; EdgeList const& nl = this->EntryConstraintGraph[i];

View File

@ -1342,7 +1342,7 @@ void cmComputeLinkInformation::AddFrameworkItem(std::string const& item)
// Try to separate the framework name and path. // Try to separate the framework name and path.
if(!this->SplitFramework.find(item.c_str())) if(!this->SplitFramework.find(item.c_str()))
{ {
cmOStringStream e; std::ostringstream e;
e << "Could not parse framework path \"" << item << "\" " e << "Could not parse framework path \"" << item << "\" "
<< "linked by target " << this->Target->GetName() << "."; << "linked by target " << this->Target->GetName() << ".";
cmSystemTools::Error(e.str().c_str()); cmSystemTools::Error(e.str().c_str());
@ -1389,7 +1389,7 @@ void cmComputeLinkInformation::DropDirectoryItem(std::string const& item)
{ {
// A full path to a directory was found as a link item. Warn the // A full path to a directory was found as a link item. Warn the
// user. // user.
cmOStringStream e; std::ostringstream e;
e << "WARNING: Target \"" << this->Target->GetName() e << "WARNING: Target \"" << this->Target->GetName()
<< "\" requests linking to directory \"" << item << "\". " << "\" requests linking to directory \"" << item << "\". "
<< "Targets may link only to libraries. " << "Targets may link only to libraries. "
@ -1505,7 +1505,7 @@ void cmComputeLinkInformation::HandleBadFullItem(std::string const& item,
if(!this->CMakeInstance->GetPropertyAsBool(wid)) if(!this->CMakeInstance->GetPropertyAsBool(wid))
{ {
this->CMakeInstance->SetProperty(wid, "1"); this->CMakeInstance->SetProperty(wid, "1");
cmOStringStream w; std::ostringstream w;
w << (this->Makefile->GetPolicies() w << (this->Makefile->GetPolicies()
->GetPolicyWarning(cmPolicies::CMP0008)) << "\n" ->GetPolicyWarning(cmPolicies::CMP0008)) << "\n"
<< "Target \"" << this->Target->GetName() << "\" links to item\n" << "Target \"" << this->Target->GetName() << "\" links to item\n"
@ -1524,7 +1524,7 @@ void cmComputeLinkInformation::HandleBadFullItem(std::string const& item,
case cmPolicies::REQUIRED_IF_USED: case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::REQUIRED_ALWAYS: case cmPolicies::REQUIRED_ALWAYS:
{ {
cmOStringStream e; std::ostringstream e;
e << (this->Makefile->GetPolicies()-> e << (this->Makefile->GetPolicies()->
GetRequiredPolicyError(cmPolicies::CMP0008)) << "\n" GetRequiredPolicyError(cmPolicies::CMP0008)) << "\n"
<< "Target \"" << this->Target->GetName() << "\" links to item\n" << "Target \"" << this->Target->GetName() << "\" links to item\n"
@ -1554,7 +1554,7 @@ bool cmComputeLinkInformation::FinishLinkerSearchDirectories()
if(!this->CMakeInstance->GetPropertyAsBool("CMP0003-WARNING-GIVEN")) if(!this->CMakeInstance->GetPropertyAsBool("CMP0003-WARNING-GIVEN"))
{ {
this->CMakeInstance->SetProperty("CMP0003-WARNING-GIVEN", "1"); this->CMakeInstance->SetProperty("CMP0003-WARNING-GIVEN", "1");
cmOStringStream w; std::ostringstream w;
this->PrintLinkPolicyDiagnosis(w); this->PrintLinkPolicyDiagnosis(w);
this->CMakeInstance->IssueMessage(cmake::AUTHOR_WARNING, w.str(), this->CMakeInstance->IssueMessage(cmake::AUTHOR_WARNING, w.str(),
this->Target->GetBacktrace()); this->Target->GetBacktrace());
@ -1569,7 +1569,7 @@ bool cmComputeLinkInformation::FinishLinkerSearchDirectories()
case cmPolicies::REQUIRED_IF_USED: case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::REQUIRED_ALWAYS: case cmPolicies::REQUIRED_ALWAYS:
{ {
cmOStringStream e; std::ostringstream e;
e << (this->Makefile->GetPolicies()-> e << (this->Makefile->GetPolicies()->
GetRequiredPolicyError(cmPolicies::CMP0003)) << "\n"; GetRequiredPolicyError(cmPolicies::CMP0003)) << "\n";
this->PrintLinkPolicyDiagnosis(e); this->PrintLinkPolicyDiagnosis(e);

View File

@ -361,7 +361,7 @@ void cmComputeTargetDepends::AddTargetDepend(
cmMakefile *makefile = depender->GetMakefile(); cmMakefile *makefile = depender->GetMakefile();
cmake::MessageType messageType = cmake::AUTHOR_WARNING; cmake::MessageType messageType = cmake::AUTHOR_WARNING;
bool issueMessage = false; bool issueMessage = false;
cmOStringStream e; std::ostringstream e;
switch(depender->GetPolicyStatusCMP0046()) switch(depender->GetPolicyStatusCMP0046())
{ {
case cmPolicies::WARN: case cmPolicies::WARN:
@ -539,7 +539,7 @@ cmComputeTargetDepends
bool strong) bool strong)
{ {
// Construct the error message. // Construct the error message.
cmOStringStream e; std::ostringstream e;
e << "The inter-target dependency graph contains the following " e << "The inter-target dependency graph contains the following "
<< "strongly connected component (cycle):\n"; << "strongly connected component (cycle):\n";
std::vector<NodeList> const& components = ccg.GetComponents(); std::vector<NodeList> const& components = ccg.GetComponents();

View File

@ -119,7 +119,7 @@ const char* cmConditionEvaluator::GetDefinitionIfUnquoted(
if(!hasBeenReported) if(!hasBeenReported)
{ {
cmOStringStream e; std::ostringstream e;
e << (this->Makefile.GetPolicies()->GetPolicyWarning( e << (this->Makefile.GetPolicies()->GetPolicyWarning(
cmPolicies::CMP0054)) << "\n"; cmPolicies::CMP0054)) << "\n";
e << "Quoted variables like \"" << argument.GetValue() << e << "Quoted variables like \"" << argument.GetValue() <<
@ -169,7 +169,7 @@ bool cmConditionEvaluator::IsKeyword(std::string const& keyword,
if(!hasBeenReported) if(!hasBeenReported)
{ {
cmOStringStream e; std::ostringstream e;
e << (this->Makefile.GetPolicies()->GetPolicyWarning( e << (this->Makefile.GetPolicies()->GetPolicyWarning(
cmPolicies::CMP0054)) << "\n"; cmPolicies::CMP0054)) << "\n";
e << "Quoted keywords like \"" << argument.GetValue() << e << "Quoted keywords like \"" << argument.GetValue() <<
@ -559,7 +559,7 @@ bool cmConditionEvaluator::HandleLevel2(cmArgumentList &newArgs,
cmsys::RegularExpression regEntry; cmsys::RegularExpression regEntry;
if ( !regEntry.compile(rex) ) if ( !regEntry.compile(rex) )
{ {
cmOStringStream error; std::ostringstream error;
error << "Regular expression \"" << rex << "\" cannot compile"; error << "Regular expression \"" << rex << "\" cannot compile";
errorString = error.str(); errorString = error.str();
status = cmake::FATAL_ERROR; status = cmake::FATAL_ERROR;

View File

@ -34,7 +34,7 @@ bool cmConfigureFileCommand
// If the input location is a directory, error out. // If the input location is a directory, error out.
if(cmSystemTools::FileIsDirectory(this->InputFile)) if(cmSystemTools::FileIsDirectory(this->InputFile))
{ {
cmOStringStream e; std::ostringstream e;
e << "input location\n" e << "input location\n"
<< " " << this->InputFile << "\n" << " " << this->InputFile << "\n"
<< "is a directory but a file was expected."; << "is a directory but a file was expected.";

View File

@ -150,7 +150,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
} }
else else
{ {
cmOStringStream m; std::ostringstream m;
m << "try_compile given unknown argument \"" << argv[i] << "\"."; m << "try_compile given unknown argument \"" << argv[i] << "\".";
this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, m.str()); this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, m.str());
} }
@ -220,7 +220,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
// do not allow recursive try Compiles // do not allow recursive try Compiles
if (this->BinaryDirectory == this->Makefile->GetHomeOutputDirectory()) if (this->BinaryDirectory == this->Makefile->GetHomeOutputDirectory())
{ {
cmOStringStream e; std::ostringstream e;
e << "Attempt at a recursive or nested TRY_COMPILE in directory\n" e << "Attempt at a recursive or nested TRY_COMPILE in directory\n"
<< " " << this->BinaryDirectory << "\n"; << " " << this->BinaryDirectory << "\n";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
@ -256,7 +256,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
} }
else else
{ {
cmOStringStream err; std::ostringstream err;
err << "Unknown extension \"" << ext << "\" for file\n" err << "Unknown extension \"" << ext << "\" for file\n"
<< " " << *si << "\n" << " " << *si << "\n"
<< "try_compile() works only for enabled languages. " << "try_compile() works only for enabled languages. "
@ -282,7 +282,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
FILE *fout = cmsys::SystemTools::Fopen(outFileName,"w"); FILE *fout = cmsys::SystemTools::Fopen(outFileName,"w");
if (!fout) if (!fout)
{ {
cmOStringStream e; std::ostringstream e;
e << "Failed to open\n" e << "Failed to open\n"
<< " " << outFileName << "\n" << " " << outFileName << "\n"
<< cmSystemTools::GetLastSystemError(); << cmSystemTools::GetLastSystemError();
@ -337,7 +337,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
if(this->Makefile->PolicyOptionalWarningEnabled( if(this->Makefile->PolicyOptionalWarningEnabled(
"CMAKE_POLICY_WARNING_CMP0056")) "CMAKE_POLICY_WARNING_CMP0056"))
{ {
cmOStringStream w; std::ostringstream w;
w << (this->Makefile->GetCMakeInstance()->GetPolicies() w << (this->Makefile->GetCMakeInstance()->GetPolicies()
->GetPolicyWarning(cmPolicies::CMP0056)) << "\n" ->GetPolicyWarning(cmPolicies::CMP0056)) << "\n"
"For compatibility with older versions of CMake, try_compile " "For compatibility with older versions of CMake, try_compile "
@ -553,7 +553,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
!cmSystemTools::CopyFileAlways(this->OutputFile, !cmSystemTools::CopyFileAlways(this->OutputFile,
copyFile)) copyFile))
{ {
cmOStringStream emsg; std::ostringstream emsg;
emsg << "Cannot copy output executable\n" emsg << "Cannot copy output executable\n"
<< " '" << this->OutputFile << "'\n" << " '" << this->OutputFile << "'\n"
<< "to destination specified by COPY_FILE:\n" << "to destination specified by COPY_FILE:\n"
@ -691,7 +691,7 @@ void cmCoreTryCompile::FindOutputFile(const std::string& targetName)
} }
} }
cmOStringStream emsg; std::ostringstream emsg;
emsg << "Unable to find the executable at any of:\n"; emsg << "Unable to find the executable at any of:\n";
for (unsigned int i = 0; i < searchDirs.size(); ++i) for (unsigned int i = 0; i < searchDirs.size(); ++i)
{ {

View File

@ -53,7 +53,7 @@ bool cmDefinePropertyCommand
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "given invalid scope " << args[0] << ". " e << "given invalid scope " << args[0] << ". "
<< "Valid scopes are " << "Valid scopes are "
<< "GLOBAL, DIRECTORY, TARGET, SOURCE, " << "GLOBAL, DIRECTORY, TARGET, SOURCE, "
@ -100,7 +100,7 @@ bool cmDefinePropertyCommand
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "given invalid argument \"" << args[i] << "\"."; e << "given invalid argument \"" << args[i] << "\".";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;

View File

@ -123,7 +123,7 @@ void cmDepends::Clear(const char *file)
// Print verbose output. // Print verbose output.
if(this->Verbose) if(this->Verbose)
{ {
cmOStringStream msg; std::ostringstream msg;
msg << "Clearing dependencies in \"" << file << "\"." << std::endl; msg << "Clearing dependencies in \"" << file << "\"." << std::endl;
cmSystemTools::Stdout(msg.str().c_str()); cmSystemTools::Stdout(msg.str().c_str());
} }
@ -213,7 +213,7 @@ bool cmDepends::CheckDependencies(std::istream& internalDepends,
// Print verbose output. // Print verbose output.
if(this->Verbose) if(this->Verbose)
{ {
cmOStringStream msg; std::ostringstream msg;
msg << "Dependee \"" << dependee msg << "Dependee \"" << dependee
<< "\" does not exist for depender \"" << "\" does not exist for depender \""
<< depender << "\"." << std::endl; << depender << "\"." << std::endl;
@ -235,7 +235,7 @@ bool cmDepends::CheckDependencies(std::istream& internalDepends,
// Print verbose output. // Print verbose output.
if(this->Verbose) if(this->Verbose)
{ {
cmOStringStream msg; std::ostringstream msg;
msg << "Dependee \"" << dependee msg << "Dependee \"" << dependee
<< "\" is newer than depender \"" << "\" is newer than depender \""
<< depender << "\"." << std::endl; << depender << "\"." << std::endl;
@ -257,7 +257,7 @@ bool cmDepends::CheckDependencies(std::istream& internalDepends,
// Print verbose output. // Print verbose output.
if(this->Verbose) if(this->Verbose)
{ {
cmOStringStream msg; std::ostringstream msg;
msg << "Dependee \"" << dependee msg << "Dependee \"" << dependee
<< "\" is newer than depends file \"" << "\" is newer than depends file \""
<< internalDependsFileName << "\"." << std::endl; << internalDependsFileName << "\"." << std::endl;

View File

@ -532,7 +532,7 @@ cmELFInternalImpl<Types>
break; break;
} }
#endif #endif
cmOStringStream e; std::ostringstream e;
e << "Unknown ELF file type " << eti; e << "Unknown ELF file type " << eti;
this->SetErrorMessage(e.str().c_str()); this->SetErrorMessage(e.str().c_str());
return; return;

View File

@ -189,7 +189,7 @@ bool cmExecuteProcessCommand
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << " given unknown argument \"" << args[i] << "\"."; e << " given unknown argument \"" << args[i] << "\".";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;

View File

@ -45,7 +45,7 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "given target \"" << te->GetName() << "\" more than once."; e << "given target \"" << te->GetName() << "\" more than once.";
this->Makefile->GetCMakeInstance() this->Makefile->GetCMakeInstance()
->IssueMessage(cmake::FATAL_ERROR, e.str(), this->Backtrace); ->IssueMessage(cmake::FATAL_ERROR, e.str(), this->Backtrace);
@ -70,7 +70,7 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
cmTarget* te = *tei; cmTarget* te = *tei;
if (te->GetProperty("INTERFACE_SOURCES")) if (te->GetProperty("INTERFACE_SOURCES"))
{ {
cmOStringStream e; std::ostringstream e;
e << "Target \"" e << "Target \""
<< te->GetName() << te->GetName()
<< "\" has a populated INTERFACE_SOURCES property. This is not " << "\" has a populated INTERFACE_SOURCES property. This is not "
@ -313,7 +313,7 @@ cmExportBuildFileGenerator
return; return;
} }
cmOStringStream e; std::ostringstream e;
e << "export called with target \"" << depender->GetName() e << "export called with target \"" << depender->GetName()
<< "\" which requires target \"" << dependee->GetName() << "\" "; << "\" which requires target \"" << dependee->GetName() << "\" ";
if (occurrences == 0) if (occurrences == 0)

View File

@ -89,7 +89,7 @@ bool cmExportCommand
if(cmSystemTools::GetFilenameLastExtension(this->Filename.GetCString()) if(cmSystemTools::GetFilenameLastExtension(this->Filename.GetCString())
!= ".cmake") != ".cmake")
{ {
cmOStringStream e; std::ostringstream e;
e << "FILE option given filename \"" << this->Filename.GetString() e << "FILE option given filename \"" << this->Filename.GetString()
<< "\" which does not have an extension of \".cmake\".\n"; << "\" which does not have an extension of \".cmake\".\n";
this->SetError(e.str()); this->SetError(e.str());
@ -103,7 +103,7 @@ bool cmExportCommand
{ {
if(!this->Makefile->CanIWriteThisFile(fname.c_str())) if(!this->Makefile->CanIWriteThisFile(fname.c_str()))
{ {
cmOStringStream e; std::ostringstream e;
e << "FILE option given filename \"" << fname e << "FILE option given filename \"" << fname
<< "\" which is in the source tree.\n"; << "\" which is in the source tree.\n";
this->SetError(e.str()); this->SetError(e.str());
@ -126,7 +126,7 @@ bool cmExportCommand
{ {
if (this->Append.IsEnabled()) if (this->Append.IsEnabled())
{ {
cmOStringStream e; std::ostringstream e;
e << "EXPORT signature does not recognise the APPEND option."; e << "EXPORT signature does not recognise the APPEND option.";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -134,7 +134,7 @@ bool cmExportCommand
if (this->ExportOld.IsEnabled()) if (this->ExportOld.IsEnabled())
{ {
cmOStringStream e; std::ostringstream e;
e << "EXPORT signature does not recognise the " e << "EXPORT signature does not recognise the "
"EXPORT_LINK_INTERFACE_LIBRARIES option."; "EXPORT_LINK_INTERFACE_LIBRARIES option.";
this->SetError(e.str()); this->SetError(e.str());
@ -145,7 +145,7 @@ bool cmExportCommand
std::string setName = this->ExportSetName.GetString(); std::string setName = this->ExportSetName.GetString();
if (setMap.find(setName) == setMap.end()) if (setMap.find(setName) == setMap.end())
{ {
cmOStringStream e; std::ostringstream e;
e << "Export set \"" << setName << "\" not found."; e << "Export set \"" << setName << "\" not found.";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -161,7 +161,7 @@ bool cmExportCommand
{ {
if (this->Makefile->IsAlias(*currentTarget)) if (this->Makefile->IsAlias(*currentTarget))
{ {
cmOStringStream e; std::ostringstream e;
e << "given ALIAS target \"" << *currentTarget e << "given ALIAS target \"" << *currentTarget
<< "\" which may not be exported."; << "\" which may not be exported.";
this->SetError(e.str()); this->SetError(e.str());
@ -172,7 +172,7 @@ bool cmExportCommand
{ {
if(target->GetType() == cmTarget::OBJECT_LIBRARY) if(target->GetType() == cmTarget::OBJECT_LIBRARY)
{ {
cmOStringStream e; std::ostringstream e;
e << "given OBJECT library \"" << *currentTarget e << "given OBJECT library \"" << *currentTarget
<< "\" which may not be exported."; << "\" which may not be exported.";
this->SetError(e.str()); this->SetError(e.str());
@ -181,7 +181,7 @@ bool cmExportCommand
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "given target \"" << *currentTarget e << "given target \"" << *currentTarget
<< "\" which is not built by this project."; << "\" which is not built by this project.";
this->SetError(e.str()); this->SetError(e.str());
@ -261,7 +261,7 @@ bool cmExportCommand::HandlePackage(std::vector<std::string> const& args)
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "PACKAGE given unknown argument: " << args[i]; e << "PACKAGE given unknown argument: " << args[i];
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -278,7 +278,7 @@ bool cmExportCommand::HandlePackage(std::vector<std::string> const& args)
cmsys::RegularExpression packageRegex(packageExpr); cmsys::RegularExpression packageRegex(packageExpr);
if(!packageRegex.find(package.c_str())) if(!packageRegex.find(package.c_str()))
{ {
cmOStringStream e; std::ostringstream e;
e << "PACKAGE given invalid package name \"" << package << "\". " e << "PACKAGE given invalid package name \"" << package << "\". "
<< "Package names must match \"" << packageExpr << "\"."; << "Package names must match \"" << packageExpr << "\".";
this->SetError(e.str()); this->SetError(e.str());
@ -314,7 +314,7 @@ void cmExportCommand::ReportRegistryError(std::string const& msg,
std::string const& key, std::string const& key,
long err) long err)
{ {
cmOStringStream e; std::ostringstream e;
e << msg << "\n" e << msg << "\n"
<< " HKEY_CURRENT_USER\\" << key << "\n"; << " HKEY_CURRENT_USER\\" << key << "\n";
wchar_t winmsg[1024]; wchar_t winmsg[1024];
@ -355,7 +355,7 @@ void cmExportCommand::StorePackageRegistryWin(std::string const& package,
RegCloseKey(hKey); RegCloseKey(hKey);
if(err != ERROR_SUCCESS) if(err != ERROR_SUCCESS)
{ {
cmOStringStream msg; std::ostringstream msg;
msg << "Cannot set registry value \"" << hash << "\" under key"; msg << "Cannot set registry value \"" << hash << "\" under key";
this->ReportRegistryError(msg.str(), key, err); this->ReportRegistryError(msg.str(), key, err);
return; return;
@ -400,7 +400,7 @@ void cmExportCommand::StorePackageRegistryDir(std::string const& package,
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "Cannot create package registry file:\n" e << "Cannot create package registry file:\n"
<< " " << fname << "\n" << " " << fname << "\n"
<< cmSystemTools::GetLastSystemError() << "\n"; << cmSystemTools::GetLastSystemError() << "\n";

View File

@ -81,7 +81,7 @@ bool cmExportFileGenerator::GenerateImportFile()
if(!foutPtr.get() || !*foutPtr) if(!foutPtr.get() || !*foutPtr)
{ {
std::string se = cmSystemTools::GetLastSystemError(); std::string se = cmSystemTools::GetLastSystemError();
cmOStringStream e; std::ostringstream e;
e << "cannot write to file \"" << this->MainImportFile e << "cannot write to file \"" << this->MainImportFile
<< "\": " << se; << "\": " << se;
cmSystemTools::Error(e.str().c_str()); cmSystemTools::Error(e.str().c_str());
@ -247,7 +247,7 @@ static bool checkInterfaceDirs(const std::string &prepro,
continue; continue;
} }
cmake::MessageType messageType = cmake::FATAL_ERROR; cmake::MessageType messageType = cmake::FATAL_ERROR;
cmOStringStream e; std::ostringstream e;
if (genexPos != std::string::npos) if (genexPos != std::string::npos)
{ {
switch (target->GetPolicyStatusCMP0041()) switch (target->GetPolicyStatusCMP0041())
@ -295,7 +295,7 @@ static bool checkInterfaceDirs(const std::string &prepro,
{ {
case cmPolicies::WARN: case cmPolicies::WARN:
{ {
cmOStringStream s; std::ostringstream s;
s << target->GetMakefile()->GetPolicies() s << target->GetMakefile()->GetPolicies()
->GetPolicyWarning(cmPolicies::CMP0052) << "\n"; ->GetPolicyWarning(cmPolicies::CMP0052) << "\n";
s << "Directory:\n \"" << *li << "\"\nin " s << "Directory:\n \"" << *li << "\"\nin "
@ -391,7 +391,7 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface(
if (cge->GetHadContextSensitiveCondition()) if (cge->GetHadContextSensitiveCondition())
{ {
cmMakefile* mf = target->GetMakefile(); cmMakefile* mf = target->GetMakefile();
cmOStringStream e; std::ostringstream e;
e << "Target \"" << target->GetName() << "\" is installed with " e << "Target \"" << target->GetName() << "\" is installed with "
"INCLUDES DESTINATION set to a context sensitive path. Paths which " "INCLUDES DESTINATION set to a context sensitive path. Paths which "
"depend on the configuration, policy values or the link interface are " "depend on the configuration, policy values or the link interface are "
@ -473,7 +473,7 @@ void getCompatibleInterfaceProperties(cmTarget *target,
if (!info) if (!info)
{ {
cmMakefile* mf = target->GetMakefile(); cmMakefile* mf = target->GetMakefile();
cmOStringStream e; std::ostringstream e;
e << "Exporting the target \"" << target->GetName() << "\" is not " e << "Exporting the target \"" << target->GetName() << "\" is not "
"allowed since its linker language cannot be determined"; "allowed since its linker language cannot be determined";
mf->IssueMessage(cmake::FATAL_ERROR, e.str()); mf->IssueMessage(cmake::FATAL_ERROR, e.str());
@ -773,7 +773,7 @@ cmExportFileGenerator
if(newCMP0022Behavior && !this->ExportOld) if(newCMP0022Behavior && !this->ExportOld)
{ {
cmMakefile *mf = target->GetMakefile(); cmMakefile *mf = target->GetMakefile();
cmOStringStream e; std::ostringstream e;
e << "Target \"" << target->GetName() << "\" has policy CMP0022 enabled, " e << "Target \"" << target->GetName() << "\" has policy CMP0022 enabled, "
"but also has old-style LINK_INTERFACE_LIBRARIES properties " "but also has old-style LINK_INTERFACE_LIBRARIES properties "
"populated, but it was exported without the " "populated, but it was exported without the "
@ -857,7 +857,7 @@ cmExportFileGenerator
{ {
std::string prop = "IMPORTED_LINK_INTERFACE_MULTIPLICITY"; std::string prop = "IMPORTED_LINK_INTERFACE_MULTIPLICITY";
prop += suffix; prop += suffix;
cmOStringStream m; std::ostringstream m;
m << iface->Multiplicity; m << iface->Multiplicity;
properties[prop] = m.str(); properties[prop] = m.str();
} }

View File

@ -56,7 +56,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "install(EXPORT \"" e << "install(EXPORT \""
<< this->IEGen->GetExportSet()->GetName() << this->IEGen->GetExportSet()->GetName()
<< "\" ...) " << "includes target \"" << te->Target->GetName() << "\" ...) " << "includes target \"" << te->Target->GetName()
@ -133,7 +133,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
if (te->GetProperty("INTERFACE_SOURCES")) if (te->GetProperty("INTERFACE_SOURCES"))
{ {
cmOStringStream e; std::ostringstream e;
e << "Target \"" e << "Target \""
<< te->GetName() << te->GetName()
<< "\" has a populated INTERFACE_SOURCES property. This is not " << "\" has a populated INTERFACE_SOURCES property. This is not "
@ -290,7 +290,7 @@ cmExportInstallFileGenerator::GenerateImportFileConfig(
if(!exportFileStream) if(!exportFileStream)
{ {
std::string se = cmSystemTools::GetLastSystemError(); std::string se = cmSystemTools::GetLastSystemError();
cmOStringStream e; std::ostringstream e;
e << "cannot write to file \"" << fileName e << "cannot write to file \"" << fileName
<< "\": " << se; << "\": " << se;
cmSystemTools::Error(e.str().c_str()); cmSystemTools::Error(e.str().c_str());
@ -516,7 +516,7 @@ cmExportInstallFileGenerator
cmTarget* dependee, cmTarget* dependee,
int occurrences) int occurrences)
{ {
cmOStringStream e; std::ostringstream e;
e << "install(EXPORT \"" e << "install(EXPORT \""
<< this->IEGen->GetExportSet()->GetName() << this->IEGen->GetExportSet()->GetName()
<< "\" ...) " << "\" ...) "

View File

@ -99,7 +99,7 @@ int cmExprParserHelper::LexInput(char* buf, int maxlen)
void cmExprParserHelper::Error(const char* str) void cmExprParserHelper::Error(const char* str)
{ {
unsigned long pos = static_cast<unsigned long>(this->InputBufferPos); unsigned long pos = static_cast<unsigned long>(this->InputBufferPos);
cmOStringStream ostr; std::ostringstream ostr;
ostr << str << " (" << pos << ")"; ostr << str << " (" << pos << ")";
this->ErrorString = ostr.str(); this->ErrorString = ostr.str();
} }

View File

@ -454,7 +454,7 @@ cmExtraCodeLiteGenerator::GetBuildCommand(const cmMakefile* mf) const
else if ( generator == "MinGW Makefiles" || else if ( generator == "MinGW Makefiles" ||
generator == "Unix Makefiles" ) generator == "Unix Makefiles" )
{ {
cmOStringStream ss; std::ostringstream ss;
ss << make << " -j " << this->CpuCount; ss << make << " -j " << this->CpuCount;
buildCommand = ss.str(); buildCommand = ss.str();
} }
@ -482,7 +482,7 @@ cmExtraCodeLiteGenerator::GetSingleFileBuildCommand
std::string generator = mf->GetSafeDefinition("CMAKE_GENERATOR"); std::string generator = mf->GetSafeDefinition("CMAKE_GENERATOR");
if ( generator == "Unix Makefiles" || generator == "MinGW Makefiles" ) if ( generator == "Unix Makefiles" || generator == "MinGW Makefiles" )
{ {
cmOStringStream ss; std::ostringstream ss;
ss << make << " -f$(ProjectPath)/Makefile $(CurrentFileName).cpp.o"; ss << make << " -f$(ProjectPath)/Makefile $(CurrentFileName).cpp.o";
buildCommand = ss.str(); buildCommand = ss.str();
} }

View File

@ -404,7 +404,7 @@ bool cmFileCommand::HandleHashCommand(std::vector<std::string> const& args)
#if defined(CMAKE_BUILD_WITH_CMAKE) #if defined(CMAKE_BUILD_WITH_CMAKE)
if(args.size() != 3) if(args.size() != 3)
{ {
cmOStringStream e; std::ostringstream e;
e << args[0] << " requires a file name and output variable"; e << args[0] << " requires a file name and output variable";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -419,14 +419,14 @@ bool cmFileCommand::HandleHashCommand(std::vector<std::string> const& args)
this->Makefile->AddDefinition(args[2], out.c_str()); this->Makefile->AddDefinition(args[2], out.c_str());
return true; return true;
} }
cmOStringStream e; std::ostringstream e;
e << args[0] << " failed to read file \"" << args[1] << "\": " e << args[0] << " failed to read file \"" << args[1] << "\": "
<< cmSystemTools::GetLastSystemError(); << cmSystemTools::GetLastSystemError();
this->SetError(e.str()); this->SetError(e.str());
} }
return false; return false;
#else #else
cmOStringStream e; std::ostringstream e;
e << args[0] << " not available during bootstrap"; e << args[0] << " not available during bootstrap";
this->SetError(e.str().c_str()); this->SetError(e.str().c_str());
return false; return false;
@ -519,7 +519,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
if(sscanf(args[i].c_str(), "%d", &limit_input) != 1 || if(sscanf(args[i].c_str(), "%d", &limit_input) != 1 ||
limit_input < 0) limit_input < 0)
{ {
cmOStringStream e; std::ostringstream e;
e << "STRINGS option LIMIT_INPUT value \"" e << "STRINGS option LIMIT_INPUT value \""
<< args[i] << "\" is not an unsigned integer."; << args[i] << "\" is not an unsigned integer.";
this->SetError(e.str()); this->SetError(e.str());
@ -532,7 +532,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
if(sscanf(args[i].c_str(), "%d", &limit_output) != 1 || if(sscanf(args[i].c_str(), "%d", &limit_output) != 1 ||
limit_output < 0) limit_output < 0)
{ {
cmOStringStream e; std::ostringstream e;
e << "STRINGS option LIMIT_OUTPUT value \"" e << "STRINGS option LIMIT_OUTPUT value \""
<< args[i] << "\" is not an unsigned integer."; << args[i] << "\" is not an unsigned integer.";
this->SetError(e.str()); this->SetError(e.str());
@ -545,7 +545,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
int count; int count;
if(sscanf(args[i].c_str(), "%d", &count) != 1 || count < 0) if(sscanf(args[i].c_str(), "%d", &count) != 1 || count < 0)
{ {
cmOStringStream e; std::ostringstream e;
e << "STRINGS option LIMIT_COUNT value \"" e << "STRINGS option LIMIT_COUNT value \""
<< args[i] << "\" is not an unsigned integer."; << args[i] << "\" is not an unsigned integer.";
this->SetError(e.str()); this->SetError(e.str());
@ -559,7 +559,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
int len; int len;
if(sscanf(args[i].c_str(), "%d", &len) != 1 || len < 0) if(sscanf(args[i].c_str(), "%d", &len) != 1 || len < 0)
{ {
cmOStringStream e; std::ostringstream e;
e << "STRINGS option LENGTH_MINIMUM value \"" e << "STRINGS option LENGTH_MINIMUM value \""
<< args[i] << "\" is not an unsigned integer."; << args[i] << "\" is not an unsigned integer.";
this->SetError(e.str()); this->SetError(e.str());
@ -573,7 +573,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
int len; int len;
if(sscanf(args[i].c_str(), "%d", &len) != 1 || len < 0) if(sscanf(args[i].c_str(), "%d", &len) != 1 || len < 0)
{ {
cmOStringStream e; std::ostringstream e;
e << "STRINGS option LENGTH_MAXIMUM value \"" e << "STRINGS option LENGTH_MAXIMUM value \""
<< args[i] << "\" is not an unsigned integer."; << args[i] << "\" is not an unsigned integer.";
this->SetError(e.str()); this->SetError(e.str());
@ -586,7 +586,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
{ {
if(!regex.compile(args[i].c_str())) if(!regex.compile(args[i].c_str()))
{ {
cmOStringStream e; std::ostringstream e;
e << "STRINGS option REGEX value \"" e << "STRINGS option REGEX value \""
<< args[i] << "\" could not be compiled."; << args[i] << "\" could not be compiled.";
this->SetError(e.str()); this->SetError(e.str());
@ -603,7 +603,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "STRINGS option ENCODING \"" e << "STRINGS option ENCODING \""
<< args[i] << "\" not recognized."; << args[i] << "\" not recognized.";
this->SetError(e.str()); this->SetError(e.str());
@ -613,7 +613,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "STRINGS given unknown argument \"" e << "STRINGS given unknown argument \""
<< args[i] << "\""; << args[i] << "\"";
this->SetError(e.str()); this->SetError(e.str());
@ -641,7 +641,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
#endif #endif
if(!fin) if(!fin)
{ {
cmOStringStream e; std::ostringstream e;
e << "STRINGS file \"" << fileName << "\" cannot be read."; e << "STRINGS file \"" << fileName << "\" cannot be read.";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -1037,7 +1037,7 @@ cmFileCommand::HandleDifferentCommand(std::vector<std::string> const& args)
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "DIFFERENT given unknown argument " << args[i]; e << "DIFFERENT given unknown argument " << args[i];
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -1152,7 +1152,7 @@ protected:
{ {
if(permissions && !cmSystemTools::SetPermissions(toFile, permissions)) if(permissions && !cmSystemTools::SetPermissions(toFile, permissions))
{ {
cmOStringStream e; std::ostringstream e;
e << this->Name << " cannot set permissions on \"" << toFile << "\""; e << this->Name << " cannot set permissions on \"" << toFile << "\"";
this->FileCommand->SetError(e.str()); this->FileCommand->SetError(e.str());
return false; return false;
@ -1176,7 +1176,7 @@ protected:
else if(arg == "SETGID") { permissions |= mode_setgid; } else if(arg == "SETGID") { permissions |= mode_setgid; }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << this->Name << " given invalid permission \"" << arg << "\"."; e << this->Name << " given invalid permission \"" << arg << "\".";
this->FileCommand->SetError(e.str()); this->FileCommand->SetError(e.str());
return false; return false;
@ -1203,7 +1203,7 @@ protected:
virtual bool ReportMissing(const char* fromFile) virtual bool ReportMissing(const char* fromFile)
{ {
// The input file does not exist and installation is not optional. // The input file does not exist and installation is not optional.
cmOStringStream e; std::ostringstream e;
e << this->Name << " cannot find \"" << fromFile << "\"."; e << this->Name << " cannot find \"" << fromFile << "\".";
this->FileCommand->SetError(e.str()); this->FileCommand->SetError(e.str());
return false; return false;
@ -1236,14 +1236,14 @@ protected:
void NotBeforeMatch(std::string const& arg) void NotBeforeMatch(std::string const& arg)
{ {
cmOStringStream e; std::ostringstream e;
e << "option " << arg << " may not appear before PATTERN or REGEX."; e << "option " << arg << " may not appear before PATTERN or REGEX.";
this->FileCommand->SetError(e.str()); this->FileCommand->SetError(e.str());
this->Doing = DoingError; this->Doing = DoingError;
} }
void NotAfterMatch(std::string const& arg) void NotAfterMatch(std::string const& arg)
{ {
cmOStringStream e; std::ostringstream e;
e << "option " << arg << " may not appear after PATTERN or REGEX."; e << "option " << arg << " may not appear after PATTERN or REGEX.";
this->FileCommand->SetError(e.str()); this->FileCommand->SetError(e.str());
this->Doing = DoingError; this->Doing = DoingError;
@ -1281,7 +1281,7 @@ bool cmFileCopier::Parse(std::vector<std::string> const& args)
if(!this->CheckKeyword(args[i]) && if(!this->CheckKeyword(args[i]) &&
!this->CheckValue(args[i])) !this->CheckValue(args[i]))
{ {
cmOStringStream e; std::ostringstream e;
e << "called with unknown argument \"" << args[i] << "\"."; e << "called with unknown argument \"" << args[i] << "\".";
this->FileCommand->SetError(e.str()); this->FileCommand->SetError(e.str());
return false; return false;
@ -1297,7 +1297,7 @@ bool cmFileCopier::Parse(std::vector<std::string> const& args)
// Require a destination. // Require a destination.
if(this->Destination.empty()) if(this->Destination.empty())
{ {
cmOStringStream e; std::ostringstream e;
e << this->Name << " given no DESTINATION"; e << this->Name << " given no DESTINATION";
this->FileCommand->SetError(e.str()); this->FileCommand->SetError(e.str());
return false; return false;
@ -1477,7 +1477,7 @@ bool cmFileCopier::CheckValue(std::string const& arg)
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "could not compile PATTERN \"" << arg << "\"."; e << "could not compile PATTERN \"" << arg << "\".";
this->FileCommand->SetError(e.str()); this->FileCommand->SetError(e.str());
this->Doing = DoingError; this->Doing = DoingError;
@ -1493,7 +1493,7 @@ bool cmFileCopier::CheckValue(std::string const& arg)
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "could not compile REGEX \"" << arg << "\"."; e << "could not compile REGEX \"" << arg << "\".";
this->FileCommand->SetError(e.str()); this->FileCommand->SetError(e.str());
this->Doing = DoingError; this->Doing = DoingError;
@ -1573,7 +1573,7 @@ bool cmFileCopier::Install(const char* fromFile, const char* toFile)
{ {
if(!*fromFile) if(!*fromFile)
{ {
cmOStringStream e; std::ostringstream e;
e << "INSTALL encountered an empty string input file name."; e << "INSTALL encountered an empty string input file name.";
this->FileCommand->SetError(e.str()); this->FileCommand->SetError(e.str());
return false; return false;
@ -1614,7 +1614,7 @@ bool cmFileCopier::InstallSymlink(const char* fromFile, const char* toFile)
std::string symlinkTarget; std::string symlinkTarget;
if(!cmSystemTools::ReadSymlink(fromFile, symlinkTarget)) if(!cmSystemTools::ReadSymlink(fromFile, symlinkTarget))
{ {
cmOStringStream e; std::ostringstream e;
e << this->Name << " cannot read symlink \"" << fromFile e << this->Name << " cannot read symlink \"" << fromFile
<< "\" to duplicate at \"" << toFile << "\"."; << "\" to duplicate at \"" << toFile << "\".";
this->FileCommand->SetError(e.str()); this->FileCommand->SetError(e.str());
@ -1647,7 +1647,7 @@ bool cmFileCopier::InstallSymlink(const char* fromFile, const char* toFile)
// Create the symlink. // Create the symlink.
if(!cmSystemTools::CreateSymlink(symlinkTarget, toFile)) if(!cmSystemTools::CreateSymlink(symlinkTarget, toFile))
{ {
cmOStringStream e; std::ostringstream e;
e << this->Name << " cannot duplicate symlink \"" << fromFile e << this->Name << " cannot duplicate symlink \"" << fromFile
<< "\" at \"" << toFile << "\"."; << "\" at \"" << toFile << "\".";
this->FileCommand->SetError(e.str()); this->FileCommand->SetError(e.str());
@ -1679,7 +1679,7 @@ bool cmFileCopier::InstallFile(const char* fromFile, const char* toFile,
// Copy the file. // Copy the file.
if(copy && !cmSystemTools::CopyAFile(fromFile, toFile, true)) if(copy && !cmSystemTools::CopyAFile(fromFile, toFile, true))
{ {
cmOStringStream e; std::ostringstream e;
e << this->Name << " cannot copy file \"" << fromFile e << this->Name << " cannot copy file \"" << fromFile
<< "\" to \"" << toFile << "\"."; << "\" to \"" << toFile << "\".";
this->FileCommand->SetError(e.str()); this->FileCommand->SetError(e.str());
@ -1698,7 +1698,7 @@ bool cmFileCopier::InstallFile(const char* fromFile, const char* toFile,
} }
if (!cmSystemTools::CopyFileTime(fromFile, toFile)) if (!cmSystemTools::CopyFileTime(fromFile, toFile))
{ {
cmOStringStream e; std::ostringstream e;
e << this->Name << " cannot set modification time on \"" e << this->Name << " cannot set modification time on \""
<< toFile << "\""; << toFile << "\"";
this->FileCommand->SetError(e.str()); this->FileCommand->SetError(e.str());
@ -1730,7 +1730,7 @@ bool cmFileCopier::InstallDirectory(const char* source,
// Make sure the destination directory exists. // Make sure the destination directory exists.
if(!cmSystemTools::MakeDirectory(destination)) if(!cmSystemTools::MakeDirectory(destination))
{ {
cmOStringStream e; std::ostringstream e;
e << this->Name << " cannot make directory \"" << destination << "\": " e << this->Name << " cannot make directory \"" << destination << "\": "
<< cmSystemTools::GetLastSystemError(); << cmSystemTools::GetLastSystemError();
this->FileCommand->SetError(e.str()); this->FileCommand->SetError(e.str());
@ -2075,7 +2075,7 @@ bool cmFileInstaller::CheckKeyword(std::string const& arg)
else if(arg == "COMPONENTS" || arg == "CONFIGURATIONS" || else if(arg == "COMPONENTS" || arg == "CONFIGURATIONS" ||
arg == "PROPERTIES") arg == "PROPERTIES")
{ {
cmOStringStream e; std::ostringstream e;
e << "INSTALL called with old-style " << arg << " argument. " e << "INSTALL called with old-style " << arg << " argument. "
<< "This script was generated with an older version of CMake. " << "This script was generated with an older version of CMake. "
<< "Re-run this cmake version on your build tree."; << "Re-run this cmake version on your build tree.";
@ -2143,7 +2143,7 @@ bool cmFileInstaller
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "Option TYPE given unknown value \"" << stype << "\"."; e << "Option TYPE given unknown value \"" << stype << "\".";
this->FileCommand->SetError(e.str()); this->FileCommand->SetError(e.str());
return false; return false;
@ -2288,7 +2288,7 @@ cmFileCommand::HandleRPathChangeCommand(std::vector<std::string> const& args)
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "RPATH_CHANGE given unknown argument " << args[i]; e << "RPATH_CHANGE given unknown argument " << args[i];
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -2311,7 +2311,7 @@ cmFileCommand::HandleRPathChangeCommand(std::vector<std::string> const& args)
} }
if(!cmSystemTools::FileExists(file, true)) if(!cmSystemTools::FileExists(file, true))
{ {
cmOStringStream e; std::ostringstream e;
e << "RPATH_CHANGE given FILE \"" << file << "\" that does not exist."; e << "RPATH_CHANGE given FILE \"" << file << "\" that does not exist.";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -2323,7 +2323,7 @@ cmFileCommand::HandleRPathChangeCommand(std::vector<std::string> const& args)
bool changed; bool changed;
if(!cmSystemTools::ChangeRPath(file, oldRPath, newRPath, &emsg, &changed)) if(!cmSystemTools::ChangeRPath(file, oldRPath, newRPath, &emsg, &changed))
{ {
cmOStringStream e; std::ostringstream e;
e << "RPATH_CHANGE could not write new RPATH:\n" e << "RPATH_CHANGE could not write new RPATH:\n"
<< " " << newRPath << "\n" << " " << newRPath << "\n"
<< "to the file:\n" << "to the file:\n"
@ -2373,7 +2373,7 @@ cmFileCommand::HandleRPathRemoveCommand(std::vector<std::string> const& args)
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "RPATH_REMOVE given unknown argument " << args[i]; e << "RPATH_REMOVE given unknown argument " << args[i];
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -2386,7 +2386,7 @@ cmFileCommand::HandleRPathRemoveCommand(std::vector<std::string> const& args)
} }
if(!cmSystemTools::FileExists(file, true)) if(!cmSystemTools::FileExists(file, true))
{ {
cmOStringStream e; std::ostringstream e;
e << "RPATH_REMOVE given FILE \"" << file << "\" that does not exist."; e << "RPATH_REMOVE given FILE \"" << file << "\" that does not exist.";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -2398,7 +2398,7 @@ cmFileCommand::HandleRPathRemoveCommand(std::vector<std::string> const& args)
bool removed; bool removed;
if(!cmSystemTools::RemoveRPath(file, &emsg, &removed)) if(!cmSystemTools::RemoveRPath(file, &emsg, &removed))
{ {
cmOStringStream e; std::ostringstream e;
e << "RPATH_REMOVE could not remove RPATH from file:\n" e << "RPATH_REMOVE could not remove RPATH from file:\n"
<< " " << file << "\n" << " " << file << "\n"
<< emsg; << emsg;
@ -2454,7 +2454,7 @@ cmFileCommand::HandleRPathCheckCommand(std::vector<std::string> const& args)
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "RPATH_CHECK given unknown argument " << args[i]; e << "RPATH_CHECK given unknown argument " << args[i];
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -2555,7 +2555,7 @@ bool cmFileCommand::HandleRename(std::vector<std::string> const& args)
if(!cmSystemTools::RenameFile(oldname.c_str(), newname.c_str())) if(!cmSystemTools::RenameFile(oldname.c_str(), newname.c_str()))
{ {
std::string err = cmSystemTools::GetLastSystemError(); std::string err = cmSystemTools::GetLastSystemError();
cmOStringStream e; std::ostringstream e;
e << "RENAME failed to rename\n" e << "RENAME failed to rename\n"
<< " " << oldname << "\n" << " " << oldname << "\n"
<< "to\n" << "to\n"
@ -2722,7 +2722,7 @@ namespace {
if (updated) if (updated)
{ {
cmOStringStream oss; std::ostringstream oss;
oss << "[" << this->Text << " " << this->CurrentPercentage oss << "[" << this->Text << " " << this->CurrentPercentage
<< "% complete]"; << "% complete]";
status = oss.str(); status = oss.str();
@ -2994,7 +2994,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
msg += "\""; msg += "\"";
if(statusVar.size()) if(statusVar.size())
{ {
cmOStringStream result; std::ostringstream result;
result << (int)0 << ";\"" << msg; result << (int)0 << ";\"" << msg;
this->Makefile->AddDefinition(statusVar, this->Makefile->AddDefinition(statusVar,
result.str().c_str()); result.str().c_str());
@ -3133,7 +3133,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
if(statusVar.size()) if(statusVar.size())
{ {
cmOStringStream result; std::ostringstream result;
result << (int)res << ";\"" << ::curl_easy_strerror(res) << "\""; result << (int)res << ";\"" << ::curl_easy_strerror(res) << "\"";
this->Makefile->AddDefinition(statusVar, this->Makefile->AddDefinition(statusVar,
result.str().c_str()); result.str().c_str());
@ -3159,7 +3159,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
if (expectedHash != actualHash) if (expectedHash != actualHash)
{ {
cmOStringStream oss; std::ostringstream oss;
oss << "DOWNLOAD HASH mismatch" << std::endl oss << "DOWNLOAD HASH mismatch" << std::endl
<< " for file: [" << file << "]" << std::endl << " for file: [" << file << "]" << std::endl
<< " expected hash: [" << expectedHash << "]" << std::endl << " expected hash: [" << expectedHash << "]" << std::endl
@ -3392,7 +3392,7 @@ cmFileCommand::HandleUploadCommand(std::vector<std::string> const& args)
if(statusVar.size()) if(statusVar.size())
{ {
cmOStringStream result; std::ostringstream result;
result << (int)res << ";\"" << ::curl_easy_strerror(res) << "\""; result << (int)res << ";\"" << ::curl_easy_strerror(res) << "\"";
this->Makefile->AddDefinition(statusVar, this->Makefile->AddDefinition(statusVar,
result.str().c_str()); result.str().c_str());
@ -3568,7 +3568,7 @@ bool cmFileCommand::HandleLockCommand(
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << merr << ", but got:\n \"" << args[i] << "\"."; e << merr << ", but got:\n \"" << args[i] << "\".";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
return false; return false;
@ -3601,7 +3601,7 @@ bool cmFileCommand::HandleLockCommand(
if(!cmSystemTools::StringToLong(args[i].c_str(), &scanned) if(!cmSystemTools::StringToLong(args[i].c_str(), &scanned)
|| scanned < 0) || scanned < 0)
{ {
cmOStringStream e; std::ostringstream e;
e << "TIMEOUT value \"" << args[i] << "\" is not an unsigned integer."; e << "TIMEOUT value \"" << args[i] << "\" is not an unsigned integer.";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
return false; return false;
@ -3610,7 +3610,7 @@ bool cmFileCommand::HandleLockCommand(
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "expected DIRECTORY, RELEASE, GUARD, RESULT_VARIABLE or TIMEOUT\n"; e << "expected DIRECTORY, RELEASE, GUARD, RESULT_VARIABLE or TIMEOUT\n";
e << "but got: \"" << args[i] << "\"."; e << "but got: \"" << args[i] << "\".";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
@ -3635,7 +3635,7 @@ bool cmFileCommand::HandleLockCommand(
std::string parentDir = cmSystemTools::GetParentDirectory(path); std::string parentDir = cmSystemTools::GetParentDirectory(path);
if (!cmSystemTools::MakeDirectory(parentDir)) if (!cmSystemTools::MakeDirectory(parentDir))
{ {
cmOStringStream e; std::ostringstream e;
e << "directory\n \"" << parentDir << "\"\ncreation failed "; e << "directory\n \"" << parentDir << "\"\ncreation failed ";
e << "(check permissions)."; e << "(check permissions).";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
@ -3645,7 +3645,7 @@ bool cmFileCommand::HandleLockCommand(
FILE *file = cmsys::SystemTools::Fopen(path, "w"); FILE *file = cmsys::SystemTools::Fopen(path, "w");
if (!file) if (!file)
{ {
cmOStringStream e; std::ostringstream e;
e << "file\n \"" << path << "\"\ncreation failed (check permissions)."; e << "file\n \"" << path << "\"\ncreation failed (check permissions).";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
cmSystemTools::SetFatalErrorOccured(); cmSystemTools::SetFatalErrorOccured();
@ -3685,7 +3685,7 @@ bool cmFileCommand::HandleLockCommand(
if (resultVariable.empty() && !fileLockResult.IsOk()) if (resultVariable.empty() && !fileLockResult.IsOk())
{ {
cmOStringStream e; std::ostringstream e;
e << "error locking file\n \"" << path << "\"\n" << result << "."; e << "error locking file\n \"" << path << "\"\n" << result << ".";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
cmSystemTools::SetFatalErrorOccured(); cmSystemTools::SetFatalErrorOccured();

View File

@ -301,7 +301,7 @@ bool cmFindPackageCommand
if(args[i].find_first_of(":/\\") != args[i].npos || if(args[i].find_first_of(":/\\") != args[i].npos ||
cmSystemTools::GetFilenameLastExtension(args[i]) != ".cmake") cmSystemTools::GetFilenameLastExtension(args[i]) != ".cmake")
{ {
cmOStringStream e; std::ostringstream e;
e << "given CONFIGS option followed by invalid file name \"" e << "given CONFIGS option followed by invalid file name \""
<< args[i] << "\". The names given must be file names without " << args[i] << "\". The names given must be file names without "
<< "a path and with a \".cmake\" extension."; << "a path and with a \".cmake\" extension.";
@ -317,7 +317,7 @@ bool cmFindPackageCommand
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "called with invalid argument \"" << args[i] << "\""; e << "called with invalid argument \"" << args[i] << "\"";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -330,7 +330,7 @@ bool cmFindPackageCommand
std::back_inserter(doubledComponents)); std::back_inserter(doubledComponents));
if(!doubledComponents.empty()) if(!doubledComponents.empty())
{ {
cmOStringStream e; std::ostringstream e;
e << "called with components that are both required and optional:\n"; e << "called with components that are both required and optional:\n";
for(unsigned int i=0; i<doubledComponents.size(); ++i) for(unsigned int i=0; i<doubledComponents.size(); ++i)
{ {
@ -345,7 +345,7 @@ bool cmFindPackageCommand
this->UseConfigFiles = moduleArgs.empty(); this->UseConfigFiles = moduleArgs.empty();
if(!this->UseFindModules && !this->UseConfigFiles) if(!this->UseFindModules && !this->UseConfigFiles)
{ {
cmOStringStream e; std::ostringstream e;
e << "given options exclusive to Module mode:\n"; e << "given options exclusive to Module mode:\n";
for(std::set<unsigned int>::const_iterator si = moduleArgs.begin(); for(std::set<unsigned int>::const_iterator si = moduleArgs.begin();
si != moduleArgs.end(); ++si) si != moduleArgs.end(); ++si)
@ -427,7 +427,7 @@ bool cmFindPackageCommand
{ {
if (this->Required) if (this->Required)
{ {
cmOStringStream e; std::ostringstream e;
e << "for module " << this->Name << " called with REQUIRED, but " e << "for module " << this->Name << " called with REQUIRED, but "
<< disableFindPackageVar << disableFindPackageVar
<< " is enabled. A REQUIRED package cannot be disabled."; << " is enabled. A REQUIRED package cannot be disabled.";
@ -460,7 +460,7 @@ bool cmFindPackageCommand
if(this->UseFindModules && this->UseConfigFiles && if(this->UseFindModules && this->UseConfigFiles &&
this->Makefile->IsOn("CMAKE_FIND_PACKAGE_WARN_NO_MODULE")) this->Makefile->IsOn("CMAKE_FIND_PACKAGE_WARN_NO_MODULE"))
{ {
cmOStringStream aw; std::ostringstream aw;
if(this->RequiredCMakeVersion >= CMake_VERSION_ENCODE(2,8,8)) if(this->RequiredCMakeVersion >= CMake_VERSION_ENCODE(2,8,8))
{ {
aw << "find_package called without either MODULE or CONFIG option and " aw << "find_package called without either MODULE or CONFIG option and "
@ -751,8 +751,8 @@ bool cmFindPackageCommand::HandlePackageMode()
if (result && !found && (!this->Quiet || this->Required)) if (result && !found && (!this->Quiet || this->Required))
{ {
// The variable is not set. // The variable is not set.
cmOStringStream e; std::ostringstream e;
cmOStringStream aw; std::ostringstream aw;
if (configFileSetFOUNDFalse) if (configFileSetFOUNDFalse)
{ {
e << "Found package configuration file:\n" e << "Found package configuration file:\n"
@ -1470,7 +1470,7 @@ void cmFindPackageCommand::FillPrefixesBuilds()
// It is likely that CMake will have recently built the project. // It is likely that CMake will have recently built the project.
for(int i=0; i <= 10; ++i) for(int i=0; i <= 10; ++i)
{ {
cmOStringStream r; std::ostringstream r;
r << r <<
"[HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\" "[HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\"
"Settings\\StartPath;WhereBuild" << i << "]"; "Settings\\StartPath;WhereBuild" << i << "]";

View File

@ -170,7 +170,7 @@ bool cmForEachCommand
step == 0 step == 0
) )
{ {
cmOStringStream str; std::ostringstream str;
str << "called with incorrect range specification: start "; str << "called with incorrect range specification: start ";
str << start << ", stop " << stop << ", step " << step; str << start << ", stop " << stop << ", step " << step;
this->SetError(str.str()); this->SetError(str.str());
@ -243,7 +243,7 @@ bool cmForEachCommand::HandleInMode(std::vector<std::string> const& args)
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "Unknown argument:\n" << " " << args[i] << "\n"; e << "Unknown argument:\n" << " " << args[i] << "\n";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
return true; return true;

View File

@ -103,7 +103,7 @@ bool cmFunctionHelperCommand::InvokeInitialPass
cmMakefile::PolicyPushPop polScope(this->Makefile, true, this->Policies); cmMakefile::PolicyPushPop polScope(this->Makefile, true, this->Policies);
// set the value of argc // set the value of argc
cmOStringStream strStream; std::ostringstream strStream;
strStream << expandedArgs.size(); strStream << expandedArgs.size();
this->Makefile->AddDefinition("ARGC",strStream.str().c_str()); this->Makefile->AddDefinition("ARGC",strStream.str().c_str());
this->Makefile->MarkVariableAsUsed("ARGC"); this->Makefile->MarkVariableAsUsed("ARGC");
@ -111,7 +111,7 @@ bool cmFunctionHelperCommand::InvokeInitialPass
// set the values for ARGV0 ARGV1 ... // set the values for ARGV0 ARGV1 ...
for (unsigned int t = 0; t < expandedArgs.size(); ++t) for (unsigned int t = 0; t < expandedArgs.size(); ++t)
{ {
cmOStringStream tmpStream; std::ostringstream tmpStream;
tmpStream << "ARGV" << t; tmpStream << "ARGV" << t;
this->Makefile->AddDefinition(tmpStream.str(), this->Makefile->AddDefinition(tmpStream.str(),
expandedArgs[t].c_str()); expandedArgs[t].c_str());

View File

@ -106,7 +106,7 @@ void cmGeneratorExpressionDAGChecker::ReportError(
if (parent && !parent->Parent) if (parent && !parent->Parent)
{ {
cmOStringStream e; std::ostringstream e;
e << "Error evaluating generator expression:\n" e << "Error evaluating generator expression:\n"
<< " " << expr << "\n" << " " << expr << "\n"
<< "Self reference on target \"" << "Self reference on target \""
@ -118,7 +118,7 @@ void cmGeneratorExpressionDAGChecker::ReportError(
} }
{ {
cmOStringStream e; std::ostringstream e;
e << "Error evaluating generator expression:\n" e << "Error evaluating generator expression:\n"
<< " " << expr << "\n" << " " << expr << "\n"
<< "Dependency loop found."; << "Dependency loop found.";
@ -130,7 +130,7 @@ void cmGeneratorExpressionDAGChecker::ReportError(
int loopStep = 1; int loopStep = 1;
while (parent) while (parent)
{ {
cmOStringStream e; std::ostringstream e;
e << "Loop step " << loopStep << "\n" e << "Loop step " << loopStep << "\n"
<< " " << " "
<< (parent->Content ? parent->Content->GetOriginalExpression() : expr) << (parent->Content ? parent->Content->GetOriginalExpression() : expr)

View File

@ -51,7 +51,7 @@ void cmGeneratorExpressionEvaluationFile::Generate(const std::string& config,
} }
if (condResult != "1") if (condResult != "1")
{ {
cmOStringStream e; std::ostringstream e;
e << "Evaluation file condition \"" << rawCondition << "\" did " e << "Evaluation file condition \"" << rawCondition << "\" did "
"not evaluate to valid content. Got \"" << condResult << "\"."; "not evaluate to valid content. Got \"" << condResult << "\".";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
@ -73,7 +73,7 @@ void cmGeneratorExpressionEvaluationFile::Generate(const std::string& config,
{ {
return; return;
} }
cmOStringStream e; std::ostringstream e;
e << "Evaluation file to be written multiple times for different " e << "Evaluation file to be written multiple times for different "
"configurations with different content:\n " << outputFileName; "configurations with different content:\n " << outputFileName;
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
@ -123,7 +123,7 @@ void cmGeneratorExpressionEvaluationFile::Generate()
cmsys::ifstream fin(this->Input.c_str()); cmsys::ifstream fin(this->Input.c_str());
if(!fin) if(!fin)
{ {
cmOStringStream e; std::ostringstream e;
e << "Evaluation file \"" << this->Input << "\" cannot be read."; e << "Evaluation file \"" << this->Input << "\" cannot be read.";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
return; return;

View File

@ -36,7 +36,7 @@ void reportError(cmGeneratorExpressionContext *context,
return; return;
} }
cmOStringStream e; std::ostringstream e;
e << "Error evaluating generator expression:\n" e << "Error evaluating generator expression:\n"
<< " " << expr << "\n" << " " << expr << "\n"
<< result; << result;
@ -456,7 +456,7 @@ struct CompilerIdNode : public cmGeneratorExpressionNode
{ {
case cmPolicies::WARN: case cmPolicies::WARN:
{ {
cmOStringStream e; std::ostringstream e;
e << context->Makefile->GetPolicies() e << context->Makefile->GetPolicies()
->GetPolicyWarning(cmPolicies::CMP0044); ->GetPolicyWarning(cmPolicies::CMP0044);
context->Makefile->GetCMakeInstance() context->Makefile->GetCMakeInstance()
@ -953,7 +953,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
if (!target) if (!target)
{ {
cmOStringStream e; std::ostringstream e;
e << "Target \"" e << "Target \""
<< targetName << targetName
<< "\" not found."; << "\" not found.";
@ -1253,7 +1253,7 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode
{ {
if (!context->EvaluateForBuildsystem) if (!context->EvaluateForBuildsystem)
{ {
cmOStringStream e; std::ostringstream e;
e << "The evaluation of the TARGET_OBJECTS generator expression " e << "The evaluation of the TARGET_OBJECTS generator expression "
"is only suitable for consumption by CMake. It is not suitable " "is only suitable for consumption by CMake. It is not suitable "
"for writing out elsewhere."; "for writing out elsewhere.";
@ -1266,7 +1266,7 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode
context->Makefile->FindGeneratorTargetToUse(tgtName); context->Makefile->FindGeneratorTargetToUse(tgtName);
if (!gt) if (!gt)
{ {
cmOStringStream e; std::ostringstream e;
e << "Objects of target \"" << tgtName e << "Objects of target \"" << tgtName
<< "\" referenced but no such target exists."; << "\" referenced but no such target exists.";
reportError(context, content->GetOriginalExpression(), e.str()); reportError(context, content->GetOriginalExpression(), e.str());
@ -1274,7 +1274,7 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode
} }
if (gt->GetType() != cmTarget::OBJECT_LIBRARY) if (gt->GetType() != cmTarget::OBJECT_LIBRARY)
{ {
cmOStringStream e; std::ostringstream e;
e << "Objects of target \"" << tgtName e << "Objects of target \"" << tgtName
<< "\" referenced but is not an OBJECT library."; << "\" referenced but is not an OBJECT library.";
reportError(context, content->GetOriginalExpression(), e.str()); reportError(context, content->GetOriginalExpression(), e.str());
@ -2028,7 +2028,7 @@ std::string GeneratorExpressionContent::EvaluateParameters(
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "$<" + identifier + "> expression requires " e << "$<" + identifier + "> expression requires "
<< numExpected << numExpected
<< " comma separated parameters, but got " << " comma separated parameters, but got "

View File

@ -31,7 +31,7 @@ void reportBadObjLib(std::vector<cmSourceFile*> const& badObjLib,
{ {
if(!badObjLib.empty()) if(!badObjLib.empty())
{ {
cmOStringStream e; std::ostringstream e;
e << "OBJECT library \"" << target->GetName() << "\" contains:\n"; e << "OBJECT library \"" << target->GetName() << "\" contains:\n";
for(std::vector<cmSourceFile*>::const_iterator i = badObjLib.begin(); for(std::vector<cmSourceFile*>::const_iterator i = badObjLib.begin();
i != badObjLib.end(); ++i) i != badObjLib.end(); ++i)
@ -630,7 +630,7 @@ cmTargetTraceDependencies
this->GlobalGenerator->GetFilenameTargetDepends(sf); this->GlobalGenerator->GetFilenameTargetDepends(sf);
if (tgts.find(this->Target) != tgts.end()) if (tgts.find(this->Target) != tgts.end())
{ {
cmOStringStream e; std::ostringstream e;
e << "Evaluation output file\n \"" << sf->GetFullPath() e << "Evaluation output file\n \"" << sf->GetFullPath()
<< "\"\ndepends on the sources of a target it is used in. This " << "\"\ndepends on the sources of a target it is used in. This "
"is a dependency loop and is not allowed."; "is a dependency loop and is not allowed.";

View File

@ -73,7 +73,7 @@ bool cmGetPropertyCommand
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "given invalid scope " << args[1] << ". " e << "given invalid scope " << args[1] << ". "
<< "Valid scopes are " << "Valid scopes are "
<< "GLOBAL, DIRECTORY, TARGET, SOURCE, TEST, VARIABLE, CACHE, INSTALL."; << "GLOBAL, DIRECTORY, TARGET, SOURCE, TEST, VARIABLE, CACHE, INSTALL.";
@ -122,7 +122,7 @@ bool cmGetPropertyCommand
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "given invalid argument \"" << args[i] << "\"."; e << "given invalid argument \"" << args[i] << "\".";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -312,7 +312,7 @@ bool cmGetPropertyCommand::HandleTargetMode()
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "could not find TARGET " << this->Name e << "could not find TARGET " << this->Name
<< ". Perhaps it has not yet been created."; << ". Perhaps it has not yet been created.";
this->SetError(e.str()); this->SetError(e.str());
@ -338,7 +338,7 @@ bool cmGetPropertyCommand::HandleSourceMode()
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "given SOURCE name that could not be found or created: " e << "given SOURCE name that could not be found or created: "
<< this->Name; << this->Name;
this->SetError(e.str()); this->SetError(e.str());
@ -362,7 +362,7 @@ bool cmGetPropertyCommand::HandleTestMode()
} }
// If not found it is an error. // If not found it is an error.
cmOStringStream e; std::ostringstream e;
e << "given TEST name that does not exist: " << this->Name; e << "given TEST name that does not exist: " << this->Name;
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -423,7 +423,7 @@ bool cmGetPropertyCommand::HandleInstallMode()
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "given INSTALL name that could not be found or created: " e << "given INSTALL name that could not be found or created: "
<< this->Name; << this->Name;
this->SetError(e.str()); this->SetError(e.str());

View File

@ -47,7 +47,7 @@ bool cmGetTargetPropertyCommand
else else
{ {
bool issueMessage = false; bool issueMessage = false;
cmOStringStream e; std::ostringstream e;
cmake::MessageType messageType = cmake::AUTHOR_WARNING; cmake::MessageType messageType = cmake::AUTHOR_WARNING;
switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0045)) switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0045))
{ {

View File

@ -88,7 +88,7 @@ bool cmGlobalGenerator::SetGeneratorPlatform(std::string const& p,
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << e <<
"Generator\n" "Generator\n"
" " << this->GetName() << "\n" " " << this->GetName() << "\n"
@ -109,7 +109,7 @@ bool cmGlobalGenerator::SetGeneratorToolset(std::string const& ts,
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << e <<
"Generator\n" "Generator\n"
" " << this->GetName() << "\n" " " << this->GetName() << "\n"
@ -284,7 +284,7 @@ void cmGlobalGenerator::FindMakeProgram(cmMakefile* mf)
if(!mf->GetDefinition("CMAKE_MAKE_PROGRAM") if(!mf->GetDefinition("CMAKE_MAKE_PROGRAM")
|| cmSystemTools::IsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) || cmSystemTools::IsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM")))
{ {
cmOStringStream err; std::ostringstream err;
err << "CMake was unable to find a build program corresponding to \"" err << "CMake was unable to find a build program corresponding to \""
<< this->GetName() << "\". CMAKE_MAKE_PROGRAM is not set. You " << this->GetName() << "\". CMAKE_MAKE_PROGRAM is not set. You "
<< "probably need to select a different build tool."; << "probably need to select a different build tool.";
@ -405,7 +405,7 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
const char* lang = li->c_str(); const char* lang = li->c_str();
if(this->LanguagesReady.find(lang) == this->LanguagesReady.end()) if(this->LanguagesReady.find(lang) == this->LanguagesReady.end())
{ {
cmOStringStream e; std::ostringstream e;
e << "The test project needs language " e << "The test project needs language "
<< lang << " which is not enabled."; << lang << " which is not enabled.";
this->TryCompileOuterMakefile this->TryCompileOuterMakefile
@ -467,7 +467,7 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
#ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx #ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx
# pragma warning (pop) # pragma warning (pop)
#endif #endif
cmOStringStream windowsVersionString; std::ostringstream windowsVersionString;
windowsVersionString << osvi.dwMajorVersion << "." << osvi.dwMinorVersion; windowsVersionString << osvi.dwMajorVersion << "." << osvi.dwMinorVersion;
windowsVersionString.str(); windowsVersionString.str();
mf->AddDefinition("CMAKE_HOST_SYSTEM_VERSION", mf->AddDefinition("CMAKE_HOST_SYSTEM_VERSION",
@ -660,7 +660,7 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages,
std::string compilerEnv = "CMAKE_"; std::string compilerEnv = "CMAKE_";
compilerEnv += lang; compilerEnv += lang;
compilerEnv += "_COMPILER_ENV_VAR"; compilerEnv += "_COMPILER_ENV_VAR";
cmOStringStream noCompiler; std::ostringstream noCompiler;
const char* compilerFile = mf->GetDefinition(compilerName); const char* compilerFile = mf->GetDefinition(compilerName);
if(!compilerFile || !*compilerFile || if(!compilerFile || !*compilerFile ||
cmSystemTools::IsNOTFOUND(compilerFile)) cmSystemTools::IsNOTFOUND(compilerFile))
@ -852,7 +852,7 @@ void cmGlobalGenerator::CheckCompilerIdCompatibility(cmMakefile* mf,
if(!this->CMakeInstance->GetIsInTryCompile() && if(!this->CMakeInstance->GetIsInTryCompile() &&
mf->PolicyOptionalWarningEnabled("CMAKE_POLICY_WARNING_CMP0025")) mf->PolicyOptionalWarningEnabled("CMAKE_POLICY_WARNING_CMP0025"))
{ {
cmOStringStream w; std::ostringstream w;
w << policies->GetPolicyWarning(cmPolicies::CMP0025) << "\n" w << policies->GetPolicyWarning(cmPolicies::CMP0025) << "\n"
"Converting " << lang << "Converting " << lang <<
" compiler id \"AppleClang\" to \"Clang\" for compatibility." " compiler id \"AppleClang\" to \"Clang\" for compatibility."
@ -884,7 +884,7 @@ void cmGlobalGenerator::CheckCompilerIdCompatibility(cmMakefile* mf,
if(!this->CMakeInstance->GetIsInTryCompile() && if(!this->CMakeInstance->GetIsInTryCompile() &&
mf->PolicyOptionalWarningEnabled("CMAKE_POLICY_WARNING_CMP0047")) mf->PolicyOptionalWarningEnabled("CMAKE_POLICY_WARNING_CMP0047"))
{ {
cmOStringStream w; std::ostringstream w;
w << policies->GetPolicyWarning(cmPolicies::CMP0047) << "\n" w << policies->GetPolicyWarning(cmPolicies::CMP0047) << "\n"
"Converting " << lang << "Converting " << lang <<
" compiler id \"QCC\" to \"GNU\" for compatibility." " compiler id \"QCC\" to \"GNU\" for compatibility."
@ -1147,7 +1147,7 @@ void cmGlobalGenerator::Configure()
if ( this->CMakeInstance->GetWorkingMode() == cmake::NORMAL_MODE) if ( this->CMakeInstance->GetWorkingMode() == cmake::NORMAL_MODE)
{ {
cmOStringStream msg; std::ostringstream msg;
if(cmSystemTools::GetErrorOccuredFlag()) if(cmSystemTools::GetErrorOccuredFlag())
{ {
msg << "Configuring incomplete, errors occurred!"; msg << "Configuring incomplete, errors occurred!";
@ -1196,7 +1196,7 @@ bool cmGlobalGenerator::CheckALLOW_DUPLICATE_CUSTOM_TARGETS() const
} }
// This generator does not support duplicate custom targets. // This generator does not support duplicate custom targets.
cmOStringStream e; std::ostringstream e;
e << "This project has enabled the ALLOW_DUPLICATE_CUSTOM_TARGETS " e << "This project has enabled the ALLOW_DUPLICATE_CUSTOM_TARGETS "
<< "global property. " << "global property. "
<< "The \"" << this->GetName() << "\" generator does not support " << "The \"" << this->GetName() << "\" generator does not support "
@ -1346,7 +1346,7 @@ void cmGlobalGenerator::Generate()
if(!this->CMP0042WarnTargets.empty()) if(!this->CMP0042WarnTargets.empty())
{ {
cmOStringStream w; std::ostringstream w;
w << w <<
(this->GetCMakeInstance()->GetPolicies()-> (this->GetCMakeInstance()->GetPolicies()->
GetPolicyWarning(cmPolicies::CMP0042)) << "\n"; GetPolicyWarning(cmPolicies::CMP0042)) << "\n";
@ -2331,7 +2331,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
cpackCommandLines.erase(cpackCommandLines.begin(), cpackCommandLines.erase(cpackCommandLines.begin(),
cpackCommandLines.end()); cpackCommandLines.end());
depends.erase(depends.begin(), depends.end()); depends.erase(depends.begin(), depends.end());
cmOStringStream ostr; std::ostringstream ostr;
if ( componentsSet->size() > 0 ) if ( componentsSet->size() > 0 )
{ {
ostr << "Available install components are:"; ostr << "Available install components are:";

View File

@ -71,7 +71,7 @@ std::string cmGlobalNinjaGenerator::EncodeIdent(const std::string &ident,
if (std::find_if(ident.begin(), ident.end(), if (std::find_if(ident.begin(), ident.end(),
std::not1(std::ptr_fun(IsIdentChar))) != ident.end()) { std::not1(std::ptr_fun(IsIdentChar))) != ident.end()) {
static unsigned VarNum = 0; static unsigned VarNum = 0;
cmOStringStream names; std::ostringstream names;
names << "ident" << VarNum++; names << "ident" << VarNum++;
vars << names.str() << " = " << ident << "\n"; vars << names.str() << " = " << ident << "\n";
return "$" + names.str(); return "$" + names.str();
@ -191,7 +191,7 @@ void cmGlobalNinjaGenerator::WriteBuild(std::ostream& os,
build += " " + rule; build += " " + rule;
// Write the variables bound to this build statement. // Write the variables bound to this build statement.
cmOStringStream variable_assignments; std::ostringstream variable_assignments;
for(cmNinjaVars::const_iterator i = variables.begin(); for(cmNinjaVars::const_iterator i = variables.begin();
i != variables.end(); ++i) i != variables.end(); ++i)
cmGlobalNinjaGenerator::WriteVariable(variable_assignments, cmGlobalNinjaGenerator::WriteVariable(variable_assignments,
@ -295,7 +295,7 @@ cmGlobalNinjaGenerator::AddMacOSXContentRule()
cmLocalGenerator *lg = this->LocalGenerators[0]; cmLocalGenerator *lg = this->LocalGenerators[0];
cmMakefile* mfRoot = lg->GetMakefile(); cmMakefile* mfRoot = lg->GetMakefile();
cmOStringStream cmd; std::ostringstream cmd;
cmd << lg->ConvertToOutputFormat( cmd << lg->ConvertToOutputFormat(
mfRoot->GetRequiredDefinition("CMAKE_COMMAND"), mfRoot->GetRequiredDefinition("CMAKE_COMMAND"),
cmLocalGenerator::SHELL) cmLocalGenerator::SHELL)
@ -1103,7 +1103,7 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os)
cmLocalGenerator *lg = this->LocalGenerators[0]; cmLocalGenerator *lg = this->LocalGenerators[0];
cmMakefile* mfRoot = lg->GetMakefile(); cmMakefile* mfRoot = lg->GetMakefile();
cmOStringStream cmd; std::ostringstream cmd;
cmd << lg->ConvertToOutputFormat( cmd << lg->ConvertToOutputFormat(
mfRoot->GetRequiredDefinition("CMAKE_COMMAND"), mfRoot->GetRequiredDefinition("CMAKE_COMMAND"),
cmLocalGenerator::SHELL) cmLocalGenerator::SHELL)

View File

@ -783,7 +783,7 @@ cmGlobalUnixMakefileGenerator3
lg->GetMakefile()->GetHomeOutputDirectory(); lg->GetMakefile()->GetHomeOutputDirectory();
progressDir += cmake::GetCMakeFilesDirectory(); progressDir += cmake::GetCMakeFilesDirectory();
{ {
cmOStringStream progCmd; std::ostringstream progCmd;
progCmd << "$(CMAKE_COMMAND) -E cmake_progress_report "; progCmd << "$(CMAKE_COMMAND) -E cmake_progress_report ";
// all target counts // all target counts
progCmd << lg->Convert(progressDir, progCmd << lg->Convert(progressDir,
@ -824,7 +824,7 @@ cmGlobalUnixMakefileGenerator3
{ {
// TODO: Convert the total progress count to a make variable. // TODO: Convert the total progress count to a make variable.
cmOStringStream progCmd; std::ostringstream progCmd;
progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start ";
// # in target // # in target
progCmd << lg->Convert(progressDir, progCmd << lg->Convert(progressDir,
@ -841,7 +841,7 @@ cmGlobalUnixMakefileGenerator3
commands.push_back(lg->GetRecursiveMakeCall commands.push_back(lg->GetRecursiveMakeCall
(tmp.c_str(),localName)); (tmp.c_str(),localName));
{ {
cmOStringStream progCmd; std::ostringstream progCmd;
progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # 0 progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # 0
progCmd << lg->Convert(progressDir, progCmd << lg->Convert(progressDir,
cmLocalGenerator::FULL, cmLocalGenerator::FULL,

View File

@ -156,7 +156,7 @@ cmGlobalVisualStudio10Generator::SetGeneratorToolset(std::string const& ts,
if (this->SystemIsWindowsCE && ts.empty() && if (this->SystemIsWindowsCE && ts.empty() &&
this->DefaultPlatformToolset.empty()) this->DefaultPlatformToolset.empty())
{ {
cmOStringStream e; std::ostringstream e;
e << this->GetName() << " Windows CE version '" << this->SystemVersion e << this->GetName() << " Windows CE version '" << this->SystemVersion
<< "' requires CMAKE_GENERATOR_TOOLSET to be set."; << "' requires CMAKE_GENERATOR_TOOLSET to be set.";
mf->IssueMessage(cmake::FATAL_ERROR, e.str()); mf->IssueMessage(cmake::FATAL_ERROR, e.str());
@ -202,7 +202,7 @@ bool cmGlobalVisualStudio10Generator::InitializeSystem(cmMakefile* mf)
{ {
if(this->DefaultPlatformName != "Win32") if(this->DefaultPlatformName != "Win32")
{ {
cmOStringStream e; std::ostringstream e;
e << "CMAKE_SYSTEM_NAME is 'Android' but CMAKE_GENERATOR " e << "CMAKE_SYSTEM_NAME is 'Android' but CMAKE_GENERATOR "
<< "specifies a platform too: '" << this->GetName() << "'"; << "specifies a platform too: '" << this->GetName() << "'";
mf->IssueMessage(cmake::FATAL_ERROR, e.str()); mf->IssueMessage(cmake::FATAL_ERROR, e.str());
@ -231,7 +231,7 @@ bool cmGlobalVisualStudio10Generator::InitializeWindowsCE(cmMakefile* mf)
{ {
if (this->DefaultPlatformName != "Win32") if (this->DefaultPlatformName != "Win32")
{ {
cmOStringStream e; std::ostringstream e;
e << "CMAKE_SYSTEM_NAME is 'WindowsCE' but CMAKE_GENERATOR " e << "CMAKE_SYSTEM_NAME is 'WindowsCE' but CMAKE_GENERATOR "
<< "specifies a platform too: '" << this->GetName() << "'"; << "specifies a platform too: '" << this->GetName() << "'";
mf->IssueMessage(cmake::FATAL_ERROR, e.str()); mf->IssueMessage(cmake::FATAL_ERROR, e.str());
@ -246,7 +246,7 @@ bool cmGlobalVisualStudio10Generator::InitializeWindowsCE(cmMakefile* mf)
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmGlobalVisualStudio10Generator::InitializeWindowsPhone(cmMakefile* mf) bool cmGlobalVisualStudio10Generator::InitializeWindowsPhone(cmMakefile* mf)
{ {
cmOStringStream e; std::ostringstream e;
e << this->GetName() << " does not support Windows Phone."; e << this->GetName() << " does not support Windows Phone.";
mf->IssueMessage(cmake::FATAL_ERROR, e.str()); mf->IssueMessage(cmake::FATAL_ERROR, e.str());
return false; return false;
@ -255,7 +255,7 @@ bool cmGlobalVisualStudio10Generator::InitializeWindowsPhone(cmMakefile* mf)
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmGlobalVisualStudio10Generator::InitializeWindowsStore(cmMakefile* mf) bool cmGlobalVisualStudio10Generator::InitializeWindowsStore(cmMakefile* mf)
{ {
cmOStringStream e; std::ostringstream e;
e << this->GetName() << " does not support Windows Store."; e << this->GetName() << " does not support Windows Store.";
mf->IssueMessage(cmake::FATAL_ERROR, e.str()); mf->IssueMessage(cmake::FATAL_ERROR, e.str());
return false; return false;
@ -320,7 +320,7 @@ void cmGlobalVisualStudio10Generator::Generate()
if(this->LongestSource.Length > 0) if(this->LongestSource.Length > 0)
{ {
cmMakefile* mf = this->LongestSource.Target->GetMakefile(); cmMakefile* mf = this->LongestSource.Target->GetMakefile();
cmOStringStream e; std::ostringstream e;
e << e <<
"The binary and/or source directory paths may be too long to generate " "The binary and/or source directory paths may be too long to generate "
"Visual Studio 10 files for this project. " "Visual Studio 10 files for this project. "
@ -574,7 +574,7 @@ bool cmGlobalVisualStudio10Generator::Find64BitTools(cmMakefile* mf)
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\" "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\"
"Windows\\v7.1;InstallationFolder", winSDK_7_1)) "Windows\\v7.1;InstallationFolder", winSDK_7_1))
{ {
cmOStringStream m; std::ostringstream m;
m << "Found Windows SDK v7.1: " << winSDK_7_1; m << "Found Windows SDK v7.1: " << winSDK_7_1;
mf->DisplayStatus(m.str().c_str(), -1); mf->DisplayStatus(m.str().c_str(), -1);
this->DefaultPlatformToolset = "Windows7.1SDK"; this->DefaultPlatformToolset = "Windows7.1SDK";
@ -582,7 +582,7 @@ bool cmGlobalVisualStudio10Generator::Find64BitTools(cmMakefile* mf)
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "Cannot enable 64-bit tools with Visual Studio 2010 Express.\n" e << "Cannot enable 64-bit tools with Visual Studio 2010 Express.\n"
<< "Install the Microsoft Windows SDK v7.1 to get 64-bit tools:\n" << "Install the Microsoft Windows SDK v7.1 to get 64-bit tools:\n"
<< " http://msdn.microsoft.com/en-us/windows/bb980924.aspx"; << " http://msdn.microsoft.com/en-us/windows/bb980924.aspx";

View File

@ -133,7 +133,7 @@ bool cmGlobalVisualStudio11Generator::InitializeWindowsPhone(cmMakefile* mf)
{ {
if(!this->SelectWindowsPhoneToolset(this->DefaultPlatformToolset)) if(!this->SelectWindowsPhoneToolset(this->DefaultPlatformToolset))
{ {
cmOStringStream e; std::ostringstream e;
if(this->DefaultPlatformToolset.empty()) if(this->DefaultPlatformToolset.empty())
{ {
e << this->GetName() << " supports Windows Phone '8.0', but not '" e << this->GetName() << " supports Windows Phone '8.0', but not '"
@ -156,7 +156,7 @@ bool cmGlobalVisualStudio11Generator::InitializeWindowsStore(cmMakefile* mf)
{ {
if(!this->SelectWindowsStoreToolset(this->DefaultPlatformToolset)) if(!this->SelectWindowsStoreToolset(this->DefaultPlatformToolset))
{ {
cmOStringStream e; std::ostringstream e;
if(this->DefaultPlatformToolset.empty()) if(this->DefaultPlatformToolset.empty())
{ {
e << this->GetName() << " supports Windows Store '8.0', but not '" e << this->GetName() << " supports Windows Store '8.0', but not '"

View File

@ -113,7 +113,7 @@ bool cmGlobalVisualStudio12Generator::InitializeWindowsPhone(cmMakefile* mf)
{ {
if(!this->SelectWindowsPhoneToolset(this->DefaultPlatformToolset)) if(!this->SelectWindowsPhoneToolset(this->DefaultPlatformToolset))
{ {
cmOStringStream e; std::ostringstream e;
if(this->DefaultPlatformToolset.empty()) if(this->DefaultPlatformToolset.empty())
{ {
e << this->GetName() << " supports Windows Phone '8.0' and '8.1', but " e << this->GetName() << " supports Windows Phone '8.0' and '8.1', but "
@ -136,7 +136,7 @@ bool cmGlobalVisualStudio12Generator::InitializeWindowsStore(cmMakefile* mf)
{ {
if(!this->SelectWindowsStoreToolset(this->DefaultPlatformToolset)) if(!this->SelectWindowsStoreToolset(this->DefaultPlatformToolset))
{ {
cmOStringStream e; std::ostringstream e;
if(this->DefaultPlatformToolset.empty()) if(this->DefaultPlatformToolset.empty())
{ {
e << this->GetName() << " supports Windows Store '8.0' and '8.1', but " e << this->GetName() << " supports Windows Store '8.0' and '8.1', but "

View File

@ -1170,7 +1170,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
this->CreateString("2147483647")); this->CreateString("2147483647"));
copyFilesBuildPhase->AddAttribute("dstSubfolderSpec", copyFilesBuildPhase->AddAttribute("dstSubfolderSpec",
this->CreateString("6")); this->CreateString("6"));
cmOStringStream ostr; std::ostringstream ostr;
if (cmtarget.IsFrameworkOnApple()) if (cmtarget.IsFrameworkOnApple())
{ {
// dstPath in frameworks is relative to Versions/<version> // dstPath in frameworks is relative to Versions/<version>
@ -1581,7 +1581,7 @@ void cmGlobalXCodeGenerator
} }
else else
{ {
cmOStringStream str; std::ostringstream str;
str << "_buildpart_" << count++ ; str << "_buildpart_" << count++ ;
tname[&ccg.GetCC()] = std::string(target.GetName()) + str.str(); tname[&ccg.GetCC()] = std::string(target.GetName()) + str.str();
makefileStream << "\\\n\t" << tname[&ccg.GetCC()]; makefileStream << "\\\n\t" << tname[&ccg.GetCC()];
@ -2299,7 +2299,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
// VERSION -> current_version // VERSION -> current_version
target.GetTargetVersion(false, major, minor, patch); target.GetTargetVersion(false, major, minor, patch);
cmOStringStream v; std::ostringstream v;
// Xcode always wants at least 1.0.0 or nothing // Xcode always wants at least 1.0.0 or nothing
if(!(major == 0 && minor == 0 && patch == 0)) if(!(major == 0 && minor == 0 && patch == 0))
@ -2311,7 +2311,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
// SOVERSION -> compatibility_version // SOVERSION -> compatibility_version
target.GetTargetVersion(true, major, minor, patch); target.GetTargetVersion(true, major, minor, patch);
cmOStringStream vso; std::ostringstream vso;
// Xcode always wants at least 1.0.0 or nothing // Xcode always wants at least 1.0.0 or nothing
if(!(major == 0 && minor == 0 && patch == 0)) if(!(major == 0 && minor == 0 && patch == 0))

View File

@ -497,7 +497,7 @@ int cmGraphVizWriter::CollectAllTargets()
continue; continue;
} }
//std::cout << "Found target: " << tit->first.c_str() << std::endl; //std::cout << "Found target: " << tit->first.c_str() << std::endl;
cmOStringStream ostr; std::ostringstream ostr;
ostr << this->GraphNodePrefix << cnt++; ostr << this->GraphNodePrefix << cnt++;
this->TargetNamesNodes[realTargetName] = ostr.str(); this->TargetNamesNodes[realTargetName] = ostr.str();
this->TargetPtrs[realTargetName] = &tit->second; this->TargetPtrs[realTargetName] = &tit->second;
@ -544,7 +544,7 @@ int cmGraphVizWriter::CollectAllExternalLibs(int cnt)
this->TargetPtrs.find(libName); this->TargetPtrs.find(libName);
if ( tarIt == this->TargetPtrs.end() ) if ( tarIt == this->TargetPtrs.end() )
{ {
cmOStringStream ostr; std::ostringstream ostr;
ostr << this->GraphNodePrefix << cnt++; ostr << this->GraphNodePrefix << cnt++;
this->TargetNamesNodes[libName] = ostr.str(); this->TargetNamesNodes[libName] = ostr.str();
this->TargetPtrs[libName] = NULL; this->TargetPtrs[libName] = NULL;

View File

@ -98,7 +98,7 @@ bool cmIncludeCommand
if (gg->IsExportedTargetsFile(fname_abs)) if (gg->IsExportedTargetsFile(fname_abs))
{ {
const char *modal = 0; const char *modal = 0;
cmOStringStream e; std::ostringstream e;
cmake::MessageType messageType = cmake::AUTHOR_WARNING; cmake::MessageType messageType = cmake::AUTHOR_WARNING;
switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0024)) switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0024))

View File

@ -273,7 +273,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
if(!unknownArgs.empty()) if(!unknownArgs.empty())
{ {
// Unknown argument. // Unknown argument.
cmOStringStream e; std::ostringstream e;
e << "TARGETS given unknown argument \"" << unknownArgs[0] << "\"."; e << "TARGETS given unknown argument \"" << unknownArgs[0] << "\".";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -373,7 +373,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
if (this->Makefile->IsAlias(*targetIt)) if (this->Makefile->IsAlias(*targetIt))
{ {
cmOStringStream e; std::ostringstream e;
e << "TARGETS given target \"" << (*targetIt) e << "TARGETS given target \"" << (*targetIt)
<< "\" which is an alias."; << "\" which is an alias.";
this->SetError(e.str()); this->SetError(e.str());
@ -390,7 +390,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
target->GetType() != cmTarget::OBJECT_LIBRARY && target->GetType() != cmTarget::OBJECT_LIBRARY &&
target->GetType() != cmTarget::INTERFACE_LIBRARY) target->GetType() != cmTarget::INTERFACE_LIBRARY)
{ {
cmOStringStream e; std::ostringstream e;
e << "TARGETS given target \"" << (*targetIt) e << "TARGETS given target \"" << (*targetIt)
<< "\" which is not an executable, library, or module."; << "\" which is not an executable, library, or module.";
this->SetError(e.str()); this->SetError(e.str());
@ -398,7 +398,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
} }
else if(target->GetType() == cmTarget::OBJECT_LIBRARY) else if(target->GetType() == cmTarget::OBJECT_LIBRARY)
{ {
cmOStringStream e; std::ostringstream e;
e << "TARGETS given OBJECT library \"" << (*targetIt) e << "TARGETS given OBJECT library \"" << (*targetIt)
<< "\" which may not be installed."; << "\" which may not be installed.";
this->SetError(e.str()); this->SetError(e.str());
@ -410,7 +410,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
else else
{ {
// Did not find the target. // Did not find the target.
cmOStringStream e; std::ostringstream e;
e << "TARGETS given target \"" << (*targetIt) e << "TARGETS given target \"" << (*targetIt)
<< "\" which does not exist in this directory."; << "\" which does not exist in this directory.";
this->SetError(e.str()); this->SetError(e.str());
@ -502,7 +502,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "TARGETS given no FRAMEWORK DESTINATION for shared library " e << "TARGETS given no FRAMEWORK DESTINATION for shared library "
"FRAMEWORK target \"" << target.GetName() << "\"."; "FRAMEWORK target \"" << target.GetName() << "\".";
this->SetError(e.str()); this->SetError(e.str());
@ -522,7 +522,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "TARGETS given no LIBRARY DESTINATION for shared library " e << "TARGETS given no LIBRARY DESTINATION for shared library "
"target \"" << target.GetName() << "\"."; "target \"" << target.GetName() << "\".";
this->SetError(e.str()); this->SetError(e.str());
@ -542,7 +542,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "TARGETS given no ARCHIVE DESTINATION for static library " e << "TARGETS given no ARCHIVE DESTINATION for static library "
"target \"" << target.GetName() << "\"."; "target \"" << target.GetName() << "\".";
this->SetError(e.str()); this->SetError(e.str());
@ -563,7 +563,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "TARGETS given no LIBRARY DESTINATION for module target \"" e << "TARGETS given no LIBRARY DESTINATION for module target \""
<< target.GetName() << "\"."; << target.GetName() << "\".";
this->SetError(e.str()); this->SetError(e.str());
@ -598,7 +598,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
} }
if(!bundleGenerator) if(!bundleGenerator)
{ {
cmOStringStream e; std::ostringstream e;
e << "TARGETS given no BUNDLE DESTINATION for MACOSX_BUNDLE " e << "TARGETS given no BUNDLE DESTINATION for MACOSX_BUNDLE "
"executable target \"" << target.GetName() << "\"."; "executable target \"" << target.GetName() << "\".";
this->SetError(e.str()); this->SetError(e.str());
@ -615,7 +615,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "TARGETS given no RUNTIME DESTINATION for executable " e << "TARGETS given no RUNTIME DESTINATION for executable "
"target \"" << target.GetName() << "\"."; "target \"" << target.GetName() << "\".";
this->SetError(e.str()); this->SetError(e.str());
@ -681,7 +681,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "INSTALL TARGETS - target " << target.GetName() << " has " e << "INSTALL TARGETS - target " << target.GetName() << " has "
<< "PRIVATE_HEADER files but no PRIVATE_HEADER DESTINATION."; << "PRIVATE_HEADER files but no PRIVATE_HEADER DESTINATION.";
cmSystemTools::Message(e.str().c_str(), "Warning"); cmSystemTools::Message(e.str().c_str(), "Warning");
@ -708,7 +708,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "INSTALL TARGETS - target " << target.GetName() << " has " e << "INSTALL TARGETS - target " << target.GetName() << " has "
<< "PUBLIC_HEADER files but no PUBLIC_HEADER DESTINATION."; << "PUBLIC_HEADER files but no PUBLIC_HEADER DESTINATION.";
cmSystemTools::Message(e.str().c_str(), "Warning"); cmSystemTools::Message(e.str().c_str(), "Warning");
@ -734,7 +734,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "INSTALL TARGETS - target " << target.GetName() << " has " e << "INSTALL TARGETS - target " << target.GetName() << " has "
<< "RESOURCE files but no RESOURCE DESTINATION."; << "RESOURCE files but no RESOURCE DESTINATION.";
cmSystemTools::Message(e.str().c_str(), "Warning"); cmSystemTools::Message(e.str().c_str(), "Warning");
@ -855,7 +855,7 @@ bool cmInstallCommand::HandleFilesMode(std::vector<std::string> const& args)
if(!unknownArgs.empty()) if(!unknownArgs.empty())
{ {
// Unknown argument. // Unknown argument.
cmOStringStream e; std::ostringstream e;
e << args[0] << " given unknown argument \"" << unknownArgs[0] << "\"."; e << args[0] << " given unknown argument \"" << unknownArgs[0] << "\".";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -870,7 +870,7 @@ bool cmInstallCommand::HandleFilesMode(std::vector<std::string> const& args)
if(!ica.GetRename().empty() && files.GetVector().size() > 1) if(!ica.GetRename().empty() && files.GetVector().size() > 1)
{ {
// The rename option works only with one file. // The rename option works only with one file.
cmOStringStream e; std::ostringstream e;
e << args[0] << " given RENAME option with more than one file."; e << args[0] << " given RENAME option with more than one file.";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -890,7 +890,7 @@ bool cmInstallCommand::HandleFilesMode(std::vector<std::string> const& args)
if(ica.GetDestination().empty()) if(ica.GetDestination().empty())
{ {
// A destination is required. // A destination is required.
cmOStringStream e; std::ostringstream e;
e << args[0] << " given no DESTINATION!"; e << args[0] << " given no DESTINATION!";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -931,7 +931,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector<std::string> const& args)
{ {
if(in_match_mode) if(in_match_mode)
{ {
cmOStringStream e; std::ostringstream e;
e << args[0] << " does not allow \"" e << args[0] << " does not allow \""
<< args[i] << "\" after PATTERN or REGEX."; << args[i] << "\" after PATTERN or REGEX.";
this->SetError(e.str()); this->SetError(e.str());
@ -945,7 +945,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector<std::string> const& args)
{ {
if(in_match_mode) if(in_match_mode)
{ {
cmOStringStream e; std::ostringstream e;
e << args[0] << " does not allow \"" e << args[0] << " does not allow \""
<< args[i] << "\" after PATTERN or REGEX."; << args[i] << "\" after PATTERN or REGEX.";
this->SetError(e.str()); this->SetError(e.str());
@ -960,7 +960,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector<std::string> const& args)
{ {
if(in_match_mode) if(in_match_mode)
{ {
cmOStringStream e; std::ostringstream e;
e << args[0] << " does not allow \"" e << args[0] << " does not allow \""
<< args[i] << "\" after PATTERN or REGEX."; << args[i] << "\" after PATTERN or REGEX.";
this->SetError(e.str()); this->SetError(e.str());
@ -988,7 +988,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector<std::string> const& args)
// Add this property to the current match rule. // Add this property to the current match rule.
if(!in_match_mode || doing == DoingPattern || doing == DoingRegex) if(!in_match_mode || doing == DoingPattern || doing == DoingRegex)
{ {
cmOStringStream e; std::ostringstream e;
e << args[0] << " does not allow \"" e << args[0] << " does not allow \""
<< args[i] << "\" before a PATTERN or REGEX is given."; << args[i] << "\" before a PATTERN or REGEX is given.";
this->SetError(e.str()); this->SetError(e.str());
@ -1001,7 +1001,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector<std::string> const& args)
{ {
if(!in_match_mode) if(!in_match_mode)
{ {
cmOStringStream e; std::ostringstream e;
e << args[0] << " does not allow \"" e << args[0] << " does not allow \""
<< args[i] << "\" before a PATTERN or REGEX is given."; << args[i] << "\" before a PATTERN or REGEX is given.";
this->SetError(e.str()); this->SetError(e.str());
@ -1016,7 +1016,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector<std::string> const& args)
{ {
if(in_match_mode) if(in_match_mode)
{ {
cmOStringStream e; std::ostringstream e;
e << args[0] << " does not allow \"" e << args[0] << " does not allow \""
<< args[i] << "\" after PATTERN or REGEX."; << args[i] << "\" after PATTERN or REGEX.";
this->SetError(e.str()); this->SetError(e.str());
@ -1030,7 +1030,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector<std::string> const& args)
{ {
if(in_match_mode) if(in_match_mode)
{ {
cmOStringStream e; std::ostringstream e;
e << args[0] << " does not allow \"" e << args[0] << " does not allow \""
<< args[i] << "\" after PATTERN or REGEX."; << args[i] << "\" after PATTERN or REGEX.";
this->SetError(e.str()); this->SetError(e.str());
@ -1044,7 +1044,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector<std::string> const& args)
{ {
if(in_match_mode) if(in_match_mode)
{ {
cmOStringStream e; std::ostringstream e;
e << args[0] << " does not allow \"" e << args[0] << " does not allow \""
<< args[i] << "\" after PATTERN or REGEX."; << args[i] << "\" after PATTERN or REGEX.";
this->SetError(e.str()); this->SetError(e.str());
@ -1059,7 +1059,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector<std::string> const& args)
{ {
if(in_match_mode) if(in_match_mode)
{ {
cmOStringStream e; std::ostringstream e;
e << args[0] << " does not allow \"" e << args[0] << " does not allow \""
<< args[i] << "\" after PATTERN or REGEX."; << args[i] << "\" after PATTERN or REGEX.";
this->SetError(e.str()); this->SetError(e.str());
@ -1074,7 +1074,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector<std::string> const& args)
{ {
if(in_match_mode) if(in_match_mode)
{ {
cmOStringStream e; std::ostringstream e;
e << args[0] << " does not allow \"" e << args[0] << " does not allow \""
<< args[i] << "\" after PATTERN or REGEX."; << args[i] << "\" after PATTERN or REGEX.";
this->SetError(e.str()); this->SetError(e.str());
@ -1088,7 +1088,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector<std::string> const& args)
{ {
if(in_match_mode) if(in_match_mode)
{ {
cmOStringStream e; std::ostringstream e;
e << args[0] << " does not allow \"" e << args[0] << " does not allow \""
<< args[i] << "\" after PATTERN or REGEX."; << args[i] << "\" after PATTERN or REGEX.";
this->SetError(e.str()); this->SetError(e.str());
@ -1113,7 +1113,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector<std::string> const& args)
if(cmSystemTools::FileExists(dir.c_str()) && if(cmSystemTools::FileExists(dir.c_str()) &&
!cmSystemTools::FileIsDirectory(dir)) !cmSystemTools::FileIsDirectory(dir))
{ {
cmOStringStream e; std::ostringstream e;
e << args[0] << " given non-directory \"" e << args[0] << " given non-directory \""
<< args[i] << "\" to install."; << args[i] << "\" to install.";
this->SetError(e.str()); this->SetError(e.str());
@ -1169,7 +1169,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector<std::string> const& args)
// Check the requested permission. // Check the requested permission.
if(!cmInstallCommandArguments::CheckPermissions(args[i],permissions_file)) if(!cmInstallCommandArguments::CheckPermissions(args[i],permissions_file))
{ {
cmOStringStream e; std::ostringstream e;
e << args[0] << " given invalid file permission \"" e << args[0] << " given invalid file permission \""
<< args[i] << "\"."; << args[i] << "\".";
this->SetError(e.str()); this->SetError(e.str());
@ -1181,7 +1181,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector<std::string> const& args)
// Check the requested permission. // Check the requested permission.
if(!cmInstallCommandArguments::CheckPermissions(args[i],permissions_dir)) if(!cmInstallCommandArguments::CheckPermissions(args[i],permissions_dir))
{ {
cmOStringStream e; std::ostringstream e;
e << args[0] << " given invalid directory permission \"" e << args[0] << " given invalid directory permission \""
<< args[i] << "\"."; << args[i] << "\".";
this->SetError(e.str()); this->SetError(e.str());
@ -1193,7 +1193,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector<std::string> const& args)
// Check the requested permission. // Check the requested permission.
if(!cmInstallCommandArguments::CheckPermissions(args[i], literal_args)) if(!cmInstallCommandArguments::CheckPermissions(args[i], literal_args))
{ {
cmOStringStream e; std::ostringstream e;
e << args[0] << " given invalid permission \"" e << args[0] << " given invalid permission \""
<< args[i] << "\"."; << args[i] << "\".";
this->SetError(e.str()); this->SetError(e.str());
@ -1203,7 +1203,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector<std::string> const& args)
else else
{ {
// Unknown argument. // Unknown argument.
cmOStringStream e; std::ostringstream e;
e << args[0] << " given unknown argument \"" << args[i] << "\"."; e << args[0] << " given unknown argument \"" << args[i] << "\".";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -1224,7 +1224,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector<std::string> const& args)
if(!destination) if(!destination)
{ {
// A destination is required. // A destination is required.
cmOStringStream e; std::ostringstream e;
e << args[0] << " given no DESTINATION!"; e << args[0] << " given no DESTINATION!";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -1271,7 +1271,7 @@ bool cmInstallCommand::HandleExportMode(std::vector<std::string> const& args)
if (!unknownArgs.empty()) if (!unknownArgs.empty())
{ {
// Unknown argument. // Unknown argument.
cmOStringStream e; std::ostringstream e;
e << args[0] << " given unknown argument \"" << unknownArgs[0] << "\"."; e << args[0] << " given unknown argument \"" << unknownArgs[0] << "\".";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -1286,7 +1286,7 @@ bool cmInstallCommand::HandleExportMode(std::vector<std::string> const& args)
if(ica.GetDestination().empty()) if(ica.GetDestination().empty())
{ {
// A destination is required. // A destination is required.
cmOStringStream e; std::ostringstream e;
e << args[0] << " given no DESTINATION!"; e << args[0] << " given no DESTINATION!";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;
@ -1296,7 +1296,7 @@ bool cmInstallCommand::HandleExportMode(std::vector<std::string> const& args)
std::string fname = filename.GetString(); std::string fname = filename.GetString();
if(fname.find_first_of(":/\\") != fname.npos) if(fname.find_first_of(":/\\") != fname.npos)
{ {
cmOStringStream e; std::ostringstream e;
e << args[0] << " given invalid export file name \"" << fname << "\". " e << args[0] << " given invalid export file name \"" << fname << "\". "
<< "The FILE argument may not contain a path. " << "The FILE argument may not contain a path. "
<< "Specify the path in the DESTINATION argument."; << "Specify the path in the DESTINATION argument.";
@ -1308,7 +1308,7 @@ bool cmInstallCommand::HandleExportMode(std::vector<std::string> const& args)
if(!fname.empty() && if(!fname.empty() &&
cmSystemTools::GetFilenameLastExtension(fname) != ".cmake") cmSystemTools::GetFilenameLastExtension(fname) != ".cmake")
{ {
cmOStringStream e; std::ostringstream e;
e << args[0] << " given invalid export file name \"" << fname << "\". " e << args[0] << " given invalid export file name \"" << fname << "\". "
<< "The FILE argument must specify a name ending in \".cmake\"."; << "The FILE argument must specify a name ending in \".cmake\".";
this->SetError(e.str()); this->SetError(e.str());
@ -1323,7 +1323,7 @@ bool cmInstallCommand::HandleExportMode(std::vector<std::string> const& args)
if(fname.find_first_of(":/\\") != fname.npos) if(fname.find_first_of(":/\\") != fname.npos)
{ {
cmOStringStream e; std::ostringstream e;
e << args[0] << " given export name \"" << exp.GetString() << "\". " e << args[0] << " given export name \"" << exp.GetString() << "\". "
<< "This name cannot be safely converted to a file name. " << "This name cannot be safely converted to a file name. "
<< "Specify a different export name or use the FILE option to set " << "Specify a different export name or use the FILE option to set "
@ -1348,7 +1348,7 @@ bool cmInstallCommand::HandleExportMode(std::vector<std::string> const& args)
if(!newCMP0022Behavior) if(!newCMP0022Behavior)
{ {
cmOStringStream e; std::ostringstream e;
e << "INSTALL(EXPORT) given keyword \"" e << "INSTALL(EXPORT) given keyword \""
<< "EXPORT_LINK_INTERFACE_LIBRARIES" << "\", but target \"" << "EXPORT_LINK_INTERFACE_LIBRARIES" << "\", but target \""
<< te->Target->GetName() << te->Target->GetName()
@ -1395,7 +1395,7 @@ bool cmInstallCommand::MakeFilesFullPath(const char* modeName,
// Make sure the file is not a directory. // Make sure the file is not a directory.
if(gpos == file.npos && cmSystemTools::FileIsDirectory(file)) if(gpos == file.npos && cmSystemTools::FileIsDirectory(file))
{ {
cmOStringStream e; std::ostringstream e;
e << modeName << " given directory \"" << (*fileIt) << "\" to install."; e << modeName << " given directory \"" << (*fileIt) << "\" to install.";
this->SetError(e.str()); this->SetError(e.str());
return false; return false;

View File

@ -121,7 +121,7 @@ void cmInstallExportGenerator::GenerateScript(std::ostream& os)
// Skip empty sets. // Skip empty sets.
if(ExportSet->GetTargetExports()->empty()) if(ExportSet->GetTargetExports()->empty())
{ {
cmOStringStream e; std::ostringstream e;
e << "INSTALL(EXPORT) given unknown export \"" e << "INSTALL(EXPORT) given unknown export \""
<< ExportSet->GetName() << "\""; << ExportSet->GetName() << "\"";
cmSystemTools::Error(e.str().c_str()); cmSystemTools::Error(e.str().c_str());

View File

@ -47,7 +47,7 @@ void cmInstallTargetGenerator::GenerateScript(std::ostream& os)
// Warn if installing an exclude-from-all target. // Warn if installing an exclude-from-all target.
if(this->Target->GetPropertyAsBool("EXCLUDE_FROM_ALL")) if(this->Target->GetPropertyAsBool("EXCLUDE_FROM_ALL"))
{ {
cmOStringStream msg; std::ostringstream msg;
msg << "WARNING: Target \"" << this->Target->GetName() msg << "WARNING: Target \"" << this->Target->GetName()
<< "\" has EXCLUDE_FROM_ALL set and will not be built by default " << "\" has EXCLUDE_FROM_ALL set and will not be built by default "
<< "but an install rule has been provided for it. CMake does " << "but an install rule has been provided for it. CMake does "
@ -424,7 +424,7 @@ cmInstallTargetGenerator
::AddTweak(std::ostream& os, Indent const& indent, const std::string& config, ::AddTweak(std::ostream& os, Indent const& indent, const std::string& config,
std::string const& file, TweakMethod tweak) std::string const& file, TweakMethod tweak)
{ {
cmOStringStream tw; std::ostringstream tw;
(this->*tweak)(tw, indent.Next(), config, file); (this->*tweak)(tw, indent.Next(), config, file);
std::string tws = tw.str(); std::string tws = tw.str();
if(!tws.empty()) if(!tws.empty())
@ -450,7 +450,7 @@ cmInstallTargetGenerator
else else
{ {
// Generate a foreach loop to tweak multiple files. // Generate a foreach loop to tweak multiple files.
cmOStringStream tw; std::ostringstream tw;
this->AddTweak(tw, indent.Next(), config, "${file}", tweak); this->AddTweak(tw, indent.Next(), config, "${file}", tweak);
std::string tws = tw.str(); std::string tws = tw.str();
if(!tws.empty()) if(!tws.empty())
@ -699,7 +699,7 @@ cmInstallTargetGenerator
(!oldRuntimeDirs.empty() || !newRuntimeDirs.empty()) (!oldRuntimeDirs.empty() || !newRuntimeDirs.empty())
) )
{ {
cmOStringStream msg; std::ostringstream msg;
msg << "WARNING: Target \"" << this->Target->GetName() msg << "WARNING: Target \"" << this->Target->GetName()
<< "\" has runtime paths which cannot be changed during install. " << "\" has runtime paths which cannot be changed during install. "
<< "To change runtime paths, OS X version 10.6 or newer is required. " << "To change runtime paths, OS X version 10.6 or newer is required. "

View File

@ -36,7 +36,7 @@ void cmLinkDirectoriesCommand::AddLinkDir(std::string const& dir)
if(!cmSystemTools::FileIsFullPath(unixPath.c_str())) if(!cmSystemTools::FileIsFullPath(unixPath.c_str()))
{ {
bool convertToAbsolute = false; bool convertToAbsolute = false;
cmOStringStream e; std::ostringstream e;
e << "This command specifies the relative path\n" e << "This command specifies the relative path\n"
<< " " << unixPath << "\n" << " " << unixPath << "\n"
<< "as a link directory.\n"; << "as a link directory.\n";

View File

@ -225,7 +225,7 @@ bool cmListCommand::HandleGetCommand(std::vector<std::string> const& args)
} }
if ( item < 0 || nitem <= (size_t)item ) if ( item < 0 || nitem <= (size_t)item )
{ {
cmOStringStream str; std::ostringstream str;
str << "index: " << item << " out of range (-" str << "index: " << item << " out of range (-"
<< varArgsExpanded.size() << ", " << varArgsExpanded.size() << ", "
<< varArgsExpanded.size()-1 << ")"; << varArgsExpanded.size()-1 << ")";
@ -322,7 +322,7 @@ bool cmListCommand::HandleInsertCommand(std::vector<std::string> const& args)
if((!this->GetList(varArgsExpanded, listName) if((!this->GetList(varArgsExpanded, listName)
|| varArgsExpanded.empty()) && item != 0) || varArgsExpanded.empty()) && item != 0)
{ {
cmOStringStream str; std::ostringstream str;
str << "index: " << item << " out of range (0, 0)"; str << "index: " << item << " out of range (0, 0)";
this->SetError(str.str()); this->SetError(str.str());
return false; return false;
@ -337,7 +337,7 @@ bool cmListCommand::HandleInsertCommand(std::vector<std::string> const& args)
} }
if ( item < 0 || nitem <= (size_t)item ) if ( item < 0 || nitem <= (size_t)item )
{ {
cmOStringStream str; std::ostringstream str;
str << "index: " << item << " out of range (-" str << "index: " << item << " out of range (-"
<< varArgsExpanded.size() << ", " << varArgsExpanded.size() << ", "
<< (varArgsExpanded.size() == 0?0:(varArgsExpanded.size()-1)) << ")"; << (varArgsExpanded.size() == 0?0:(varArgsExpanded.size()-1)) << ")";
@ -570,7 +570,7 @@ bool cmListCommand::HandleRemoveAtCommand(
} }
if ( item < 0 || nitem <= (size_t)item ) if ( item < 0 || nitem <= (size_t)item )
{ {
cmOStringStream str; std::ostringstream str;
str << "index: " << item << " out of range (-" str << "index: " << item << " out of range (-"
<< varArgsExpanded.size() << ", " << varArgsExpanded.size() << ", "
<< varArgsExpanded.size()-1 << ")"; << varArgsExpanded.size()-1 << ")";

View File

@ -68,7 +68,7 @@ bool cmListFileParser::ParseFile()
bom != cmListFileLexer_BOM_UTF8) bom != cmListFileLexer_BOM_UTF8)
{ {
cmListFileLexer_SetFileName(this->Lexer, 0, 0); cmListFileLexer_SetFileName(this->Lexer, 0, 0);
cmOStringStream m; std::ostringstream m;
m << "File\n " << this->FileName << "\n" m << "File\n " << this->FileName << "\n"
<< "starts with a Byte-Order-Mark that is not UTF-8."; << "starts with a Byte-Order-Mark that is not UTF-8.";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, m.str()); this->Makefile->IssueMessage(cmake::FATAL_ERROR, m.str());
@ -108,7 +108,7 @@ bool cmListFileParser::ParseFile()
} }
else else
{ {
cmOStringStream error; std::ostringstream error;
error << "Error in cmake code at\n" error << "Error in cmake code at\n"
<< this->FileName << ":" << token->line << ":\n" << this->FileName << ":" << token->line << ":\n"
<< "Parse error. Expected a newline, got " << "Parse error. Expected a newline, got "
@ -120,7 +120,7 @@ bool cmListFileParser::ParseFile()
} }
else else
{ {
cmOStringStream error; std::ostringstream error;
error << "Error in cmake code at\n" error << "Error in cmake code at\n"
<< this->FileName << ":" << token->line << ":\n" << this->FileName << ":" << token->line << ":\n"
<< "Parse error. Expected a command name, got " << "Parse error. Expected a command name, got "
@ -268,7 +268,7 @@ bool cmListFileParser::ParseFunction(const char* name, long line)
token->type == cmListFileLexer_Token_Space) {} token->type == cmListFileLexer_Token_Space) {}
if(!token) if(!token)
{ {
cmOStringStream error; std::ostringstream error;
error << "Error in cmake code at\n" << this->FileName << ":" error << "Error in cmake code at\n" << this->FileName << ":"
<< cmListFileLexer_GetCurrentLine(this->Lexer) << ":\n" << cmListFileLexer_GetCurrentLine(this->Lexer) << ":\n"
<< "Parse error. Function missing opening \"(\"."; << "Parse error. Function missing opening \"(\".";
@ -277,7 +277,7 @@ bool cmListFileParser::ParseFunction(const char* name, long line)
} }
if(token->type != cmListFileLexer_Token_ParenLeft) if(token->type != cmListFileLexer_Token_ParenLeft)
{ {
cmOStringStream error; std::ostringstream error;
error << "Error in cmake code at\n" << this->FileName << ":" error << "Error in cmake code at\n" << this->FileName << ":"
<< cmListFileLexer_GetCurrentLine(this->Lexer) << ":\n" << cmListFileLexer_GetCurrentLine(this->Lexer) << ":\n"
<< "Parse error. Expected \"(\", got " << "Parse error. Expected \"(\", got "
@ -355,7 +355,7 @@ bool cmListFileParser::ParseFunction(const char* name, long line)
else else
{ {
// Error. // Error.
cmOStringStream error; std::ostringstream error;
error << "Error in cmake code at\n" << this->FileName << ":" error << "Error in cmake code at\n" << this->FileName << ":"
<< cmListFileLexer_GetCurrentLine(this->Lexer) << ":\n" << cmListFileLexer_GetCurrentLine(this->Lexer) << ":\n"
<< "Parse error. Function missing ending \")\". " << "Parse error. Function missing ending \")\". "
@ -367,7 +367,7 @@ bool cmListFileParser::ParseFunction(const char* name, long line)
} }
} }
cmOStringStream error; std::ostringstream error;
error << "Error in cmake code at\n" error << "Error in cmake code at\n"
<< this->FileName << ":" << lastLine << ":\n" << this->FileName << ":" << lastLine << ":\n"
<< "Parse error. Function missing ending \")\". " << "Parse error. Function missing ending \")\". "
@ -389,7 +389,7 @@ bool cmListFileParser::AddArgument(cmListFileLexer_Token* token,
} }
bool isError = (this->Separation == SeparationError || bool isError = (this->Separation == SeparationError ||
delim == cmListFileArgument::Bracket); delim == cmListFileArgument::Bracket);
cmOStringStream m; std::ostringstream m;
m << "Syntax " << (isError? "Error":"Warning") << " in cmake code at\n" m << "Syntax " << (isError? "Error":"Warning") << " in cmake code at\n"
<< " " << this->FileName << ":" << token->line << ":" << " " << this->FileName << ":" << token->line << ":"
<< token->column << "\n" << token->column << "\n"

View File

@ -226,7 +226,7 @@ bool cmLoadCommandCommand
std::string fullPath = cmSystemTools::FindFile(moduleName.c_str(), path); std::string fullPath = cmSystemTools::FindFile(moduleName.c_str(), path);
if (fullPath == "") if (fullPath == "")
{ {
cmOStringStream e; std::ostringstream e;
e << "Attempt to load command failed from file \"" e << "Attempt to load command failed from file \""
<< moduleName << "\""; << moduleName << "\"";
this->SetError(e.str()); this->SetError(e.str());

View File

@ -153,7 +153,7 @@ void cmLocalGenerator::ComputeObjectMaxPath()
} }
else else
{ {
cmOStringStream w; std::ostringstream w;
w << "CMAKE_OBJECT_PATH_MAX is set to " << pmax w << "CMAKE_OBJECT_PATH_MAX is set to " << pmax
<< ", which is less than the minimum of 128. " << ", which is less than the minimum of 128. "
<< "The value will be ignored."; << "The value will be ignored.";
@ -162,7 +162,7 @@ void cmLocalGenerator::ComputeObjectMaxPath()
} }
else else
{ {
cmOStringStream w; std::ostringstream w;
w << "CMAKE_OBJECT_PATH_MAX is set to \"" << plen w << "CMAKE_OBJECT_PATH_MAX is set to \"" << plen
<< "\", which fails to parse as a positive integer. " << "\", which fails to parse as a positive integer. "
<< "The value will be ignored."; << "The value will be ignored.";
@ -191,7 +191,7 @@ void cmLocalGenerator::ReadInputFile()
// The file is missing. Check policy CMP0014. // The file is missing. Check policy CMP0014.
cmMakefile* mf = this->Parent->GetMakefile(); cmMakefile* mf = this->Parent->GetMakefile();
cmOStringStream e; std::ostringstream e;
e << "The source directory\n" e << "The source directory\n"
<< " " << this->Makefile->GetStartDirectory() << "\n" << " " << this->Makefile->GetStartDirectory() << "\n"
<< "does not contain a CMakeLists.txt file."; << "does not contain a CMakeLists.txt file.";
@ -1245,7 +1245,7 @@ void cmLocalGenerator::InsertRuleLauncher(std::string& s, cmTarget* target,
{ {
if(const char* val = this->GetRuleLauncher(target, prop)) if(const char* val = this->GetRuleLauncher(target, prop))
{ {
cmOStringStream wrapped; std::ostringstream wrapped;
wrapped << val << " " << s; wrapped << val << " " << s;
s = wrapped.str(); s = wrapped.str();
} }
@ -1326,7 +1326,7 @@ std::string cmLocalGenerator::GetIncludeFlags(
} }
OutputFormat shellFormat = forResponseFile? RESPONSE : SHELL; OutputFormat shellFormat = forResponseFile? RESPONSE : SHELL;
cmOStringStream includeFlags; std::ostringstream includeFlags;
std::string flagVar = "CMAKE_INCLUDE_FLAG_"; std::string flagVar = "CMAKE_INCLUDE_FLAG_";
flagVar += lang; flagVar += lang;
@ -1521,7 +1521,7 @@ void cmLocalGenerator::AddCompileOptions(
} }
if (this->Makefile->IsLaterStandard(it->first, standard, it->second)) if (this->Makefile->IsLaterStandard(it->first, standard, it->second))
{ {
cmOStringStream e; std::ostringstream e;
e << "The COMPILE_FEATURES property of target \"" e << "The COMPILE_FEATURES property of target \""
<< target->GetName() << "\" was evaluated when computing the link " << target->GetName() << "\" was evaluated when computing the link "
"implementation, and the \"" << it->first << "_STANDARD\" was \"" "implementation, and the \"" << it->first << "_STANDARD\" was \""
@ -1880,7 +1880,7 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& linkLibraries,
OutputFormat shellFormat = (forResponseFile) ? RESPONSE : OutputFormat shellFormat = (forResponseFile) ? RESPONSE :
((useWatcomQuote) ? WATCOMQUOTE : SHELL); ((useWatcomQuote) ? WATCOMQUOTE : SHELL);
bool escapeAllowMakeVars = !forResponseFile; bool escapeAllowMakeVars = !forResponseFile;
cmOStringStream fout; std::ostringstream fout;
std::string config = this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"); std::string config = this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
cmComputeLinkInformation* pcli = tgt.Target->GetLinkInformation(config); cmComputeLinkInformation* pcli = tgt.Target->GetLinkInformation(config);
if(!pcli) if(!pcli)
@ -2242,7 +2242,7 @@ AddCompilerRequirementFlag(std::string &flags, cmTarget* target,
const char *opt = target->GetMakefile()->GetDefinition(option_flag); const char *opt = target->GetMakefile()->GetDefinition(option_flag);
if (!opt) if (!opt)
{ {
cmOStringStream e; std::ostringstream e;
e << "Target \"" << target->GetName() << "\" requires the language " e << "Target \"" << target->GetName() << "\" requires the language "
"dialect \"" << lang << standardProp << "\" " "dialect \"" << lang << standardProp << "\" "
<< (ext ? "(with compiler extensions)" : "") << ", but CMake " << (ext ? "(with compiler extensions)" : "") << ", but CMake "
@ -2327,7 +2327,7 @@ static void AddVisibilityCompileOption(std::string &flags, cmTarget* target,
&& strcmp(prop, "protected") != 0 && strcmp(prop, "protected") != 0
&& strcmp(prop, "internal") != 0 ) && strcmp(prop, "internal") != 0 )
{ {
cmOStringStream e; std::ostringstream e;
e << "Target " << target->GetName() << " uses unsupported value \"" e << "Target " << target->GetName() << " uses unsupported value \""
<< prop << "\" for " << flagDefine << "."; << prop << "\" for " << flagDefine << ".";
cmSystemTools::Error(e.str().c_str()); cmSystemTools::Error(e.str().c_str());
@ -2442,7 +2442,7 @@ bool cmLocalGenerator::GetShouldUseOldFlags(bool shared,
{ {
case cmPolicies::WARN: case cmPolicies::WARN:
{ {
cmOStringStream e; std::ostringstream e;
e << "Variable " << flagsVar << " has been modified. CMake " e << "Variable " << flagsVar << " has been modified. CMake "
"will ignore the POSITION_INDEPENDENT_CODE target property for " "will ignore the POSITION_INDEPENDENT_CODE target property for "
"shared libraries and will use the " << flagsVar << " variable " "shared libraries and will use the " << flagsVar << " variable "
@ -3251,7 +3251,7 @@ cmLocalGenerator
// Warn if this is the first time the path has been seen. // Warn if this is the first time the path has been seen.
if(this->ObjectMaxPathViolations.insert(dir_max).second) if(this->ObjectMaxPathViolations.insert(dir_max).second)
{ {
cmOStringStream m; std::ostringstream m;
m << "The object file directory\n" m << "The object file directory\n"
<< " " << dir_max << "\n" << " " << dir_max << "\n"
<< "has " << dir_max.size() << " characters. " << "has " << dir_max.size() << " characters. "
@ -3649,7 +3649,7 @@ bool cmLocalGenerator::CheckDefinition(std::string const& define) const
} }
if(function_style) if(function_style)
{ {
cmOStringStream e; std::ostringstream e;
e << "WARNING: Function-style preprocessor definitions may not be " e << "WARNING: Function-style preprocessor definitions may not be "
<< "passed on the compiler command line because many compilers " << "passed on the compiler command line because many compilers "
<< "do not support it.\n" << "do not support it.\n"
@ -3662,7 +3662,7 @@ bool cmLocalGenerator::CheckDefinition(std::string const& define) const
// Many compilers do not support # in the value so we disable it. // Many compilers do not support # in the value so we disable it.
if(define.find_first_of("#") != define.npos) if(define.find_first_of("#") != define.npos)
{ {
cmOStringStream e; std::ostringstream e;
e << "WARNING: Preprocessor definitions containing '#' may not be " e << "WARNING: Preprocessor definitions containing '#' may not be "
<< "passed on the compiler command line because many compilers " << "passed on the compiler command line because many compilers "
<< "do not support it.\n" << "do not support it.\n"
@ -3704,7 +3704,7 @@ void cmLocalGenerator::GenerateAppleInfoPList(cmTarget* target,
} }
if(!cmSystemTools::FileExists(inFile.c_str(), true)) if(!cmSystemTools::FileExists(inFile.c_str(), true))
{ {
cmOStringStream e; std::ostringstream e;
e << "Target " << target->GetName() << " Info.plist template \"" e << "Target " << target->GetName() << " Info.plist template \""
<< inFile << "\" could not be found."; << inFile << "\" could not be found.";
cmSystemTools::Error(e.str().c_str()); cmSystemTools::Error(e.str().c_str());
@ -3748,7 +3748,7 @@ void cmLocalGenerator::GenerateFrameworkInfoPList(cmTarget* target,
} }
if(!cmSystemTools::FileExists(inFile.c_str(), true)) if(!cmSystemTools::FileExists(inFile.c_str(), true))
{ {
cmOStringStream e; std::ostringstream e;
e << "Target " << target->GetName() << " Info.plist template \"" e << "Target " << target->GetName() << " Info.plist template \""
<< inFile << "\" could not be found."; << inFile << "\" could not be found.";
cmSystemTools::Error(e.str().c_str()); cmSystemTools::Error(e.str().c_str());

View File

@ -369,7 +369,7 @@ std::string cmLocalNinjaGenerator::BuildCommandLine(
return ":"; return ":";
#endif #endif
cmOStringStream cmd; std::ostringstream cmd;
for (std::vector<std::string>::const_iterator li = cmdLines.begin(); for (std::vector<std::string>::const_iterator li = cmdLines.begin();
li != cmdLines.end(); ++li) li != cmdLines.end(); ++li)
#ifdef _WIN32 #ifdef _WIN32
@ -409,7 +409,7 @@ void cmLocalNinjaGenerator::AppendCustomCommandLines(
if (wd.empty()) if (wd.empty())
wd = this->GetMakefile()->GetStartOutputDirectory(); wd = this->GetMakefile()->GetStartOutputDirectory();
cmOStringStream cdCmd; std::ostringstream cdCmd;
#ifdef _WIN32 #ifdef _WIN32
std::string cdStr = "cd /D "; std::string cdStr = "cd /D ";
#else #else

View File

@ -1554,7 +1554,7 @@ bool cmLocalUnixMakefileGenerator3::UpdateDependencies(const char* tgtInfo,
{ {
if(verbose) if(verbose)
{ {
cmOStringStream msg; std::ostringstream msg;
msg << "Dependee \"" << tgtInfo msg << "Dependee \"" << tgtInfo
<< "\" is newer than depender \"" << "\" is newer than depender \""
<< internalDependFile << "\"." << std::endl; << internalDependFile << "\"." << std::endl;
@ -1577,7 +1577,7 @@ bool cmLocalUnixMakefileGenerator3::UpdateDependencies(const char* tgtInfo,
{ {
if(verbose) if(verbose)
{ {
cmOStringStream msg; std::ostringstream msg;
msg << "Dependee \"" << dirInfoFile msg << "Dependee \"" << dirInfoFile
<< "\" is newer than depender \"" << "\" is newer than depender \""
<< internalDependFile << "\"." << std::endl; << internalDependFile << "\"." << std::endl;
@ -1788,7 +1788,7 @@ void cmLocalUnixMakefileGenerator3::CheckMultipleOutputs(bool verbose)
{ {
if(verbose) if(verbose)
{ {
cmOStringStream msg; std::ostringstream msg;
msg << "Deleting primary custom command output \"" << dependee msg << "Deleting primary custom command output \"" << dependee
<< "\" because another output \"" << "\" because another output \""
<< depender << "\" does not exist." << std::endl; << depender << "\" does not exist." << std::endl;
@ -1918,7 +1918,7 @@ void cmLocalUnixMakefileGenerator3
std::string progressDir = this->Makefile->GetHomeOutputDirectory(); std::string progressDir = this->Makefile->GetHomeOutputDirectory();
progressDir += cmake::GetCMakeFilesDirectory(); progressDir += cmake::GetCMakeFilesDirectory();
{ {
cmOStringStream progCmd; std::ostringstream progCmd;
progCmd << progCmd <<
"$(CMAKE_COMMAND) -E cmake_progress_start "; "$(CMAKE_COMMAND) -E cmake_progress_start ";
progCmd << this->Convert(progressDir, progCmd << this->Convert(progressDir,
@ -1942,7 +1942,7 @@ void cmLocalUnixMakefileGenerator3
this->Makefile->GetHomeOutputDirectory(), this->Makefile->GetHomeOutputDirectory(),
cmLocalGenerator::START_OUTPUT); cmLocalGenerator::START_OUTPUT);
{ {
cmOStringStream progCmd; std::ostringstream progCmd;
progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # 0 progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # 0
progCmd << this->Convert(progressDir, progCmd << this->Convert(progressDir,
cmLocalGenerator::FULL, cmLocalGenerator::FULL,

View File

@ -1321,7 +1321,7 @@ void cmLocalVisualStudio6Generator
int major; int major;
int minor; int minor;
target.GetTargetVersion(major, minor); target.GetTargetVersion(major, minor);
cmOStringStream targetVersionStream; std::ostringstream targetVersionStream;
targetVersionStream << "/version:" << major << "." << minor; targetVersionStream << "/version:" << major << "." << minor;
targetVersionFlag = targetVersionStream.str(); targetVersionFlag = targetVersionStream.str();
} }
@ -1998,7 +1998,7 @@ cmLocalVisualStudio6Generator
if(define.find_first_of(" ") != define.npos && if(define.find_first_of(" ") != define.npos &&
define.find_first_of("\"$;") != define.npos) define.find_first_of("\"$;") != define.npos)
{ {
cmOStringStream e; std::ostringstream e;
e << "WARNING: The VS6 IDE does not support preprocessor definition " e << "WARNING: The VS6 IDE does not support preprocessor definition "
<< "values with spaces and '\"', '$', or ';'.\n" << "values with spaces and '\"', '$', or ';'.\n"
<< "CMake is dropping a preprocessor definition: " << define << "\n" << "CMake is dropping a preprocessor definition: " << define << "\n"

View File

@ -1115,7 +1115,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
if(this->GetVersion() < VS8 || this->FortranProject) if(this->GetVersion() < VS8 || this->FortranProject)
{ {
cmOStringStream libdeps; std::ostringstream libdeps;
this->Internal->OutputObjects(libdeps, &target); this->Internal->OutputObjects(libdeps, &target);
if(!libdeps.str().empty()) if(!libdeps.str().empty())
{ {
@ -1713,7 +1713,7 @@ bool cmLocalVisualStudio7Generator
// Write the children to temporary output. // Write the children to temporary output.
bool hasChildrenWithSources = false; bool hasChildrenWithSources = false;
cmOStringStream tmpOut; std::ostringstream tmpOut;
for(unsigned int i=0;i<children.size();++i) for(unsigned int i=0;i<children.size();++i)
{ {
if(this->WriteGroup(&children[i], target, tmpOut, libName, configs)) if(this->WriteGroup(&children[i], target, tmpOut, libName, configs))

View File

@ -107,7 +107,7 @@ bool cmMacroHelperCommand::InvokeInitialPass
cmMakefile::PolicyPushPop polScope(this->Makefile, true, this->Policies); cmMakefile::PolicyPushPop polScope(this->Makefile, true, this->Policies);
// set the value of argc // set the value of argc
cmOStringStream argcDefStream; std::ostringstream argcDefStream;
argcDefStream << expandedArgs.size(); argcDefStream << expandedArgs.size();
std::string argcDef = argcDefStream.str(); std::string argcDef = argcDefStream.str();

View File

@ -363,7 +363,7 @@ cmListFileBacktrace cmMakefile::GetBacktrace() const
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmMakefile::PrintCommandTrace(const cmListFileFunction& lff) const void cmMakefile::PrintCommandTrace(const cmListFileFunction& lff) const
{ {
cmOStringStream msg; std::ostringstream msg;
msg << lff.FilePath << "(" << lff.Line << "): "; msg << lff.FilePath << "(" << lff.Line << "): ";
msg << lff.Name << "("; msg << lff.Name << "(";
for(std::vector<cmListFileArgument>::const_iterator i = for(std::vector<cmListFileArgument>::const_iterator i =
@ -556,7 +556,7 @@ void cmMakefile::IncludeScope::EnforceCMP0011()
case cmPolicies::WARN: case cmPolicies::WARN:
// Warn because the user did not set this policy. // Warn because the user did not set this policy.
{ {
cmOStringStream w; std::ostringstream w;
w << policies->GetPolicyWarning(cmPolicies::CMP0011) << "\n" w << policies->GetPolicyWarning(cmPolicies::CMP0011) << "\n"
<< "The included script\n " << this->File << "\n" << "The included script\n " << this->File << "\n"
<< "affects policy settings. " << "affects policy settings. "
@ -568,7 +568,7 @@ void cmMakefile::IncludeScope::EnforceCMP0011()
case cmPolicies::REQUIRED_IF_USED: case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::REQUIRED_ALWAYS: case cmPolicies::REQUIRED_ALWAYS:
{ {
cmOStringStream e; std::ostringstream e;
e << policies->GetRequiredPolicyError(cmPolicies::CMP0011) << "\n" e << policies->GetRequiredPolicyError(cmPolicies::CMP0011) << "\n"
<< "The included script\n " << this->File << "\n" << "The included script\n " << this->File << "\n"
<< "affects policy settings, so it requires this policy to be set."; << "affects policy settings, so it requires this policy to be set.";
@ -741,7 +741,7 @@ void cmMakefile::EnforceDirectoryLevelRules() const
// Diagnose a violation of CMP0000 if necessary. // Diagnose a violation of CMP0000 if necessary.
if(this->CheckCMP0000) if(this->CheckCMP0000)
{ {
cmOStringStream msg; std::ostringstream msg;
msg << "No cmake_minimum_required command is present. " msg << "No cmake_minimum_required command is present. "
<< "A line of code such as\n" << "A line of code such as\n"
<< " cmake_minimum_required(VERSION " << " cmake_minimum_required(VERSION "
@ -897,7 +897,7 @@ cmMakefile::AddCustomCommandToTarget(const std::string& target,
{ {
cmake::MessageType messageType = cmake::AUTHOR_WARNING; cmake::MessageType messageType = cmake::AUTHOR_WARNING;
bool issueMessage = false; bool issueMessage = false;
cmOStringStream e; std::ostringstream e;
switch(this->GetPolicyStatus(cmPolicies::CMP0040)) switch(this->GetPolicyStatus(cmPolicies::CMP0040))
{ {
case cmPolicies::WARN: case cmPolicies::WARN:
@ -924,7 +924,7 @@ cmMakefile::AddCustomCommandToTarget(const std::string& target,
if(ti->second.GetType() == cmTarget::OBJECT_LIBRARY) if(ti->second.GetType() == cmTarget::OBJECT_LIBRARY)
{ {
cmOStringStream e; std::ostringstream e;
e << "Target \"" << target << "\" is an OBJECT library " e << "Target \"" << target << "\" is an OBJECT library "
"that may not have PRE_BUILD, PRE_LINK, or POST_BUILD commands."; "that may not have PRE_BUILD, PRE_LINK, or POST_BUILD commands.";
this->IssueMessage(cmake::FATAL_ERROR, e.str()); this->IssueMessage(cmake::FATAL_ERROR, e.str());
@ -932,7 +932,7 @@ cmMakefile::AddCustomCommandToTarget(const std::string& target,
} }
if(ti->second.GetType() == cmTarget::INTERFACE_LIBRARY) if(ti->second.GetType() == cmTarget::INTERFACE_LIBRARY)
{ {
cmOStringStream e; std::ostringstream e;
e << "Target \"" << target << "\" is an INTERFACE library " e << "Target \"" << target << "\" is an INTERFACE library "
"that may not have PRE_BUILD, PRE_LINK, or POST_BUILD commands."; "that may not have PRE_BUILD, PRE_LINK, or POST_BUILD commands.";
this->IssueMessage(cmake::FATAL_ERROR, e.str()); this->IssueMessage(cmake::FATAL_ERROR, e.str());
@ -997,7 +997,7 @@ cmMakefile::AddCustomCommandToOutput(const std::vector<std::string>& outputs,
cmCustomCommandLine const& cl = *i; cmCustomCommandLine const& cl = *i;
if(!cl.empty() && !cl[0].empty() && cl[0][0] == '"') if(!cl.empty() && !cl[0].empty() && cl[0][0] == '"')
{ {
cmOStringStream e; std::ostringstream e;
e << "COMMAND may not contain literal quotes:\n " << cl[0] << "\n"; e << "COMMAND may not contain literal quotes:\n " << cl[0] << "\n";
this->IssueMessage(cmake::FATAL_ERROR, e.str()); this->IssueMessage(cmake::FATAL_ERROR, e.str());
return 0; return 0;
@ -1555,7 +1555,7 @@ void cmMakefile::AddLinkLibraryForTarget(const std::string& target,
(tgt->GetType() == cmTarget::INTERFACE_LIBRARY) || (tgt->GetType() == cmTarget::INTERFACE_LIBRARY) ||
tgt->IsExecutableWithExports())) tgt->IsExecutableWithExports()))
{ {
cmOStringStream e; std::ostringstream e;
e << "Target \"" << lib << "\" of type " e << "Target \"" << lib << "\" of type "
<< cmTarget::GetTargetTypeName(tgt->GetType()) << cmTarget::GetTargetTypeName(tgt->GetType())
<< " may not be linked into another target. " << " may not be linked into another target. "
@ -1568,7 +1568,7 @@ void cmMakefile::AddLinkLibraryForTarget(const std::string& target,
} }
else else
{ {
cmOStringStream e; std::ostringstream e;
e << "Attempt to add link library \"" e << "Attempt to add link library \""
<< lib << "\" to target \"" << lib << "\" to target \""
<< target << "\" which is not built in this directory."; << target << "\" which is not built in this directory.";
@ -1584,7 +1584,7 @@ void cmMakefile::AddLinkDirectoryForTarget(const std::string& target,
{ {
if(this->IsAlias(target)) if(this->IsAlias(target))
{ {
cmOStringStream e; std::ostringstream e;
e << "ALIAS target \"" << target << "\" " e << "ALIAS target \"" << target << "\" "
<< "may not be linked into another target."; << "may not be linked into another target.";
this->IssueMessage(cmake::FATAL_ERROR, e.str()); this->IssueMessage(cmake::FATAL_ERROR, e.str());
@ -2006,7 +2006,7 @@ void cmMakefile::CheckForUnused(const char* reason,
!cmSystemTools::IsSubDirectory(path, !cmSystemTools::IsSubDirectory(path,
cmake::GetCMakeFilesDirectory()))) cmake::GetCMakeFilesDirectory())))
{ {
cmOStringStream msg; std::ostringstream msg;
msg << "unused variable (" << reason << ") \'" << name << "\'"; msg << "unused variable (" << reason << ") \'" << name << "\'";
this->GetCMakeInstance()->IssueMessage(cmake::AUTHOR_WARNING, this->GetCMakeInstance()->IssueMessage(cmake::AUTHOR_WARNING,
msg.str(), msg.str(),
@ -2311,7 +2311,7 @@ void cmMakefile::ExpandVariablesCMP0019()
{ {
return; return;
} }
cmOStringStream w; std::ostringstream w;
const char *includeDirs = this->GetProperty("INCLUDE_DIRECTORIES"); const char *includeDirs = this->GetProperty("INCLUDE_DIRECTORIES");
if(mightExpandVariablesCMP0019(includeDirs)) if(mightExpandVariablesCMP0019(includeDirs))
@ -2389,7 +2389,7 @@ void cmMakefile::ExpandVariablesCMP0019()
if(!w.str().empty()) if(!w.str().empty())
{ {
cmOStringStream m; std::ostringstream m;
m << this->GetPolicies()->GetPolicyWarning(cmPolicies::CMP0019) m << this->GetPolicies()->GetPolicyWarning(cmPolicies::CMP0019)
<< "\n" << "\n"
<< "The following variable evaluations were encountered:\n" << "The following variable evaluations were encountered:\n"
@ -2782,7 +2782,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringOld(
else else
{ {
// Construct the main error message. // Construct the main error message.
cmOStringStream error; std::ostringstream error;
error << "Syntax error in cmake code "; error << "Syntax error in cmake code ";
if(filename && line > 0) if(filename && line > 0)
{ {
@ -2890,7 +2890,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew(
case NORMAL: case NORMAL:
if(filename && lookup == lineVar) if(filename && lookup == lineVar)
{ {
cmOStringStream ostr; std::ostringstream ostr;
ostr << line; ostr << line;
varresult = ostr.str(); varresult = ostr.str();
} }
@ -2932,7 +2932,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew(
cmSystemTools::IsSubDirectory(filename, cmSystemTools::IsSubDirectory(filename,
this->GetHomeOutputDirectory())) this->GetHomeOutputDirectory()))
{ {
cmOStringStream msg; std::ostringstream msg;
cmListFileBacktrace bt(this->GetLocalGenerator()); cmListFileBacktrace bt(this->GetLocalGenerator());
cmListFileContext lfc; cmListFileContext lfc;
lfc.FilePath = filename; lfc.FilePath = filename;
@ -3126,7 +3126,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew(
if(error) if(error)
{ {
cmOStringStream emsg; std::ostringstream emsg;
emsg << "Syntax error in cmake code "; emsg << "Syntax error in cmake code ";
if(filename) if(filename)
{ {
@ -3341,7 +3341,7 @@ void cmMakefile::PopFunctionBlockerBarrier(bool reportError)
{ {
// Report the context in which the unclosed block was opened. // Report the context in which the unclosed block was opened.
cmListFileContext const& lfc = fb->GetStartingContext(); cmListFileContext const& lfc = fb->GetStartingContext();
cmOStringStream e; std::ostringstream e;
e << "A logical block opening on the line\n" e << "A logical block opening on the line\n"
<< " " << lfc << "\n" << " " << lfc << "\n"
<< "is not closed."; << "is not closed.";
@ -3499,7 +3499,7 @@ cmMakefile::RemoveFunctionBlocker(cmFunctionBlocker* fb,
if(!(*pos)->ShouldRemove(lff, *this)) if(!(*pos)->ShouldRemove(lff, *this))
{ {
cmListFileContext const& lfc = fb->GetStartingContext(); cmListFileContext const& lfc = fb->GetStartingContext();
cmOStringStream e; std::ostringstream e;
e << "A logical block opening on the line\n" e << "A logical block opening on the line\n"
<< " " << lfc << "\n" << " " << lfc << "\n"
<< "closes on the line\n" << "closes on the line\n"
@ -3559,14 +3559,14 @@ void cmMakefile::SetScriptModeFile(const char* scriptfile)
void cmMakefile::SetArgcArgv(const std::vector<std::string>& args) void cmMakefile::SetArgcArgv(const std::vector<std::string>& args)
{ {
cmOStringStream strStream; std::ostringstream strStream;
strStream << args.size(); strStream << args.size();
this->AddDefinition("CMAKE_ARGC", strStream.str().c_str()); this->AddDefinition("CMAKE_ARGC", strStream.str().c_str());
//this->MarkVariableAsUsed("CMAKE_ARGC"); //this->MarkVariableAsUsed("CMAKE_ARGC");
for (unsigned int t = 0; t < args.size(); ++t) for (unsigned int t = 0; t < args.size(); ++t)
{ {
cmOStringStream tmpStream; std::ostringstream tmpStream;
tmpStream << "CMAKE_ARGV" << t; tmpStream << "CMAKE_ARGV" << t;
this->AddDefinition(tmpStream.str(), args[t].c_str()); this->AddDefinition(tmpStream.str(), args[t].c_str());
//this->MarkVariableAsUsed(tmpStream.str().c_str()); //this->MarkVariableAsUsed(tmpStream.str().c_str());
@ -3918,7 +3918,7 @@ std::string cmMakefile::GetModulesFile(const char* filename) const
{ {
case cmPolicies::WARN: case cmPolicies::WARN:
{ {
cmOStringStream e; std::ostringstream e;
e << "File " << currentFile << " includes " e << "File " << currentFile << " includes "
<< moduleInCMakeModulePath << moduleInCMakeModulePath
<< " (found via CMAKE_MODULE_PATH) which shadows " << " (found via CMAKE_MODULE_PATH) which shadows "
@ -4098,7 +4098,7 @@ int cmMakefile::ConfigureFile(const char* infile, const char* outfile,
if(bom != cmsys::FStream::BOM_None && if(bom != cmsys::FStream::BOM_None &&
bom != cmsys::FStream::BOM_UTF8) bom != cmsys::FStream::BOM_UTF8)
{ {
cmOStringStream e; std::ostringstream e;
e << "File starts with a Byte-Order-Mark that is not UTF-8:\n " e << "File starts with a Byte-Order-Mark that is not UTF-8:\n "
<< sinfile; << sinfile;
this->IssueMessage(cmake::FATAL_ERROR, e.str()); this->IssueMessage(cmake::FATAL_ERROR, e.str());
@ -4310,7 +4310,7 @@ const char *cmMakefile::GetProperty(const std::string& prop,
} }
else if (prop == "LINK_DIRECTORIES") else if (prop == "LINK_DIRECTORIES")
{ {
cmOStringStream str; std::ostringstream str;
for (std::vector<std::string>::const_iterator for (std::vector<std::string>::const_iterator
it = this->GetLinkDirectories().begin(); it = this->GetLinkDirectories().begin();
it != this->GetLinkDirectories().end(); it != this->GetLinkDirectories().end();
@ -4488,7 +4488,7 @@ void cmMakefile::AddCMakeDependFilesFromUser()
std::string cmMakefile::GetListFileStack() const std::string cmMakefile::GetListFileStack() const
{ {
cmOStringStream tmp; std::ostringstream tmp;
size_t depth = this->ListFileStack.size(); size_t depth = this->ListFileStack.size();
if (depth > 0) if (depth > 0)
{ {
@ -4606,7 +4606,7 @@ void cmMakefile::RaiseScope(const std::string& var, const char *varDef)
} }
else else
{ {
cmOStringStream m; std::ostringstream m;
m << "Cannot set \"" << var << "\": current scope has no parent."; m << "Cannot set \"" << var << "\": current scope has no parent.";
this->IssueMessage(cmake::AUTHOR_WARNING, m.str()); this->IssueMessage(cmake::AUTHOR_WARNING, m.str());
} }
@ -4701,7 +4701,7 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg,
{ {
if(this->IsAlias(name)) if(this->IsAlias(name))
{ {
cmOStringStream e; std::ostringstream e;
e << "cannot create target \"" << name e << "cannot create target \"" << name
<< "\" because an alias with the same name already exists."; << "\" because an alias with the same name already exists.";
msg = e.str(); msg = e.str();
@ -4715,7 +4715,7 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg,
{ {
// Imported targets were not supported in previous versions. // Imported targets were not supported in previous versions.
// This is new code, so we can make it an error. // This is new code, so we can make it an error.
cmOStringStream e; std::ostringstream e;
e << "cannot create target \"" << name e << "cannot create target \"" << name
<< "\" because an imported target with the same name already exists."; << "\" because an imported target with the same name already exists.";
msg = e.str(); msg = e.str();
@ -4754,7 +4754,7 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg,
// Produce an error that tells the user how to work around the // Produce an error that tells the user how to work around the
// problem. // problem.
cmOStringStream e; std::ostringstream e;
e << "cannot create target \"" << name e << "cannot create target \"" << name
<< "\" because another target with the same name already exists. " << "\" because another target with the same name already exists. "
<< "The existing target is "; << "The existing target is ";
@ -4800,7 +4800,7 @@ bool cmMakefile::EnforceUniqueDir(const std::string& srcPath,
{ {
return true; return true;
} }
cmOStringStream e; std::ostringstream e;
switch (this->GetPolicyStatus(cmPolicies::CMP0013)) switch (this->GetPolicyStatus(cmPolicies::CMP0013))
{ {
case cmPolicies::WARN: case cmPolicies::WARN:
@ -4985,7 +4985,7 @@ bool cmMakefile::SetPolicy(const char *id,
cmPolicies::PolicyID pid; cmPolicies::PolicyID pid;
if (!this->GetPolicies()->GetPolicyID(id, /* out */ pid)) if (!this->GetPolicies()->GetPolicyID(id, /* out */ pid))
{ {
cmOStringStream e; std::ostringstream e;
e << "Policy \"" << id << "\" is not known to this version of CMake."; e << "Policy \"" << id << "\" is not known to this version of CMake.";
this->IssueMessage(cmake::FATAL_ERROR, e.str()); this->IssueMessage(cmake::FATAL_ERROR, e.str());
return false; return false;
@ -5200,7 +5200,7 @@ AddRequiredTargetFeature(cmTarget *target, const std::string& feature,
availableFeatures.end(), availableFeatures.end(),
feature) == availableFeatures.end()) feature) == availableFeatures.end())
{ {
cmOStringStream e; std::ostringstream e;
e << "The compiler feature \"" << feature e << "The compiler feature \"" << feature
<< "\" is not known to " << lang << " compiler\n\"" << "\" is not known to " << lang << " compiler\n\""
<< this->GetDefinition("CMAKE_" + lang + "_COMPILER_ID") << this->GetDefinition("CMAKE_" + lang + "_COMPILER_ID")
@ -5240,7 +5240,7 @@ CompileFeatureKnown(cmTarget const* target, const std::string& feature,
lang = "CXX"; lang = "CXX";
return true; return true;
} }
cmOStringStream e; std::ostringstream e;
if (error) if (error)
{ {
e << "specified"; e << "specified";
@ -5271,7 +5271,7 @@ CompileFeaturesAvailable(const std::string& lang, std::string *error) const
if (!featuresKnown || !*featuresKnown) if (!featuresKnown || !*featuresKnown)
{ {
cmOStringStream e; std::ostringstream e;
if (error) if (error)
{ {
e << "no"; e << "no";
@ -5326,7 +5326,7 @@ HaveCFeatureAvailable(cmTarget const* target, const std::string& feature) const
if (std::find_if(cmArrayBegin(C_STANDARDS), cmArrayEnd(C_STANDARDS), if (std::find_if(cmArrayBegin(C_STANDARDS), cmArrayEnd(C_STANDARDS),
cmStrCmp(existingCStandard)) == cmArrayEnd(C_STANDARDS)) cmStrCmp(existingCStandard)) == cmArrayEnd(C_STANDARDS))
{ {
cmOStringStream e; std::ostringstream e;
e << "The C_STANDARD property on target \"" << target->GetName() e << "The C_STANDARD property on target \"" << target->GetName()
<< "\" contained an invalid value: \"" << existingCStandard << "\"."; << "\" contained an invalid value: \"" << existingCStandard << "\".";
this->IssueMessage(cmake::FATAL_ERROR, e.str()); this->IssueMessage(cmake::FATAL_ERROR, e.str());
@ -5403,7 +5403,7 @@ bool cmMakefile::HaveCxxFeatureAvailable(cmTarget const* target,
if (std::find_if(cmArrayBegin(CXX_STANDARDS), cmArrayEnd(CXX_STANDARDS), if (std::find_if(cmArrayBegin(CXX_STANDARDS), cmArrayEnd(CXX_STANDARDS),
cmStrCmp(existingCxxStandard)) == cmArrayEnd(CXX_STANDARDS)) cmStrCmp(existingCxxStandard)) == cmArrayEnd(CXX_STANDARDS))
{ {
cmOStringStream e; std::ostringstream e;
e << "The CXX_STANDARD property on target \"" << target->GetName() e << "The CXX_STANDARD property on target \"" << target->GetName()
<< "\" contained an invalid value: \"" << existingCxxStandard << "\"."; << "\" contained an invalid value: \"" << existingCxxStandard << "\".";
this->IssueMessage(cmake::FATAL_ERROR, e.str()); this->IssueMessage(cmake::FATAL_ERROR, e.str());
@ -5478,7 +5478,7 @@ AddRequiredTargetCxxFeature(cmTarget *target,
if (std::find_if(cmArrayBegin(CXX_STANDARDS), cmArrayEnd(CXX_STANDARDS), if (std::find_if(cmArrayBegin(CXX_STANDARDS), cmArrayEnd(CXX_STANDARDS),
cmStrCmp(existingCxxStandard)) == cmArrayEnd(CXX_STANDARDS)) cmStrCmp(existingCxxStandard)) == cmArrayEnd(CXX_STANDARDS))
{ {
cmOStringStream e; std::ostringstream e;
e << "The CXX_STANDARD property on target \"" << target->GetName() e << "The CXX_STANDARD property on target \"" << target->GetName()
<< "\" contained an invalid value: \"" << existingCxxStandard << "\"."; << "\" contained an invalid value: \"" << existingCxxStandard << "\".";
this->IssueMessage(cmake::FATAL_ERROR, e.str()); this->IssueMessage(cmake::FATAL_ERROR, e.str());
@ -5577,7 +5577,7 @@ AddRequiredTargetCFeature(cmTarget *target, const std::string& feature) const
if (std::find_if(cmArrayBegin(C_STANDARDS), cmArrayEnd(C_STANDARDS), if (std::find_if(cmArrayBegin(C_STANDARDS), cmArrayEnd(C_STANDARDS),
cmStrCmp(existingCStandard)) == cmArrayEnd(C_STANDARDS)) cmStrCmp(existingCStandard)) == cmArrayEnd(C_STANDARDS))
{ {
cmOStringStream e; std::ostringstream e;
e << "The C_STANDARD property on target \"" << target->GetName() e << "The C_STANDARD property on target \"" << target->GetName()
<< "\" contained an invalid value: \"" << existingCStandard << "\"."; << "\" contained an invalid value: \"" << existingCStandard << "\".";
this->IssueMessage(cmake::FATAL_ERROR, e.str()); this->IssueMessage(cmake::FATAL_ERROR, e.str());

View File

@ -371,8 +371,8 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
std::string targetVersionMajor; std::string targetVersionMajor;
std::string targetVersionMinor; std::string targetVersionMinor;
{ {
cmOStringStream majorStream; std::ostringstream majorStream;
cmOStringStream minorStream; std::ostringstream minorStream;
int major; int major;
int minor; int minor;
this->Target->GetTargetVersion(major, minor); this->Target->GetTargetVersion(major, minor);

View File

@ -566,8 +566,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
std::string targetVersionMajor; std::string targetVersionMajor;
std::string targetVersionMinor; std::string targetVersionMinor;
{ {
cmOStringStream majorStream; std::ostringstream majorStream;
cmOStringStream minorStream; std::ostringstream minorStream;
int major; int major;
int minor; int minor;
this->Target->GetTargetVersion(major, minor); this->Target->GetTargetVersion(major, minor);
@ -805,7 +805,7 @@ cmMakefileLibraryTargetGenerator
if(major > 0 || minor > 0 || patch > 0) if(major > 0 || minor > 0 || patch > 0)
{ {
// Append the flag since a non-zero version is specified. // Append the flag since a non-zero version is specified.
cmOStringStream vflag; std::ostringstream vflag;
vflag << flag << major << "." << minor << "." << patch; vflag << flag << major << "." << minor << "." << patch;
this->LocalGenerator->AppendFlags(flags, vflag.str()); this->LocalGenerator->AppendFlags(flags, vflag.str());
} }

Some files were not shown because too many files have changed in this diff Show More