Disk ARchive  2.7.14
Full featured and portable backup and archiving tool
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
libdar::filesystem_restore Class Reference

receive the flow of inode from the restoration filtering routing and promotes these to real filesystem objects More...

#include <filesystem_restore.hpp>

+ Inheritance diagram for libdar::filesystem_restore:
+ Collaboration diagram for libdar::filesystem_restore:

Public Types

using action_done_for_data = enum { done_data_restored, done_no_change_no_data, done_no_change_policy, done_data_removed }
 

Public Member Functions

 filesystem_restore (const std::shared_ptr< user_interaction > &dialog, const path &root, bool x_warn_overwrite, bool x_info_details, const mask &x_ea_mask, 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
 
 filesystem_restore (const filesystem_restore &ref)=delete
 copy constructor is forbidden
 
 filesystem_restore (filesystem_restore &&ref)=delete
 move constructor is forbidden
 
filesystem_restoreoperator= (const filesystem_restore &ref)=delete
 assignment operator is forbidden
 
filesystem_restoreoperator= (filesystem_restore &&ref)=delete
 move operator is forbidden
 
 ~filesystem_restore ()
 destructor
 
void reset_write ()
 reset the writing process for the current object
 
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 More...
 
void ignore_overwrite_restrictions_for_next_write ()
 ask for no warning or user interaction for the next write operation More...
 

Private Member Functions

void detruire ()
 
void restore_stack_dir_ownership ()
 
user_interactionget_ui () const
 
std::shared_ptr< user_interactionget_pointer () const
 
void action_over_remove (const cat_inode *in_place, const cat_detruit *to_be_added, const std::string &spot, over_action_data action)
 perform action due to the overwriting policy when the "to be added" entry is a detruit object
 
void action_over_data (const cat_inode *in_place, const cat_nomme *to_be_added, const std::string &spot, over_action_data action, action_done_for_data &data_done)
 perform action for data due to the overwriting policy when the "to be added" entry is not a cat_detruit
 
bool action_over_ea (const cat_inode *in_place, const cat_nomme *to_be_added, const std::string &spot, over_action_ea action)
 perform action for EA due to overwriting policy
 
bool action_over_fsa (const cat_inode *in_place, const cat_nomme *to_be_added, const std::string &spot, over_action_ea action)
 perform action for FSA due to overwriting policy
 

Private Attributes

pathfs_root
 
bool info_details
 
maskea_mask
 
bool warn_overwrite
 
comparison_fields what_to_check
 
bool warn_remove_no_match
 
std::deque< stack_dir_t > stack_dir
 
pathcurrent_dir
 
bool empty
 
bool ignore_over_restricts
 
const crit_actionoverwrite
 
bool only_overwrite
 

Additional Inherited Members

- Protected Member Functions inherited from libdar::mem_ui
user_interactionget_ui () const
 get access to the user_interaction object More...
 
std::shared_ptr< user_interactionget_pointer () const
 get access to the shared_ptr pointing to the user_interaction
 
 mem_ui (const std::shared_ptr< user_interaction > &dialog)
 constructor More...
 
 mem_ui (const mem_ui &ref)=default
 the copy constructor More...
 
 mem_ui (mem_ui &&ref) noexcept=default
 the move constructor
 
mem_uioperator= (const mem_ui &ref)=default
 assignement operator More...
 
mem_uioperator= (mem_ui &&ref) noexcept=default
 move operator
 
virtual ~mem_ui () noexcept(false)
 destructor More...
 

Detailed Description

receive the flow of inode from the restoration filtering routing and promotes these to real filesystem objects

Definition at line 58 of file filesystem_restore.hpp.

Member Function Documentation

◆ ignore_overwrite_restrictions_for_next_write()

void libdar::filesystem_restore::ignore_overwrite_restrictions_for_next_write ( )
inline

ask for no warning or user interaction for the next write operation

Note
this is used when a file has been saved several times due to its changes at the time of the backup and is restored in sequential read. Restoring each failed backup would lead to ask each time the actions to take about overwriting... anoying for the user

Definition at line 123 of file filesystem_restore.hpp.

◆ write()

void libdar::filesystem_restore::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

Parameters
[in]xis the libdar object to restore
[out]data_restoredtrue if data has been restored (inode or hard link created), false if either there is no data to restore or if this action is forbidden by the overwriting policy
[out]ea_restoredtrue if EA has been restored, false if either no EA to restore or if forbidden by overwriting policy
[out]data_createdtrue if data has been restored leading to file creation, false in any other case
[out]hard_linktrue when data_restored is true and only a hard link to an already existing inode has been created
[out]fsa_restoredtrue if FSA has been restored, false if either no FSA to restore or if forbidden by overwriting policy
Note
any failure to restore data or EA that is not due to its absence in "x" nor to an interdiction from the overwriting policy is signaled through an exception.

The documentation for this class was generated from the following file: