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/CPack/cmCPackNSISGenerator.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/CPack/cmCPackNSISGenerator.cxx')
-rw-r--r-- | Source/CPack/cmCPackNSISGenerator.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index 4d48cb5..9fa588d 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -74,7 +74,7 @@ int cmCPackNSISGenerator::PackageFiles() // Strip off the component part of the path. fileN = fileN.substr(fileN.find('/') + 1, std::string::npos); } - cmSystemTools::ReplaceString(fileN, "/", "\\"); + std::replace(fileN.begin(), fileN.end(), '/', '\\'); str << " Delete \"$INSTDIR\\" << fileN << "\"" << std::endl; } cmCPackLogger(cmCPackLog::LOG_DEBUG, "Uninstall Files: " << str.str() @@ -104,7 +104,7 @@ int cmCPackNSISGenerator::PackageFiles() fileN = fileN.substr(slash + 1, std::string::npos); } } - cmSystemTools::ReplaceString(fileN, "/", "\\"); + std::replace(fileN.begin(), fileN.end(), '/', '\\'); dstr << " RMDir \"$INSTDIR\\" << fileN << "\"" << std::endl; if (!componentName.empty()) { this->Components[componentName].Directories.push_back(fileN); @@ -548,7 +548,7 @@ void cmCPackNSISGenerator::CreateMenuLinks(std::ostringstream& str, // Convert / to \ in filenames, but not in urls: // if (!url) { - cmSystemTools::ReplaceString(sourceName, "/", "\\"); + std::replace(sourceName.begin(), sourceName.end(), '/', '\\'); } ++it; @@ -790,13 +790,13 @@ std::string cmCPackNSISGenerator::CreateComponentDescription( for (pathIt = component->Files.begin(); pathIt != component->Files.end(); ++pathIt) { path = *pathIt; - cmSystemTools::ReplaceString(path, "/", "\\"); + std::replace(path.begin(), path.end(), '/', '\\'); macrosOut << " Delete \"$INSTDIR\\" << path << "\"\n"; } for (pathIt = component->Directories.begin(); pathIt != component->Directories.end(); ++pathIt) { path = *pathIt; - cmSystemTools::ReplaceString(path, "/", "\\"); + std::replace(path.begin(), path.end(), '/', '\\'); macrosOut << " RMDir \"$INSTDIR\\" << path << "\"\n"; } macrosOut << " noremove_" << component->Name << ":\n"; |