summaryrefslogtreecommitdiffstats
path: root/Source/cmCreateTestSourceList.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/cmCreateTestSourceList.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/cmCreateTestSourceList.cxx')
-rw-r--r--Source/cmCreateTestSourceList.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/cmCreateTestSourceList.cxx b/Source/cmCreateTestSourceList.cxx
index 6f7cfbe..d8c629c 100644
--- a/Source/cmCreateTestSourceList.cxx
+++ b/Source/cmCreateTestSourceList.cxx
@@ -95,9 +95,9 @@ bool cmCreateTestSourceList::InitialPass(std::vector<std::string> const& args,
func_name = cmSystemTools::GetFilenameWithoutLastExtension(*i);
}
cmSystemTools::ConvertToUnixSlashes(func_name);
- cmSystemTools::ReplaceString(func_name, " ", "_");
- cmSystemTools::ReplaceString(func_name, "/", "_");
- cmSystemTools::ReplaceString(func_name, ":", "_");
+ std::replace(func_name.begin(), func_name.end(), ' ', '_');
+ std::replace(func_name.begin(), func_name.end(), '/', '_');
+ std::replace(func_name.begin(), func_name.end(), ':', '_');
tests_func_name.push_back(func_name);
forwardDeclareCode += "int ";
forwardDeclareCode += func_name;