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

Method FindResources

framework/src/bundle/BundleArchive.cpp:125–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123 }
124
125 std::vector<BundleResource>
126 BundleArchive::FindResources(std::string const& path, std::string const& filePattern, bool recurse) const
127 {
128 std::vector<BundleResource> result;
129 if (!resourceContainer)
130 {
131 return result;
132 }
133
134 std::string normalizedPath = path;
135 // add a leading and trailing slash
136 if (normalizedPath.empty())
137 normalizedPath.push_back('/');
138 if (*normalizedPath.begin() != '/')
139 normalizedPath = '/' + normalizedPath;
140 if (*normalizedPath.rbegin() != '/')
141 normalizedPath.push_back('/');
142 resourceContainer->FindNodes(this->shared_from_this(),
143 resourcePrefix + normalizedPath,
144 filePattern.empty() ? "*" : filePattern,
145 recurse,
146 result);
147 return result;
148 }
149
150 BundleArchive::TimeStamp
151 BundleArchive::GetLastModified() const

Callers

nothing calls this directly

Calls 4

FindNodesMethod · 0.80
shared_from_thisMethod · 0.80
emptyMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected