the class path is here to manipulate paths in the Unix notation: using'/' More...
#include <path.hpp>
Public Member Functions | |
path (const std::string &s) | |
constructor from a string | |
path (const char *s) | |
constructor from a char * | |
path (const path &ref) | |
copy constructor | |
path & | operator= (const path &ref) |
assignment operator | |
bool | operator== (const path &ref) const |
comparison operator | |
std::string | basename () const |
get the basename of a path | |
void | reset_read () |
reset the read_subdir operation | |
bool | read_subdir (std::string &r) |
sequentially read the elements that compose the path | |
bool | is_relative () const |
whether the path is relative or absolute (= start with a /) | |
bool | pop (std::string &arg) |
remove and gives in argument the basename of the path | |
bool | pop_front (std::string &arg) |
remove and gives in argument the outer most member of the path | |
path | operator+ (const path &arg) const |
add a path to the current path. The added path *must* be a relative path | |
path & | operator+= (const path &arg) |
add a path to the current path. The added path *must* be a relative path | |
bool | is_subdir_of (const path &p, bool case_sensit) const |
test whether the current object is a subdir of the method's argument | |
std::string | display () const |
convert back a path to a string | |
unsigned int | degre () const |
returns the number of member in the path |
the class path is here to manipulate paths in the Unix notation: using'/'
several operations are provided as well as convertion functions
Definition at line 48 of file path.hpp.
libdar::path::path | ( | const std::string & | s | ) |
constructor from a string
This realizes the string to path convertion function
libdar::path::path | ( | const char * | s | ) | [inline] |
std::string libdar::path::basename | ( | ) | const |
get the basename of a path
this function returns the basename that's it the right most member of a path
unsigned int libdar::path::degre | ( | ) | const [inline] |
std::string libdar::path::display | ( | ) | const |
convert back a path to a string
the returned string is the representation of the current object in Unix notation
bool libdar::path::is_subdir_of | ( | const path & | p, | |
bool | case_sensit | |||
) | const |
test whether the current object is a subdir of the method's argument
[in] | p | the path to test with |
[in] | case_sensit | whether the test must be in case sensitive manner or not |
add a path to the current path. The added path *must* be a relative path
[in] | arg | the relative path to add |
add a path to the current path. The added path *must* be a relative path
[in] | arg | the relative path to add |
bool libdar::path::pop | ( | std::string & | arg | ) |
remove and gives in argument the basename of the path
[out] | arg | the basename of the path |
bool libdar::path::pop_front | ( | std::string & | arg | ) |
remove and gives in argument the outer most member of the path
[out] | arg | the value of the outer element of the path |
bool libdar::path::read_subdir | ( | std::string & | r | ) |
sequentially read the elements that compose the path
[out] | r | the next element of the path |
void libdar::path::reset_read | ( | ) | [inline] |