| Disk ARchive 2.8.3 Full featured and portable backup and archiving tool

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
libdar::data_dir Class Reference
Private

the data_dir class inherits from data_tree and holds the directory tree's parent relationship More...

`#include <data_dir.hpp>`

Inherits libdar::data_tree.

## Public Member Functions
| data_dir (const std::string &name)
| data_dir (generic_file &f, unsigned char db_version)
| does not read signature
| data_dir (const data_tree &ref)
| data_dir (const data_dir &ref)
| data_dir (data_dir &&ref)=default
data_dir & | operator= (const data_dir &ref)
data_dir & | operator= (data_dir &&ref) noexcept=default
virtual void | dump (generic_file &f) const override
| write signature followed by data constructor will read
void | add (const cat_inode *entry, const archive_num &archive)
void | add (const cat_detruit *entry, const archive_num &archive)
const data_tree * | read_child (const std::string &name) const
void | read_all_children (std::vector< std::string > &fils) const
void | finalize_except_self (const archive_num &archive, const datetime &deleted_date, const archive_num &ignore_archives_greater_or_equal)
virtual bool | check_order (user_interaction &dialog, const path &current_path, bool &initial_warn) const override
| check date order between archives withing the database ; throw Erange if problem found with date order
virtual void | finalize (const archive_num &archive, const datetime &deleted_date, const archive_num &ignore_archives_greater_or_equal) override
| add deleted entry if no object of the current archive exist and the entry of the previous archive is already present.
virtual bool | remove_all_from (const archive_num &archive_to_remove, const archive_num &last_archive) override
| return true if the corresponding file is no more located in any archive (thus, the object is no more usefull in the base)
void | show (database_listing_show_files_callback callback, void *tag, archive_num num, std::string marge="") const
| list the most recent files owned by that archive (or by any archive if num == 0)
virtual void | apply_permutation (archive_num src, archive_num dst) override
virtual void | skip_out (archive_num num) override
| decrement archive numbers above num
virtual void | compute_most_recent_stats (std::deque< infinint > &data, std::deque< infinint > &ea, std::deque< infinint > &total_data, std::deque< infinint > &total_ea, const datetime &ingore_older_than_that) const override
| provide a summary of the latest version of file and ea per archive number of the database
virtual void | compute_restoration_needed_archives (std::deque< infinint > &data, std::deque< infinint > &ea, std::deque< infinint > &total_data, std::deque< infinint > &total_ea, const datetime &ignore_older_than_that) const override
| provide a summary of the archives that will be required to restore the data in the latest state
virtual char | obj_signature () const override
virtual bool | fix_corruption () override
bool | data_tree_find (path chemin, const data_tree *&ptr) const
| lookup routine to find a pointer to the dat_tree object corresponding to the given path
void | data_tree_update_with (const cat_directory *dir, archive_num archive)
| add a directory to the dat_dir
Public Member Functions inherited from libdar::data_tree
| data_tree (const std::string &name)
| data_tree (generic_file &f, unsigned char db_version)
| constructor does not read signature
| data_tree (const data_tree &ref)=default
| data_tree (data_tree &&ref) noexcept=default
data_tree & | operator= (const data_tree &ref)=default
data_tree & | operator= (data_tree &&ref) noexcept=default
std::string | get_name () const
void | set_name (const std::string &name)
db_lookup | get_data (std::set< archive_num > &archive, const datetime &date, bool even_when_removed) const
db_lookup | get_EA (archive_num &archive, const datetime &date, bool even_when_removed) const
| if EA has been saved alone later, returns in which version for the state of the file at the given date.
bool | read_data (archive_num num, datetime &val, db_etat &present) const
| return the date of file's last modification date within the give archive and whether the file has been saved or deleted
bool | read_EA (archive_num num, datetime &val, db_etat &present) const
| return the date of last inode change and whether the EA has been saved or deleted
void | set_data (const archive_num &archive, const datetime &date, db_etat present)
void | set_data (const archive_num &archive, const datetime &date, db_etat present, const crc *base, const crc *result)
void | set_EA (const archive_num &archive, const datetime &date, db_etat present)
void | listing (database_listing_get_version_callback callback, void *tag) const
| list where is saved this file

## Static Public Member Functions
static char | signature ()
static data_dir * | data_tree_read (generic_file &f, unsigned char db_version)
| read a signature and then run the data_dir constructor but aborts if not a data_dir
Static Public Member Functions inherited from libdar::data_tree
static char | signature ()

## Private Member Functions
void | add_child (data_tree *fils)
| "this" is now responsible of "fils" disalocation
void | remove_child (const std::string &name)
data_tree * | find_or_addition (const std::string &name, bool is_dir, const archive_num &archive)

## Static Private Member Functions
static data_tree * | read_next_in_list_from_file (generic_file &f, unsigned char db_version)
| read signature and depening on it run data_tree or data_dir constructor

## Private Attributes
std::deque< data_tree * > | rejetons
| subdir and subfiles of the current dir

## Detailed Description

the data_dir class inherits from data_tree and holds the directory tree's parent relationship

Definition at line 52 of file data_dir.hpp.

## Member Function Documentation

## ◆ apply_permutation()

