Loading...
Searching...
No Matches
libdar::cat_entree Class Referenceabstract
Private

the root class from all other inherite for any entry in the catalogue More...

`#include <cat_entree.hpp>`

Inherited by libdar::cat_eod, and libdar::cat_nomme.

## 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
| 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
void | dump (const pile_descriptor &pdesc, bool small) const
| write down the object information to a stack
void | specific_dump (const pile_descriptor &pdesc, bool small) const
| this call gives an access to inherited_dump
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
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

## 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

## 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
escape * | get_escape_layer () const
| escape generic_file relative methods
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

## Detailed Description

the root class from all other inherite for any entry in the catalogue

Definition at line 59 of file cat_entree.hpp.

## Constructor & Destructor Documentation

## cat_entree() [1/2]

libdar::cat_entree::cat_entree | ( | saved_status | val | ) |

inline

setup an object when read from filesystem

Definition at line 84 of file cat_entree.hpp.

References xsaved.

Referenced by cat_entree(), clone(), libdar::cat_eod::clone(), operator==(), libdar::cat_eod::operator==(), libdar::cat_nomme::operator==(), read(), and same_as().

## cat_entree() [2/2]

libdar::cat_entree::cat_entree | ( | const smart_pointer< pile_descriptor > & | pdesc,
|  | bool | small,
|  | saved_status | val )

setup an object when read from an archive

