aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Ridgers <[email protected]>2021-10-18 14:03:53 +0200
committerMartin Ridgers <[email protected]>2021-10-18 14:03:53 +0200
commitd6c9c1a7d1641e0300cfd084ba703fc5ff051911 (patch)
tree4a6fb3afd60d337c72db2d803efcd74d5aeec62d
parentTests for ExtendablePathBuilder (diff)
downloadzen-d6c9c1a7d1641e0300cfd084ba703fc5ff051911.tar.xz
zen-d6c9c1a7d1641e0300cfd084ba703fc5ff051911.zip
Use cross-platform ExtPathBuilder instead of ExtWideStrBuilder
-rw-r--r--zenstore/filecas.cpp6
-rw-r--r--zenstore/filecas.h6
2 files changed, 6 insertions, 6 deletions
diff --git a/zenstore/filecas.cpp b/zenstore/filecas.cpp
index 3941499f1..98807960d 100644
--- a/zenstore/filecas.cpp
+++ b/zenstore/filecas.cpp
@@ -35,7 +35,6 @@ using namespace fmt::literals;
FileCasStrategy::ShardingHelper::ShardingHelper(const std::filesystem::path& RootPath, const IoHash& ChunkHash)
{
ShardedPath.Append(RootPath.c_str());
- ShardedPath.Append(std::filesystem::path::preferred_separator);
ExtendableStringBuilder<64> HashString;
ChunkHash.ToHexString(HashString);
@@ -55,13 +54,14 @@ FileCasStrategy::ShardingHelper::ShardingHelper(const std::filesystem::path& Roo
// would probably be a good idea to measure performance for different
// policies and chunk counts
+ ShardedPath.AppendSeparator();
ShardedPath.AppendAsciiRange(str, str + 3);
- ShardedPath.Append(std::filesystem::path::preferred_separator);
+ ShardedPath.AppendSeparator();
ShardedPath.AppendAsciiRange(str + 3, str + 5);
Shard2len = ShardedPath.Size();
- ShardedPath.Append(std::filesystem::path::preferred_separator);
+ ShardedPath.AppendSeparator();
ShardedPath.AppendAsciiRange(str + 5, str + 40);
}
diff --git a/zenstore/filecas.h b/zenstore/filecas.h
index 8f36c0170..04ffffdd2 100644
--- a/zenstore/filecas.h
+++ b/zenstore/filecas.h
@@ -4,9 +4,9 @@
#include <zencore/zencore.h>
+#include <zencore/filesystem.h>
#include <zencore/iobuffer.h>
#include <zencore/iohash.h>
-#include <zencore/string.h>
#include <zencore/thread.h>
#include <zenstore/CAS.h>
@@ -52,8 +52,8 @@ private:
{
ShardingHelper(const std::filesystem::path& RootPath, const IoHash& ChunkHash);
- size_t Shard2len = 0;
- ExtendableWideStringBuilder<128> ShardedPath;
+ size_t Shard2len = 0;
+ ExtendablePathBuilder<128> ShardedPath;
};
};