virtual void libdar::data_dir::apply_permutation | ( | archive_num | src,
|  | archive_num | dst )
| override virtual

Reimplemented from libdar::data_tree.

## ◆ check_order()

virtual bool libdar::data_dir::check_order | ( | user_interaction & | dialog,
|  | const path & | current_path,
|  | bool & | initial_warn ) const
| override virtual

check date order between archives withing the database ; throw Erange if problem found with date order

Reimplemented from libdar::data_tree.

## ◆ compute_most_recent_stats()

virtual void libdar::data_dir::compute_most_recent_stats | ( | std::deque< infinint > & | data,
|  | std::deque< infinint > & | ea,
|  | std::deque< infinint > & | total_data,
|  | std::deque< infinint > & | total_ea,
|  | const datetime & | ignore_older_than_that ) const
| override virtual

provide a summary of the latest version of file and ea per archive number of the database

Parameters

  [out] | data | is a table indexed by archive num providing the number latest data version per archive
  [out] | ea | is a table indexed by archive num providing the number latest EA version per archive
  [out] | total_data | is a table indexed by archive providing the total number of entries with data, archive per archive (most recent and older)
  [out] | total_ea | is a table indexed by archive num providing the total number of entries with EA, archive per archive (most recent and older)
  [in] | ignore_older_than_that | if not null date, ignore data et EA versions strictly more recent than this date

Note
  the provided four fields that will receive table of counters per archive should be initialized by the caller as this is a recursive call with data_dir that increment the counter recursively.

Reimplemented from libdar::data_tree.

## ◆ compute_restoration_needed_archives()

virtual void libdar::data_dir::compute_restoration_needed_archives | ( | std::deque< infinint > & | data,
|  | std::deque< infinint > & | ea,
|  | std::deque< infinint > & | total_data,
|  | std::deque< infinint > & | total_ea,
|  | const datetime & | ignore_older_than_that ) const
| override virtual

provide a summary of the archives that will be required to restore the data in the latest state

Note
  if ignore_older_than_that is set, the result concerns the latest state for the provided date and ignores data from a more recent state.

Reimplemented from libdar::data_tree.

## ◆ data_tree_find()

bool libdar::data_dir::data_tree_find | ( | path | chemin,
|  | const data_tree *& | ptr ) const

lookup routine to find a pointer to the dat_tree object corresponding to the given path

Parameters

  [in] | chemin | is the path to look for
  [out] | ptr | is a pointer to the looked node, if found

Returns
  true if a node could be found in the database

## ◆ data_tree_read()

data_dir * libdar::data_dir::data_tree_read | ( | generic_file & | f,
|  | unsigned char | db_version )
| static

read a signature and then run the data_dir constructor but aborts if not a data_dir

Note
  the constructors of data_tree and data_dir do not read the signature because its purpose it to know whether the following is a data_dir or data_tree dump() result.

## ◆ dump()

virtual void libdar::data_dir::dump | ( | generic_file & | f | ) | const
| override virtual

write signature followed by data constructor will read

Reimplemented from libdar::data_tree.

## ◆ finalize()

virtual void libdar::data_dir::finalize | ( | const archive_num & | archive,
|  | const datetime & | deleted_date,
|  | const archive_num & | ignore_archive_greater_or_equal )
| override virtual

add deleted entry if no object of the current archive exist and the entry of the previous archive is already present.

Parameters

  [in] | archive | is the number of the archive to finalize
  [in] | deleted_date | date of deletion to use for inode removal when no information can be grabbed from the archive (this date is taken from the parent dir last modification date)
  [in] | ignore_archive_greater_or_equal | ignore archives which number is greater or equal than "ignore_archive_greater_or_equal" as if they were not present in the database. If set to zero, no archive is ignored.

Reimplemented from libdar::data_tree.

## ◆ fix_corruption()

virtual bool libdar::data_dir::fix_corruption | ( |  | ) |
| override virtual

Reimplemented from libdar::data_tree.

## ◆ obj_signature()

virtual char libdar::data_dir::obj_signature | ( |  | ) | const
| inline override virtual

Reimplemented from libdar::data_tree.

Definition at line 98 of file data_dir.hpp.

## ◆ operator=()

data_dir & libdar::data_dir::operator= | ( | const data_dir & | ref | ) |
| inline

Definition at line 60 of file data_dir.hpp.

## ◆ remove_all_from()

virtual bool libdar::data_dir::remove_all_from | ( | const archive_num & | archive_to_remove,
|  | const archive_num & | last_archive )
| override virtual

return true if the corresponding file is no more located in any archive (thus, the object is no more usefull in the base)

Reimplemented from libdar::data_tree.

## ◆ signature()

char libdar::data_dir::signature | ( |  | ) |
| inline static

Definition at line 99 of file data_dir.hpp.

## ◆ skip_out()

virtual void libdar::data_dir::skip_out | ( | archive_num | num | ) |
| override virtual

decrement archive numbers above num

Reimplemented from libdar::data_tree.

## Member Data Documentation

## ◆ rejetons

std::deque<data_tree *> libdar::data_dir::rejetons
| private

subdir and subfiles of the current dir

Definition at line 122 of file data_dir.hpp.

Referenced by data_dir().

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

- data_dir.hpp