32 #include "../my_config.h"
71 virtual bool is_covered(
const std::string &expression)
const = 0;
101 bool is_covered(
const std::string & expression)
const {
return val; };
122 simple_mask(
const std::string & wilde_card_expression,
bool case_sensit);
129 bool is_covered(
const std::string &expression)
const;
135 std::string the_mask;
163 bool is_covered(
const std::string & expression)
const;
170 std::string mask_exp;
173 void set_preg(
const std::string & wilde_card_expression,
209 void copy_from(
const mask &m);
242 bool is_covered(
const std::string & expression)
const {
return t_is_covered(expression); };
252 U_I
size()
const {
return lst.size(); };
262 std::vector<mask *> lst;
265 void copy_from(
const et_mask & m);
268 template<
class T>
bool t_is_covered(
const T & expression)
const
270 std::vector<mask *>::const_iterator it = lst.begin();
273 throw Erange(
"et_mask::is_covered",
dar_gettext(
"No mask in the list of mask to operate on"));
275 while(it != lst.end() && (*it)->is_covered(expression))
278 return it == lst.end();
294 bool is_covered(
const std::string & expression)
const {
return t_is_covered(expression); };
301 template<
class T>
bool t_is_covered(
const T & expression)
const
303 std::vector<mask *>::const_iterator it = lst.begin();
306 throw Erange(
"et_mask::is_covered",
dar_gettext(
"No mask to operate on in the list of mask"));
308 while(it != lst.end() && ! (*it)->is_covered(expression))
311 return it != lst.end();
330 bool is_covered(
const std::string & expression)
const {
throw SRC_BUG; };
351 same_path_mask(
const std::string &p,
bool case_sensit) { chemin = p; case_s = case_sensit; };
354 bool is_covered(
const std::string &chemin)
const;
374 exclude_dir_mask(
const std::string &p,
bool case_sensit) { chemin = p; case_s = case_sensit;};
377 bool is_covered(
const std::string &expression)
const {
throw SRC_BUG; }
bool is_covered(const path &chemin) const
check whether the given path is covered by the mask
mask * clone() const
inherited from the mask class
same_path_mask(const std::string &p, bool case_sensit)
the constructor to be used by libdar external programs
bool is_covered(const path &chemin) const
check whether the given path is covered by the mask
bool is_covered(const std::string &expression) const
inherited from the mask class
the generic class, parent of all masks
makes the OR operator between two or more masks
U_I size() const
the number of mask on which is done the AND operator
void clear()
clear the mask
makes an AND operator between two or more masks
exclude_dir_mask(const std::string &p, bool case_sensit)
the constructor to be used by libdar external programs
const char * dar_gettext(const char *)
a routine to change NLS domaine forth and back for inline routines
bool is_covered(const std::string &expression) const
inherited from the mask class
matches regular expressions (see "man 7 regex")
bool is_covered(const path &chemin) const
check whether the given path is covered by the mask
bool is_covered(const std::string &expression) const
inherited from the mask class
bool is_covered(const std::string &expression) const
inherited from the mask class
not_mask(const mask &m)
the constructor to be used by libdar external programs
boolean mask, either always true or false
mask * clone() const
inherited from the mask class
mask * clone() const
inherited from the mask class
regular_mask & operator=(const regular_mask &ref)
the assignment operator
string matches if it is subdir of mask or mask is a subdir of expression
matches if string is exactly the given mask (no wilde card expression)
const not_mask & operator=(const not_mask &m)
assignment operator
bool is_subdir_of(const path &p, bool case_sensit) const
test whether the current object is a subdir of the method's argument
memory_pool * get_pool() const
virtual ~regular_mask()
destructor
et_mask(const et_mask &m)
copy constructor
matches as done on shell command lines (see "man 7 glob")
here is the definition of the path classthe path class handle path and provide several operation on t...
virtual mask * clone() const =0
bool is_covered(const std::string &chemin) const
inherited from the mask class
mask * clone() const
inherited from the mask class
matches if string is the given constructor string or a sub directory of it
mask * clone() const
inherited from the mask class
mask * clone() const
inherited from the mask class
bool is_covered(const std::string &expression) const
inherited from the mask class
virtual bool is_covered(const path &chemin) const
check whether the given path is covered by the mask
simple_path_mask(const path &p, bool case_sensit)
the constructor to be used by libdar external programs
bool_mask(bool always)
the constructor
bool is_covered(const path &chemin) const
check whether the given path is covered by the mask
exception used to signal range error
not_mask(const not_mask &m)
copy constructor
const et_mask & operator=(const et_mask &m)
assignment operator
bool is_covered(const path &chemin) const
check whether the given path is covered by the mask
bool is_covered(const std::string &expression) const
inherited from the mask class
bool is_covered(const std::string &expression) const
inherited from the mask class
this is the base class of object that can be allocated on a memory pool
et_mask()
the constructor to be used by libdar external programs
std::string display() const
convert back a path to a string
mask * clone() const
inherited from the mask class
simple_mask(const simple_mask &m)
copy constructor
bool is_covered(const std::string &expression) const
inherited from the mask class
regular_mask(const std::string &wilde_card_expression, bool x_case_sensit)
the constructor to be used by libdar external programs
virtual bool is_covered(const std::string &expression) const =0
check wether the given string is covered by the mask
simple_mask(const std::string &wilde_card_expression, bool case_sensit)
the constructor to use by libdar external programs
libdar namespace encapsulate all libdar symbols
mask * clone() const
inherited from the mask class
mask * clone() const
inherited from the mask class
const simple_mask & operator=(const simple_mask &m)
assignment operator
void add_mask(const mask &toadd)
add a mask to the operator
the class path is here to manipulate paths in the Unix notation: using'/'