29 #include "../my_config.h"
47 data_preserve_mark_already_saved,
48 data_overwrite_mark_already_saved,
62 EA_preserve_mark_already_saved,
63 EA_overwrite_mark_already_saved,
152 static const inode *get_inode(
const nomme * arg);
172 const testing & operator = (
const testing & ref) { free(); copy_from(ref);
if(!check())
throw Ememory(
"testing::testing(const testing &)"); };
179 if(x_input->
evaluate(first, second))
180 x_go_true->
get_action(first, second, data, ea);
182 x_go_false->
get_action(first, second, data, ea);
193 void copy_from(
const testing & ref);
208 const crit_chain & operator = (
const crit_chain & ref) { destroy(); copy_from(ref);
return *
this; };
212 void clear() { destroy(); };
220 std::vector<crit_action *> sequence;
239 bool evaluate(
const nomme &first,
const nomme &second)
const {
return dynamic_cast<const inode *
>(&first) != NULL || dynamic_cast<const mirage *>(&first) != NULL; };
278 bool evaluate(
const nomme &first,
const nomme &second)
const
280 const mirage * tmp =
dynamic_cast<const mirage *
>(&first);
375 const inode *tmp =
dynamic_cast<const inode *
>(&first);
376 return tmp != NULL && tmp->ea_get_saved_status() != inode::ea_none && tmp->ea_get_saved_status() != inode::ea_removed;
478 const crit_not & operator = (
const crit_not & ref) { destroy(); copy_from(ref);
return *
this; };
488 void copy_from(
const crit_not & ref);
489 void destroy() {
if(x_crit != NULL) {
delete x_crit; x_crit = NULL; } };
512 std::vector<criterium *> operand;
515 void copy_from(
const crit_and & ref);
519 class crit_or :
public crit_and
522 crit_or() { clear(); };
524 bool evaluate(
const nomme & first,
const nomme & second)
const;
525 criterium *clone()
const {
return new (std::nothrow) crit_or(*
this); };
529 class crit_invert :
public crit_not
532 crit_invert(
const criterium & crit) : crit_not(crit) {};
534 bool evaluate(
const nomme & first,
const nomme & second)
const {
return x_crit->
evaluate(second, first); };
535 criterium *clone()
const {
return new (std::nothrow) crit_invert(*
this); };
563 extern void crit_show_entry_info(user_interaction & dialog,
const std::string & full_name,
const entree *already_here,
const entree *dolly);
returns true if the first entry is a inode with several hard links (whatever is the second entry) and...
bool evaluate(const nomme &first, const nomme &second) const
criterum interface method
criterium * clone() const
clone construction method
bool evaluate(const nomme &first, const nomme &second) const
criterum interface method
criterium * clone() const
clone construction method
return true if the entry is a sparse file (or hard linked sparse file)
bool evaluate(const nomme &first, const nomme &second) const
criterum interface method
bool evaluate(const nomme &first, const nomme &second) const
criterum interface method
bool evaluate(const nomme &first, const nomme &second) const
criterum interface method
virtual bool evaluate(const nomme &first, const nomme &second) const
criterum interface method
over_action_data
the possible actions for overwriting data
returns true if the in place entry has its EA saved (not just marked as saved) in the archve of refer...
crit_action * clone() const
clone construction method
bool evaluate(const nomme &first, const nomme &second) const
criterum interface method
void gobe(crit_and &to_be_voided)
this call merges to the current call the arguments of another "crit_and", the given argument is clear...
returns true if the data of the first entry is more recent or of the same date as the fixed date give...
criterium * clone() const
clone construction method
void get_action(const nomme &first, const nomme &second, over_action_data &data, over_action_ea &ea) const
the action to take based on the files to compare
virtual criterium * clone() const =0
clone construction method
bool ea()
returns whether EA support has been activated at compilation time
returns true if the first entry is a plain file (whatever is the second)
bool evaluate(const nomme &first, const nomme &second) const
criterum interface method
returns true if the space used by EA of the first entry is greater or equal to the space used by the ...
bool evaluate(const nomme &first, const nomme &second) const
criterum interface method
realises the negation of the criterium given in argument to its constructor
the base class for all entry that have a name
criterium * clone() const
clone construction method
the basic constant action
criterium * clone() const
clone construction method
the hard link implementation, mirage is the named entry owned by a directory it points to a common "e...
the directory inode class
over_action_ea
the possible action for overwriting EA
realises the AND operator
returns true if the data of the first entry is bigger or equal to the one of the second entry ...
criterium * clone() const
clone construction method
returns true if the first entry is a inode with several hard links (whatever is the second entry) ...
bool evaluate(const nomme &first, const nomme &second) const
criterum interface method
return true if the entry is a dirty file (or hard linked dirty file)
the crit_chain class sequences crit_actions up to full definition of the action
bool evaluate(const nomme &first, const nomme &second) const
criterum interface method
criterium * clone() const
clone construction method
testing(const criterium &input, const crit_action &go_true, const crit_action &go_false)
the constructor
the root class for all inode
returns true if the EA of the first entry is more recent or equal to the one of the second entry ...
exception used when memory has been exhausted
criterium * clone() const
clone construction method
criterium * clone() const
clone construction method
criterium * clone() const
clone construction method
the global action for overwriting
returns true if the two entries are of the same type (plain-file/char dev/block dev/named pipe/symlin...
criterium * clone() const
clone construction method
criterium * clone() const
clone construction method
virtual crit_action * clone() const =0
clone construction method
bool evaluate(const nomme &first, const nomme &second) const
criterum interface method
over_action_data crit_ask_user_for_data_action(user_interaction &dialog, const std::string &full_name, const entree *already_here, const entree *dolly)
ask user for Data action
criterium * clone() const
clone construction method
criterium * clone() const
clone construction method
bool evaluate(const nomme &first, const nomme &second) const
criterum interface method
void crit_show_entry_info(user_interaction &dialog, const std::string &full_name, const entree *already_here, const entree *dolly)
show information suited for user comparison and decision for entry in conflict
void get_action(const nomme &first, const nomme &second, over_action_data &data, over_action_ea &ea) const
the inherited pure virtual method from class action that must be gimplemented
over_action_ea crit_ask_user_for_EA_action(user_interaction &dialog, const std::string &full_name, const entree *already_here, const entree *dolly)
ask user for EA action
bool evaluate(const nomme &first, const nomme &second) const
criterum interface method
virtual void get_action(const nomme &first, const nomme &second, over_action_data &data, over_action_ea &ea) const =0
the action to take based on the files to compare
the generic criterium class, parent of all criterium
criterium * clone() const
clone construction method
bool is_first_mirage() const
whether we are the mirage that triggered this hard link creation
returns true if the first entry is an inode (whatever is the second)
returns true if the data of the first entry is more recent or of the same date of the one of the seco...
crit_action * clone() const
clone construction method
bool evaluate(const nomme &first, const nomme &second) const
criterum interface method
the testing class binds criterium to actions
returns true if the data of the first entry is saved int the archive (not marked as unchanged since t...
the arbitrary large positive integer class
criterium * clone() const
clone construction method
criterium * clone() const
clone construction method
crit_constant_action(over_action_data data, over_action_ea ea)
the constuctor
virtual ~crit_action()
the destructor
crit_action * clone() const
clone construction method
returns true if the first entry has more or even EA (in number not in size) than the second entry ...
bool evaluate(const nomme &first, const nomme &second) const
criterum interface method
bool evaluate(const nomme &first, const nomme &second) const
criterum interface method
virtual bool evaluate(const nomme &first, const nomme &second) const =0
criterum interface method
void get_action(const nomme &first, const nomme &second, over_action_data &data, over_action_ea &ea) const
the inherited pure virtual methods from class action that must be implemented
bool evaluate(const nomme &first, const nomme &second) const
criterum interface method
criterium * clone() const
clone construction method
returns true if the first entry is a directory (whatever is the second)
here is defined the many classed which is build of the catalogue
criterium * clone() const
clone construction method
returns true if the EA of the first entry is more recent or equal to the fixed date given in argument...
bool evaluate(const nomme &first, const nomme &second) const
criterum interface method