32 #include "../my_config.h" 72 virtual bool is_covered(
const std::string &expression)
const = 0;
85 virtual std::string
dump(
const std::string & prefix =
"")
const = 0;
107 bool is_covered(
const std::string & expression)
const {
return val; };
109 std::string
dump(
const std::string & prefix)
const {
return prefix + (val ? gettext(
"TRUE") : gettext(
"FALSE")); };
129 simple_mask(
const std::string & wilde_card_expression,
bool case_sensit);
136 bool is_covered(
const std::string &expression)
const;
139 std::string
dump(
const std::string & prefix)
const;
145 std::string the_mask;
173 bool is_covered(
const std::string & expression)
const;
176 std::string
dump(
const std::string & prefix)
const;
183 std::string mask_exp;
186 void set_preg(
const std::string & wilde_card_expression,
212 bool is_covered(
const std::string &expression)
const {
return !ref->is_covered(expression); };
214 std::string
dump(
const std::string & prefix)
const;
223 void copy_from(
const mask &m);
253 void add_mask(
const mask & toadd);
256 bool is_covered(
const std::string & expression)
const {
return t_is_covered(expression); };
258 std::string
dump(
const std::string & prefix)
const {
return dump_logical(prefix, gettext(
"AND")); };
267 U_I
size()
const {
return lst.size(); };
277 std::vector<mask *> lst;
279 std::string dump_logical(
const std::string & prefix,
const std::string & boolop)
const;
282 void copy_from(
const et_mask & m);
285 template<
class T>
bool t_is_covered(
const T & expression)
const 287 std::vector<mask *>::const_iterator it = lst.begin();
290 throw Erange(
"et_mask::is_covered",
dar_gettext(
"No mask in the list of mask to operate on"));
292 while(it != lst.end() && (*it)->is_covered(expression))
295 return it == lst.end();
311 bool is_covered(
const std::string & expression)
const {
return t_is_covered(expression); };
313 std::string
dump(
const std::string & prefix)
const {
return dump_logical(prefix, gettext(
"OR")); };
318 template<
class T>
bool t_is_covered(
const T & expression)
const 320 std::vector<mask *>::const_iterator it = lst.begin();
323 throw Erange(
"et_mask::is_covered",
dar_gettext(
"No mask to operate on in the list of mask"));
325 while(it != lst.end() && ! (*it)->is_covered(expression))
328 return it != lst.end();
347 bool is_covered(
const std::string & expression)
const {
throw SRC_BUG; };
349 std::string
dump(
const std::string & prefix)
const;
369 same_path_mask(
const std::string &p,
bool case_sensit) { chemin = p; case_s = case_sensit; };
372 bool is_covered(
const std::string &chemin)
const;
375 std::string
dump(
const std::string & prefix)
const;
395 exclude_dir_mask(
const std::string &p,
bool case_sensit) { chemin = p; case_s = case_sensit;};
398 bool is_covered(
const std::string &expression)
const {
throw SRC_BUG; }
400 std::string
dump(
const std::string & prefix)
const;
bool is_covered(const std::string &expression) 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
the generic class, parent of all masks
mask * clone() const
inherited from the mask class
makes the OR operator between two or more masks
memory_pool * get_pool() const
bool is_covered(const std::string &expression) const
inherited from the mask class
void clear()
clear the mask
std::string dump(const std::string &prefix) const
dump in human readable form the nature of 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 path &chemin) const
check whether the given path is covered by the mask
std::string dump(const std::string &prefix) const
dump in human readable form the nature of the mask
matches regular expressions (see "man 7 regex")
std::string dump(const std::string &prefix) const
dump in human readable form the nature of the mask
bool is_covered(const std::string &expression) const
inherited from the mask class
mask * clone() 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
bool is_covered(const path &chemin) const
check whether the given path is covered by the mask
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)
U_I size() const
the number of mask on which is done the AND operator
virtual bool is_covered(const path &chemin) const
check whether the given path is covered by the mask
virtual ~regular_mask()
destructor
bool is_covered(const path &chemin) const
check whether the given path is covered by the mask
et_mask(const et_mask &m)
copy constructor
mask * clone() const
inherited from the mask class
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
matches if string is the given constructor string or a sub directory of it
bool is_covered(const std::string &expression) const
inherited from the mask class
simple_path_mask(const path &p, bool case_sensit)
the constructor to be used by libdar external programs
bool is_covered(const std::string &expression) const
inherited from the mask class
bool_mask(bool always)
the constructor
exception used to signal range error
not_mask(const not_mask &m)
copy constructor
mask * clone() 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
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
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
bool is_subdir_of(const path &p, bool case_sensit) const
test whether the current object is a subdir of the method's argument
mask * clone() const
inherited from the mask class
virtual std::string dump(const std::string &prefix="") const =0
dump in human readable form the nature of the mask
simple_mask(const simple_mask &m)
copy constructor
virtual bool is_covered(const std::string &expression) const =0
check wether the given string is covered by the mask
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'/'
mask * clone() const
inherited from the mask class