Loading...
Searching...
No Matches
libdar::catalogue Class Reference
Private

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

`#include <catalogue.hpp>`

Inherits libdar::mem_ui.

## 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
catalogue & | operator= (const catalogue &ref)
catalogue & | operator= (catalogue &&ref)=delete
void | set_early_memory_release ()
| reduce memory footprint releasing from memory catalogue parts
bool | get_early_memory_release () const
| get early memory release status
bool | get_memory_released () const
| return true if the catalogue has been released from memory
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)
virtual void | remove_last_read ()
| remove last read entry
const cat_directory & | get_current_reading_dir () const
virtual void | tail_catalogue_to_current_read (bool including_last_read)
virtual bool | read_second_time_dir () const
path | get_current_read_path () const
| return the <ROOT> based path of the current directory where reading is currently taking place
void | reset_add ()
virtual void | pre_add (const cat_entree *ref, const pile_descriptor *dest=nullptr) const
| catalogue extension routines for escape sequence
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 ()
virtual void | set_escape_layer (escape *ptr)
void | add (cat_entree *ref, bool addtostats=true)
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_directory & | get_current_add_dir () const
void | remove_in_current_add (const std::string &name)
| remove entry of given name that was added
void | reset_compare () const
bool | compare (const cat_entree *name, const cat_entree *&extracted) const
infinint | update_destroyed_with (const catalogue &ref, const path &fs_root, bool display_treated)
| add into "this" detruit object corresponding to object of ref absent in "this"
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)
void | drop_all_non_detruits ()
| remove/destroy from "this" all objects that are neither directory nor detruit objects
void | drop_all_ea_and_fsa ()
| remove all EA and FSA (they get flagged as "partial" if they had "full" status
bool | is_subset_of (const catalogue &ref) const
| check whether all inode existing in the "this" and ref have the same attributes
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
const cat_directory * | get_contenu () const
const label & | get_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)
void | set_all_mirage_s_inode_wrote_field_to (bool val) const
| recursive setting of mirage inode_wrote flag
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
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
bool | get_in_place (path &arg) const
| get the in_place path when available
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
| mem_ui (const mem_ui &ref)=default
| the copy constructor
| mem_ui (mem_ui &&ref) noexcept=default
| the move constructor
mem_ui & | operator= (const mem_ui &ref)=default
| assignement operator
mem_ui & | operator= (mem_ui &&ref) noexcept=default
| move operator
virtual | ~mem_ui () noexcept(false)
| destructor

## Protected Member Functions

entree_stats & | access_stats ()
void | copy_detruits_from (const catalogue &ref)
const cat_eod * | get_r_eod_address () const
void | swap_stuff (catalogue &ref)
bool | is_mem_released () const
| provide to inherited class the access to the early mem release mode and fields
void | set_mem_released ()
| let inherited class tell when memory release has completed
Protected Member Functions inherited from libdar::mem_ui
user_interaction & | get_ui () const
| get access to the user_interaction object
std::shared_ptr< user_interaction > | get_pointer () const
| get access to the shared_ptr pointing to the user_interaction
void | change_ui (const std::shared_ptr< user_interaction > &new_dialog)
| change the user_interaction object

## Private Member Functions

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

## Private Attributes

cat_directory * | contenu
| catalogue contents
path | out_compare
| stores the missing directory structure, when extracting
cat_directory * | current_compare
| points to the current directory when comparing
cat_directory * | current_add
| points to the directory where to add the next file with add_file;
cat_directory * | current_read
| points to the directory where the next item will be read
path * | sub_tree
| path to sub_tree
signed int | sub_count
| count the depth in of read routine in the sub_tree
entree_stats | stats
| statistics catalogue contents
label | ref_data_name
| name of the archive where is located the data
path | in_place
| path of the directory used for root of the backup (at the time of the backup)
bool | early_mem_release
| whether to release memory as soon as possible
bool | mem_released
| wether the catalogue content has been released and the object is no more usable
escape * | faked_escape
| used when reading an archive with the help of an isolated catalog to keep trace of the sequential read mode if any

## Static Private Attributes

static const cat_eod | r_eod
| needed to return eod reference, without taking risk of saturating memory
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 | ( |  | ) |

inline virtual

Definition at line 76 of file catalogue.hpp.

## Member Function Documentation

## access_stats()

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

inline protected

Definition at line 284 of file catalogue.hpp.

## drop_all_ea_and_fsa()

void libdar::catalogue::drop_all_ea_and_fsa | ( |  | ) |

inline

remove all EA and FSA (they get flagged as "partial" if they had "full" status

Definition at line 204 of file catalogue.hpp.

References contenu.

## drop_escape_layer()

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

inline virtual

Definition at line 153 of file catalogue.hpp.

## get_contenu()

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

inline

Definition at line 223 of file catalogue.hpp.

## get_current_add_dir()

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

inline

Definition at line 160 of file catalogue.hpp.

## get_current_reading_dir()

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

inline

Definition at line 120 of file catalogue.hpp.

## get_data_name()

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

inline

Definition at line 225 of file catalogue.hpp.

## get_early_memory_release()

bool libdar::catalogue::get_early_memory_release | ( |  | ) | const

inline

get early memory release status

Definition at line 95 of file catalogue.hpp.

References early_mem_release.

## get_escape_layer()

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

inline virtual

Definition at line 152 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] | arg | value 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_memory_released()

bool libdar::catalogue::get_memory_released | ( |  | ) | const

inline

return true if the catalogue has been released from memory

Definition at line 98 of file catalogue.hpp.

References mem_released.

## get_r_eod_address()

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

inline protected

Definition at line 287 of file catalogue.hpp.

