| Disk ARchive 2.8.4 Full featured and portable backup and archiving tool

Loading...
Searching...
No Matches
mask_list.hpp
Go to the documentation of this file.
1/*********************************************************************/
2// dar - disk archive - a backup/restoration program
3// Copyright (C) 2002-2026 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#include "eols.hpp"
36
37#include <string>
38#include <deque>
39
40 namespace libdar
41{
42
45
47
51
52 class mask_list : public mask
53 {
54 public:
55
57
78 mask_list(const std::string & filename_list_st,
79 bool case_sensit,
80 const path & prefix,
81 bool include,
82 const std::deque<std::string> & eol_list = std::deque<std::string>() );
83 mask_list(const mask_list & ref) = default;
84 mask_list(mask_list && ref) = default;
85 mask_list & operator = (const mask_list & ref) = default;
86 mask_list & operator = (mask_list && ref) noexcept = default;
87 ~mask_list() = default;
88
90 virtual bool is_covered(const std::string & expression) const override;
92 virtual mask *clone() const override { return new (std::nothrow) mask_list(*this); };
93
95 U_I size() const { return contenu.size(); };
96
98 virtual std::string dump(const std::string & prefix) const override;
99
100 private:
101
102 std::deque <std::string> contenu;
103 U_I taille;
104 bool case_s;
105 bool including; // mask is used for including files (not for excluding files)
106 eols cutter;
107 };
108
110
111} // end of namespace
112
113#endif
libdar::eols
the class eols provide a way to detect the presence of string from a list of string in a byte flow
Definition eols.hpp:48
libdar::mask_list::clone
virtual mask * clone() const override
inherited from the mask class
Definition mask_list.hpp:92
libdar::mask_list::mask_list
mask_list(const std::string &filename_list_st, bool case_sensit, const path &prefix, bool include, const std::deque< std::string > &eol_list=std::deque< std::string >())
the constructor
libdar::mask_list::size
U_I size() const
routing only necessary for doing some testing
Definition mask_list.hpp:95
libdar::mask_list::dump
virtual std::string dump(const std::string &prefix) const override
output the listing content
libdar::mask_list::is_covered
virtual bool is_covered(const std::string &expression) const override
inherited from the mask class
libdar::path
the class path is here to manipulate paths in the Unix notation: using'/'
Definition path.hpp:51
eols.hpp
provide a way to detect the presence of string from a list of string in a byte flow
mask.hpp
here lies a collection of mask classes
my_config.h
include macro defined by the configure script and some specific additional ones
libdar
libdar namespace encapsulate all libdar symbols
Definition archive.hpp:47