Disk ARchive
2.7.15
Full featured and portable backup and archiving tool
|
the root class from all other inherite for any entry in the catalogue More...
#include <cat_entree.hpp>
Public Member Functions | |
cat_entree (saved_status val) | |
setup an object when read from filesystem | |
cat_entree (const smart_pointer< pile_descriptor > &pdesc, bool small, saved_status val) | |
setup an object when read from an archive More... | |
cat_entree (const cat_entree &ref)=default | |
cat_entree (cat_entree &&ref) noexcept=default | |
cat_entree & | operator= (const cat_entree &ref)=default |
cat_entree & | operator= (cat_entree &&ref)=default |
virtual | ~cat_entree () noexcept(false) |
destructor | |
virtual bool | operator== (const cat_entree &ref) const =0 |
returns true if the two object are the same | |
bool | operator!= (const cat_entree &ref) const |
bool | same_as (const cat_entree &ref) const |
return true of the two objects would generate the same entry on filsystem More... | |
void | dump (const pile_descriptor &pdesc, bool small) const |
write down the object information to a stack More... | |
void | specific_dump (const pile_descriptor &pdesc, bool small) const |
this call gives an access to inherited_dump More... | |
virtual void | post_constructor (const pile_descriptor &pdesc) |
let inherited classes build object's data after CRC has been read from file in small read mode More... | |
virtual unsigned char | signature () const =0 |
inherited class signature | |
virtual std::string | get_description () const =0 |
inherited class designation | |
virtual cat_entree * | clone () const =0 |
a way to copy the exact type of an object even if pointed to by a parent class pointer | |
virtual void | change_location (const smart_pointer< pile_descriptor > &pdesc) |
saved_status | get_saved_status () const |
obtain the saved status of the object | |
void | set_saved_status (saved_status x) |
modify the saved_status of the object | |
void | set_list_entry (const slice_layout *sly, bool fetch_ea, list_entry &ent) const |
setup a list_entry object relative to the current cat_entree object More... | |
Static Public Member Functions | |
static cat_entree * | read (const std::shared_ptr< user_interaction > &dialog, const smart_pointer< pile_descriptor > &f, const archive_version &reading_ver, entree_stats &stats, std::map< infinint, cat_etoile * > &corres, compression default_algo, bool lax, bool only_detruit, bool small) |
read and create an object of inherited class of class cat_entree More... | |
Protected Member Functions | |
virtual void | inherited_dump (const pile_descriptor &pdesc, bool small) const |
inherited class may overload this method but shall first call the parent's inherited_dump() in the overloaded method | |
pile * | get_pile () const |
stack used to read object from (nullptr is returned for object created from filesystem) | |
proto_compressor * | get_compressor_layer () const |
compressor generic_file relative methods More... | |
escape * | get_escape_layer () const |
escape generic_file relative methods More... | |
generic_file * | get_read_cat_layer (bool small) const |
return the adhoc layer in the stack to read from the catalogue objects (except the EA, FSA or Data part) | |
Private Attributes | |
saved_status | xsaved |
inode data status, this field is stored with signature() in the cat_signature field -> must be managed by cat_entree | |
smart_pointer< pile_descriptor > | pdesc |
Static Private Attributes | |
static const U_I | ENTREE_CRC_SIZE |
the root class from all other inherite for any entry in the catalogue
Definition at line 59 of file cat_entree.hpp.
libdar::cat_entree::cat_entree | ( | const smart_pointer< pile_descriptor > & | pdesc, |
bool | small, | ||
saved_status | val | ||
) |
setup an object when read from an archive
[in] | pdesc | points to an existing stack that will be read from to setup fields of inherited classes, this pointed to pile object must survive the whole life of the cat_entree object |
[in] | small | whether a small or a whole read is to be read, (inode has been dump() with small set to true) |
[in] | val | saved_status to assign the the new object |
|
virtual |
for archive merging, will let the object drop EA, FSA and Data to an alternate stack than the one it has been read from
Reimplemented in libdar::cat_mirage, and libdar::cat_directory.
Referenced by libdar::cat_mirage::change_location().
void libdar::cat_entree::dump | ( | const pile_descriptor & | pdesc, |
bool | small | ||
) | const |
write down the object information to a stack
[in,out] | pdesc | is the stack where to write the data to |
[in] | small | defines whether to do a small or normal dump |
|
inlineprotected |
compressor generic_file relative methods
Definition at line 193 of file cat_entree.hpp.
References libdar::smart_pointer< T >::is_null().
|
inlineprotected |
escape generic_file relative methods
Definition at line 200 of file cat_entree.hpp.
References libdar::smart_pointer< T >::is_null().
|
inlinevirtual |
let inherited classes build object's data after CRC has been read from file in small read mode
[in] | pdesc | stack to read the data from |
Reimplemented in libdar::cat_mirage, and libdar::cat_file.
Definition at line 139 of file cat_entree.hpp.
|
static |
read and create an object of inherited class of class cat_entree
[in] | dialog | for user interaction |
[in] | f | where from to read data in order to create the object |
[in] | reading_ver | archive version format to use for reading |
[in,out] | stats | updated statistical fields |
[in,out] | corres | used to setup hard links |
[in] | default_algo | default compression algorithm |
[in] | lax | whether to use relax mode |
[in] | only_detruit | whether to only consider detruit objects (in addition to the directory tree) |
[in] | small | whether the dump() to read has been done with the small argument set |
|
inline |
return true of the two objects would generate the same entry on filsystem
for a and b two cat_entree, if a == b, then a.same_as(b) is true also. But the opposit may be wrong if for example "a" is a hardlink pointing to an inode while b is a normal inode, restoring both could lead to having the same entry in filsystem while a and b are different for libdar: here they are objects of two different classes.
Definition at line 120 of file cat_entree.hpp.
Referenced by libdar::cat_nomme::same_as().
void libdar::cat_entree::set_list_entry | ( | const slice_layout * | sly, |
bool | fetch_ea, | ||
list_entry & | ent | ||
) | const |
setup a list_entry object relative to the current cat_entree object
[in] | sly | the slice layout that shall be used for file location in slices |
[in] | fetch_ea | whether to fetch EA and fill these values into the generated list_entry |
[out] | ent | the list_entry that will be setup by the call |
|
inline |
this call gives an access to inherited_dump
[in,out] | pdesc | is the stack where to write the data to |
[in] | small | defines whether to do a small or normal dump |
Definition at line 132 of file cat_entree.hpp.
References inherited_dump().