26 #ifndef CRIT_ACTION_HPP 27 #define CRIT_ACTION_HPP 29 #include "../my_config.h" 154 testing & operator = (
const testing & ref) { free(); copy_from(ref);
if(!check())
throw Ememory(
"testing::testing(const testing &)");
return *
this; };
155 testing & operator = (
testing && ref) noexcept { crit_action::operator = (std::move(ref)); move_from(std::move(ref));
return *
this; };
162 if(x_input->evaluate(first, second))
163 x_go_true->get_action(first, second, data, ea);
165 x_go_false->get_action(first, second, data, ea);
175 void nullifyptr() noexcept { x_input =
nullptr; x_go_true = x_go_false =
nullptr; };
176 void free() noexcept;
177 void copy_from(
const testing & ref);
178 void move_from(
testing && ref) noexcept;
195 crit_chain & operator = (
crit_chain && ref) noexcept { crit_action::operator = (std::move(ref)); sequence = std::move(ref.sequence);
return *
this; };
199 void clear() { destroy(); };
207 std::deque<crit_action *> sequence;
contains classes that let the user define the policy for overwriting files
bool ea() noexcept
returns whether EA support has been activated at compilation time
merge EA but do not overwrite existing EA of 'in place' by one of the same name of 'to be added' inod...
overwrite the 'in place' but mark the 'to be added' as already saved in the archive of reference ...
over_action_data
the possible actions for overwriting data
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 override
clone construction method
ask for user decision about file's data
action still undefined at this step of the evaluation
keep the EA of the 'in place' entry
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 ...
virtual crit_action * clone() const override
clone construction method
the basic constant action
overwirte the 'in place' entry by the 'to be added' one
over_action_ea
the possible action for overwriting EA
virtual crit_action * clone() const override
clone construction method
drop any EA but mark them as already saved in the archive of reference (ctime is the one of the 'in p...
the crit_chain class sequences crit_actions up to full definition of the action
drop any EA but mark them as already saved in the archive of reference (ctime is the one of the 'to b...
defines the interaction interface between libdar and users.
action still undefined at this step of the evaluation
exception used when memory has been exhausted
keep the 'in place' but mark it as already saved in the archive of reference
the global action for overwriting
the base class for all entry that have a name
virtual ~crit_action()=default
the destructor
virtual crit_action * clone() const =0
clone construction method
merge EA but if both inode share an EA with the same name, take keep the one of the 'to be added' ino...
drop the EA for the elected entry
the generic criterium class, parent of all criterium
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
ask for user decision about EA
the testing class binds criterium to actions
crit_constant_action(over_action_data data, over_action_ea ea)
the constuctor
remove the original data/EA (file is completely deleted)
do not overwrite (keep the 'in place' entry)
keep the EA of the 'to be added' entry
libdar namespace encapsulate all libdar symbols