diff options
Diffstat (limited to 'Source/cmCommandArgumentParserHelper.cxx')
-rw-r--r-- | Source/cmCommandArgumentParserHelper.cxx | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx index ca29967..b368b3a 100644 --- a/Source/cmCommandArgumentParserHelper.cxx +++ b/Source/cmCommandArgumentParserHelper.cxx @@ -5,6 +5,7 @@ #include "cmCommandArgumentLexer.h" #include "cmMakefile.h" #include "cmState.h" +#include "cmStringAlgorithms.h" #include "cmSystemTools.h" #include <iostream> @@ -58,7 +59,7 @@ const char* cmCommandArgumentParserHelper::ExpandSpecialVariable( std::string str; if (cmSystemTools::GetEnv(var, str)) { if (this->EscapeQuotes) { - return this->AddString(cmSystemTools::EscapeQuotes(str)); + return this->AddString(cmEscapeQuotes(str)); } return this->AddString(str); } @@ -68,7 +69,7 @@ const char* cmCommandArgumentParserHelper::ExpandSpecialVariable( if (const std::string* c = this->Makefile->GetState()->GetInitializedCacheValue(var)) { if (this->EscapeQuotes) { - return this->AddString(cmSystemTools::EscapeQuotes(*c)); + return this->AddString(cmEscapeQuotes(*c)); } return this->AddString(*c); } @@ -87,9 +88,7 @@ const char* cmCommandArgumentParserHelper::ExpandVariable(const char* var) return nullptr; } if (this->FileLine >= 0 && strcmp(var, "CMAKE_CURRENT_LIST_LINE") == 0) { - std::ostringstream ostr; - ostr << this->FileLine; - return this->AddString(ostr.str()); + return this->AddString(std::to_string(this->FileLine)); } const char* value = this->Makefile->GetDefinition(var); if (!value) { @@ -99,7 +98,7 @@ const char* cmCommandArgumentParserHelper::ExpandVariable(const char* var) } } if (this->EscapeQuotes && value) { - return this->AddString(cmSystemTools::EscapeQuotes(value)); + return this->AddString(cmEscapeQuotes(value)); } return this->AddString(value ? value : ""); } @@ -123,9 +122,7 @@ const char* cmCommandArgumentParserHelper::ExpandVariableForAt(const char* var) // - this->ReplaceAtSyntax is false // - this->ReplaceAtSyntax is true, but this->RemoveEmpty is false, // and the variable was not defined - std::string ref = "@"; - ref += var; - ref += "@"; + std::string ref = cmStrCat('@', var, '@'); return this->AddString(ref); } |