| 18 | |
| 19 | namespace { |
| 20 | std::filesystem::path getRoot(Cache::StorageScope Scope) { |
| 21 | switch (Scope) { |
| 22 | case Cache::StorageScope::Global: |
| 23 | return std::filesystem::u8path(kCacheRoot); |
| 24 | case Cache::StorageScope::Local: { |
| 25 | if (const auto Home = Path::home(); !Home.empty()) { |
| 26 | return Home / "cache"sv; |
| 27 | } |
| 28 | return {}; |
| 29 | } |
| 30 | default: |
| 31 | assumingUnreachable(); |
| 32 | } |
| 33 | } |
| 34 | } // namespace |
| 35 | |
| 36 | Expect<std::filesystem::path> Cache::getPath(Span<const Byte> Data, |