Disk ARchive 2.7.16
Full featured and portable backup and archiving tool
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
libdar::catalogue Class Reference

the catalogue class which gather all objects contained in a give archive More...

#include <catalogue.hpp>

+ Inheritance diagram for libdar::catalogue:
+ Collaboration diagram for libdar::catalogue:

Public Member Functions

 catalogue (const std::shared_ptr< user_interaction > &ui, const datetime &root_last_modif, const label &data_name)
 
 catalogue (const std::shared_ptr< user_interaction > &ui, const pile_descriptor &pdesc, const archive_version &reading_ver, compression default_algo, bool lax, const label &lax_layer1_data_name, bool only_detruit=false)
 
 catalogue (const catalogue &ref)
 
 catalogue (catalogue &&ref)=delete
 
catalogueoperator= (const catalogue &ref)
 
catalogueoperator= (catalogue &&ref)=delete
 
virtual void reset_read () const
 
virtual void end_read () const
 
virtual void skip_read_to_parent_dir () const
 
virtual bool read (const cat_entree *&ref) const
 
virtual bool read_if_present (std::string *name, const cat_nomme *&ref) const
 
void remove_read_entry (std::string &name)
 
const cat_directoryget_current_reading_dir () const
 
virtual void tail_catalogue_to_current_read ()
 
void reset_sub_read (const path &sub)
 
bool sub_read (user_interaction &ui, const cat_entree *&ref)
 
virtual bool read_second_time_dir () const
 
void reset_add ()
 
virtual void pre_add (const cat_entree *ref, const pile_descriptor *dest=nullptr) const
 catalogue extension routines for escape sequence More...
 
virtual void pre_add_ea (const cat_entree *ref, const pile_descriptor *dest=nullptr) const
 
virtual void pre_add_crc (const cat_entree *ref, const pile_descriptor *dest=nullptr) const
 
virtual void pre_add_dirty (const pile_descriptor *dest=nullptr) const
 
virtual void pre_add_ea_crc (const cat_entree *ref, const pile_descriptor *dest=nullptr) const
 
virtual void pre_add_waste_mark (const pile_descriptor *dest=nullptr) const
 
virtual void pre_add_failed_mark (const pile_descriptor *dest=nullptr) const
 
virtual void pre_add_fsa (const cat_entree *ref, const pile_descriptor *dest=nullptr) const
 
virtual void pre_add_fsa_crc (const cat_entree *ref, const pile_descriptor *dest=nullptr) const
 
virtual void pre_add_delta_sig (const pile_descriptor *dest=nullptr) const
 
virtual escape * get_escape_layer () const
 
virtual void drop_escape_layer ()
 
void add (cat_entree *ref)
 
void re_add_in (const std::string &subdirname)
 
void re_add_in_replace (const cat_directory &dir)
 
void add_in_current_read (cat_nomme *ref)
 
const cat_directoryget_current_add_dir () const
 
void reset_compare () const
 
bool compare (const cat_entree *name, const cat_entree *&extracted) const
 
infinint update_destroyed_with (const catalogue &ref)
 add into "this" detruit object corresponding to object of ref absent in "this" More...
 
void update_absent_with (const catalogue &ref, infinint aborting_next_etoile)
 copy from ref missing files in "this" and mark then as "not_saved" (no change since reference) More...
 
void drop_all_non_detruits ()
 remove/destroy from "this" all objects that are neither directory nor detruit objects
 
bool is_subset_of (const catalogue &ref) const
 check whether all inode existing in the "this" and ref have the same attributes More...
 
void reset_dump () const
 before dumping the catalogue, need to set all hardlinked inode they have not been saved once
 
void dump (const pile_descriptor &pdesc) const
 write down the whole catalogue to file
 
entree_stats get_stats () const
 
bool is_empty () const
 whether the catalogue is empty or not More...
 
const cat_directoryget_contenu () const
 
const labelget_data_name () const
 
void set_data_name (const label &val)
 
datetime get_root_dir_last_modif () const
 
void launch_recursive_has_changed_update () const
 recursive evaluation of directories that have changed (make the cat_directory::get_recurisve_has_changed() method of entry in this catalogue meaningful) More...
 
void set_all_mirage_s_inode_wrote_field_to (bool val) const
 recursive setting of mirage inode_wrote flag More...
 
datetime get_root_mtime () const
 
void reset_all ()
 reset all pointers to the root (a bit better than reset_add() + reset_read() + reset_compare() + reset_sub_read())
 
