Disk ARchive 2.7.16
Full featured and portable backup and archiving tool
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
libdar::et_mask Class Reference

makes an AND operator between two or more masks More...

#include <mask.hpp>

+ Inheritance diagram for libdar::et_mask:
+ Collaboration diagram for libdar::et_mask:

Public Member Functions

 et_mask ()
 the constructor to be used by libdar external programs More...
 
 et_mask (const et_mask &m)
 copy constructor More...
 
 et_mask (et_mask &&m) noexcept
 move constructor More...
 
et_maskoperator= (const et_mask &m)
 assignment operator
 
et_maskoperator= (et_mask &&m) noexcept
 move operator More...
 
 ~et_mask ()
 destructor More...
 
void add_mask (const mask &toadd)
 add a mask to the operator More...
 
bool is_covered (const std::string &expression) const override
 inherited from the mask class More...
 
bool is_covered (const path &chemin) const override
 check whether the given path is covered by the mask More...
 
std::string dump (const std::string &prefix) const override
 dump in human readable form the nature of the mask More...
 
maskclone () const override
 inherited from the mask class More...
 
U_I size () const
 the number of mask on which is done the AND operator More...
 
void clear ()
 clear the mask More...
 
- Public Member Functions inherited from libdar::mask
 mask (const mask &ref)=default
 
 mask (mask &&ref) noexcept=default
 
maskoperator= (const mask &ref)=default
 
maskoperator= (mask &&ref) noexcept=default
 
virtual bool is_covered (const std::string &expression) const =0
 check wether the given string is covered by the mask More...
 
virtual bool is_covered (const path &chemin) const
 check whether the given path is covered by the mask More...
 
virtual std::string dump (const std::string &prefix="") const =0
 dump in human readable form the nature of the mask More...
 
virtual maskclone () const =0
 

Protected Member Functions

std::string dump_logical (const std::string &prefix, const std::string &boolop) const
 

Protected Attributes

std::deque< mask * > lst
 

Private Member Functions

void copy_from (const et_mask &m)
 
void move_from (et_mask &&m) noexcept
 
void detruit ()
 
template<class T >
bool t_is_covered (const T &expression) const
 

Detailed Description

makes an AND operator between two or more masks

Definition at line 272 of file mask.hpp.

Constructor & Destructor Documentation

◆ et_mask() [1/3]

libdar::et_mask::et_mask ( )
inline

the constructor to be used by libdar external programs

Note
at this stage the mask is not usable and will throw an exception until some mask are added to the AND thanks to the add_mask() method

Definition at line 281 of file mask.hpp.

Referenced by clone().

◆ et_mask() [2/3]

libdar::et_mask::et_mask ( const et_mask m)
inline

copy constructor

Definition at line 284 of file mask.hpp.

◆ et_mask() [3/3]

libdar::et_mask::et_mask ( et_mask &&  m)
inlinenoexcept

move constructor

Definition at line 287 of file mask.hpp.

◆ ~et_mask()

libdar::et_mask::~et_mask ( )
inline

destructor

Definition at line 296 of file mask.hpp.

Member Function Documentation

◆ add_mask()

void libdar::et_mask::add_mask ( const mask toadd)

add a mask to the operator

Parameters
[in]toadda mask to add to the AND operator
Note
the mask given in argument has not to survive the et_mask to which it has been added a internal copy of the mask has been done.

◆ clear()

void libdar::et_mask::clear ( )
inline

clear the mask

remove all previously added masks

Note
that after this call the mask is no more usable as the AND operator cannot be done on any mask

Definition at line 325 of file mask.hpp.

◆ clone()

mask * libdar::et_mask::clone ( ) const
inlineoverridevirtual

inherited from the mask class

Implements libdar::mask.

Reimplemented in libdar::ou_mask.

Definition at line 312 of file mask.hpp.

References et_mask().

◆ dump()

std::string libdar::et_mask::dump ( const std::string &  prefix) const
inlineoverridevirtual

dump in human readable form the nature of the mask

Parameters
[in]prefixused for indentation withing the output string

Implements libdar::mask.

Reimplemented in libdar::ou_mask.

Definition at line 309 of file mask.hpp.

◆ is_covered() [1/2]

bool libdar::et_mask::is_covered ( const path chemin) const
inlineoverridevirtual

check whether the given path is covered by the mask

Parameters
[in]cheminis the path to check
Returns
true if the given path is covered by the mask
Note
only libdar internally needs to call this method
this is an optional method to the previous one, it can be overwritten

Reimplemented from libdar::mask.

Reimplemented in libdar::ou_mask.

Definition at line 308 of file mask.hpp.

◆ is_covered() [2/2]

bool libdar::et_mask::is_covered ( const std::string &  expression) const
inlineoverridevirtual

inherited from the mask class

Implements libdar::mask.

Reimplemented in libdar::ou_mask.

Definition at line 307 of file mask.hpp.

◆ operator=()

et_mask & libdar::et_mask::operator= ( et_mask &&  m)
inlinenoexcept

move operator

Definition at line 293 of file mask.hpp.

◆ size()

U_I libdar::et_mask::size ( ) const
inline

the number of mask on which is done the AND operator

Returns
the number of mask that has been added thanks to the add_mask() method
Note
there is no mean to remove a given mask once it has been added (see the clear method)

Definition at line 318 of file mask.hpp.

◆ t_is_covered()

template<class T >
bool libdar::et_mask::t_is_covered ( const T &  expression) const
inlineprivate

Definition at line 337 of file mask.hpp.

Member Data Documentation

◆ lst

std::deque<mask *> libdar::et_mask::lst
protected

Definition at line 328 of file mask.hpp.


The documentation for this class was generated from the following file: