30 #include "../my_config.h" 51 typedef U_16 archive_num;
52 #define ARCHIVE_NUM_MAX 65534 62 enum lookup { found_present, found_removed, not_found, not_restorable };
76 std::string get_name()
const {
return filename; };
77 void set_name(
const std::string & name) { filename = name; };
80 lookup
get_data(archive_num &
archive,
const datetime & date,
bool even_when_removed)
const;
83 lookup
get_EA(archive_num & archive,
const datetime & date,
bool even_when_removed)
const;
86 bool read_data(archive_num num, datetime & val, etat & present)
const;
89 bool read_EA(archive_num num, datetime & val, etat & present)
const;
91 void set_data(
const archive_num & archive,
const datetime & date, etat present) { status sta = { date, present }; last_mod[archive] = sta; };
92 void set_EA(
const archive_num & archive,
const datetime & date, etat present) { status sta = { date, present }; last_change[archive] = sta; };
95 virtual bool check_order(
user_interaction & dialog,
const path & current_path,
bool & initial_warn)
const {
return check_map_order(dialog, last_mod, current_path,
"data", initial_warn) && check_map_order(dialog, last_change, current_path,
"EA", initial_warn); };
106 virtual void finalize(
const archive_num & archive,
107 const datetime & deleted_date,
108 const archive_num & ignore_archive_greater_or_equal);
111 virtual bool remove_all_from(
const archive_num & archive_to_remove,
const archive_num & last_archive);
115 virtual void apply_permutation(archive_num src, archive_num dst);
118 virtual void skip_out(archive_num num);
119 virtual void compute_most_recent_stats(std::vector<infinint> & data,
120 std::vector<infinint> &
ea,
121 std::vector<infinint> & total_data,
122 std::vector<infinint> & total_ea)
const;
124 virtual char obj_signature()
const {
return signature(); };
125 static char signature() {
return 't'; };
128 virtual bool fix_corruption();
137 unsigned char db_version);
141 std::string filename;
142 std::map<archive_num, status> last_mod;
143 std::map<archive_num, status> last_change;
150 const std::map<archive_num, status> the_map,
151 const path & current_path,
152 const std::string & field_nature,
153 bool & initial_warn)
const;
171 void add(
const cat_detruit *entry,
const archive_num & archive);
172 const data_tree *read_child(
const std::string & name)
const;
173 void read_all_children(std::vector<std::string> & fils)
const;
174 virtual void finalize_except_self(
const archive_num & archive,
175 const datetime & deleted_date,
176 const archive_num & ignore_archives_greater_or_equal);
180 void finalize(
const archive_num & archive,
const datetime & deleted_date,
const archive_num & ignore_archives_greater_or_equal);
181 bool remove_all_from(
const archive_num & archive_to_remove,
const archive_num & last_archive);
184 void show(
user_interaction & dialog, archive_num num, std::string marge =
"")
const;
185 void apply_permutation(archive_num src, archive_num dst);
187 void compute_most_recent_stats(std::vector<infinint> & data, std::vector<infinint> &
ea,
188 std::vector<infinint> & total_data, std::vector<infinint> & total_ea)
const;
190 char obj_signature()
const {
return signature(); };
191 static char signature() {
return 'd'; };
193 virtual bool fix_corruption();
197 std::list<data_tree *> rejetons;
200 void remove_child(
const std::string & name);
201 data_tree *find_or_addition(
const std::string & name,
bool is_dir,
const archive_num & archive);
214 extern archive_num data_tree_permutation(archive_num src, archive_num dst, archive_num x);
lookup get_data(archive_num &archive, const datetime &date, bool even_when_removed) const
return the archive where to find the data that was defined just before or at the given date ...
virtual bool check_order(user_interaction &dialog, const path ¤t_path, bool &initial_warn) const
check date order between archives withing the database ; throw Erange if problem found with date orde...
class used to organize objects in tree in catalogue as like directories in a filesystem ...
the data_dir class inherits from data_tree and holds the directory tree's parent relationship ...
class generic_file is defined here as well as class fichierthe generic_file interface is widely used ...
bool read_data(archive_num num, datetime &val, etat &present) const
return the date of file's last modification date within the give archive and whether the file has bee...
bool ea()
returns whether EA support has been activated at compilation time
the data_tree class stores presence of a given file in a set of archives
lookup get_EA(archive_num &archive, const datetime &date, bool even_when_removed) const
if EA has been saved alone later, returns in which version for the state of the file at the given dat...
This is a pure virtual class that is used by libdar when interaction with the user is required...
used to record information in a catalogue about a deleted file (differential backup context) ...
bool data_tree_find(path chemin, const data_dir &racine, const data_tree *&ptr)
lookup routine to find a pointer to the dat_dir object corresponding to the given path ...
the cat_directory inode class
the archive class realizes the most general operations on archives
void listing(user_interaction &dialog) const
list where is saved this file
defines the interaction between libdar and the user.Three classes are defined
here is the definition of the path classthe path class handle path and provide several operation on t...
virtual void skip_out(archive_num num)
decrement archive numbers above num
virtual void finalize(const archive_num &archive, const datetime &deleted_date, const archive_num &ignore_archive_greater_or_equal)
add deleted entry if no object of the current archive exist and the entry of the previous archive is ...
bool read_EA(archive_num num, datetime &val, etat &present) const
return the date of last inode change and whether the EA has been saved or deleted ...
switch module to limitint (32 ou 64 bits integers) or infinint
this is the interface class from which all other data transfer classes inherit
this is the base class of object that can be allocated on a memory pool
the root class for all cat_inode
base object for all inode types, managed EA and FSA, dates, permissions, ownership, ...
virtual bool remove_all_from(const archive_num &archive_to_remove, const archive_num &last_archive)
return true if the corresponding file is no more located in any archive (thus, the object is no more ...
libdar namespace encapsulate all libdar symbols
the class path is here to manipulate paths in the Unix notation: using'/'