![]() |
Disk ARchive
2.5.2
Full featured and portable backup and archiving tool
|
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 00025 00026 00027 #ifndef EA_HPP 00028 #define EA_HPP 00029 00030 #include "../my_config.h" 00031 #include <map> 00032 #include <string> 00033 #include "infinint.hpp" 00034 #include "generic_file.hpp" 00035 #include "mask.hpp" 00036 #include "header_version.hpp" 00037 #include "on_pool.hpp" 00038 00039 namespace libdar 00040 { 00041 00044 00046 00047 class ea_attributs : public on_pool 00048 { 00049 public: 00050 ea_attributs() { alire = attr.begin(); }; 00051 ea_attributs(generic_file & f, const archive_version & edit); 00052 ea_attributs(const ea_attributs & ref); 00053 00054 bool operator == (const ea_attributs & ref) const { return attr == ref.attr; }; 00055 00056 void dump(generic_file & f) const; 00057 void add(const std::string & key, const std::string & value) { attr[key] = value; }; 00058 void reset_read() const; 00059 bool read(std::string & key, std::string & value) const; 00060 infinint size() const { return attr.size(); }; 00061 void clear() { attr.clear(); alire = attr.begin(); }; 00062 bool find(const std::string &key, std::string & found_value) const; 00063 bool diff(const ea_attributs & other, const mask & filter) const; 00064 infinint space_used() const; 00065 00067 00073 ea_attributs operator + (const ea_attributs & arg) const; 00074 00075 private: 00076 std::map<std::string, std::string> attr; 00077 std::map<std::string, std::string>::iterator alire; 00078 }; 00079 00081 00082 } // end of namespace 00083 00084 #endif