diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2019-08-01 10:57:18 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2019-08-01 11:33:00 (GMT) |
commit | a693e875db5d0939a316955f513396e533153b6d (patch) | |
tree | e063b89a0bb0d69ce7c3f332d7e03a8efec6421b /Source/cmGlobalVisualStudio7Generator.cxx | |
parent | 33d9a691306956750bffb10be9d0b17a47c0ec0b (diff) | |
download | CMake-a693e875db5d0939a316955f513396e533153b6d.zip CMake-a693e875db5d0939a316955f513396e533153b6d.tar.gz CMake-a693e875db5d0939a316955f513396e533153b6d.tar.bz2 |
Cleanups: Use cmHas{Prefix,Suffix} instead of String{Starts,Ends}With
Diffstat (limited to 'Source/cmGlobalVisualStudio7Generator.cxx')
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 8401efb..bead0e3 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -8,7 +8,9 @@ #include "cmMakefile.h" #include "cmMessageType.h" #include "cmState.h" +#include "cmStringAlgorithms.h" #include "cmUuid.h" +#include "cm_string_view.hxx" #include "cmake.h" #include "cmsys/Encoding.hxx" @@ -432,16 +434,15 @@ void cmGlobalVisualStudio7Generator::WriteTargetDepends( void cmGlobalVisualStudio7Generator::WriteFolders(std::ostream& fout) { - const char* prefix = "CMAKE_FOLDER_GUID_"; - const std::string::size_type skip_prefix = strlen(prefix); + cm::string_view const prefix = "CMAKE_FOLDER_GUID_"; std::string guidProjectTypeFolder = "2150E333-8FDC-42A3-9474-1A3956D46DE8"; for (auto const& iter : VisualStudioFolders) { std::string fullName = iter.first; std::string guid = this->GetGUID(fullName); std::replace(fullName.begin(), fullName.end(), '/', '\\'); - if (cmSystemTools::StringStartsWith(fullName.c_str(), prefix)) { - fullName = fullName.substr(skip_prefix); + if (cmHasPrefix(fullName, prefix)) { + fullName = fullName.substr(prefix.size()); } std::string nameOnly = cmSystemTools::GetFilenameName(fullName); |