26 #ifndef CRIT_ACTION_HPP
27 #define CRIT_ACTION_HPP
29 #include "../my_config.h"
153 testing & operator = (
const testing & ref) { free(); copy_from(ref);
if(!
check())
throw Ememory(
"testing::testing(const testing &)");
return *
this; };
154 testing & operator = (
testing && ref) noexcept { crit_action::operator = (std::move(ref)); move_from(std::move(ref));
return *
this; };
161 if(x_input->
evaluate(first, second))
174 void nullifyptr() noexcept { x_input =
nullptr; x_go_true = x_go_false =
nullptr; };
175 void free() noexcept;
176 void copy_from(const
testing & ref);
177 void move_from(
testing && ref) noexcept;
194 crit_chain & operator = (
crit_chain && ref) noexcept { crit_action::operator = (std::move(ref)); sequence = std::move(ref.sequence);
return *
this; };
198 void clear() { destroy(); };
206 std::deque<crit_action *> sequence;
exception used when memory has been exhausted
the base class for all entry that have a name
the global action for overwriting
virtual ~crit_action()=default
the destructor
virtual void get_action(const cat_nomme &first, const cat_nomme &second, over_action_data &data, over_action_ea &ea) const =0
the action to take based on the files to compare
virtual crit_action * clone() const =0
clone construction method
the crit_chain class sequences crit_actions up to full definition of the action
virtual crit_action * clone() const override
clone construction method
virtual void get_action(const cat_nomme &first, const cat_nomme &second, over_action_data &data, over_action_ea &ea) const override
the action to take based on the files to compare
the basic constant action
crit_constant_action(over_action_data data, over_action_ea ea)
the constuctor
virtual crit_action * clone() const override
clone construction method
virtual void get_action(const cat_nomme &first, const cat_nomme &second, over_action_data &data, over_action_ea &ea) const override
the inherited pure virtual methods from class action that must be implemented
the generic criterium class, parent of all criterium
virtual bool evaluate(const cat_nomme &first, const cat_nomme &second) const =0
criterum interface method
the testing class binds criterium to actions
virtual crit_action * clone() const override
clone construction method
virtual void get_action(const cat_nomme &first, const cat_nomme &second, over_action_data &data, over_action_ea &ea) const override
the inherited pure virtual method from class crit_action that must be implemented
bool check() const
returns false if an field is nullptr
testing(const criterium &input, const crit_action &go_true, const crit_action &go_false)
the constructor
contains classes that let the user define the policy for overwriting files
over_action_ea
the possible action for overwriting EA
over_action_data
the possible actions for overwriting data
@ EA_ask
ask for user decision about EA
@ EA_merge_preserve
merge EA but do not overwrite existing EA of 'in place' by one of the same name of 'to be added' inod...
@ EA_preserve_mark_already_saved
drop any EA but mark them as already saved in the archive of reference (ctime is the one of the 'in p...
@ EA_overwrite
keep the EA of the 'to be added' entry
@ EA_preserve
keep the EA of the 'in place' entry
@ EA_merge_overwrite
merge EA but if both inode share an EA with the same name, take keep the one of the 'to be added' ino...
@ EA_undefined
action still undefined at this step of the evaluation
@ EA_clear
drop the EA for the elected entry
@ EA_overwrite_mark_already_saved
drop any EA but mark them as already saved in the archive of reference (ctime is the one of the 'to b...
@ data_preserve
do not overwrite (keep the 'in place' entry)
@ data_preserve_mark_already_saved
keep the 'in place' but mark it as already saved in the archive of reference
@ data_overwrite
overwirte the 'in place' entry by the 'to be added' one
@ data_ask
ask for user decision about file's data
@ data_remove
remove the original data/EA (file is completely deleted)
@ data_undefined
action still undefined at this step of the evaluation
@ data_overwrite_mark_already_saved
overwrite the 'in place' but mark the 'to be added' as already saved in the archive of reference
bool ea() noexcept
returns whether EA support has been activated at compilation time
libdar namespace encapsulate all libdar symbols