Disk ARchive  2.7.15
Full featured and portable backup and archiving tool
ea.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 
26 
27 #ifndef EA_HPP
28 #define EA_HPP
29 
30 #include "../my_config.h"
31 #include <map>
32 #include <string>
33 #include "infinint.hpp"
34 #include "mask.hpp"
35 
36 namespace libdar
37 {
38 
41 
43  class archive_version;
44  class generic_file;
45 
47 
49  {
50  public:
51  ea_attributs() { alire = attr.begin(); };
52  ea_attributs(generic_file & f, const archive_version & edit);
53  ea_attributs(const ea_attributs & ref);
54  ea_attributs(ea_attributs && ref) noexcept;
55  ea_attributs & operator = (const ea_attributs & ref);
56  ea_attributs & operator = (ea_attributs && ref) noexcept;
57  ~ea_attributs() = default;
58 
59  bool operator == (const ea_attributs & ref) const { return attr == ref.attr; };
60 
61  void dump(generic_file & f) const;
62  void add(const std::string & key, const std::string & value) { attr[key] = value; };
63  void reset_read() const;
64  bool read(std::string & key, std::string & value) const;
65  infinint size() const { return attr.size(); };
66  void clear() { attr.clear(); alire = attr.begin(); };
67  bool find(const std::string &key, std::string & found_value) const;
68  bool diff(const ea_attributs & other, const mask & filter) const;
69  infinint space_used() const;
70 
72 
79 
80  private:
81  std::map<std::string, std::string> attr;
82  mutable std::map<std::string, std::string>::const_iterator alire;
83  };
84 
86 
87 } // end of namespace
88 
89 #endif
class archive_version manages the version of the archive format
the class ea_attributs manages the set of EA that can be associated to an inode
Definition: ea.hpp:49
ea_attributs operator+(const ea_attributs &arg) const
addition operator.
this is the interface class from which all other data transfer classes inherit
the arbitrary large positive integer class
the generic class, parent of all masks
Definition: mask.hpp:62
switch module to limitint (32 ou 64 bits integers) or infinint
here lies a collection of mask classes
libdar namespace encapsulate all libdar symbols
Definition: archive.hpp:47