Disk ARchive  2.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
ea.hpp
Go to the documentation of this file.
1 /*********************************************************************/
2 // dar - disk archive - a backup/restoration program
3 // Copyright (C) 2002-2052 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 //
19 // to contact the author : http://dar.linux.free.fr/email.html
20 /*********************************************************************/
21 // $Id: ea.hpp,v 1.23 2011/01/09 17:25:58 edrusb Rel $
22 //
23 /*********************************************************************/
24 
28 
29 
30 #ifndef EA_HPP
31 #define EA_HPP
32 
33 #include "../my_config.h"
34 #include <map>
35 #include <string>
36 #include "infinint.hpp"
37 #include "generic_file.hpp"
38 #include "special_alloc.hpp"
39 #include "mask.hpp"
40 #include "header_version.hpp"
41 
42 namespace libdar
43 {
44 
47 
49 
51  {
52  public:
53  ea_attributs() { alire = attr.begin(); };
54  ea_attributs(generic_file & f, const archive_version & edit);
55  ea_attributs(const ea_attributs & ref);
56 
57  void dump(generic_file & f) const;
58  void add(const std::string & key, const std::string & value) { attr[key] = value; };
59  void reset_read() const;
60  bool read(std::string & key, std::string & value) const;
61  infinint size() const { return attr.size(); };
62  void clear() { attr.clear(); alire = attr.begin(); };
63  bool find(const std::string &key, std::string & found_value) const;
64  bool diff(const ea_attributs & other, const mask & filter) const;
65  infinint space_used() const;
66 
68 
74  ea_attributs operator + (const ea_attributs & arg) const;
75 
76 #ifdef LIBDAR_SPECIAL_ALLOC
77  USE_SPECIAL_ALLOC(ea_attributs);
78 #endif
79 
80  private:
81  std::map<std::string, std::string> attr;
82  std::map<std::string, std::string>::iterator alire;
83  };
84 
86 
87 } // end of namespace
88 
89 #endif