31 #include "../my_config.h" 37 #define FAKE_ROOT path(string("<ROOT>"), true) 62 path(
const std::string & s,
bool x_undisclosed =
false);
68 path(
const char *s,
bool x_undisclosed =
false) { *
this =
path(std::string(s), x_undisclosed); };
78 bool operator != (
const path & ref)
const {
return !(*
this == ref); };
113 bool pop(std::string & arg);
152 unsigned int degre()
const {
return dirs.size() + (relative ? 0 : 1); };
158 std::list<std::string>::iterator reading;
159 std::list<std::string> dirs;
bool is_relative() const
whether the path is relative or absolute (= start with a /)
unsigned int degre() const
returns the number of member in the path
void explode_undisclosed() const
if the current object is an undisclosed path, tries to convert it back to normal path ...
bool pop(std::string &arg)
remove and gives in argument the basename of the path
void reset_read()
reset the read_subdir operation
path(const std::string &s, bool x_undisclosed=false)
constructor from a string
bool read_subdir(std::string &r)
sequentially read the elements that compose the path
bool pop_front(std::string &arg)
remove and gives in argument the outer most member of the path
std::string basename() const
get the basename of a path
bool operator==(const path &ref) const
comparison operator
contains all the excetion class thrown by libdar
bool is_absolute() const
whether the path is absolute or relative
path(const char *s, bool x_undisclosed=false)
constructor from a char *
this is the base class of object that can be allocated on a memory pool
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
bool is_undisclosed() const
whether the path has an undisclosed part at the beginning
const path & operator=(const path &ref)
assignment operator
libdar namespace encapsulate all libdar symbols
std::string display() const
convert back a path to a string
the class path is here to manipulate paths in the Unix notation: using'/'