void set_to_unsaved_data_and_FSA ()
 
void change_location (const pile_descriptor &pdesc)
 change location where to find EA, FSA and DATA for all the objects of the catalogue
 
void transfer_delta_signatures (const pile_descriptor &destination, bool sequential_read, bool build, const mask &delta_mask, const infinint &delta_sig_min_size, const delta_sig_block_size &signature_block_size)
 copy delta signatures to the given stack and update the cat_file objects accordingly More...
 
void drop_delta_signatures ()
 remove delta signature from the catalogue object as if they had never been calculated
 
bool has_in_place () const
 returns whether an in-place path is stored in the catalogue More...
 
bool get_in_place (path &arg) const
 get the in_place path when available More...
 
virtual void set_in_place (const path &arg)
 set the in_place path for recording in the archive
 
virtual void clear_in_place ()
 clear the in_place path
 
- Public Member Functions inherited from libdar::mem_ui
 mem_ui (const std::shared_ptr< user_interaction > &dialog)
 constructor More...
 
 mem_ui (const mem_ui &ref)=default
 the copy constructor More...
 
 mem_ui (mem_ui &&ref) noexcept=default
 the move constructor
 
mem_uioperator= (const mem_ui &ref)=default
 assignement operator More...
 
mem_uioperator= (mem_ui &&ref) noexcept=default
 move operator
 
virtual ~mem_ui () noexcept(false)
 destructor More...
 

Protected Member Functions

entree_statsaccess_stats ()
 
void copy_detruits_from (const catalogue &ref)
 
const cat_eodget_r_eod_address () const
 
void swap_stuff (catalogue &ref)
 
- Protected Member Functions inherited from libdar::mem_ui
user_interactionget_ui () const
 get access to the user_interaction object More...
 
std::shared_ptr< user_interactionget_pointer () const
 get access to the shared_ptr pointing to the user_interaction More...
 

Private Member Functions

void partial_copy_from (const catalogue &ref)
 
void detruire ()
 

Private Attributes

cat_directorycontenu
 catalogue contents More...
 
path out_compare
 stores the missing directory structure, when extracting More...
 
cat_directorycurrent_compare
 points to the current directory when extracting More...
 
cat_directorycurrent_add
 points to the directory where to add the next file with add_file; More...
 
cat_directorycurrent_read
 points to the directory where the next item will be read More...
 
pathsub_tree
 path to sub_tree More...
 
signed int sub_count
 count the depth in of read routine in the sub_tree More...
 
entree_stats stats
 statistics catalogue contents More...
 
label ref_data_name
 name of the archive where is located the data More...
 
path in_place
 path of the directory used for root of the backup (at the time of the backup) More...
 

Static Private Attributes

static const cat_eod r_eod
 needed to return eod reference, without taking risk of saturating memory More...
 
static const U_I CAT_CRC_SIZE
 

Detailed Description

the catalogue class which gather all objects contained in a give archive

Definition at line 59 of file catalogue.hpp.

Constructor & Destructor Documentation

◆ catalogue()

libdar::catalogue::catalogue ( const catalogue ref)
inline

Definition at line 72 of file catalogue.hpp.

◆ ~catalogue()

virtual libdar::catalogue::~catalogue ( )
inlinevirtual

Definition at line 76 of file catalogue.hpp.

Member Function Documentation

◆ access_stats()

entree_stats & libdar::catalogue::access_stats ( )
inlineprotected

Definition at line 257 of file catalogue.hpp.

◆ drop_escape_layer()

virtual void libdar::catalogue::drop_escape_layer ( )
inlinevirtual

Definition at line 131 of file catalogue.hpp.

◆ get_contenu()

const cat_directory * libdar::catalogue::get_contenu ( ) const
inline

Definition at line 196 of file catalogue.hpp.

◆ get_current_add_dir()

const cat_directory & libdar::catalogue::get_current_add_dir ( ) const
inline

Definition at line 137 of file catalogue.hpp.

◆ get_current_reading_dir()

const cat_directory & libdar::catalogue::get_current_reading_dir ( ) const
inline

Definition at line 95 of file catalogue.hpp.

◆ get_data_name()

const label & libdar::catalogue::get_data_name ( ) const
inline

Definition at line 198 of file catalogue.hpp.

◆ get_escape_layer()

virtual escape * libdar::catalogue::get_escape_layer ( ) const
inlinevirtual

Definition at line 130 of file catalogue.hpp.

◆ get_in_place()

