Browse Source

Further replacement of std::filesystem::path to fs::path

pull/1523/head
Antonio SJ Musumeci 2 months ago
parent
commit
e41789eff5
  1. 2
      src/mergerfs.cpp
  2. 18
      src/policy.hpp
  3. 6
      src/policy_all.hpp
  4. 6
      src/policy_epall.hpp
  5. 6
      src/policy_epff.hpp
  6. 6
      src/policy_eplfs.hpp
  7. 6
      src/policy_eplus.hpp
  8. 6
      src/policy_epmfs.hpp
  9. 6
      src/policy_eppfrd.hpp
  10. 6
      src/policy_eprand.hpp
  11. 6
      src/policy_erofs.hpp
  12. 6
      src/policy_ff.hpp
  13. 6
      src/policy_lfs.hpp
  14. 6
      src/policy_lus.hpp
  15. 2
      src/to_string.cpp
  16. 4
      src/to_string.hpp

2
src/mergerfs.cpp

@ -362,7 +362,7 @@ int
_pick_app_and_run(int argc_, _pick_app_and_run(int argc_,
char **argv_) char **argv_)
{ {
std::filesystem::path appname;
fs::path appname;
appname = argv_[0]; appname = argv_[0];
appname = appname.filename(); appname = appname.filename();

18
src/policy.hpp

@ -64,9 +64,9 @@ namespace Policy
} }
int int
operator()(const Branches::Ptr &branches_,
const std::filesystem::path &fusepath_,
std::vector<Branch*> &output_) const
operator()(const Branches::Ptr &branches_,
const fs::path &fusepath_,
std::vector<Branch*> &output_) const
{ {
return (*impl)(branches_,fusepath_,output_); return (*impl)(branches_,fusepath_,output_);
} }
@ -92,7 +92,7 @@ namespace Policy
std::string name; std::string name;
virtual bool path_preserving(void) const = 0; virtual bool path_preserving(void) const = 0;
virtual int operator()(const Branches::Ptr&, virtual int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const = 0; std::vector<Branch*>&) const = 0;
}; };
@ -124,9 +124,9 @@ namespace Policy
} }
int int
operator()(const Branches::Ptr &branches_,
const std::filesystem::path &fusepath_,
std::vector<Branch*> &output_) const
operator()(const Branches::Ptr &branches_,
const fs::path &fusepath_,
std::vector<Branch*> &output_) const
{ {
return (*impl)(branches_,fusepath_,output_); return (*impl)(branches_,fusepath_,output_);
} }
@ -151,7 +151,7 @@ namespace Policy
public: public:
std::string name; std::string name;
virtual int operator()(const Branches::Ptr&, virtual int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const = 0; std::vector<Branch*>&) const = 0;
}; };
@ -178,7 +178,7 @@ namespace Policy
int int
operator()(const Branches::Ptr &branches_, operator()(const Branches::Ptr &branches_,
const std::filesystem::path &fusepath_,
const fs::path &fusepath_,
std::vector<Branch*> &output_) const std::vector<Branch*> &output_) const
{ {
return (*impl)(branches_,fusepath_,output_); return (*impl)(branches_,fusepath_,output_);

6
src/policy_all.hpp

@ -33,7 +33,7 @@ namespace Policy
public: public:
int operator()(const Branches::Ptr&, int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const final; std::vector<Branch*>&) const final;
}; };
@ -46,7 +46,7 @@ namespace Policy
public: public:
int operator()(const Branches::Ptr&, int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const final; std::vector<Branch*>&) const final;
bool path_preserving(void) const final { return false; } bool path_preserving(void) const final { return false; }
}; };
@ -60,7 +60,7 @@ namespace Policy
public: public:
int operator()(const Branches::Ptr&, int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const final; std::vector<Branch*>&) const final;
}; };
} }

6
src/policy_epall.hpp

