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))
162 x_go_true->
get_action(first, second, data, ea);
164 x_go_false->
get_action(first, second, data, ea);
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;
192 crit_chain(
crit_chain && ref) noexcept : crit_action(std::move(ref)) { sequence = std::move(ref.sequence); };
194 crit_chain & operator = (
crit_chain && ref) noexcept { crit_action::operator = (std::move(ref)); sequence = std::move(ref.sequence);
return *
this; };
197 void add(
const crit_action & act);
198 void clear() { destroy(); };
203 virtual crit_action *
clone()
const override {
return new (std::nothrow)
crit_chain(*
this); };
206 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 crit_action * clone() const =0
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
bool check() const
returns false if an field is nullptr
the basic constant action
virtual crit_action * clone() const override
clone construction method
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...
action still undefined at this step of the evaluation
testing(const criterium &input, const crit_action &go_true, const crit_action &go_false)
the constructor
exception used when memory has been exhausted
keep the 'in place' but mark it as already saved in the archive of reference
virtual bool evaluate(const cat_nomme &first, const cat_nomme &second) const =0
criterum interface method
the global action for overwriting
the base class for all entry that have a name
virtual ~crit_action()=default
the destructor
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
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
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)
virtual crit_action * clone() const override
clone construction method
keep the EA of the 'to be added' entry
libdar namespace encapsulate all libdar symbols
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 ...