Parameters

  [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

References cat_entree().

## ~cat_entree()

virtual libdar::cat_entree::~cat_entree | ( |  | ) |

inline virtual

destructor

Definition at line 107 of file cat_entree.hpp.

## Member Function Documentation

## change_location()

virtual void libdar::cat_entree::change_location | ( | const smart_pointer< pile_descriptor > & | pdesc | ) |

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

Note
  this is used when cloning an object from a catalogue to provide a merged archive. Such cloned object must point the stack of the archive under construction, so we use this call for that need,
  this is also used when opening a catalogue if an isolated catalogue in place of the internal catalogue of an archive
  this method is virtual in order for cat_directory to overwrite it and propagate the change to all entries of the directory tree as well for mirage to propagate the change to the hard linked inode

Reimplemented in libdar::cat_directory, and libdar::cat_mirage.

## clone()

virtual cat_entree * libdar::cat_entree::clone | ( |  | ) | const

pure virtual

a way to copy the exact type of an object even if pointed to by a parent class pointer

Implemented in libdar::cat_blockdev, libdar::cat_chardev, libdar::cat_detruit, libdar::cat_directory, libdar::cat_eod, libdar::cat_file, libdar::cat_ignored, libdar::cat_ignored_dir, libdar::cat_lien, libdar::cat_mirage, libdar::cat_prise, and libdar::cat_tube.

References cat_entree().

## dump()

void libdar::cat_entree::dump | ( | const pile_descriptor & | pdesc,
|  | bool | small ) const

write down the object information to a stack

Parameters

  [in,out] | pdesc | is the stack where to write the data to
  [in] | small | defines whether to do a small or normal dump

## get_compressor_layer()

proto_compressor * libdar::cat_entree::get_compressor_layer | ( |  | ) | const

inline protected

compressor generic_file relative methods

Note
  CAUTION: the pointer to object is member of the get_pile() stack and may be managed by another thread all precaution like get_pile()->flush_read_above(get_compressor_layer() shall be take to avoid concurrent access to the proto_compressor object by the current thread and the thread managing this object

Definition at line 193 of file cat_entree.hpp.

## get_description()

virtual std::string libdar::cat_entree::get_description | ( |  | ) | const

pure virtual

inherited class designation

Implemented in libdar::cat_blockdev, libdar::cat_chardev, libdar::cat_detruit, libdar::cat_directory, libdar::cat_door, libdar::cat_eod, libdar::cat_file, libdar::cat_ignored, libdar::cat_ignored_dir, libdar::cat_lien, libdar::cat_mirage, libdar::cat_prise, and libdar::cat_tube.

## get_escape_layer()

escape * libdar::cat_entree::get_escape_layer | ( |  | ) | const

inline protected

escape generic_file relative methods

Note
  CAUTION: the pointer to object is member of the get_pile() stack and may be managed by another thread all precaution like get_pile()->flush_read_above(get_escape_layer() shall be take to avoid concurrent access to the compressor object by the current thread and the thread managing this object

Definition at line 200 of file cat_entree.hpp.

## get_pile()

pile * libdar::cat_entree::get_pile | ( |  | ) | const

inline protected

stack used to read object from (nullptr is returned for object created from filesystem)

Definition at line 186 of file cat_entree.hpp.

## get_saved_status()

saved_status libdar::cat_entree::get_saved_status | ( |  | ) | const

inline

obtain the saved status of the object

Definition at line 164 of file cat_entree.hpp.

References xsaved.

Referenced by libdar::cat_file::can_get_data().

## inherited_dump()

virtual void libdar::cat_entree::inherited_dump | ( | const pile_descriptor & | pdesc,
|  | bool | small ) const

protected virtual

inherited class may overload this method but shall first call the parent's inherited_dump() in the overloaded method

Reimplemented in libdar::cat_detruit, libdar::cat_device, libdar::cat_directory, libdar::cat_file, libdar::cat_ignored, libdar::cat_ignored_dir, libdar::cat_inode, libdar::cat_lien, libdar::cat_mirage, and libdar::cat_nomme.

Referenced by specific_dump().

## operator!=()

bool libdar::cat_entree::operator!= | ( | const cat_entree & | ref | ) | const

inline

Definition at line 111 of file cat_entree.hpp.

## operator==()

virtual bool libdar::cat_entree::operator== | ( | const cat_entree & | ref | ) | const

pure virtual

returns true if the two object are the same

Implemented in libdar::cat_blockdev, libdar::cat_chardev, libdar::cat_detruit, libdar::cat_device, libdar::cat_directory, libdar::cat_door, libdar::cat_eod, libdar::cat_file, libdar::cat_ignored, libdar::cat_ignored_dir, libdar::cat_lien, libdar::cat_mirage, libdar::cat_nomme, libdar::cat_prise, and libdar::cat_tube.

References cat_entree().

## post_constructor()

virtual void libdar::cat_entree::post_constructor | ( | const pile_descriptor & | pdesc | ) |

inline virtual

let inherited classes build object's data after CRC has been read from file in small read mode

Parameters

  [in] | pdesc | stack to read the data from

Note
  used from cat_entree::read to complete small read
  this method is called by cat_entree::read and mirage::post_constructor only when contructing an object with small set to true

Reimplemented in libdar::cat_file, and libdar::cat_mirage.

Definition at line 139 of file cat_entree.hpp.

## read()

cat_entree * libdar::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 )

static

read and create an object of inherited class of class cat_entree

Parameters

  [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

References cat_entree().

## same_as()

bool libdar::cat_entree::same_as | ( | const cat_entree & | ref | ) | const

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.

References cat_entree().

Referenced by libdar::cat_nomme::same_as().

## set_list_entry()

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

Parameters

  [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

Note
  if sly is set to nullptr, no slice location is performed, this brings some speed improvement when this information is not required

## set_saved_status()

void libdar::cat_entree::set_saved_status | ( | saved_status | x | ) |

inline

modify the saved_status of the object

Definition at line 167 of file cat_entree.hpp.

References xsaved.

## signature()

virtual unsigned char libdar::cat_entree::signature | ( |  | ) | const

pure virtual

inherited class signature

Implemented in libdar::cat_blockdev, libdar::cat_chardev, libdar::cat_detruit, libdar::cat_directory, libdar::cat_door, libdar::cat_eod, libdar::cat_file, libdar::cat_ignored, libdar::cat_ignored_dir, libdar::cat_lien, libdar::cat_mirage, libdar::cat_prise, and libdar::cat_tube.

## specific_dump()

void libdar::cat_entree::specific_dump | ( | const pile_descriptor & | pdesc,
|  | bool | small ) const

inline

this call gives an access to inherited_dump

Parameters

  [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().

## Member Data Documentation

## ENTREE_CRC_SIZE

const U_I libdar::cat_entree::ENTREE_CRC_SIZE

static private

Definition at line 206 of file cat_entree.hpp.

## pdesc

smart_pointer<pile_descriptor> libdar::cat_entree::pdesc

private

Definition at line 209 of file cat_entree.hpp.

## xsaved

saved_status libdar::cat_entree::xsaved

private

inode data status, this field is stored with signature() in the cat_signature field -> must be managed by cat_entree

Definition at line 208 of file cat_entree.hpp.

Referenced by cat_entree(), get_saved_status(), and set_saved_status().

The documentation for this class was generated from the following file:

- cat_entree.hpp