summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGhsMultiGenerator.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/cmGlobalGhsMultiGenerator.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/cmGlobalGhsMultiGenerator.cxx')
-rw-r--r--Source/cmGlobalGhsMultiGenerator.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index 8a80f46..0ae913e 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -214,7 +214,7 @@ void cmGlobalGhsMultiGenerator::OpenBuildFileStream()
this->GetCMakeInstance()->MarkCliAsUsed("GHS_OS_DIR");
}
std::string fOSDir(this->trimQuotes(osDir));
- cmSystemTools::ReplaceString(fOSDir, "\\", "/");
+ std::replace(fOSDir.begin(), fOSDir.end(), '\\', '/');
if (!fOSDir.empty() && ('c' == fOSDir[0] || 'C' == fOSDir[0])) {
this->OSDirRelative = false;
} else {
@@ -230,7 +230,7 @@ void cmGlobalGhsMultiGenerator::OpenBuildFileStream()
this->GetCMakeInstance()->MarkCliAsUsed("GHS_BSP_NAME");
}
std::string fBspName(this->trimQuotes(bspName));
- cmSystemTools::ReplaceString(fBspName, "\\", "/");
+ std::replace(fBspName.begin(), fBspName.end(), '\\', '/');
this->WriteMacros();
this->WriteHighLevelDirectives();