From e41789eff59ca9cadce9ff3b4c639d9f5bb8905e Mon Sep 17 00:00:00 2001 From: Antonio SJ Musumeci Date: Wed, 17 Sep 2025 23:24:52 -0500 Subject: [PATCH] Further replacement of std::filesystem::path to fs::path --- src/mergerfs.cpp | 2 +- src/policy.hpp | 18 +++++++++--------- src/policy_all.hpp | 6 +++--- src/policy_epall.hpp | 6 +++--- src/policy_epff.hpp | 6 +++--- src/policy_eplfs.hpp | 6 +++--- src/policy_eplus.hpp | 6 +++--- src/policy_epmfs.hpp | 6 +++--- src/policy_eppfrd.hpp | 6 +++--- src/policy_eprand.hpp | 6 +++--- src/policy_erofs.hpp | 6 +++--- src/policy_ff.hpp | 6 +++--- src/policy_lfs.hpp | 6 +++--- src/policy_lus.hpp | 6 +++--- src/to_string.cpp | 2 +- src/to_string.hpp | 4 +++- 16 files changed, 50 insertions(+), 48 deletions(-) diff --git a/src/mergerfs.cpp b/src/mergerfs.cpp index 5cd44136..fbf4a32b 100644 --- a/src/mergerfs.cpp +++ b/src/mergerfs.cpp @@ -362,7 +362,7 @@ int _pick_app_and_run(int argc_, char **argv_) { - std::filesystem::path appname; + fs::path appname; appname = argv_[0]; appname = appname.filename(); diff --git a/src/policy.hpp b/src/policy.hpp index 7c7341ce..58707d53 100644 --- a/src/policy.hpp +++ b/src/policy.hpp @@ -64,9 +64,9 @@ namespace Policy } int - operator()(const Branches::Ptr &branches_, - const std::filesystem::path &fusepath_, - std::vector &output_) const + operator()(const Branches::Ptr &branches_, + const fs::path &fusepath_, + std::vector &output_) const { return (*impl)(branches_,fusepath_,output_); } @@ -92,7 +92,7 @@ namespace Policy std::string name; virtual bool path_preserving(void) const = 0; virtual int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const = 0; }; @@ -124,9 +124,9 @@ namespace Policy } int - operator()(const Branches::Ptr &branches_, - const std::filesystem::path &fusepath_, - std::vector &output_) const + operator()(const Branches::Ptr &branches_, + const fs::path &fusepath_, + std::vector &output_) const { return (*impl)(branches_,fusepath_,output_); } @@ -151,7 +151,7 @@ namespace Policy public: std::string name; virtual int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const = 0; }; @@ -178,7 +178,7 @@ namespace Policy int operator()(const Branches::Ptr &branches_, - const std::filesystem::path &fusepath_, + const fs::path &fusepath_, std::vector &output_) const { return (*impl)(branches_,fusepath_,output_); diff --git a/src/policy_all.hpp b/src/policy_all.hpp index 46e696f3..8cafc4a2 100644 --- a/src/policy_all.hpp +++ b/src/policy_all.hpp @@ -33,7 +33,7 @@ namespace Policy public: int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const final; }; @@ -46,7 +46,7 @@ namespace Policy public: int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const final; bool path_preserving(void) const final { return false; } }; @@ -60,7 +60,7 @@ namespace Policy public: int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const final; }; } diff --git a/src/policy_epall.hpp b/src/policy_epall.hpp index 9e5eda10..96da8637 100644 --- a/src/policy_epall.hpp +++ b/src/policy_epall.hpp @@ -34,7 +34,7 @@ namespace Policy public: int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const final; }; @@ -48,7 +48,7 @@ namespace Policy public: int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const final; bool path_preserving(void) const final { return true; } }; @@ -63,7 +63,7 @@ namespace Policy public: int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const final; }; } diff --git a/src/policy_epff.hpp b/src/policy_epff.hpp index c86652a2..385cee15 100644 --- a/src/policy_epff.hpp +++ b/src/policy_epff.hpp @@ -33,7 +33,7 @@ namespace Policy public: int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const final; }; @@ -46,7 +46,7 @@ namespace Policy public: int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const final; bool path_preserving(void) const final { return true; } }; @@ -60,7 +60,7 @@ namespace Policy public: int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const final; }; } diff --git a/src/policy_eplfs.hpp b/src/policy_eplfs.hpp index 0ead02bf..f18a538c 100644 --- a/src/policy_eplfs.hpp +++ b/src/policy_eplfs.hpp @@ -33,7 +33,7 @@ namespace Policy public: int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const final; }; @@ -46,7 +46,7 @@ namespace Policy public: int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const final; bool path_preserving(void) const final { return true; } }; @@ -60,7 +60,7 @@ namespace Policy public: int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const final; }; } diff --git a/src/policy_eplus.hpp b/src/policy_eplus.hpp index 410f60d3..a28eb4f2 100644 --- a/src/policy_eplus.hpp +++ b/src/policy_eplus.hpp @@ -33,7 +33,7 @@ namespace Policy public: int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const final; }; @@ -46,7 +46,7 @@ namespace Policy public: int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const final; bool path_preserving(void) const final { return true; } }; @@ -60,7 +60,7 @@ namespace Policy public: int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const final; }; } diff --git a/src/policy_epmfs.hpp b/src/policy_epmfs.hpp index 8dc26908..85eb0537 100644 --- a/src/policy_epmfs.hpp +++ b/src/policy_epmfs.hpp @@ -34,7 +34,7 @@ namespace Policy public: int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const final; }; @@ -48,7 +48,7 @@ namespace Policy public: int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const final; bool path_preserving(void) const final { return true; } }; @@ -63,7 +63,7 @@ namespace Policy public: int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const final; }; } diff --git a/src/policy_eppfrd.hpp b/src/policy_eppfrd.hpp index 0f431792..20a1f173 100644 --- a/src/policy_eppfrd.hpp +++ b/src/policy_eppfrd.hpp @@ -33,7 +33,7 @@ namespace Policy public: int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const final; }; @@ -46,7 +46,7 @@ namespace Policy public: int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const final; bool path_preserving(void) const final { return true; } }; @@ -60,7 +60,7 @@ namespace Policy public: int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const final; }; } diff --git a/src/policy_eprand.hpp b/src/policy_eprand.hpp index aeb87a0d..9e8ea8a4 100644 --- a/src/policy_eprand.hpp +++ b/src/policy_eprand.hpp @@ -33,7 +33,7 @@ namespace Policy public: int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const final; }; @@ -46,7 +46,7 @@ namespace Policy public: int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const final; bool path_preserving(void) const final { return true; } }; @@ -60,7 +60,7 @@ namespace Policy public: int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const final; }; } diff --git a/src/policy_erofs.hpp b/src/policy_erofs.hpp index d4e8d798..a0bdb1ed 100644 --- a/src/policy_erofs.hpp +++ b/src/policy_erofs.hpp @@ -33,7 +33,7 @@ namespace Policy public: int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const final; }; @@ -46,7 +46,7 @@ namespace Policy public: int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const final; bool path_preserving(void) const final { return false; } }; @@ -60,7 +60,7 @@ namespace Policy public: int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const final; }; } diff --git a/src/policy_ff.hpp b/src/policy_ff.hpp index 5ddc622c..c28f75ef 100644 --- a/src/policy_ff.hpp +++ b/src/policy_ff.hpp @@ -33,7 +33,7 @@ namespace Policy public: int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const final; }; @@ -47,7 +47,7 @@ namespace Policy public: bool path_preserving(void) const final { return false; } int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const final; }; @@ -61,7 +61,7 @@ namespace Policy public: int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const final; }; } diff --git a/src/policy_lfs.hpp b/src/policy_lfs.hpp index 37d35856..370fde16 100644 --- a/src/policy_lfs.hpp +++ b/src/policy_lfs.hpp @@ -33,7 +33,7 @@ namespace Policy public: int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const final; }; @@ -46,7 +46,7 @@ namespace Policy public: int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const final; bool path_preserving() const final { return false; } }; @@ -60,7 +60,7 @@ namespace Policy public: int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const final; }; } diff --git a/src/policy_lus.hpp b/src/policy_lus.hpp index 23755790..a26f4b67 100644 --- a/src/policy_lus.hpp +++ b/src/policy_lus.hpp @@ -33,7 +33,7 @@ namespace Policy public: int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const final; }; @@ -46,7 +46,7 @@ namespace Policy public: int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const final; bool path_preserving() const final { return false; } }; @@ -60,7 +60,7 @@ namespace Policy public: int operator()(const Branches::Ptr&, - const std::filesystem::path&, + const fs::path&, std::vector&) const final; }; } diff --git a/src/to_string.cpp b/src/to_string.cpp index 241b89c8..94b3043e 100644 --- a/src/to_string.cpp +++ b/src/to_string.cpp @@ -55,7 +55,7 @@ str::to(const std::string &s_) } std::string -str::to(const std::filesystem::path &path_) +str::to(const fs::path &path_) { return path_.string(); } diff --git a/src/to_string.hpp b/src/to_string.hpp index 8a7b55af..18561bef 100644 --- a/src/to_string.hpp +++ b/src/to_string.hpp @@ -18,6 +18,8 @@ #pragma once +#include "fs_path.hpp" + #include #include #include @@ -30,5 +32,5 @@ namespace str std::string to(const uint64_t); std::string to(const int64_t); std::string to(const std::string&); - std::string to(const std::filesystem::path&); + std::string to(const fs::path&); }