bool libdar::catalogue::get_in_place ( path arg) const

get the in_place path when available

Parameters
[out]argvalue of the in_place path
Returns
true if the catalogue has a valid in_place value else false is returned an the argument is undefined

◆ get_r_eod_address()

const cat_eod * libdar::catalogue::get_r_eod_address ( ) const
inlineprotected

Definition at line 260 of file catalogue.hpp.

◆ get_root_dir_last_modif()

datetime libdar::catalogue::get_root_dir_last_modif ( ) const
inline

Definition at line 201 of file catalogue.hpp.

◆ get_root_mtime()

datetime libdar::catalogue::get_root_mtime ( ) const
inline

Definition at line 209 of file catalogue.hpp.

◆ get_stats()

entree_stats libdar::catalogue::get_stats ( ) const
inline

Definition at line 191 of file catalogue.hpp.

◆ has_in_place()

bool libdar::catalogue::has_in_place ( ) const
inline

returns whether an in-place path is stored in the catalogue

Definition at line 240 of file catalogue.hpp.

References in_place, and libdar::path::is_absolute().

◆ is_empty()

bool libdar::catalogue::is_empty ( ) const
inline

whether the catalogue is empty or not

Definition at line 194 of file catalogue.hpp.

References contenu.

◆ is_subset_of()

bool libdar::catalogue::is_subset_of ( const catalogue ref) const

check whether all inode existing in the "this" and ref have the same attributes

Note
stops at the first inode found in both catalogue that do not match for at least one attribute including CRC for DATA, EA or FSA if present, then return false.

◆ launch_recursive_has_changed_update()

void libdar::catalogue::launch_recursive_has_changed_update ( ) const
inline

recursive evaluation of directories that have changed (make the cat_directory::get_recurisve_has_changed() method of entry in this catalogue meaningful)

Definition at line 204 of file catalogue.hpp.

References contenu, and libdar::cat_directory::recursive_has_changed_update().

◆ pre_add()

virtual void libdar::catalogue::pre_add ( const cat_entree ref,
const pile_descriptor *  dest = nullptr 
) const
inlinevirtual

catalogue extension routines for escape sequence

Definition at line 120 of file catalogue.hpp.

◆ pre_add_crc()

virtual void libdar::catalogue::pre_add_crc ( const cat_entree ref,
const pile_descriptor *  dest = nullptr 
) const
inlinevirtual

Definition at line 122 of file catalogue.hpp.

◆ pre_add_delta_sig()

virtual void libdar::catalogue::pre_add_delta_sig ( const pile_descriptor *  dest = nullptr) const
inlinevirtual

Definition at line 129 of file catalogue.hpp.

◆ pre_add_dirty()

virtual void libdar::catalogue::pre_add_dirty ( const pile_descriptor *  dest = nullptr) const
inlinevirtual

Definition at line 123 of file catalogue.hpp.

◆ pre_add_ea()

virtual void libdar::catalogue::pre_add_ea ( const cat_entree ref,
const pile_descriptor *  dest = nullptr 
) const
inlinevirtual

Definition at line 121 of file catalogue.hpp.

◆ pre_add_ea_crc()

virtual void libdar::catalogue::pre_add_ea_crc ( const cat_entree ref,
const pile_descriptor *  dest = nullptr 
) const
inlinevirtual

Definition at line 124 of file catalogue.hpp.

◆ pre_add_failed_mark()

virtual void libdar::catalogue::pre_add_failed_mark ( const pile_descriptor *  dest = nullptr) const
inlinevirtual

Definition at line 126 of file catalogue.hpp.

◆ pre_add_fsa()

virtual void libdar::catalogue::pre_add_fsa ( const cat_entree ref,
const pile_descriptor *  dest = nullptr 
) const
inlinevirtual

Definition at line 127 of file catalogue.hpp.

◆ pre_add_fsa_crc()

virtual void libdar::catalogue::pre_add_fsa_crc ( const cat_entree ref,
const pile_descriptor *  dest = nullptr 
) const
inlinevirtual

Definition at line 128 of file catalogue.hpp.

◆ pre_add_waste_mark()

virtual void libdar::catalogue::pre_add_waste_mark ( const pile_descriptor *  dest = nullptr) const
inlinevirtual

Definition at line 125 of file catalogue.hpp.

◆ read_second_time_dir()

virtual bool libdar::catalogue::read_second_time_dir ( ) const
inlinevirtual

Definition at line 111 of file catalogue.hpp.

