MCPcopy Create free account
hub / github.com/Kitware/CMake / CreateSolutionFolder

Method CreateSolutionFolder

Source/cmGlobalVisualStudioGenerator.cxx:894–924  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

892}
893
894cm::VS::Solution::Folder* cmGlobalVisualStudioGenerator::CreateSolutionFolder(
895 cm::VS::Solution& solution, cm::string_view rawName) const
896{
897 cm::VS::Solution::Folder* folder = nullptr;
898 std::string canonicalName;
899 for (std::string::size_type cur = 0;;) {
900 static std::string delims = "/\\";
901 cur = rawName.find_first_not_of(delims, cur);
902 if (cur == std::string::npos) {
903 break;
904 }
905 std::string::size_type end = rawName.find_first_of(delims, cur);
906 cm::string_view f = end == std::string::npos
907 ? rawName.substr(cur)
908 : rawName.substr(cur, end - cur);
909 canonicalName =
910 canonicalName.empty() ? std::string(f) : cmStrCat(canonicalName, '/', f);
911 cm::VS::Solution::Folder* nextFolder = solution.GetFolder(canonicalName);
912 if (nextFolder->Id.empty()) {
913 nextFolder->Id =
914 this->GetGUID(cmStrCat("CMAKE_FOLDER_GUID_"_s, canonicalName));
915 if (folder) {
916 folder->Folders.emplace_back(nextFolder);
917 }
918 solution.Folders.emplace_back(nextFolder);
919 }
920 folder = nextFolder;
921 cur = end;
922 }
923 return folder;
924}
925
926cm::VS::Solution cmGlobalVisualStudioGenerator::CreateSolution(
927 cmLocalGenerator const* root, TargetDependSet const& projectTargets) const

Callers 1

CreateSolutionMethod · 0.95

Calls 8

GetGUIDMethod · 0.95
find_first_not_ofMethod · 0.80
find_first_ofMethod · 0.80
GetFolderMethod · 0.80
emplace_backMethod · 0.80
cmStrCatFunction · 0.70
substrMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected