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

Method scopedCache

valdi/src/valdi/runtime/Resources/DiskCacheImpl.cpp:77–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77Ref<IDiskCache> DiskCacheImpl::scopedCache(const Path& subfolder, bool allowsReadOutsideOfScope) const {
78 auto result = resolveAbsolutePath(subfolder, false);
79 if (result.failure()) {
80 return nullptr;
81 }
82 auto rootPath = result.value();
83 auto readPath = allowsReadOutsideOfScope ? _allowedReadPath : rootPath;
84
85 auto scopedInstance = Valdi::makeShared<DiskCacheImpl>(std::move(rootPath), std::move(readPath));
86
87 return scopedInstance;
88}
89
90bool DiskCacheImpl::remove(const Path& path) {
91 auto resolvedPath = resolveAbsolutePath(path, false);

Callers 3

TESTFunction · 0.45
RuntimeManagerWrapperMethod · 0.45
updateActiveDiskStoreMethod · 0.45

Calls 2

valueMethod · 0.65
failureMethod · 0.45

Tested by 1

TESTFunction · 0.36