summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2014-02-10 05:21:34 (GMT)
committerBrad King <brad.king@kitware.com>2014-03-08 18:05:35 (GMT)
commit270eb96df05b93023cdd3d3a186b44b4ece1d655 (patch)
tree25d3037b5412b24242c631cccfe36e16a0fa8e1c /Source/cmSystemTools.cxx
parent215b1addf09359507281359cd7d478c61c01a9f2 (diff)
downloadCMake-270eb96df05b93023cdd3d3a186b44b4ece1d655.zip
CMake-270eb96df05b93023cdd3d3a186b44b4ece1d655.tar.gz
CMake-270eb96df05b93023cdd3d3a186b44b4ece1d655.tar.bz2
strings: Remove cmStdString references
Casts from std::string -> cmStdString were high on the list of things taking up time. Avoid such implicit casts across function calls by just using std::string everywhere. The comment that the symbol name is too long is no longer relevant since modern debuggers alias the templates anyways and the size is a non-issue since the underlying methods are generated since it's inherited.
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx50
1 files changed, 9 insertions, 41 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 2b17fba..39b53bf 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -477,13 +477,6 @@ public:
args.push_back(*arg);
}
}
- void Store(std::vector<cmStdString>& args) const
- {
- for(char** arg = this->ArgV; arg && *arg; ++arg)
- {
- args.push_back(*arg);
- }
- }
};
//----------------------------------------------------------------------------
@@ -495,15 +488,6 @@ void cmSystemTools::ParseUnixCommandLine(const char* command,
argv.Store(args);
}
-//----------------------------------------------------------------------------
-void cmSystemTools::ParseUnixCommandLine(const char* command,
- std::vector<cmStdString>& args)
-{
- // Invoke the underlying parser.
- cmSystemToolsArgV argv = cmsysSystem_Parse_CommandForUnix(command, 0);
- argv.Store(args);
-}
-
std::string cmSystemTools::EscapeWindowsShellArgument(const char* arg,
int shell_flags)
{
@@ -523,9 +507,9 @@ std::string cmSystemTools::EscapeWindowsShellArgument(const char* arg,
return result;
}
-std::vector<cmStdString> cmSystemTools::ParseArguments(const char* command)
+std::vector<std::string> cmSystemTools::ParseArguments(const char* command)
{
- std::vector<cmStdString> args;
+ std::vector<std::string> args;
std::string arg;
bool win_path = false;
@@ -606,22 +590,6 @@ std::vector<cmStdString> cmSystemTools::ParseArguments(const char* command)
}
-bool cmSystemTools::RunSingleCommand(std::vector<cmStdString>const& command,
- std::string* output ,
- int* retVal , const char* dir ,
- OutputOption outputflag ,
- double timeout )
-{
- std::vector<std::string> cmd;
- for(std::vector<cmStdString>::const_iterator i = command.begin();
- i != command.end(); ++i)
- {
- cmd.push_back(*i);
- }
- return cmSystemTools::RunSingleCommand(cmd, output, retVal, dir,
- outputflag, timeout);
-}
-
bool cmSystemTools::RunSingleCommand(std::vector<std::string>const& command,
std::string* output ,
int* retVal , const char* dir ,
@@ -781,7 +749,7 @@ bool cmSystemTools::RunSingleCommand(
outputflag = OUTPUT_NONE;
}
- std::vector<cmStdString> args = cmSystemTools::ParseArguments(command);
+ std::vector<std::string> args = cmSystemTools::ParseArguments(command);
if(args.size() < 1)
{
@@ -1114,8 +1082,8 @@ void cmSystemTools::ExpandListArgument(const std::string& arg,
}
}
-bool cmSystemTools::SimpleGlob(const cmStdString& glob,
- std::vector<cmStdString>& files,
+bool cmSystemTools::SimpleGlob(const std::string& glob,
+ std::vector<std::string>& files,
int type /* = 0 */)
{
files.clear();
@@ -1233,7 +1201,7 @@ cmSystemTools::FileFormat cmSystemTools::GetFileFormat(const char* cext)
return cmSystemTools::UNKNOWN_FILE_FORMAT;
}
-bool cmSystemTools::Split(const char* s, std::vector<cmStdString>& l)
+bool cmSystemTools::Split(const char* s, std::vector<std::string>& l)
{
std::vector<std::string> temp;
bool res = Superclass::Split(s, temp);
@@ -1445,7 +1413,7 @@ bool cmSystemTools::IsPathToFramework(const char* path)
}
bool cmSystemTools::CreateTar(const char* outFileName,
- const std::vector<cmStdString>& files,
+ const std::vector<std::string>& files,
bool gzip, bool bzip2, bool verbose)
{
#if defined(CMAKE_BUILD_WITH_CMAKE)
@@ -1465,7 +1433,7 @@ bool cmSystemTools::CreateTar(const char* outFileName,
cmArchiveWrite::CompressNone)),
cmArchiveWrite::TypeTAR);
a.SetVerbose(verbose);
- for(std::vector<cmStdString>::const_iterator i = files.begin();
+ for(std::vector<std::string>::const_iterator i = files.begin();
i != files.end(); ++i)
{
std::string path = *i;
@@ -2317,7 +2285,7 @@ bool cmSystemTools::GuessLibrarySOName(std::string const& fullPath,
bool cmSystemTools::GuessLibraryInstallName(std::string const& fullPath,
std::string& soname)
{
- std::vector<cmStdString> cmds;
+ std::vector<std::string> cmds;
cmds.push_back("otool");
cmds.push_back("-D");
cmds.push_back(fullPath.c_str());