49 constexpr ~URL() =
default;
50 constexpr URL()
noexcept =
default;
51 constexpr URL(
URL const &)
noexcept =
default;
52 constexpr URL(
URL &&)
noexcept =
default;
53 constexpr URL &operator=(
URL const &)
noexcept =
default;
54 constexpr URL &operator=(
URL &&)
noexcept =
default;
56 explicit URL(std::string_view url);
57 explicit URL(
char const *url);
61 explicit operator bool()
const noexcept
66 [[nodiscard]]
bool empty()
const noexcept
73 [[nodiscard]] std::string_view scheme()
const noexcept;
77 [[nodiscard]]
std::string fragment()
const noexcept;
79 [[nodiscard]]
std::string filename()
const noexcept;
81 [[nodiscard]]
std::string directory()
const noexcept;
83 [[nodiscard]]
std::string nativeDirectory()
const noexcept;
85 [[nodiscard]]
std::string extension()
const noexcept;
91 [[nodiscard]]
std::string nativePath()
const noexcept;
95 [[nodiscard]]
bool isFileScheme()
const noexcept
97 return scheme() ==
"file";
100 [[nodiscard]]
bool isAbsolute()
const noexcept;
101 [[nodiscard]]
bool isRelative()
const noexcept;
102 [[nodiscard]]
bool isRootDirectory()
const noexcept;
104 [[nodiscard]]
URL urlByAppendingPath(
URL const &other)
const noexcept;
106 [[nodiscard]]
URL urlByAppendingPath(std::string_view
const other)
const noexcept;
107 [[nodiscard]]
URL urlByAppendingPath(
std::string const &other)
const noexcept;
108 [[nodiscard]]
URL urlByAppendingPath(
char const *other)
const noexcept;
110 [[nodiscard]]
URL urlByAppendingPath(std::wstring_view
const other)
const noexcept;
111 [[nodiscard]]
URL urlByAppendingPath(
std::wstring const &other)
const noexcept;
112 [[nodiscard]]
URL urlByAppendingPath(
wchar_t const *other)
const noexcept;
114 [[nodiscard]]
URL urlByAppendingExtension(std::string_view other)
const noexcept;
115 [[nodiscard]]
URL urlByAppendingExtension(
std::string const &other)
const noexcept;
116 [[nodiscard]]
URL urlByAppendingExtension(
char const *other)
const noexcept;
118 [[nodiscard]]
URL urlByRemovingFilename()
const noexcept;
137 [[nodiscard]] static
URL urlFromPath(
std::string_view const path) noexcept;
138 [[nodiscard]] static
URL urlFromWPath(
std::wstring_view const path) noexcept;
140 static
void setUrlForCurrentWorkingDirectory(
URL url) noexcept;
141 [[nodiscard]] static
URL urlFromCurrentWorkingDirectory() noexcept;
142 [[nodiscard]] static
URL urlFromResourceDirectory() noexcept;
143 [[nodiscard]] static
URL urlFromExecutableDirectory() noexcept;
144 [[nodiscard]] static
URL urlFromExecutableFile() noexcept;
145 [[nodiscard]] static
URL urlFromApplicationDataDirectory() noexcept;
146 [[nodiscard]] static
URL urlFromApplicationLogDirectory() noexcept;
147 [[nodiscard]] static
URL urlFromSystemfontDirectory() noexcept;
148 [[nodiscard]] static
URL urlFromApplicationPreferencesFile() noexcept;
154 [[nodiscard]] static
std::vector<
std::
string> filenamesByScanningDirectory(
std::string_view path) noexcept;
156 [[nodiscard]] static
std::
string nativePathFromPath(
std::string_view path) noexcept;
157 [[nodiscard]] static
std::wstring nativeWPathFromPath(
std::string_view path) noexcept;
159 [[nodiscard]] friend
bool operator==(
URL const &lhs,
URL const &rhs) noexcept
161 return lhs.value == rhs.value;
164 [[nodiscard]]
friend auto operator<=>(
URL const &lhs,
URL const &rhs)
noexcept
166 return lhs.value <=> rhs.value;
169 [[nodiscard]]
friend URL operator/(URL
const &lhs, URL
const &rhs)
noexcept
171 return lhs.urlByAppendingPath(rhs);
174 [[nodiscard]]
friend URL operator/(URL
const &lhs, std::string_view
const &rhs)
noexcept
176 return lhs.urlByAppendingPath(URL{rhs});
192 static URL _urlOfCurrentWorkingDirectory;