◆ set_all_mirage_s_inode_wrote_field_to()

void libdar::catalogue::set_all_mirage_s_inode_wrote_field_to ( bool  val) const
inline

recursive setting of mirage inode_wrote flag

Definition at line 207 of file catalogue.hpp.

References contenu, and set_all_mirage_s_inode_wrote_field_to().

Referenced by set_all_mirage_s_inode_wrote_field_to().

◆ set_data_name()

void libdar::catalogue::set_data_name ( const label val)
inline

Definition at line 199 of file catalogue.hpp.

◆ set_to_unsaved_data_and_FSA()

void libdar::catalogue::set_to_unsaved_data_and_FSA ( )
inline

Definition at line 214 of file catalogue.hpp.

◆ swap_stuff()

void libdar::catalogue::swap_stuff ( catalogue ref)
protected

invert the data tree memory management responsibility pointed to by "contenu" pointers between the current catalogue and the catalogue given in argument.

◆ transfer_delta_signatures()

void libdar::catalogue::transfer_delta_signatures ( const pile_descriptor &  destination,
bool  sequential_read,
bool  build,
const mask delta_mask,
const infinint delta_sig_min_size,
const delta_sig_block_size signature_block_size 
)

copy delta signatures to the given stack and update the cat_file objects accordingly

Parameters
[in]destinationwhere to drop delta signatures
[in]sequential_readwhether we read the archive in sequential mode
[in]buildif set and delta signature is not present but data is available for a file, calculate the delta sig
[in]delta_maskdefines what files to calculate delta signature for when build is set to true
[in]delta_sig_min_sizeminimum size below which to never calculate delta signatures
[in]signature_block_sizeblock size to use for computing delta signatures
Note
this method relies on reset_read() and read()

◆ update_absent_with()

void libdar::catalogue::update_absent_with ( const catalogue ref,
infinint  aborting_next_etoile 
)

copy from ref missing files in "this" and mark then as "not_saved" (no change since reference)

in case of abortion, completes missing files as if what could not be inspected had not changed since the reference was done aborting_last_etoile is the highest etoile reference withing "this" current object.

◆ update_destroyed_with()

infinint libdar::catalogue::update_destroyed_with ( const catalogue ref)

add into "this" detruit object corresponding to object of ref absent in "this"

Note
ref must have the same directory tree "this", else the operation generates an exception

Member Data Documentation

◆ CAT_CRC_SIZE

const U_I libdar::catalogue::CAT_CRC_SIZE
staticprivate

Definition at line 285 of file catalogue.hpp.

◆ contenu

cat_directory* libdar::catalogue::contenu
private

catalogue contents

Definition at line 270 of file catalogue.hpp.

Referenced by is_empty(), launch_recursive_has_changed_update(), and set_all_mirage_s_inode_wrote_field_to().

◆ current_add

cat_directory* libdar::catalogue::current_add
mutableprivate

points to the directory where to add the next file with add_file;

Definition at line 273 of file catalogue.hpp.

◆ current_compare

cat_directory* libdar::catalogue::current_compare
mutableprivate

points to the current directory when extracting

Definition at line 272 of file catalogue.hpp.

◆ current_read

cat_directory* libdar::catalogue::current_read
mutableprivate

points to the directory where the next item will be read

Definition at line 274 of file catalogue.hpp.

◆ in_place

path libdar::catalogue::in_place
private

path of the directory used for root of the backup (at the time of the backup)

Definition at line 279 of file catalogue.hpp.

Referenced by has_in_place().

◆ out_compare

path libdar::catalogue::out_compare
mutableprivate

stores the missing directory structure, when extracting

Definition at line 271 of file catalogue.hpp.

◆ r_eod

const cat_eod libdar::catalogue::r_eod
staticprivate

needed to return eod reference, without taking risk of saturating memory

Definition at line 284 of file catalogue.hpp.

◆ ref_data_name

label libdar::catalogue::ref_data_name
private

name of the archive where is located the data

Definition at line 278 of file catalogue.hpp.

◆ stats

entree_stats libdar::catalogue::stats
private

statistics catalogue contents

Definition at line 277 of file catalogue.hpp.

◆ sub_count

signed int libdar::catalogue::sub_count
mutableprivate

count the depth in of read routine in the sub_tree

Definition at line 276 of file catalogue.hpp.

◆ sub_tree

path* libdar::catalogue::sub_tree
private

path to sub_tree

Definition at line 275 of file catalogue.hpp.


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