summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalNinjaGenerator.cxx
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2016-05-24 20:58:11 (GMT)
committerDaniel Pfeifer <daniel@pfeifer-mail.de>2016-05-24 21:22:20 (GMT)
commit5cec953e6aafd4c132a7b6c0a929d95c1dee79ea (patch)
tree09cf2f4a8f28c5ca8a7e648486fc10e1ae5e2d89 /Source/cmGlobalNinjaGenerator.cxx
parent2a1a2033afe73da08af46e12ed77a8f55a89417f (diff)
downloadCMake-5cec953e6aafd4c132a7b6c0a929d95c1dee79ea.zip
CMake-5cec953e6aafd4c132a7b6c0a929d95c1dee79ea.tar.gz
CMake-5cec953e6aafd4c132a7b6c0a929d95c1dee79ea.tar.bz2
Use std::replace for replacing chars in strings.
Find uses of `cmSystemTools::ReplaceString` where both `replace` and `with` are string literals with a size of one. Automate with: git grep -l ReplaceString | xargs sed -i "s|cmSystemTools::ReplaceString(\([^,]*\), \"\(.\)\", \"\(.\)\");|std::replace(\1.begin(), \1.end(), '\2', '\3');|g" git grep -l ReplaceString | xargs sed -i "s|cmSystemTools::ReplaceString(\([^,]*\), \"\(.\)\", \"\\\\\\\\\");|std::replace(\1.begin(), \1.end(), '\2', '\\\\\\\\');|g" git grep -l ReplaceString | xargs sed -i "s|cmSystemTools::ReplaceString(\([^,]*\), \"\\\\\\\\\", \"\(.\)\");|std::replace(\1.begin(), \1.end(), '\\\\\\\\', '\2');|g"
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index d65b463..af6e88c 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;
}