32 #ifndef FILESYSTEM_HPP
33 #define FILESYSTEM_HPP
35 #include "../my_config.h"
69 bool x_furtive_read_mode) :
mem_ui(dialog) { furtive_read_mode = x_furtive_read_mode; };
79 const infinint & get_last_etoile_ref()
const {
return etiquette_counter; };
85 void corres_reset() { corres_read.clear(); etiquette_counter = 0; };
91 const std::string & name,
93 const mask & ea_mask);
105 couple(
etoile *ptr, nlink_t ino_count) : holder(
"FAKE", ptr) { count = ino_count; obj = ptr; };
110 node(ino_t num, dev_t dev) { numnode = num;
device = dev; };
113 bool operator < (
const node & ref)
const {
return numnode < ref.numnode || (numnode == ref.numnode &&
device < ref.device); };
120 std::map <node, couple> corres_read;
122 bool furtive_read_mode;
136 const mask & x_ea_mask,
137 bool check_no_dump_flag,
139 bool furtive_read_mode,
140 bool x_cache_directory_tagging,
142 bool x_ignore_unknown);
147 void reset_read(
infinint & root_fs_device);
149 void skip_read_to_parent_dir();
159 bool furtive_read_mode;
160 bool cache_directory_tagging;
162 std::vector<etage> pile;
178 const mask & x_ea_mask,
180 bool furtive_read_mode);
186 bool read_filename(
const std::string & name,
nomme * &ref);
190 void skip_read_filename_in_parent_dir();
194 struct filename_struct
204 bool furtive_read_mode;
206 std::vector<filename_struct> filename_pile;
224 void write_hard_linked_target_if_not_set(
const mirage *ref,
const std::string & chemin);
229 bool known_etiquette(
const infinint & eti);
238 void corres_reset() { corres_write.clear(); };
239 void make_file(
const nomme * ref,
255 const std::string & spot,
256 const mask & ea_mask);
275 std::map <infinint, corres_ino_ea> corres_write;
287 bool x_warn_overwrite,
289 const mask & x_ea_mask,
291 bool x_warn_remove_no_match,
294 bool x_only_overwrite);
308 done_no_change_no_data,
309 done_no_change_policy,
311 } action_done_for_data;
322 void write(
const entree *x, action_done_for_data & data_restored,
bool & ea_restored,
bool & data_created,
bool & hard_link);
336 stack_dir_t(
const directory & ref,
bool restore) :
directory(ref) { restore_date = restore; };
338 bool get_restore_date()
const {
return restore_date; };
339 void set_restore_date(
bool val) { restore_date = val; };
350 bool warn_remove_no_match;
351 std::vector<stack_dir_t> stack_dir;
354 bool ignore_over_restricts;
355 const crit_action *overwrite;
359 void restore_stack_dir_ownership();
362 void action_over_remove(
const inode *in_place,
const detruit *to_be_added,
const std::string & spot,
over_action_data action);
363 void action_over_data(
const inode *in_place,
364 const nomme *to_be_added,
365 const std::string & spot,
367 action_done_for_data & data_done);
368 bool action_over_ea(
const inode *in_place,
const nomme *to_be_added,
const std::string & spot,
over_action_ea action);
contains classes that let the user define the policy for overwriting files
the generic class, parent of all masks
mem_ui(user_interaction &dialog)
constructor
bool raw_clear_ea_set(const nomme *e, const std::string &path)
remove EA set from filesystem's file, allows subsequent raw_set_ea
filesystem_restore(user_interaction &dialog, const path &root, bool x_warn_overwrite, bool x_info_details, const mask &x_ea_mask, inode::comparison_fields what_to_check, bool x_warn_remove_no_match, bool empty, const crit_action *x_overwrite, bool x_only_overwrite)
constructor
over_action_data
the possible actions for overwriting data
keep trace of hard links when reading the filesystem
void ignore_overwrite_restrictions_for_next_write()
This is a pure virtual class that is used by libdar when interaction with the user is required...
make a flow sequence of inode to feed the backup filtering routing
the root class from all other inherite for any entry in the catalogue
the base class for all entry that have a name
the hard link implementation, mirage is the named entry owned by a directory it points to a common "e...
the directory inode class
comparison_fields
flag used to only consider certain fields when comparing/restoring inodes
over_action_ea
the possible action for overwriting EA
const filesystem_restore & operator=(const filesystem_restore &ref)
assignment operator is forbidden (throws an exception)
the hard link implementation (etoile means star in French, seen a star as a point from which are thro...
definition of the etage structure is done here
filesystem_restore(const filesystem_restore &ref)
copy constructor is forbidden (throws an exception)
the global action for overwriting
the special device root class
switch module to limitint (32 ou 64 bits integers) or infinint
void clear_corres_if_pointing_to(const infinint &ligne, const std::string &path)
void write(const entree *x, action_done_for_data &data_restored, bool &ea_restored, bool &data_created, bool &hard_link)
restore a libdar object to a filesystem entry both data and EA
void reset_write()
reset the writing process for the current object
bool raw_set_ea(const nomme *e, const ea_attributs &list_ea, const std::string &spot, const mask &ea_mask)
add the given EA matching the given mask to the file pointed to by "e" and spot
class mem_ui to keep a copy of a user_interaction object
~filesystem_restore()
destructor
make a flow of inode to feed the difference filter routine
receive the flow of inode from the restoration filtering routing and promotes these to real filesyste...
the arbitrary large positive integer class
user_interaction & get_ui() const
get access to the user_interaction cloned object
the class ea_attributs manages the set of EA that can be associated to an inode
here is defined the many classed which is build of the catalogue
keep trace of already written inodes to restore hard links
the class path is here to manipulate paths in the Unix notation: using'/'