32 #ifndef FILESYSTEM_HPP
33 #define FILESYSTEM_HPP
35 #include "../my_config.h"
72 bool x_furtive_read_mode,
73 const fsa_scope & scope) :
mem_ui(&dialog) { furtive_read_mode = x_furtive_read_mode; sc = scope; };
83 const infinint & get_last_etoile_ref()
const {
return etiquette_counter; };
92 void corres_reset() { corres_read.clear(); etiquette_counter = 0; };
97 cat_nomme *make_read_entree(path & lieu,
98 const std::string & name,
100 const mask & ea_mask);
112 couple(cat_etoile *ptr, nlink_t ino_count) : holder(
"FAKE", ptr) { count = ino_count; obj = ptr; };
117 node(ino_t num, dev_t dev) { numnode = num; device = dev; };
120 bool operator < (
const node & ref)
const {
return numnode < ref.numnode || (numnode == ref.numnode && device < ref.device); };
127 std::map <node, couple> corres_read;
128 infinint etiquette_counter;
129 bool furtive_read_mode;
144 const mask & x_ea_mask,
145 bool check_no_dump_flag,
147 bool furtive_read_mode,
148 bool x_cache_directory_tagging,
150 bool x_ignore_unknown,
151 const fsa_scope & scope);
156 void reset_read(
infinint & root_fs_device);
158 void skip_read_to_parent_dir();
168 bool furtive_read_mode;
169 bool cache_directory_tagging;
171 std::vector<etage> pile;
187 const mask & x_ea_mask,
189 bool furtive_read_mode,
190 const fsa_scope & scope);
196 bool read_filename(
const std::string & name,
cat_nomme * &ref);
200 void skip_read_filename_in_parent_dir();
204 struct filename_struct
214 bool furtive_read_mode;
216 std::vector<filename_struct> filename_pile;
234 void write_hard_linked_target_if_not_set(
const cat_mirage *ref,
const std::string & chemin);
239 bool known_etiquette(
const infinint & eti);
248 void corres_reset() { corres_write.clear(); };
253 const fsa_scope & scope);
268 const std::string & spot,
269 const mask & ea_mask);
288 std::map <infinint, corres_ino_ea> corres_write;
300 bool x_warn_overwrite,
302 const mask & x_ea_mask,
304 bool x_warn_remove_no_match,
307 bool x_only_overwrite,
308 const fsa_scope & scope);
322 done_no_change_no_data,
323 done_no_change_policy,
325 } action_done_for_data;
337 void write(
const cat_entree *x,
338 action_done_for_data & data_restored,
342 bool & fsa_restored);
358 bool get_restore_date()
const {
return restore_date; };
359 void set_restore_date(
bool val) { restore_date = val; };
370 bool warn_remove_no_match;
371 std::vector<stack_dir_t> stack_dir;
374 bool ignore_over_restricts;
375 const crit_action *overwrite;
379 void restore_stack_dir_ownership();
384 void action_over_remove(
const cat_inode *in_place,
385 const cat_detruit *to_be_added,
386 const std::string & spot,
389 void action_over_data(
const cat_inode *in_place,
390 const cat_nomme *to_be_added,
391 const std::string & spot,
393 action_done_for_data & data_done);
395 bool action_over_ea(
const cat_inode *in_place,
396 const cat_nomme *to_be_added,
397 const std::string & spot,
400 bool action_over_fsa(
const cat_inode *in_place,
401 const cat_nomme *to_be_added,
402 const std::string & spot,
contains classes that let the user define the policy for overwriting files
void write(const cat_entree *x, action_done_for_data &data_restored, bool &ea_restored, bool &data_created, bool &hard_link, bool &fsa_restored)
restore a libdar object to a filesystem entry both data and EA
filesystem specific attributes available families and fsa_scope definition
the generic class, parent of all masks
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
const fsa_scope get_fsa_scope() const
provide the FSA scope used by the object
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, cat_mirage is the named entry owned by a directory it points to a commo...
the cat_directory inode class
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
mem_ui(const user_interaction &dialog)
constructor
the base class for all entry that have a name
bool raw_set_ea(const cat_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
bool raw_clear_ea_set(const cat_nomme *e, const std::string &path)
remove EA set from filesystem's file, allows subsequent raw_set_ea
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 reset_write()
reset the writing process for the current object
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
this is the base class of object that can be allocated on a memory pool
receive the flow of inode from the restoration filtering routing and promotes these to real filesyste...
the arbitrary large positive integer class
include file gathering all entree found in a catalogue
comparison_fields
flag used to only consider certain fields when comparing/restoring inodes
the root class from all other inherite for any entry in the catalogue
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
libdar namespace encapsulate all libdar symbols
here is defined the many classed which is build of the catalogue
filesystem_restore(user_interaction &dialog, const path &root, bool x_warn_overwrite, bool x_info_details, const mask &x_ea_mask, cat_inode::comparison_fields what_to_check, bool x_warn_remove_no_match, bool empty, const crit_action *x_overwrite, bool x_only_overwrite, const fsa_scope &scope)
constructor
keep trace of already written inodes to restore hard links
the class path is here to manipulate paths in the Unix notation: using'/'