Disk ARchive 2.7.16
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 More...
 
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 More...
 
 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 Typedef Documentation

◆ action_done_for_data

using libdar::filesystem_restore::action_done_for_data = enum { done_data_restored, done_no_change_no_data, done_no_change_policy, done_data_removed }

Definition at line 92 of file filesystem_restore.hpp.

Constructor & Destructor Documentation

◆ ~filesystem_restore()

libdar::filesystem_restore::~filesystem_restore ( )
inline

destructor

Definition at line 87 of file filesystem_restore.hpp.

Member Function Documentation

◆ get_pointer()

std::shared_ptr< user_interaction > libdar::filesystem_restore::get_pointer ( ) const
inlineprivate

Definition at line 155 of file filesystem_restore.hpp.

◆ get_ui()

user_interaction & libdar::filesystem_restore::get_ui ( ) const
inlineprivate

Definition at line 154 of file filesystem_restore.hpp.

◆ 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.

Member Data Documentation

◆ current_dir

path* libdar::filesystem_restore::current_dir
private

Definition at line 146 of file filesystem_restore.hpp.

◆ ea_mask

mask* libdar::filesystem_restore::ea_mask
private

Definition at line 141 of file filesystem_restore.hpp.

◆ empty

bool libdar::filesystem_restore::empty
private

Definition at line 147 of file filesystem_restore.hpp.

◆ fs_root

path* libdar::filesystem_restore::fs_root
private

Definition at line 139 of file filesystem_restore.hpp.

◆ ignore_over_restricts

bool libdar::filesystem_restore::ignore_over_restricts
private

Definition at line 148 of file filesystem_restore.hpp.

◆ info_details

bool libdar::filesystem_restore::info_details
private

Definition at line 140 of file filesystem_restore.hpp.

◆ only_overwrite

bool libdar::filesystem_restore::only_overwrite
private

Definition at line 150 of file filesystem_restore.hpp.

◆ overwrite

const crit_action* libdar::filesystem_restore::overwrite
private

Definition at line 149 of file filesystem_restore.hpp.

◆ stack_dir

std::deque<stack_dir_t> libdar::filesystem_restore::stack_dir
private

Definition at line 145 of file filesystem_restore.hpp.

◆ warn_overwrite

bool libdar::filesystem_restore::warn_overwrite
private

Definition at line 142 of file filesystem_restore.hpp.

◆ warn_remove_no_match

bool libdar::filesystem_restore::warn_remove_no_match
private

Definition at line 144 of file filesystem_restore.hpp.

◆ what_to_check

comparison_fields libdar::filesystem_restore::what_to_check
private

Definition at line 143 of file filesystem_restore.hpp.


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