18class Path :
private std::filesystem::path {
19 using Base = std::filesystem::path;
30 : Base(std::move(
base)) {}
33 : Base(str.native()) {}
36 : Base(std::move(str).native()) {}
41 Path(
const std::string &str)
54 Base::operator=(
base);
59 Base::operator=(std::move(
base));
64 Base::operator=(str.
native());
69 Base::operator=(std::move(str).native());
89 return static_cast<Base &
>(*this);
92 const Base &
base() const noexcept {
93 return static_cast<const Base &
>(*this);
105 return Base::empty();
109 return Base::has_root_path();
113 return Base::has_root_name();
117 return Base::has_root_directory();
121 return Base::has_relative_path();
125 return Base::has_parent_path();
129 return Base::has_filename();
133 return Base::has_stem();
137 return Base::has_extension();
141 return Base::is_absolute();
145 return Base::is_relative();
149 return Base::root_path();
153 return Base::root_name();
157 return Base::root_directory();
161 return Base::relative_path();
165 return Base::parent_path();
169 return Base::filename();
177 return Base::extension();
181 return Base::lexically_normal();
185 return Base::lexically_relative(
base);
189 return Base::lexically_proximate(
base);
193 Base::make_preferred();
198 Base::remove_filename();
203 Base::replace_filename(replacement);
208 Base::replace_extension(replacement);
213 Base::operator/=(other);
218 Base::operator/=(other);
223 Base::operator/=(other.
native());
240 Base::operator+=(other);
245 Base::operator+=(
base);
250 Base::operator+=(str.
native());
280 return lhs.base() == rhs.base();
284 return lhs.base() <=> rhs.base();
296 return std::hash<std::filesystem::path>()(path.base());
302 constexpr auto parse(std::format_parse_context &ctx) {
306 template <
typename FormatContext>
308 return std::format_to(ctx.out(),
"{}", path.
to_string());
bool has_relative_path() const
Definition Path.h:120
const Base & base() const noexcept
Definition Path.h:92
Path & operator/=(std::string_view str)
Definition Path.h:235
Path & operator=(const Base &base)
Definition Path.h:53
Path & operator+=(const Path &other)
Definition Path.h:239
Path(std::string &&str)
Definition Path.h:44
Path & make_preferred()
Definition Path.h:192
bool is_absolute() const
Definition Path.h:140
Path(const SystemString &str)
Definition Path.h:32
Path & operator=(SystemString &&str)
Definition Path.h:68
Path & operator/=(const Base &other)
Definition Path.h:217
Path(std::string_view str)
Definition Path.h:47
Path & replace_extension(const Path &replacement)
Definition Path.h:207
Path root_directory() const
Definition Path.h:156
bool has_stem() const
Definition Path.h:132
Path root_path() const
Definition Path.h:148
Path & operator=(const char *str)
Definition Path.h:73
Path relative_path() const
Definition Path.h:160
Path & remove_filename()
Definition Path.h:197
Path(SystemString &&str)
Definition Path.h:35
Path & operator/=(const char *str)
Definition Path.h:227
bool is_relative() const
Definition Path.h:144
bool empty() const
Definition Path.h:104
bool has_filename() const
Definition Path.h:128
Path(Path &&other) noexcept=default
Path & operator/=(const Path &other)
Definition Path.h:212
void clear()
Definition Path.h:266
void swap(Path &other) noexcept
Definition Path.h:270
bool has_root_path() const
Definition Path.h:108
Path & operator+=(const char *str)
Definition Path.h:254
Path(Base &&base) noexcept
Definition Path.h:29
bool has_root_name() const
Definition Path.h:112
Path & operator=(Base &&base) noexcept
Definition Path.h:58
Path(const char *str)
Definition Path.h:38
Base & base() noexcept
Definition Path.h:88
bool has_parent_path() const
Definition Path.h:124
Path & operator=(const std::string &str)
Definition Path.h:77
Path & operator=(const SystemString &str)
Definition Path.h:63
Path lexically_relative(const Path &base) const
Definition Path.h:184
Path(const Path &other)=default
Path stem() const
Definition Path.h:172
Path & operator/=(const SystemString &other)
Definition Path.h:222
SystemString to_system_string() const
Definition Path.h:96
Path(const std::string &str)
Definition Path.h:41
Path & operator+=(const Base &base)
Definition Path.h:244
Path & operator+=(const SystemString &str)
Definition Path.h:249
Path parent_path() const
Definition Path.h:164
Path & operator+=(const std::string &str)
Definition Path.h:258
bool has_root_directory() const
Definition Path.h:116
Path root_name() const
Definition Path.h:152
Path lexically_proximate(const Path &base) const
Definition Path.h:188
Path & operator/=(const std::string &str)
Definition Path.h:231
Path(const Base &base)
Definition Path.h:26
std::string to_string() const
Definition Path.h:100
static constexpr char preferred_separator
Definition Path.h:22
Path lexically_normal() const
Definition Path.h:180
Path & replace_filename(const Path &replacement)
Definition Path.h:202
bool has_extension() const
Definition Path.h:136
Path & operator=(std::string_view str)
Definition Path.h:81
Path & operator=(Path &&other) noexcept=default
Path & operator+=(std::string_view str)
Definition Path.h:262
Path extension() const
Definition Path.h:176
Path & operator=(const Path &other)=default
Path filename() const
Definition Path.h:168
Definition SystemString.h:19
string_type & native() &noexcept
Definition SystemString.h:81
std::string to_string() const &
Definition SystemString.h:97
Definition GraphColoringAllocator.h:13
void swap(FileHandle &lhs, FileHandle &rhs) noexcept
Definition FileHandle.h:61
MINI_LLVM_EXPORT BigInteger operator/(const BigInteger &lhs, int32_t rhs)
MINI_LLVM_EXPORT bool operator==(const BigInteger &lhs, const BigInteger &rhs) noexcept
MINI_LLVM_EXPORT std::strong_ordering operator<=>(const BigInteger &lhs, const BigInteger &rhs) noexcept
size_t operator()(const mini_llvm::Path &path) const noexcept
Definition Path.h:295