## get_root_dir_last_modif()

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

inline

Definition at line 228 of file catalogue.hpp.

## get_root_mtime()

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

inline

Definition at line 236 of file catalogue.hpp.

## get_stats()

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

inline

Definition at line 218 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 267 of file catalogue.hpp.

References in_place.

## is_empty()

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

inline

whether the catalogue is empty or not

Definition at line 221 of file catalogue.hpp.

References contenu.

## is_mem_released()

bool libdar::catalogue::is_mem_released | ( |  | ) | const

inline protected

provide to inherited class the access to the early mem release mode and fields

Definition at line 297 of file catalogue.hpp.

References mem_released.

## 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 231 of file catalogue.hpp.

References contenu.

## pre_add()

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

inline virtual

catalogue extension routines for escape sequence

Definition at line 142 of file catalogue.hpp.

## pre_add_crc()

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

inline virtual

Definition at line 144 of file catalogue.hpp.

## pre_add_delta_sig()

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

inline virtual

Definition at line 151 of file catalogue.hpp.

## pre_add_dirty()

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

inline virtual

Definition at line 145 of file catalogue.hpp.

## pre_add_ea()

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

inline virtual

Definition at line 143 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

inline virtual

Definition at line 146 of file catalogue.hpp.

## pre_add_failed_mark()

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

inline virtual

Definition at line 148 of file catalogue.hpp.

## pre_add_fsa()

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

inline virtual

Definition at line 149 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

inline virtual

Definition at line 150 of file catalogue.hpp.

## pre_add_waste_mark()

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

inline virtual

Definition at line 147 of file catalogue.hpp.

## read_second_time_dir()

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

inline virtual

Definition at line 130 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 234 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 226 of file catalogue.hpp.

## set_early_memory_release()

void libdar::catalogue::set_early_memory_release | ( |  | ) |

inline

reduce memory footprint releasing from memory catalogue parts

Note
  this only apply to read and compare relative operations and behaves the in following way: when reading a directory and exiting a directory (to read another entry a the parent level), this directory and all its content is removed from memory, this frees memory sooner but also forget about the existence of such directory.
  this option is not compatible when using a catalogue as reference as it is not possible anymore to detect which file have been removed since the backup of reference was made.
  if the reading process is reset if has completed, the catalogue is no more usable. Same thing when comparing. Thus you cannot perform new operation like the 'on-fly-isolate' of the dar command line.

Definition at line 92 of file catalogue.hpp.

References early_mem_release.

## set_escape_layer()

virtual void libdar::catalogue::set_escape_layer | ( | escape * | ptr | ) |

inline virtual

Definition at line 154 of file catalogue.hpp.

## set_mem_released()

void libdar::catalogue::set_mem_released | ( |  | ) |

inline protected

let inherited class tell when memory release has completed

Definition at line 300 of file catalogue.hpp.

References mem_released.

## set_to_unsaved_data_and_FSA()

void libdar::catalogue::set_to_unsaved_data_and_FSA | ( |  | ) |

inline

Definition at line 241 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] | destination | where to drop delta signatures
  [in] | sequential_read | whether we read the archive in sequential mode
  [in] | build | if set and delta signature is not present but data is available for a file, calculate the delta sig
  [in] | delta_mask | defines what files to calculate delta signature for when build is set to true
  [in] | delta_sig_min_size | minimum size below which to never calculate delta signatures
  [in] | signature_block_size | block 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,
|  | const path & | fs_root,
|  | bool | display_treated )

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

static private

Definition at line 321 of file catalogue.hpp.

## contenu

cat_directory* libdar::catalogue::contenu

private

catalogue contents

Definition at line 303 of file catalogue.hpp.

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

## current_add

cat_directory* libdar::catalogue::current_add

mutable private

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

Definition at line 306 of file catalogue.hpp.

## current_compare

cat_directory* libdar::catalogue::current_compare

mutable private

points to the current directory when comparing

Definition at line 305 of file catalogue.hpp.

## current_read

cat_directory* libdar::catalogue::current_read

mutable private

points to the directory where the next item will be read

Definition at line 307 of file catalogue.hpp.

Referenced by remove_last_read().

## early_mem_release

bool libdar::catalogue::early_mem_release

private

whether to release memory as soon as possible

Definition at line 313 of file catalogue.hpp.

Referenced by get_early_memory_release(), and set_early_memory_release().

## faked_escape

escape* libdar::catalogue::faked_escape

private

used when reading an archive with the help of an isolated catalog to keep trace of the sequential read mode if any

Definition at line 315 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 312 of file catalogue.hpp.

Referenced by has_in_place().

## mem_released

bool libdar::catalogue::mem_released

mutable private

wether the catalogue content has been released and the object is no more usable

Definition at line 314 of file catalogue.hpp.

Referenced by get_memory_released(), is_mem_released(), and set_mem_released().

## out_compare

path libdar::catalogue::out_compare

mutable private

stores the missing directory structure, when extracting

Definition at line 304 of file catalogue.hpp.

## r_eod

const cat_eod libdar::catalogue::r_eod

static private

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

Definition at line 320 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 311 of file catalogue.hpp.

## stats

entree_stats libdar::catalogue::stats

private

statistics catalogue contents

Definition at line 310 of file catalogue.hpp.

Referenced by clear_in_place(), and dump().

## sub_count

signed int libdar::catalogue::sub_count

mutable private

count the depth in of read routine in the sub_tree

Definition at line 309 of file catalogue.hpp.

## sub_tree

path* libdar::catalogue::sub_tree

private

path to sub_tree

Definition at line 308 of file catalogue.hpp.

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

- catalogue.hpp