Disk ARchive 2.7.16
Full featured and portable backup and archiving tool
|
the data_tree class stores presence of a given file in a set of archives More...
#include <data_tree.hpp>
Public Member Functions | |
data_tree (const std::string &name) | |
data_tree (generic_file &f, unsigned char db_version) | |
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 |
virtual void | dump (generic_file &f) const |
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) |
virtual bool | check_order (user_interaction &dialog, const path ¤t_path, bool &initial_warn) const |
check date order between archives withing the database ; throw Erange if problem found with date order More... | |
virtual void | finalize (const archive_num &archive, const datetime &deleted_date, const archive_num &ignore_archive_greater_or_equal) |
add deleted entry if no object of the current archive exist and the entry of the previous archive is already present. More... | |
virtual bool | remove_all_from (const archive_num &archive_to_remove, const archive_num &last_archive) |
return true if the corresponding file is no more located in any archive (thus, the object is no more usefull in the base) More... | |
void | listing (database_listing_get_version_callback callback, void *tag) const |
list where is saved this file | |
virtual void | apply_permutation (archive_num src, archive_num dst) |
virtual void | skip_out (archive_num num) |
decrement archive numbers above num More... | |
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 |
virtual char | obj_signature () const |
virtual bool | fix_corruption () |
Static Public Member Functions | |
static char | signature () |
Private Member Functions | |
template<class T > | |
bool | check_map_order (user_interaction &dialog, const std::map< archive_num, T > the_map, const path ¤t_path, const std::string &field_nature, bool &initial_warn) const |
bool | check_delta_validity () |
Static Private Member Functions | |
static archive_num | data_tree_permutation (archive_num src, archive_num dst, archive_num x) |
gives new archive number when an database has its archive reordered More... | |
static void | display_line (database_listing_get_version_callback callback, void *tag, archive_num num, const datetime *data, db_etat data_presence, const datetime *ea, db_etat ea_presence) |
helper method to provide information to a database_listing_get_version_callback | |
Private Attributes | |
std::string | filename |
std::map< archive_num, status_plus > | last_mod |
std::map< archive_num, status > | last_change |
Static Private Attributes | |
static constexpr const char *const | ETAT_SAVED = "S" |
static constexpr const char *const | ETAT_PATCH = "O" |
static constexpr const char *const | ETAT_PATCH_UNUSABLE = "U" |
static constexpr const char *const | ETAT_PRESENT = "P" |
static constexpr const char *const | ETAT_REMOVED = "R" |
static constexpr const char *const | ETAT_ABSENT = "A" |
static constexpr const char *const | ETAT_INODE = "I" |
static constexpr unsigned char | STATUS_PLUS_FLAG_ME = 0x01 |
static constexpr unsigned char | STATUS_PLUS_FLAG_REF = 0x02 |
the data_tree class stores presence of a given file in a set of archives
the data associated to a given file are the different modification dates that this file has been found in the archive the database has been feed by
Definition at line 53 of file data_tree.hpp.
|
inlinevirtual |
check date order between archives withing the database ; throw Erange if problem found with date order
Reimplemented in libdar::data_dir.
Definition at line 100 of file data_tree.hpp.
|
staticprivate |
gives new archive number when an database has its archive reordered
[in] | src | the archive number to move |
[in] | dst | the new position of the archive number given by src |
[in] | x | any archive number in the database, which new position is to be calculated in regard to the src -> dst move |
|
virtual |
add deleted entry if no object of the current archive exist and the entry of the previous archive is already present.
[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 in libdar::data_dir.
db_lookup libdar::data_tree::get_data | ( | std::set< archive_num > & | archive, |
const datetime & | date, | ||
bool | even_when_removed | ||
) | const |
returns the archives to restore in order to obtain the data that was defined just before (or at) the given date
[out] | archive | is the set of archive to restore in sequence to obtain the requested data |
[in] | date | date above which to ignore data found in the database |
[in] | even_when_removed | is true when user requested to restore the file in its latest state even if it has been removed afterward |
|
inline |
Definition at line 65 of file data_tree.hpp.
|
inlinevirtual |
Definition at line 130 of file data_tree.hpp.
|
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 in libdar::data_dir.
|
inline |
Definition at line 87 of file data_tree.hpp.
|
inline |
Definition at line 91 of file data_tree.hpp.
|
inline |
Definition at line 97 of file data_tree.hpp.
|
inline |
Definition at line 66 of file data_tree.hpp.
|
inlinestatic |
Definition at line 131 of file data_tree.hpp.
|
virtual |
decrement archive numbers above num
Reimplemented in libdar::data_dir.
|
staticconstexprprivate |
Definition at line 143 of file data_tree.hpp.
|
staticconstexprprivate |
Definition at line 144 of file data_tree.hpp.
|
staticconstexprprivate |
Definition at line 139 of file data_tree.hpp.
|
staticconstexprprivate |
Definition at line 140 of file data_tree.hpp.
|
staticconstexprprivate |
Definition at line 141 of file data_tree.hpp.
|
staticconstexprprivate |
Definition at line 142 of file data_tree.hpp.
|
staticconstexprprivate |
Definition at line 138 of file data_tree.hpp.
|
private |
Definition at line 195 of file data_tree.hpp.
|
private |
Definition at line 197 of file data_tree.hpp.
|
private |
Definition at line 196 of file data_tree.hpp.
|
staticconstexprprivate |
Definition at line 146 of file data_tree.hpp.
|
staticconstexprprivate |
Definition at line 147 of file data_tree.hpp.