Disk ARchive 2.7.16
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
38namespace libdar
39{
40
43
45
49
50 class mask_list : public mask
51 {
52 public:
53
55
73 mask_list(const std::string & filename_list_st, bool case_sensit, const path & prefix, bool include);
74 mask_list(const mask_list & ref) = default;
75 mask_list(mask_list && ref) = default;
76 mask_list & operator = (const mask_list & ref) = default;
77 mask_list & operator = (mask_list && ref) noexcept = default;
78 ~mask_list() = default;
79
81 virtual bool is_covered(const std::string & expression) const override;
83 virtual mask *clone() const override { return new (std::nothrow) mask_list(*this); };
84
86 U_I size() const { return contenu.size(); };
87
89 virtual std::string dump(const std::string & prefix) const override;
90
91 private:
92
93 std::deque <std::string> contenu;
94 U_I taille;
95 bool case_s;
96 bool including; // mask is used for including files (not for excluding files)
97 };
98
100
101} // end of namespace
102
103#endif
the mask_list class, matches string that are present in a given file
Definition: mask_list.hpp:51
virtual mask * clone() const override
inherited from the mask class
Definition: mask_list.hpp:83
U_I size() const
routing only necessary for doing some testing
Definition: mask_list.hpp:86
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
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