diff options
| author | Dan Engelbrecht <[email protected]> | 2024-10-10 09:57:06 +0200 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2024-10-10 09:57:06 +0200 |
| commit | 14f2d5665e00f9742a417e913eb05af38e570ea5 (patch) | |
| tree | f6369d401a7b16edd894ac304f1c59f8b630cc48 /src | |
| parent | Dashboard: alignment of complex stats & logo goes home (#187) (diff) | |
| download | zen-14f2d5665e00f9742a417e913eb05af38e570ea5.tar.xz zen-14f2d5665e00f9742a417e913eb05af38e570ea5.zip | |
oplog mirror and vfs utf8 paths (#189)
* assume "filename" fields in oplog entries are utf8 paths
Diffstat (limited to 'src')
| -rw-r--r-- | src/zen/cmds/projectstore_cmd.cpp | 6 | ||||
| -rw-r--r-- | src/zenserver/vfs/vfsimpl.cpp | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/zen/cmds/projectstore_cmd.cpp b/src/zen/cmds/projectstore_cmd.cpp index 14cd2ce3d..48787be9b 100644 --- a/src/zen/cmds/projectstore_cmd.cpp +++ b/src/zen/cmds/projectstore_cmd.cpp @@ -1755,8 +1755,8 @@ OplogMirrorCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** arg { if (CbObjectView Data = DataIter.AsObjectView()) { - std::string FileName = std::string(Data["filename"sv].AsString()); - if (!m_FilenameFilter.empty() && FileName.find(m_FilenameFilter) == std::string::npos) + std::filesystem::path FileName(Data["filename"sv].AsU8String()); + if (!m_FilenameFilter.empty() && FileName.string().find(m_FilenameFilter) == std::string::npos) { continue; } @@ -1765,7 +1765,7 @@ OplogMirrorCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** arg { continue; } - if (!FileNames.insert(FileName).second) + if (!FileNames.insert(FileName.string()).second) { continue; } diff --git a/src/zenserver/vfs/vfsimpl.cpp b/src/zenserver/vfs/vfsimpl.cpp index abb7e8f94..7e4fbe83e 100644 --- a/src/zenserver/vfs/vfsimpl.cpp +++ b/src/zenserver/vfs/vfsimpl.cpp @@ -381,12 +381,12 @@ VfsServiceDataSource::PopulateDirectory(std::string NodePath, VfsTreeNode& DirNo { if (zen::CbObjectView Data = DataIter.AsObjectView()) { - std::string_view FileName = Data["filename"sv].AsString(); - zen::Oid ChunkId = Data["id"sv].AsObjectId(); + std::filesystem::path FileName(Data["filename"sv].AsU8String()); + zen::Oid ChunkId = Data["id"sv].AsObjectId(); if (auto FindIt = ChunkSizes.find(ChunkId); FindIt != ChunkSizes.end()) { - DirNode.AddFileNode(FileName, FindIt->second /* file size */, ChunkId, DataSource); + DirNode.AddFileNode(FileName.string(), FindIt->second /* file size */, ChunkId, DataSource); } else { |