![]() |
Rosetta
2019.07
|
Path name class supporting Windows and UN*X/Linux format names. More...
#include <PathName.hh>
Public Member Functions | |
PathName () | |
Default constructor. More... | |
PathName (std::string const &name_string) | |
String constructor. More... | |
~PathName ()=default | |
Destructor. More... | |
PathName & | operator= (std::string const &name_string) |
String assignment. More... | |
operator std::string () const | |
String conversion. More... | |
PathName & | operator() (PathName const &name) |
Functor copy assignment. More... | |
PathName & | operator() (std::string const &name_string) |
Functor string assignment. More... | |
PathName & | vol (std::string const &vol_a) |
Volume assignment. More... | |
PathName & | volume (std::string const &vol_a) |
Volume assignment. More... | |
PathName & | path (std::string const &path_a) |
Path assignment. More... | |
PathName & | erase () |
Erase the path name. More... | |
PathName & | clear () |
Clear the path name. More... | |
PathName | parent () const |
Returns the parent of this directory, or itself if no parent is available. More... | |
bool | empty () const |
Empty? More... | |
bool | absolute () const |
Absolute path? More... | |
bool | relative () const |
Relative path? More... | |
std::string const & | vol () const |
Volume. More... | |
std::string const & | volume () const |
Volume. More... | |
std::string const & | path () const |
Path. More... | |
std::string | name () const |
Path name string. More... | |
std::string | operator() () const |
Functor. More... | |
Private Member Functions | |
void | assign (std::string const &name_string) |
Parse and assign a path name string. More... | |
Static Private Member Functions | |
static bool | equal (PathName const &name1, PathName const &name2) |
PathNames equal on this platform? More... | |
Private Attributes | |
std::string | vol_ |
Volume (X:) (Windows only) More... | |
std::string | path_ |
Path (with trailing separator) More... | |
Friends | |
bool | operator== (PathName const &name1, PathName const &name2) |
PathName == PathName. More... | |
bool | operator!= (PathName const &name1, PathName const &name2) |
PathName != PathName. More... | |
bool | operator< (PathName const &name1, PathName const &name2) |
PathName < PathName. More... | |
bool | operator<= (PathName const &name1, PathName const &name2) |
PathName <= PathName. More... | |
bool | operator>= (PathName const &name1, PathName const &name2) |
PathName >= PathName. More... | |
bool | operator> (PathName const &name1, PathName const &name2) |
PathName > PathName. More... | |
std::istream & | operator>> (std::istream &stream, PathName &name) |
Input from stream. More... | |
std::ostream & | operator<< (std::ostream &stream, PathName const &name) |
Output to stream. More... | |
Path name class supporting Windows and UN*X/Linux format names.
|
inline |
Default constructor.
|
inline |
String constructor.
References assign().
|
inlinedefault |
Destructor.
bool utility::file::PathName::absolute | ( | ) | const |
|
private |
Parse and assign a path name string.
References path_, platform::file::PATH_SEPARATOR(), binder::replace(), vol_, and platform::file::VOLUME_USED().
Referenced by operator()(), operator=(), utility::file::operator>>(), and PathName().
|
inline |
|
staticprivate |
PathNames equal on this platform?
References platform::file::CASE_SENSITIVE(), utility::file::equali(), path_, and vol_.
Referenced by utility::file::operator!=(), and utility::file::operator==().
|
inline |
|
inline |
Path name string.
Referenced by utility::file::create_directory_recursive(), operator std::string(), operator()(), utility::file::operator<<(), and parent().
|
inline |
String conversion.
References name().
Functor copy assignment.
References operator=().
|
inline |
Functor string assignment.
References assign().
|
inline |
Functor.
References name().
|
inline |
PathName utility::file::PathName::parent | ( | ) | const |
Returns the parent of this directory, or itself if no parent is available.
For relative paths, this will stop when it reaches the empty string – no "../" will be prepended to possibly go further up the directory tree.
References name(), path(), path_, and platform::file::PATH_SEPARATOR().
Referenced by utility::file::create_directory_recursive().
PathName & utility::file::PathName::path | ( | std::string const & | path_a | ) |
Path assignment.
References path_, platform::file::PATH_SEPARATOR(), and binder::replace().
Referenced by utility::file::FileName::FileName(), and parent().
|
inline |
Path.
References path_.
bool utility::file::PathName::relative | ( | ) | const |
Relative path?
References absolute().
PathName & utility::file::PathName::vol | ( | std::string const & | vol_a | ) |
Volume assignment.
References runtime_assert, vol_, and platform::file::VOLUME_USED().
Referenced by utility::file::FileName::FileName().
|
inline |
|
inline |
Volume assignment.
References vol().
|
inline |
Volume.
References vol_.
|
friend |
Output to stream.
|
friend |
Input from stream.
|
private |
|
private |