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

Method FindResources

Modules/CppMicroServices/src/usModule.cpp:277–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

275}
276
277std::vector<ModuleResource> Module::FindResources(const std::string& path, const std::string& filePattern,
278 bool recurse) const
279{
280 std::vector<ModuleResource> result;
281 if (!d->resourceContainer.IsValid())
282 {
283 return result;
284 }
285
286 std::string normalizedPath = path;
287 // add a leading and trailing slash
288 if (normalizedPath.empty()) normalizedPath.push_back('/');
289 if (*normalizedPath.begin() != '/') normalizedPath = '/' + normalizedPath;
290 if (*normalizedPath.rbegin() != '/') normalizedPath.push_back('/');
291 d->resourceContainer.FindNodes(d->info.name + normalizedPath,
292 filePattern.empty() ? "*" : filePattern,
293 recurse, result);
294 return result;
295}
296
297}
298

Callers 9

GetInternalRevisionsMethod · 0.80
testResourceOperatorsFunction · 0.80
testResourceTreeFunction · 0.80
testResourcesFromFunction · 0.80
mainFunction · 0.80
InitMethod · 0.80

Calls 4

FindNodesMethod · 0.80
IsValidMethod · 0.45
emptyMethod · 0.45
beginMethod · 0.45

Tested by 4

testResourceOperatorsFunction · 0.64
testResourceTreeFunction · 0.64
testResourcesFromFunction · 0.64