diff options
author | Brad King <brad.king@kitware.com> | 2016-05-25 13:34:29 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-05-25 13:34:29 (GMT) |
commit | 6052e4b3bfe62a8d29ca679affb101c7aec0d219 (patch) | |
tree | db207f809276b9c5691c889b9e658befc93e6d4c /Source/cmGlobalNinjaGenerator.cxx | |
parent | 9ebc2092885fa32eaa47aade965fcec2cfa308d0 (diff) | |
parent | 5784747d1b0404a0c1cb0223b15b823476023fba (diff) | |
download | CMake-6052e4b3bfe62a8d29ca679affb101c7aec0d219.zip CMake-6052e4b3bfe62a8d29ca679affb101c7aec0d219.tar.gz CMake-6052e4b3bfe62a8d29ca679affb101c7aec0d219.tar.bz2 |
Merge topic 'improve-character-find-and-replace'
5784747d Improve string find: prefer character overloads.
5cec953e Use std::replace for replacing chars in strings.
2a1a2033 cmExtraEclipseCDT4Generator: use std::replace.
34bc6e1f cmCTestScriptHandler: don't call find repeatedly.
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 44a750f..a1c9d76 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -113,9 +113,9 @@ std::string cmGlobalNinjaGenerator::EncodePath(const std::string& path) std::string result = path; #ifdef _WIN32 if (this->IsGCCOnWindows()) - cmSystemTools::ReplaceString(result, "\\", "/"); + std::replace(result.begin(), result.end(), '\\', '/'); else - cmSystemTools::ReplaceString(result, "/", "\\"); + std::replace(result.begin(), result.end(), '/', '\\'); #endif return EncodeLiteral(result); } @@ -742,7 +742,7 @@ std::string cmGlobalNinjaGenerator::ConvertToNinjaPath(const std::string& path) std::string convPath = ng->Convert(path, cmOutputConverter::HOME_OUTPUT); convPath = this->NinjaOutputPath(convPath); #ifdef _WIN32 - cmSystemTools::ReplaceString(convPath, "/", "\\"); + std::replace(convPath.begin(), convPath.end(), '/', '\\'); #endif return convPath; } @@ -755,7 +755,7 @@ std::string cmGlobalNinjaGenerator::ConvertToNinjaFolderRule( std::string convPath = ng->Convert(path + "/all", cmOutputConverter::HOME); convPath = this->NinjaOutputPath(convPath); #ifdef _WIN32 - cmSystemTools::ReplaceString(convPath, "/", "\\"); + std::replace(convPath.begin(), convPath.end(), '/', '\\'); #endif return convPath; } |