@ -34,7 +34,7 @@ namespace Policy
public: public:
int operator()(const Branches::Ptr&, int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const final; std::vector<Branch*>&) const final;
}; };
@ -48,7 +48,7 @@ namespace Policy
public: public:
int operator()(const Branches::Ptr&, int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const final; std::vector<Branch*>&) const final;
bool path_preserving(void) const final { return true; } bool path_preserving(void) const final { return true; }
}; };
@ -63,7 +63,7 @@ namespace Policy
public: public:
int operator()(const Branches::Ptr&, int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const final; std::vector<Branch*>&) const final;
}; };
} }

6
src/policy_epff.hpp

@ -33,7 +33,7 @@ namespace Policy
public: public:
int operator()(const Branches::Ptr&, int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const final; std::vector<Branch*>&) const final;
}; };
@ -46,7 +46,7 @@ namespace Policy
public: public:
int operator()(const Branches::Ptr&, int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const final; std::vector<Branch*>&) const final;
bool path_preserving(void) const final { return true; } bool path_preserving(void) const final { return true; }
}; };
@ -60,7 +60,7 @@ namespace Policy
public: public:
int operator()(const Branches::Ptr&, int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const final; std::vector<Branch*>&) const final;
}; };
} }

6
src/policy_eplfs.hpp

@ -33,7 +33,7 @@ namespace Policy
public: public:
int operator()(const Branches::Ptr&, int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const final; std::vector<Branch*>&) const final;
}; };
@ -46,7 +46,7 @@ namespace Policy
public: public:
int operator()(const Branches::Ptr&, int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const final; std::vector<Branch*>&) const final;
bool path_preserving(void) const final { return true; } bool path_preserving(void) const final { return true; }
}; };
@ -60,7 +60,7 @@ namespace Policy
public: public:
int operator()(const Branches::Ptr&, int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const final; std::vector<Branch*>&) const final;
}; };
} }

6
src/policy_eplus.hpp

@ -33,7 +33,7 @@ namespace Policy
public: public:
int operator()(const Branches::Ptr&, int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const final; std::vector<Branch*>&) const final;
}; };
@ -46,7 +46,7 @@ namespace Policy
public: public:
int operator()(const Branches::Ptr&, int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const final; std::vector<Branch*>&) const final;
bool path_preserving(void) const final { return true; } bool path_preserving(void) const final { return true; }
}; };
@ -60,7 +60,7 @@ namespace Policy
public: public:
int operator()(const Branches::Ptr&, int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const final; std::vector<Branch*>&) const final;
}; };
} }

6
src/policy_epmfs.hpp

@ -34,7 +34,7 @@ namespace Policy
public: public:
int operator()(const Branches::Ptr&, int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const final; std::vector<Branch*>&) const final;
}; };
@ -48,7 +48,7 @@ namespace Policy
public: public:
int operator()(const Branches::Ptr&, int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const final; std::vector<Branch*>&) const final;
bool path_preserving(void) const final { return true; } bool path_preserving(void) const final { return true; }
}; };
@ -63,7 +63,7 @@ namespace Policy
public: public:
int operator()(const Branches::Ptr&, int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const final; std::vector<Branch*>&) const final;
}; };
} }

6
src/policy_eppfrd.hpp

@ -33,7 +33,7 @@ namespace Policy
public: public:
int operator()(const Branches::Ptr&, int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const final; std::vector<Branch*>&) const final;
}; };
@ -46,7 +46,7 @@ namespace Policy
public: public:
int operator()(const Branches::Ptr&, int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const final; std::vector<Branch*>&) const final;
bool path_preserving(void) const final { return true; } bool path_preserving(void) const final { return true; }
}; };
@ -60,7 +60,7 @@ namespace Policy
public: public:
int operator()(const Branches::Ptr&, int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const final; std::vector<Branch*>&) const final;
}; };
} }

6
src/policy_eprand.hpp

