|
|
| Path () |
| | Constructs an empty enzo::Path object.
|
| |
|
| Path (const std::string &path) |
| | Constructs an enzo::Path object from a given std::string.
|
| |
|
| Path (const char *path) |
| | Constructs an enzo::Path object from a C string.
|
| |
|
bool | isEmpty () const |
| | Checks if the Path has no characters.
|
| |
|
bool | isRoot () const |
| | Returns true if the Path is "/".
|
| |
|
bool | isAbsolute () const |
| | Returns true if the Path is an absolute path.
|
| |
|
bool | isRelative () const |
| | Returns true if the Path is a relative path.
|
| |
| virtual bool | isValid () const |
| | Runs every validation check and returns true if the path is fully valid.
|
| |
|
std::string | getName () const |
| | Returns the name of the Path, ie, the last component of the path.
|
| |
|
Path | getParent () const |
| | Returns the parent path as a Path if it exists.
|
| |
| std::vector< Path > | getPrefixes () const |
| | Returns every ancestor path leading up to this path, ordered from shortest to longest. The path itself is not included.
|
| |
|
std::vector< std::string > | split () const |
| | Splits all of the components of a Path and returns them as a vector of strings.
|
| |
|
const std::string & | getString () const |
| | Return the path of the Path as an std::string.
|
| |
| Path | append (const enzo::Path &path) const |
| | Returns a new path formed by appending the given path to this one.
|
| |
| virtual Path | increment (int increment=1) const |
| | Increments the numerical suffix of the path's name by a given amount.
|
| |
| Path | makeRelative () const |
| | Converts an absolute path to relative, stripping the root character.
|
| |
| Path | makeAbsolute () const |
| | Converts a relative path to absolute, adding a root character.
|
| |
| Path | makeRelativeTo (const Path &anchor) const |
| | Makes a path relative to a given anchor path.
|
| |
| bool | hasPrefix (const Path &prefix) const |
| | Checks if the Path has any additional prefixes.
|
| |
|
| operator std::string_view () const |
| | Allows a Path to be viewed as its underlying string, e.g. for comparisons against string_views.
|
| |
|
bool | operator== (std::string_view other) const |
| |
|
bool | operator!= (std::string_view other) const |
| |
A default path class for creation and manipulation of tree-based paths.
| bool enzo::Path::isValid |
( |
| ) |
const |
|
virtual |
Runs every validation check and returns true if the path is fully valid.
A path is valid when it is non empty and every component is a valid name. The root path "/" is also valid.
Examples "/geo/mesh_01" valid "geo/mesh" valid relative path "/geo//mesh" invalid empty component "/geo/me!sh" invalid illegal character
- See also
- isValidName for the per component character rules.
Reimplemented in enzo::NetworkPath.