From 97cfa86c2775fdfd7ddfc5d88b6283ccee5d6bbf Mon Sep 17 00:00:00 2001 From: Martin Ridgers Date: Thu, 16 Sep 2021 16:37:15 +0200 Subject: Use std::fd::path's character type for FileSysTraveral::Visitor API --- zen/cmds/run.cpp | 2 +- zencore/include/zencore/filesystem.h | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/zen/cmds/run.cpp b/zen/cmds/run.cpp index e5210f695..97680ed5a 100644 --- a/zen/cmds/run.cpp +++ b/zen/cmds/run.cpp @@ -80,7 +80,7 @@ RunCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) Visitor(const std::filesystem::path& RootPath) : m_RootPath(RootPath) {} - virtual void VisitFile(const std::filesystem::path& Parent, const std::wstring_view& FileName, uint64_t FileSize) override + virtual void VisitFile(const std::filesystem::path& Parent, const path_view& FileName, uint64_t FileSize) override { std::filesystem::path FullPath = Parent / FileName; diff --git a/zencore/include/zencore/filesystem.h b/zencore/include/zencore/filesystem.h index a5e4dcf80..66ab37e5c 100644 --- a/zencore/include/zencore/filesystem.h +++ b/zencore/include/zencore/filesystem.h @@ -69,10 +69,12 @@ class FileSystemTraversal public: struct TreeVisitor { - virtual void VisitFile(const std::filesystem::path& Parent, const std::wstring_view& File, uint64_t FileSize) = 0; + using path_view = std::basic_string_view; + + virtual void VisitFile(const std::filesystem::path& Parent, const path_view& File, uint64_t FileSize) = 0; // This should return true if we should recurse into the directory - virtual bool VisitDirectory(const std::filesystem::path& Parent, const std::wstring_view& DirectoryName) = 0; + virtual bool VisitDirectory(const std::filesystem::path& Parent, const path_view& DirectoryName) = 0; }; void TraverseFileSystem(const std::filesystem::path& RootDir, TreeVisitor& Visitor); -- cgit v1.2.3