MCPcopy Create free account
hub / github.com/Snapchat/Valdi / getResourceContent

Method getResourceContent

valdi/src/valdi/runtime/Resources/Bundle.cpp:219–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

217}
218
219Result<BundleResourceContent> Bundle::getResourceContent(const StringBox& path) {
220 std::lock_guard<std::recursive_mutex> guard(_mutex);
221 const auto& it = _resourceContentByPath.find(path);
222 if (it != _resourceContentByPath.end()) {
223 return it->second;
224 }
225
226 auto entryResult = getEntry(path);
227 if (!entryResult) {
228 return entryResult.moveError();
229 }
230
231 auto entry = entryResult.moveValue();
232 return BundleResourceContent(entry);
233}
234
235void Bundle::setResourceContent(const StringBox& path, const BundleResourceContent& resourceContent) {
236 std::lock_guard<std::recursive_mutex> guard(_mutex);

Callers

nothing calls this directly

Calls 3

endMethod · 0.65
findMethod · 0.45

Tested by

no test coverage detected