diff options
| author | Martin Ridgers <[email protected]> | 2021-12-01 09:28:49 +0100 |
|---|---|---|
| committer | Martin Ridgers <[email protected]> | 2021-12-02 11:35:46 +0100 |
| commit | 4580978bc9a11e12f200b4c4d80e62b37875a329 (patch) | |
| tree | 4c7b3b5ddbf4f123134e916e3cf737c52354da43 | |
| parent | Added a "path_string" type to the file traversal class (diff) | |
| download | zen-4580978bc9a11e12f200b4c4d80e62b37875a329.tar.xz zen-4580978bc9a11e12f200b4c4d80e62b37875a329.zip | |
Updated RunCommand's file traversal to use platform-agnostic strings
| -rw-r--r-- | zen/cmds/run.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/zen/cmds/run.cpp b/zen/cmds/run.cpp index 8299c981a..a5a372210 100644 --- a/zen/cmds/run.cpp +++ b/zen/cmds/run.cpp @@ -85,7 +85,7 @@ RunCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) zen::ScanFile(FullPath, 64 * 1024, [&](const void* Data, size_t Size) { Ios.Append(Data, Size); }); zen::IoHash Hash = Ios.GetHash(); - std::wstring RelativePath = FullPath.lexically_relative(m_RootPath).native(); + path_string RelativePath = FullPath.lexically_relative(m_RootPath).native(); // ZEN_INFO("File: {:32} => {} ({})", zen::WideToUtf8(RelativePath), Hash, FileSize); FileEntry& Entry = m_Files[RelativePath]; @@ -95,11 +95,11 @@ RunCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) m_HashToFile[Hash] = FullPath; } - virtual bool VisitDirectory(const std::filesystem::path& Parent, const std::wstring_view& DirectoryName) override + virtual bool VisitDirectory(const std::filesystem::path& Parent, const path_view& DirectoryName) override { std::filesystem::path FullPath = Parent / DirectoryName; - if (DirectoryName.starts_with(L".")) + if (DirectoryName.starts_with('.')) { return false; } @@ -113,7 +113,7 @@ RunCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) zen::IoHash Hash; }; - std::map<std::wstring, FileEntry> m_Files; + std::map<path_string, FileEntry> m_Files; std::unordered_map<zen::IoHash, std::filesystem::path, zen::IoHash::Hasher> m_HashToFile; }; |