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

Loading...
Searching...
No Matches
ea.hpp
Go to the documentation of this file.
1/*********************************************************************/
2// dar - disk archive - a backup/restoration program
3// Copyright (C) 2002-2025 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
25
26#ifndef EA_HPP
27#define EA_HPP
28
29#include "../my_config.h"
30#include <map>
31#include <string>
32#include "infinint.hpp"
33#include "mask.hpp"
34
35namespace libdar
36{
37
40
42 class archive_version;
43 class generic_file;
44
46
47 class ea_attributs
48 {
49 public:
50 ea_attributs() { alire = attr.begin(); };
51 ea_attributs(generic_file & f, const archive_version & edit);
52 ea_attributs(const ea_attributs & ref);
53 ea_attributs(ea_attributs && ref) noexcept;
54 ea_attributs & operator = (const ea_attributs & ref);
55 ea_attributs & operator = (ea_attributs && ref) noexcept;
56 ~ea_attributs() = default;
57
58 bool operator == (const ea_attributs & ref) const { return attr == ref.attr; };
59
60 void dump(generic_file & f) const;
61 void add(const std::string & key, const std::string & value) { attr[key] = value; };
62 void reset_read() const;
63 bool read(std::string & key, std::string & value) const;
64 infinint size() const { return attr.size(); };
65 void clear() { attr.clear(); alire = attr.begin(); };
66 bool find(const std::string &key, std::string & found_value) const;
67 bool diff(const ea_attributs & other, const mask & filter) const;
68 infinint space_used() const;
69
71
77 ea_attributs operator + (const ea_attributs & arg) const;
78
79 private:
80 std::map<std::string, std::string> attr;
81 mutable std::map<std::string, std::string>::const_iterator alire;
82 };
83
85
86} // end of namespace
87
88#endif
libdar::archive_version
class archive_version manages the version of the archive format
Definition archive_version.hpp:47
libdar::ea_attributs
the class ea_attributs manages the set of EA that can be associated to an inode
Definition ea.hpp:48
libdar::ea_attributs::operator+
ea_attributs operator+(const ea_attributs &arg) const
addition operator.
libdar::generic_file
this is the interface class from which all other data transfer classes inherit
Definition generic_file.hpp:77
libdar::infinint
the arbitrary large positive integer class
Definition real_infinint.hpp:62
libdar::mask
the generic class, parent of all masks
Definition mask.hpp:62
infinint.hpp
switch module to limitint (32 ou 64 bits integers) or infinint
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