diff options
| author | Martin Ridgers <[email protected]> | 2022-01-10 12:07:03 +0100 |
|---|---|---|
| committer | Martin Ridgers <[email protected]> | 2022-01-10 13:22:28 +0100 |
| commit | 9086231f3923c0df6d9ef817441bfae5e134e8ff (patch) | |
| tree | 739a41ca51910d9319cb6c04af435bf9b4c6d5cd /zenstore/filecas.cpp | |
| parent | Vcpkg's manifest mode is no longer in use (diff) | |
| download | zen-9086231f3923c0df6d9ef817441bfae5e134e8ff.tar.xz zen-9086231f3923c0df6d9ef817441bfae5e134e8ff.zip | |
Converted use of _format UDL to fmt::format
Diffstat (limited to 'zenstore/filecas.cpp')
| -rw-r--r-- | zenstore/filecas.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/zenstore/filecas.cpp b/zenstore/filecas.cpp index fb0f80436..533c99569 100644 --- a/zenstore/filecas.cpp +++ b/zenstore/filecas.cpp @@ -35,8 +35,6 @@ ZEN_THIRD_PARTY_INCLUDES_END namespace zen { -using namespace fmt::literals; - FileCasStrategy::ShardingHelper::ShardingHelper(const std::filesystem::path& RootPath, const IoHash& ChunkHash) { ShardedPath.Append(RootPath.c_str()); @@ -241,7 +239,7 @@ FileCasStrategy::InsertChunk(IoBuffer Chunk, const IoHash& ChunkHash) if (FAILED(hRes)) { - ThrowSystemException(hRes, "Failed to open shard directory '{}'"_format(FilePath)); + ThrowSystemException(hRes, fmt::format("Failed to open shard directory '{}'", FilePath)); } // Retry rename/move @@ -386,7 +384,7 @@ FileCasStrategy::InsertChunk(const void* const ChunkData, const size_t ChunkSize if (FAILED(hRes)) { - ThrowSystemException(hRes, "Failed to open shard file '{}'"_format(Name.ShardedPath.ToUtf8())); + ThrowSystemException(hRes, fmt::format("Failed to open shard file '{}'", Name.ShardedPath.ToUtf8())); } #else // Attempt to exclusively create the file. @@ -409,10 +407,10 @@ FileCasStrategy::InsertChunk(const void* const ChunkData, const size_t ChunkSize break; } } - ThrowLastError("Failed creating shard directory '{}'"_format(Name.ShardedPath)); + ThrowLastError(fmt::format("Failed creating shard directory '{}'", Name.ShardedPath)); default: - ThrowLastError("Unexpected error occurred opening shard file '{}'"_format(Name.ShardedPath)); + ThrowLastError(fmt::format("Unexpected error occurred opening shard file '{}'", Name.ShardedPath)); } } @@ -723,8 +721,6 @@ FileCasStrategy::CollectGarbage(GcContext& GcCtx) TEST_CASE("cas.file.move") { - using namespace fmt::literals; - // specifying an absolute path here can be helpful when using procmon to dig into things ScopedTemporaryDirectory TempDir; // {"d:\\filecas_testdir"}; @@ -769,7 +765,7 @@ TEST_CASE("cas.file.move") *reinterpret_cast<int*>(Payload.MutableData()) = i; PayloadHashes.push_back(IoHash::HashBuffer(Payload)); - std::filesystem::path PayloadPath{TempDir.Path() / "payload_{}_{}"_format(w, i)}; + std::filesystem::path PayloadPath{TempDir.Path() / fmt::format("payload_{}_{}", w, i)}; WriteFile(PayloadPath, Payload); } } @@ -781,7 +777,7 @@ TEST_CASE("cas.file.move") for (int i = 0; i < kItemCount; ++i) { - std::filesystem::path PayloadPath{TempDir.Path() / "payload_{}_{}"_format(w, i)}; + std::filesystem::path PayloadPath{TempDir.Path() / fmt::format("payload_{}_{}", w, i)}; IoBuffer Payload = IoBufferBuilder::MakeFromTemporaryFile(PayloadPath); Buffers.push_back(Payload); Sync.arrive_and_wait(); |