ea.hpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00028
00029
00030 #ifndef EA_HPP
00031 #define EA_HPP
00032
00033 #include "../my_config.h"
00034 #include <vector>
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
00045 struct ea_entry
00046 {
00047 std::string key, value;
00048
00049 ea_entry() { key = value = ""; };
00050 ea_entry(user_interaction & dialog, generic_file & f, const dar_version & edit);
00051
00052 void dump(generic_file & f) const;
00053 };
00054
00055 class ea_attributs
00056 {
00057 public:
00058 ea_attributs() { alire = attr.begin(); };
00059 ea_attributs(user_interaction & dialog, generic_file & f, const dar_version & edit);
00060 ea_attributs(const ea_attributs & ref);
00061
00062 void dump(generic_file & f) const;
00063 void add(const ea_entry &x) { attr.push_back(x); };
00064 void reset_read() const;
00065 bool read(ea_entry & x) const;
00066 infinint size() const { return attr.size(); };
00067 void clear() { attr.clear(); alire = attr.begin(); };
00068 bool find(const std::string &key, std::string & found_value) const;
00069 bool diff(const ea_attributs & other, const mask & filter) const;
00070
00071 #ifdef LIBDAR_SPECIAL_ALLOC
00072 USE_SPECIAL_ALLOC(ea_attributs);
00073 #endif
00074
00075 private:
00076 std::vector<ea_entry> attr;
00077 std::vector<ea_entry>::iterator alire;
00078 };
00079
00080 }
00081
00082 #endif