summaryrefslogtreecommitdiffstats
path: root/Source/cmcmd.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-03-11 12:35:32 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-03-11 14:03:50 (GMT)
commitaf8a1643c1a42aa3b276a50bca10a4faab176764 (patch)
treee43581126113bdad071f92dbe531b5d7d1009660 /Source/cmcmd.cxx
parent21c573f682f9eafbc8d4402f7febbb1bec1cb86a (diff)
downloadCMake-af8a1643c1a42aa3b276a50bca10a4faab176764.zip
CMake-af8a1643c1a42aa3b276a50bca10a4faab176764.tar.gz
CMake-af8a1643c1a42aa3b276a50bca10a4faab176764.tar.bz2
Remove c_str calls when using stream APIs.
Use an ad-hoc clang tool for matching the calls which should be ported.
Diffstat (limited to 'Source/cmcmd.cxx')
-rw-r--r--Source/cmcmd.cxx26
1 files changed, 13 insertions, 13 deletions
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index ad1f2a5..9aee975 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -102,8 +102,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
{
if(!cmSystemTools::cmCopyFile(args[2].c_str(), args[3].c_str()))
{
- std::cerr << "Error copying file \"" << args[2].c_str()
- << "\" to \"" << args[3].c_str() << "\".\n";
+ std::cerr << "Error copying file \"" << args[2]
+ << "\" to \"" << args[3] << "\".\n";
return 1;
}
return 0;
@@ -116,7 +116,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
args[3].c_str()))
{
std::cerr << "Error copying file (if different) from \""
- << args[2].c_str() << "\" to \"" << args[3].c_str()
+ << args[2] << "\" to \"" << args[3]
<< "\".\n";
return 1;
}
@@ -129,7 +129,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
if(!cmSystemTools::CopyADirectory(args[2].c_str(), args[3].c_str()))
{
std::cerr << "Error copying directory from \""
- << args[2].c_str() << "\" to \"" << args[3].c_str()
+ << args[2] << "\" to \"" << args[3]
<< "\".\n";
return 1;
}
@@ -143,7 +143,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
{
std::string e = cmSystemTools::GetLastSystemError();
std::cerr << "Error renaming from \""
- << args[2].c_str() << "\" to \"" << args[3].c_str()
+ << args[2] << "\" to \"" << args[3]
<< "\": " << e << "\n";
return 1;
}
@@ -156,7 +156,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
if(cmSystemTools::FilesDiffer(args[2].c_str(), args[3].c_str()))
{
std::cerr << "Files \""
- << args[2].c_str() << "\" to \"" << args[3].c_str()
+ << args[2] << "\" to \"" << args[3]
<< "\" are different.\n";
return 1;
}
@@ -199,7 +199,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
std::vector<std::string>::iterator it;
for ( it = env.begin(); it != env.end(); ++ it )
{
- std::cout << it->c_str() << std::endl;
+ std::cout << *it << std::endl;
}
return 0;
}
@@ -209,7 +209,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
{
if(!cmSystemTools::MakeDirectory(args[2].c_str()))
{
- std::cerr << "Error making directory \"" << args[2].c_str()
+ std::cerr << "Error making directory \"" << args[2]
<< "\".\n";
return 1;
}
@@ -221,7 +221,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
if(cmSystemTools::FileIsDirectory(args[2].c_str()) &&
!cmSystemTools::RemoveADirectory(args[2].c_str()))
{
- std::cerr << "Error removing directory \"" << args[2].c_str()
+ std::cerr << "Error removing directory \"" << args[2]
<< "\".\n";
return 1;
}
@@ -1181,7 +1181,7 @@ bool cmcmd::RunCommand(const char* comment,
for(std::vector<std::string>::iterator i = command.begin();
i != command.end(); ++i)
{
- std::cout << i->c_str() << " ";
+ std::cout << *i << " ";
}
std::cout << "\n";
}
@@ -1257,7 +1257,7 @@ int cmcmd::VisualStudioLinkIncremental(std::vector<std::string>& args,
resourceInputFile += ".resource.txt";
if(verbose)
{
- std::cout << "Create " << resourceInputFile.c_str() << "\n";
+ std::cout << "Create " << resourceInputFile << "\n";
}
// Create input file for rc command
cmsys::ofstream fout(resourceInputFile.c_str());
@@ -1269,7 +1269,7 @@ int cmcmd::VisualStudioLinkIncremental(std::vector<std::string>& args,
manifestFile += ".embed.manifest";
std::string fullPath= cmSystemTools::CollapseFullPath(manifestFile.c_str());
fout << type << " /* CREATEPROCESS_MANIFEST_RESOURCE_ID "
- "*/ 24 /* RT_MANIFEST */ " << "\"" << fullPath.c_str() << "\"";
+ "*/ 24 /* RT_MANIFEST */ " << "\"" << fullPath << "\"";
fout.close();
manifestArg += tempManifest;
// add the manifest arg to the linkCommand
@@ -1281,7 +1281,7 @@ int cmcmd::VisualStudioLinkIncremental(std::vector<std::string>& args,
{
if(verbose)
{
- std::cout << "Create empty: " << manifestFile.c_str() << "\n";
+ std::cout << "Create empty: " << manifestFile << "\n";
}
cmsys::ofstream foutTmp(manifestFile.c_str());
}