52 explicit URL(std::string_view url);
53 explicit URL(
char const *url);
57 URL(
URL const &other) noexcept : value(other.value) {}
58 URL(
URL &&other)
noexcept =
default;
59 URL &operator=(
URL const &other)
noexcept { value = other.value;
return *
this; }
60 URL &operator=(
URL &&other)
noexcept =
default;
62 [[nodiscard]]
size_t hash()
const noexcept;
64 [[nodiscard]] std::string_view scheme()
const noexcept;
68 [[nodiscard]]
std::string fragment()
const noexcept;
70 [[nodiscard]]
std::string filename()
const noexcept;
72 [[nodiscard]]
std::string directory()
const noexcept;
74 [[nodiscard]]
std::string nativeDirectory()
const noexcept;
76 [[nodiscard]]
std::string extension()
const noexcept;
82 [[nodiscard]]
std::string nativePath()
const noexcept;
86 [[nodiscard]]
bool isFileScheme()
const noexcept {
87 return scheme() ==
"file";
90 [[nodiscard]]
bool isAbsolute()
const noexcept;
91 [[nodiscard]]
bool isRelative()
const noexcept;
92 [[nodiscard]]
bool isRootDirectory()
const noexcept;
94 [[nodiscard]]
URL urlByAppendingPath(
URL const &other)
const noexcept;
96 [[nodiscard]]
URL urlByAppendingPath(std::string_view
const other)
const noexcept;
97 [[nodiscard]]
URL urlByAppendingPath(
std::string const &other)
const noexcept;
98 [[nodiscard]]
URL urlByAppendingPath(
char const *other)
const noexcept;
100 [[nodiscard]]
URL urlByAppendingPath(std::wstring_view
const other)
const noexcept;
101 [[nodiscard]]
URL urlByAppendingPath(
std::wstring const &other)
const noexcept;
102 [[nodiscard]]
URL urlByAppendingPath(
wchar_t const *other)
const noexcept;
104 [[nodiscard]]
URL urlByAppendingExtension(std::string_view other)
const noexcept;
105 [[nodiscard]]
URL urlByAppendingExtension(
std::string const &other)
const noexcept;
106 [[nodiscard]]
URL urlByAppendingExtension(
char const *other)
const noexcept;
108 [[nodiscard]]
URL urlByRemovingFilename()
const noexcept;
127 [[nodiscard]] static
URL urlFromPath(
std::string_view const path) noexcept;
128 [[nodiscard]] static
URL urlFromWPath(
std::wstring_view const path) noexcept;
130 [[nodiscard]] static
URL urlFromCurrentWorkingDirectory() noexcept;
131 [[nodiscard]] static
URL urlFromResourceDirectory() noexcept;
132 [[nodiscard]] static
URL urlFromExecutableDirectory() noexcept;
133 [[nodiscard]] static
URL urlFromExecutableFile() noexcept;
134 [[nodiscard]] static
URL urlFromApplicationDataDirectory() noexcept;
135 [[nodiscard]] static
URL urlFromApplicationLogDirectory() noexcept;
136 [[nodiscard]] static
URL urlFromSystemfontDirectory() noexcept;
144 [[nodiscard]] static
std::
string nativePathFromPath(
std::string_view path) noexcept;
145 [[nodiscard]] static
std::wstring nativeWPathFromPath(
std::string_view path) noexcept;
147 [[nodiscard]] friend
bool operator==(
URL const &lhs,
URL const &rhs) noexcept
149 return lhs.value == rhs.value;
152 [[nodiscard]]
friend bool operator<(
URL const &lhs,
URL const &rhs)
noexcept
154 return lhs.value < rhs.value;
157 [[nodiscard]]
friend bool operator>(URL
const &lhs, URL
const &rhs)
noexcept
162 [[nodiscard]]
friend bool operator!=(URL
const &lhs, URL
const &rhs)
noexcept
164 return !(lhs == rhs);
167 [[nodiscard]]
friend bool operator>=(URL
const &lhs, URL
const &rhs)
noexcept
172 [[nodiscard]]
friend bool operator<=(URL
const &lhs, URL
const &rhs)
noexcept
177 [[nodiscard]]
friend URL operator/(URL
const &lhs, URL
const &rhs)
noexcept
179 return lhs.urlByAppendingPath(rhs);
182 [[nodiscard]]
friend URL operator/(URL
const &lhs, std::string_view
const &rhs)
noexcept
184 return lhs.urlByAppendingPath(URL{rhs});
187 [[nodiscard]]
friend std::string to_string(URL
const &url)
noexcept
194 return lhs << to_string(rhs);