| 75 | } |
| 76 | |
| 77 | Ref<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 | |
| 90 | bool DiskCacheImpl::remove(const Path& path) { |
| 91 | auto resolvedPath = resolveAbsolutePath(path, false); |