AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
Path class for performing basic path operations with a user-selectable delimiter character. More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/latest/src/axom/core/Path.hpp>
Public Member Functions | |
Path (const std::string &path, const char delim='/') | |
Constructs a path from a string. More... | |
Path ()=default | |
Default constructor for an empty path. More... | |
operator std::string () const | |
Converts a path to a string. More... | |
Path | parent () const |
Returns a path representing the parent of the calling path If the calling path is the root, the root will be returned. More... | |
std::string | baseName () const |
Returns the basename of the path (the last component) More... | |
std::string | dirName () const |
Returns dirname of the path (all but the last component) More... | |
std::pair< std::string, std::string > | split () const |
Splits the path into the "parent" (dirname) and the last component (basename) More... | |
const std::vector< std::string > & | parts () const |
Returns a const reference to the parts of the path, to be iterated over. More... | |
Static Public Member Functions | |
static Path | join (std::initializer_list< Path > paths, const char delim='/') |
Constructs a path by concatenating a set of paths. More... | |
Path class for performing basic path operations with a user-selectable delimiter character.
axom::Path::Path | ( | const std::string & | path, |
const char | delim = '/' |
||
) |
Constructs a path from a string.
[in] | path | The string representing the path |
[in] | delim | The character that delimits the path |
Empty parts in path
are removed
FIXME: Should this be marked explicit
?
|
default |
Default constructor for an empty path.
Constructs a path by concatenating a set of paths.
[in] | paths | The paths to concatenate/join |
[in] | delim | The character to join the paths with TODO: Should this be something easier-to-use, like the delimiter used by the first Path object in the list? |
Empty paths ins paths
will be ignored.
axom::Path::operator std::string | ( | ) | const |
Converts a path to a string.
FIXME: Should this be marked explicit
?
Path axom::Path::parent | ( | ) | const |
Returns a path representing the parent of the calling path If the calling path is the root, the root will be returned.
std::string axom::Path::baseName | ( | ) | const |
Returns the basename of the path (the last component)
std::string axom::Path::dirName | ( | ) | const |
Returns dirname of the path (all but the last component)
std::pair<std::string, std::string> axom::Path::split | ( | ) | const |
Splits the path into the "parent" (dirname) and the last component (basename)
|
inline |
Returns a const reference to the parts of the path, to be iterated over.