aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/cache/cachedisklayer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/zenstore/cache/cachedisklayer.cpp')
-rw-r--r--src/zenstore/cache/cachedisklayer.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/zenstore/cache/cachedisklayer.cpp b/src/zenstore/cache/cachedisklayer.cpp
index 45a4b6456..22b9d0be5 100644
--- a/src/zenstore/cache/cachedisklayer.cpp
+++ b/src/zenstore/cache/cachedisklayer.cpp
@@ -140,25 +140,37 @@ namespace cache::impl {
const char* LogExtension = ".slog";
const char* MetaExtension = ".meta";
+ std::filesystem::path GetBucketFilePath(const std::filesystem::path& BucketDir, const std::string& BucketName, const char* Extension)
+ {
+ ExtendablePathBuilder<256> Path;
+ Path.Append(BucketDir);
+ Path /= BucketName.c_str();
+ Path << Extension;
+ return Path.ToPath();
+ }
+
std::filesystem::path GetIndexPath(const std::filesystem::path& BucketDir, const std::string& BucketName)
{
- return BucketDir / (BucketName + IndexExtension);
+ return GetBucketFilePath(BucketDir, BucketName, IndexExtension);
}
std::filesystem::path GetMetaPath(const std::filesystem::path& BucketDir, const std::string& BucketName)
{
- return BucketDir / (BucketName + MetaExtension);
+ return GetBucketFilePath(BucketDir, BucketName, MetaExtension);
}
std::filesystem::path GetLogPath(const std::filesystem::path& BucketDir, const std::string& BucketName)
{
- return BucketDir / (BucketName + LogExtension);
+ return GetBucketFilePath(BucketDir, BucketName, LogExtension);
}
std::filesystem::path GetManifestPath(const std::filesystem::path& BucketDir, const std::string& BucketName)
{
ZEN_UNUSED(BucketName);
- return BucketDir / "zen_manifest";
+ ExtendablePathBuilder<256> Path;
+ Path.Append(BucketDir);
+ Path /= "zen_manifest";
+ return Path.ToPath();
}
bool ValidateCacheBucketIndexEntry(const DiskIndexEntry& Entry, std::string& OutReason)