Disk ARchive
2.4.2
|
00001 /*********************************************************************/ 00002 // dar - disk archive - a backup/restoration program 00003 // Copyright (C) 2002-2052 Denis Corbin 00004 // 00005 // This program is free software; you can redistribute it and/or 00006 // modify it under the terms of the GNU General Public License 00007 // as published by the Free Software Foundation; either version 2 00008 // of the License, or (at your option) any later version. 00009 // 00010 // This program is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 // GNU General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU General Public License 00016 // along with this program; if not, write to the Free Software 00017 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00018 // 00019 // to contact the author : http://dar.linux.free.fr/email.html 00020 /*********************************************************************/ 00021 // $Id: ea.hpp,v 1.23 2011/01/09 17:25:58 edrusb Rel $ 00022 // 00023 /*********************************************************************/ 00024 00028 00029 00030 #ifndef EA_HPP 00031 #define EA_HPP 00032 00033 #include "../my_config.h" 00034 #include <map> 00035 #include <string> 00036 #include "infinint.hpp" 00037 #include "generic_file.hpp" 00038 #include "special_alloc.hpp" 00039 #include "mask.hpp" 00040 #include "header_version.hpp" 00041 00042 namespace libdar 00043 { 00044 00047 00049 00050 class ea_attributs 00051 { 00052 public: 00053 ea_attributs() { alire = attr.begin(); }; 00054 ea_attributs(generic_file & f, const archive_version & edit); 00055 ea_attributs(const ea_attributs & ref); 00056 00057 void dump(generic_file & f) const; 00058 void add(const std::string & key, const std::string & value) { attr[key] = value; }; 00059 void reset_read() const; 00060 bool read(std::string & key, std::string & value) const; 00061 infinint size() const { return attr.size(); }; 00062 void clear() { attr.clear(); alire = attr.begin(); }; 00063 bool find(const std::string &key, std::string & found_value) const; 00064 bool diff(const ea_attributs & other, const mask & filter) const; 00065 infinint space_used() const; 00066 00068 00074 ea_attributs operator + (const ea_attributs & arg) const; 00075 00076 #ifdef LIBDAR_SPECIAL_ALLOC 00077 USE_SPECIAL_ALLOC(ea_attributs); 00078 #endif 00079 00080 private: 00081 std::map<std::string, std::string> attr; 00082 std::map<std::string, std::string>::iterator alire; 00083 }; 00084 00086 00087 } // end of namespace 00088 00089 #endif