@ -33,7 +33,7 @@ namespace Policy
public: public:
int operator()(const Branches::Ptr&, int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const final; std::vector<Branch*>&) const final;
}; };
@ -46,7 +46,7 @@ namespace Policy
public: public:
int operator()(const Branches::Ptr&, int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const final; std::vector<Branch*>&) const final;
bool path_preserving(void) const final { return true; } bool path_preserving(void) const final { return true; }
}; };
@ -60,7 +60,7 @@ namespace Policy
public: public:
int operator()(const Branches::Ptr&, int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const final; std::vector<Branch*>&) const final;
}; };
} }

6
src/policy_erofs.hpp

@ -33,7 +33,7 @@ namespace Policy
public: public:
int operator()(const Branches::Ptr&, int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const final; std::vector<Branch*>&) const final;
}; };
@ -46,7 +46,7 @@ namespace Policy
public: public:
int operator()(const Branches::Ptr&, int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const final; std::vector<Branch*>&) const final;
bool path_preserving(void) const final { return false; } bool path_preserving(void) const final { return false; }
}; };
@ -60,7 +60,7 @@ namespace Policy
public: public:
int operator()(const Branches::Ptr&, int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const final; std::vector<Branch*>&) const final;
}; };
} }

6
src/policy_ff.hpp

@ -33,7 +33,7 @@ namespace Policy
public: public:
int operator()(const Branches::Ptr&, int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const final; std::vector<Branch*>&) const final;
}; };
@ -47,7 +47,7 @@ namespace Policy
public: public:
bool path_preserving(void) const final { return false; } bool path_preserving(void) const final { return false; }
int operator()(const Branches::Ptr&, int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const final; std::vector<Branch*>&) const final;
}; };
@ -61,7 +61,7 @@ namespace Policy
public: public:
int operator()(const Branches::Ptr&, int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const final; std::vector<Branch*>&) const final;
}; };
} }

6
src/policy_lfs.hpp

@ -33,7 +33,7 @@ namespace Policy
public: public:
int operator()(const Branches::Ptr&, int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const final; std::vector<Branch*>&) const final;
}; };
@ -46,7 +46,7 @@ namespace Policy
public: public:
int operator()(const Branches::Ptr&, int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const final; std::vector<Branch*>&) const final;
bool path_preserving() const final { return false; } bool path_preserving() const final { return false; }
}; };
@ -60,7 +60,7 @@ namespace Policy
public: public:
int operator()(const Branches::Ptr&, int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const final; std::vector<Branch*>&) const final;
}; };
} }

6
src/policy_lus.hpp

@ -33,7 +33,7 @@ namespace Policy
public: public:
int operator()(const Branches::Ptr&, int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const final; std::vector<Branch*>&) const final;
}; };
@ -46,7 +46,7 @@ namespace Policy
public: public:
int operator()(const Branches::Ptr&, int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const final; std::vector<Branch*>&) const final;
bool path_preserving() const final { return false; } bool path_preserving() const final { return false; }
}; };
@ -60,7 +60,7 @@ namespace Policy
public: public:
int operator()(const Branches::Ptr&, int operator()(const Branches::Ptr&,
const std::filesystem::path&,
const fs::path&,
std::vector<Branch*>&) const final; std::vector<Branch*>&) const final;
}; };
} }

2
src/to_string.cpp

@ -55,7 +55,7 @@ str::to(const std::string &s_)
} }
std::string std::string
str::to(const std::filesystem::path &path_)
str::to(const fs::path &path_)
{ {
return path_.string(); return path_.string();
} }

4
src/to_string.hpp

@ -18,6 +18,8 @@
#pragma once #pragma once
#include "fs_path.hpp"
#include <cstdint> #include <cstdint>
#include <filesystem> #include <filesystem>
#include <string> #include <string>
@ -30,5 +32,5 @@ namespace str
std::string to(const uint64_t); std::string to(const uint64_t);
std::string to(const int64_t); std::string to(const int64_t);
std::string to(const std::string&); std::string to(const std::string&);
std::string to(const std::filesystem::path&);
std::string to(const fs::path&);
} }
Loading…
Cancel
Save