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

Method InsertPath

Source/cmExtraCodeBlocksGenerator.cxx:111–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109};
110
111void Tree::InsertPath(std::vector<std::string> const& split,
112 std::vector<std::string>::size_type start,
113 std::string const& fileName)
114{
115 if (start == split.size()) {
116 this->files.insert(fileName);
117 return;
118 }
119 for (Tree& folder : this->folders) {
120 if (folder.path == split[start]) {
121 if (start + 1 < split.size()) {
122 folder.InsertPath(split, start + 1, fileName);
123 return;
124 }
125 // last part of split
126 folder.files.insert(fileName);
127 return;
128 }
129 }
130 // Not found in folders, thus insert
131 Tree newFolder;
132 newFolder.path = split[start];
133 if (start + 1 < split.size()) {
134 newFolder.InsertPath(split, start + 1, fileName);
135 this->folders.push_back(newFolder);
136 return;
137 }
138 // last part of split
139 newFolder.files.insert(fileName);
140 this->folders.push_back(newFolder);
141}
142
143void Tree::BuildVirtualFolder(cmXMLWriter& xml) const
144{

Callers 1

CreateNewProjectFileMethod · 0.80

Calls 3

push_backMethod · 0.80
sizeMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected