Disk ARchive  2.7.15
Full featured and portable backup and archiving tool
mask_list.hpp
Go to the documentation of this file.
1 /*********************************************************************/
2 // dar - disk archive - a backup/restoration program
3 // Copyright (C) 2002-2024 Denis Corbin
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 //
19 // to contact the author, see the AUTHOR file
20 /*********************************************************************/
21 
28 
29 #ifndef MASK_LIST_HPP
30 #define MASK_LIST_HPP
31 
32 #include "../my_config.h"
33 
34 #include "mask.hpp"
35 
36 #include <string>
37 
38 namespace libdar
39 {
40 
43 
45 
49 
50  class mask_list : public mask
51  {
52  public:
53 
55 
63  mask_list(const std::string & filename_list_st, bool case_sensit, const path & prefix, bool include);
64  mask_list(const mask_list & ref) = default;
65  mask_list(mask_list && ref) = default;
66  mask_list & operator = (const mask_list & ref) = default;
67  mask_list & operator = (mask_list && ref) noexcept = default;
68  ~mask_list() = default;
69 
71  virtual bool is_covered(const std::string & expression) const override;
73  virtual mask *clone() const override { return new (std::nothrow) mask_list(*this); };
74 
76  U_I size() const { return contenu.size(); };
77 
79  virtual std::string dump(const std::string & prefix) const override;
80 
81  private:
82 
83  std::deque <std::string> contenu;
84  U_I taille;
85  bool case_s;
86  bool including; // mask is used for including files (not for excluding files)
87  };
88 
90 
91 } // end of namespace
92 
93 #endif
the mask_list class, matches string that are present in a given file
Definition: mask_list.hpp:51
U_I size() const
routing only necessary for doing some testing
Definition: mask_list.hpp:76
mask_list(const std::string &filename_list_st, bool case_sensit, const path &prefix, bool include)
the constructor
virtual std::string dump(const std::string &prefix) const override
output the listing content
virtual bool is_covered(const std::string &expression) const override
inherited from the mask class
virtual mask * clone() const override
inherited from the mask class
Definition: mask_list.hpp:73
the generic class, parent of all masks
Definition: mask.hpp:62
the class path is here to manipulate paths in the Unix notation: using'/'
Definition: path.hpp:51
here lies a collection of mask classes
libdar namespace encapsulate all libdar symbols
Definition: archive.hpp:47