MCPcopy Create free account
hub / github.com/MITK/MITK / GetChildren

Method GetChildren

Modules/CppMicroServices/src/usModuleResourceContainer.cpp:147–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145}
146
147void ModuleResourceContainer::GetChildren(const std::string& resourcePath, bool relativePaths,
148 std::vector<std::string>& names, std::vector<uint32_t>& indices) const
149{
150 d->InitSortedEntries();
151
152 ModuleResourceContainerPrivate::SetType::const_iterator iter =
153 d->m_SortedEntries.find(std::make_pair(resourcePath, 0));
154 if (iter == d->m_SortedEntries.end())
155 {
156 return;
157 }
158
159 for (++iter; iter != d->m_SortedEntries.end(); ++iter)
160 {
161 if (resourcePath.size() > iter->first.size()) break;
162 if (iter->first.compare(0, resourcePath.size(), resourcePath) == 0)
163 {
164 std::size_t pos = iter->first.find_first_of('/', resourcePath.size());
165 if (pos == std::string::npos || pos == iter->first.size()-1)
166 {
167 if (relativePaths)
168 {
169 names.push_back(iter->first.substr(resourcePath.size()));
170 }
171 else
172 {
173 names.push_back(iter->first);
174 }
175 indices.push_back(iter->second);
176 }
177 }
178 }
179}
180
181void ModuleResourceContainer::FindNodes(const std::string& path, const std::string& filePattern,
182 bool recurse, std::vector<ModuleResource>& resources) const

Callers 1

FindNodesMethod · 0.95

Calls 4

InitSortedEntriesMethod · 0.80
findMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected