|
constexpr | BasicPath (const BasicPath &other)=default |
|
constexpr | BasicPath (BasicPath &&other)=default |
|
constexpr | BasicPath (const PathView &other) noexcept |
|
constexpr | BasicPath (const string_type &pathString) noexcept |
|
constexpr | BasicPath (const string_type &pathString, const char preferredSeparator) noexcept |
|
constexpr | BasicPath (string_type &&pathString) noexcept |
|
constexpr | BasicPath (string_type &&pathString, const char preferredSeparator) noexcept |
|
constexpr | BasicPath (AZStd::string_view src) noexcept |
|
constexpr | BasicPath (AZStd::string_view src, const char preferredSeparator) noexcept |
|
constexpr | BasicPath (const value_type *pathString) noexcept |
|
constexpr | BasicPath (const value_type *pathString, const char preferredSeparator) noexcept |
|
constexpr | BasicPath (const char preferredSeparator) noexcept |
| Constructs a empty Path with the preferred separator set to the parameter.
|
|
template<typename InputIt > |
constexpr | BasicPath (InputIt first, InputIt last) |
|
template<typename InputIt > |
constexpr | BasicPath (InputIt first, InputIt last, const char preferredSeparator) |
|
constexpr | operator PathView () const noexcept |
|
constexpr BasicPath & | operator= (const BasicPath &other)=default |
|
constexpr BasicPath & | operator= (BasicPath &&other)=default |
|
constexpr BasicPath & | operator= (const PathView &pathView) noexcept |
|
constexpr BasicPath & | operator= (const string_type &str) noexcept |
|
constexpr BasicPath & | operator= (string_type &&str) noexcept |
|
constexpr BasicPath & | operator= (AZStd::string_view str) noexcept |
|
constexpr BasicPath & | operator= (const value_type *src) noexcept |
|
constexpr BasicPath & | operator= (value_type src) noexcept |
|
constexpr BasicPath & | Assign (const PathView &pathView) noexcept |
|
constexpr BasicPath & | Assign (const string_type &pathView) noexcept |
|
constexpr BasicPath & | Assign (string_type &&pathView) noexcept |
|
constexpr BasicPath & | Assign (AZStd::string_view pathView) noexcept |
|
constexpr BasicPath & | Assign (const value_type *src) noexcept |
|
constexpr BasicPath & | Assign (value_type src) noexcept |
|
template<typename InputIt > |
constexpr BasicPath & | Assign (InputIt first, InputIt last) |
|
constexpr BasicPath & | operator/= (const PathView &other) |
|
constexpr BasicPath & | operator/= (const string_type &src) |
|
constexpr BasicPath & | operator/= (AZStd::string_view src) |
|
constexpr BasicPath & | operator/= (const value_type *src) |
|
constexpr BasicPath & | operator/= (value_type src) |
|
constexpr BasicPath & | Append (const PathView &src) |
| Sames as the operator/= functions above.
|
|
constexpr BasicPath & | Append (const string_type &pathView) |
|
constexpr BasicPath & | Append (AZStd::string_view src) |
|
constexpr BasicPath & | Append (const value_type *src) |
|
constexpr BasicPath & | Append (value_type src) |
|
template<typename InputIt > |
constexpr BasicPath & | Append (InputIt first, InputIt last) |
|
constexpr void | clear () noexcept |
| Invokes clean on the underlying path string type.
|
|
constexpr BasicPath & | MakePreferred () |
| Replaces all path separators with the preferred separator value.
|
|
constexpr BasicPath & | RemoveFilename () |
|
constexpr BasicPath & | ReplaceFilename (const PathView &replacementFilename) |
|
constexpr BasicPath & | ReplaceExtension (const PathView &replacementExtension={}) |
|
constexpr void | swap (BasicPath &rhs) noexcept |
|
constexpr const string_type & | Native () const &noexcept |
|
constexpr const string_type && | Native () const &&noexcept |
|
constexpr const value_type * | c_str () const noexcept |
|
constexpr | operator string_type () const |
|
constexpr string_type & | Native () &noexcept |
|
constexpr string_type && | Native () &&noexcept |
|
AZStd::string | String () const |
|
constexpr AZStd::fixed_string< MaxPathLength > | FixedMaxPathString () const |
|
constexpr string_type | AsPosix () const |
|
AZStd::string | StringAsPosix () const |
|
constexpr AZStd::fixed_string< MaxPathLength > | FixedMaxPathStringAsPosix () const noexcept |
|
string_type | AsUri () const |
|
AZStd::string | StringAsUri () const |
|
AZStd::fixed_string< MaxPathLength > | FixedMaxPathStringAsUri () const noexcept |
|
constexpr int | Compare (const PathView &other) const noexcept |
|
constexpr int | Compare (const string_type &pathString) const |
|
constexpr int | Compare (AZStd::string_view pathString) const noexcept |
|
constexpr int | Compare (const value_type *pathString) const noexcept |
|
constexpr PathView | RootName () const |
|
constexpr PathView | RootDirectory () const |
|
constexpr PathView | RootPath () const |
|
constexpr PathView | RelativePath () const |
|
constexpr PathView | ParentPath () const |
|
constexpr PathView | Filename () const |
|
constexpr PathView | Stem () const |
|
constexpr PathView | Extension () const |
|
constexpr bool | empty () const noexcept |
| Checks if the contained string type element is empty.
|
|
constexpr bool | HasRootName () const |
|
constexpr bool | HasRootDirectory () const |
| Checks if the path has a root directory.
|
|
constexpr bool | HasRootPath () const |
|
constexpr bool | HasRelativePath () const |
|
constexpr bool | HasParentPath () const |
| checks whether the path has a parent path that empty
|
|
constexpr bool | HasFilename () const |
| Checks whether the filename is empty.
|
|
constexpr bool | HasStem () const |
| Checks whether the stem of the filename is empty <stem>[.<ext>].
|
|
constexpr bool | HasExtension () const |
| Checks whether the extension of the filename is empty <stem>[.<ext>].
|
|
constexpr bool | IsAbsolute () const |
|
constexpr bool | IsRelative () const |
| Check whether the path is not absolute.
|
|
constexpr bool | IsRelativeTo (const PathView &base) const |
| Check whether the path is relative to the base path.
|
|
constexpr const char | PreferredSeparator () const noexcept |
| Returns the preferred separator for this instance.
|
|
constexpr BasicPath | LexicallyNormal () const |
|
constexpr BasicPath | LexicallyRelative (const PathView &base) const |
|
constexpr BasicPath | LexicallyProximate (const PathView &base) const |
| Returns the lexically relative path if it is not an empty path, otherwise it returns the current *this path.
|
|
constexpr bool | Match (AZStd::string_view pathPattern) const |
| See PathView::Match for documentation on how to use.
|
|
constexpr const_iterator | begin () const |
|
constexpr const_iterator | end () const |
|
template<typename InputIt > |
constexpr auto | Assign (InputIt first, InputIt last) -> BasicPath & |
|
template<typename InputIt > |
constexpr auto | Append (InputIt first, InputIt last) -> BasicPath & |
|
template<typename StringType >
Make the path relative to the supplied base PathView, by using the following rules.
If root_name() != base.root_name() is true, return a default constructed path
(Path can't relative if the root_names are different i.e C: vs F:)
If is_absolute() != base.is_absolute() is true, return a default constructed path
(A relative path can't be formed out of when one path is absolute and the other isn't)
If !has_root_directory() && base.has_root_directory() is true return a default constructed path
(Again if one path contains a root directory and the other doesn't a relative path can't be formed
if any filename in the relative_path() or the base.relative_path() can be interpreted as a root-name
return a default constructed path (This is the occasion of having a "path" such as "foo/bar/C:/foo/bar". Such a path cannot be made relative
Otherwise determine the first mismatch of path parts between *this path and the base as if using
auto [a, b] = AZStd::mismatch(begin(), end(), base.begin(), base.end())
Then if a == end() and b == base.end(), then the paths are equal, return a relative path of "."(represents the same path)
Otherwise define N as the number of non-empty filename elements that are not "." or ".." in [b, base.end()] minus
the number of ".." elements. N is less than 0 then return a default constructed path (This is the case of all the parent directories of base being consumed by the "..". Such as a path of "foo/../bar/../..")
If N == 0 and a == end() or a->empty(), then the paths are equal and retruns a path of "."
(This is the case of a making "a/b/c" relative to a path such as "a/b/c/d/.."
Finally if all the above conditions fail then a path is composed of a default constructed path followed by
N applications of the Path append operator on "..", followed by an application of the path append operator for each element in the range of a[a, end()] (Example of this case is making "/a/d" relative to "/a/b/c". The mismatch happens on "d" for *this and b for base the number of path elements remaining from "b" to "base.end" is 2("b", "c"). Therefore two applications of ".." is formed So the path at this point is "../..", then the remaining elements in the mismatched range for *this is then append There is only 1 element in the range of [a, end()] and that is "d", so the final path becomes "../../d"