22 using namespace std::filesystem;
30 class path :
public std::filesystem::path
33 using std::filesystem::path::path;
37 path&
operator=(std::filesystem::path
path) { std::filesystem::path::operator=(std::move(
path));
return *
this; }
42 path&
operator=(
const char* c) { std::filesystem::path::operator=(c);
return *
this; }
43 path&
operator/=(
const char* c) { std::filesystem::path::operator/=(c);
return *
this; }
44 path&
append(
const char* c) { std::filesystem::path::append(c);
return *
this; }
47 path(std::string) =
delete;
57 const auto& utf8_str{std::filesystem::path::u8string()};
61 return std::string{utf8_str.begin(), utf8_str.end()};
67 path filename()
const {
return std::filesystem::path::filename(); }
72 #if __cplusplus < 202002L
75 return std::filesystem::path(std::u8string{utf8_str.begin(), utf8_str.end()});
94 static inline auto quoted(
const std::string& s)
165 static_assert(std::is_same<path::string_type, std::string>::value,
"PathToString not implemented on this platform");
166 return path.std::filesystem::path::string();
178 return std::filesystem::path(
string);
190 if (std::filesystem::is_symlink(p) && std::filesystem::is_directory(p)) {
237 void* hFile = (
void*)-1;
247 template<>
inline void formatValue(std::ostream&,
const char*,
const char*,
int,
const std::filesystem::path&) =
delete;
248 template<>
inline void formatValue(std::ostream&,
const char*,
const char*,
int,
const fs::path&) =
delete;
Path class wrapper to block calls to the fs::path(std::string) implicit constructor and the fs::path:...
path & append(const char *c)
path(std::filesystem::path path)
std::string string() const =delete
std::string u8string() const
path & append(std::string)=delete
path & operator=(std::string)=delete
path & operator=(std::filesystem::path path)
path & operator=(const char *c)
path & operator/=(std::string)=delete
path & operator/=(const char *c)
path & operator/=(std::filesystem::path path)
FileLock(FileLock &&)=delete
FileLock(const FileLock &)=delete
Filesystem operations and types.
bool create_directories(const std::filesystem::path &p, std::error_code &ec)=delete
This variant is not used.
static path absolute(const path &p)
static path u8path(const std::string &utf8_str)
static bool create_directories(const std::filesystem::path &p)
Create directory (and if necessary its parents), unless the leaf directory already exists or is a sym...
static auto quoted(const std::string &s)
static bool exists(const path &p)
static bool copy_file(const path &from, const path &to, copy_options options)
static std::string PathToString(const path &path)
Convert path object to a byte string.
static path PathFromString(const std::string &string)
Convert byte string to path object.
static path operator+(path p1, const char *p2)
static path operator/(path p1, path p2)
Bridge operations to C stdio.
FILE * fopen(const fs::path &p, const char *mode)
std::string get_filesystem_error_message(const fs::filesystem_error &e)
fs::path AbsPathJoin(const fs::path &base, const fs::path &path)
Helper function for joining two paths.
std::function< FILE *(const fs::path &, const char *)> FopenFn