Disk ARchive: libdar::database::i_database Class Reference

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

Loading...
Searching...
No Matches
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
libdar::database::i_database Class Reference
Private

the class i_database is the implementation of class database More...

`#include <i_database.hpp>`

Inherits libdar::mem_ui.

## Classes
struct | archive_data
| holds the archive used to create the database More...

## Public Member Functions
| i_database (const std::shared_ptr< user_interaction > &dialog)
| this constructor build an empty database
| i_database (const std::shared_ptr< user_interaction > &dialog, const std::string &base, const database_open_options &opt)
| this constructor reads i_database from a file
| i_database (const i_database &ref)=delete
| disabling copy constructor
| i_database (i_database &&ref) noexcept=delete
| disabling move constructor
i_database & | operator= (const i_database &ref)=delete
| disabling assignement operator
i_database & | operator= (i_database &&ref) noexcept=delete
| disabling move assignment operator
| ~i_database ()
| i_database destructor (no implicit file saving)
void | dump (const std::string &filename, const database_dump_options &opt) const
| write the database to a file (see database_header first)
void | add_archive (const archive &arch, const std::string &chemin, const std::string &basename, const database_add_options &opt)
| add an archive to the database
void | remove_archive (archive_num min, archive_num max, const database_remove_options &opt)
| remove an archive from a database
void | set_permutation (archive_num src, archive_num dst)
| change order of archive within the database
void | change_name (archive_num num, const std::string &basename, const database_change_basename_options &opt)
| change one's archive basename recorded in the database
void | set_path (archive_num num, const std::string &chemin, const database_change_path_options &opt)
| change one's archive path recorded in the database
void | set_options (const std::vector< std::string > &opt)
| change the default options given to dar when performing restoration
void | set_dar_path (const std::string &chemin)
| change the path to dar command
void | set_compression (compression algozip) const
| change compression to use when storing base on file
void | set_compression_level (U_I level) const
| change the compression level to use when storing base in file
database_archives_list | get_contents () const
| provides the list of archive used to build the database
std::vector< std::string > | get_options () const
| return the options used with dar for restoration
std::string | get_dar_path () const
| returns the path for dar
compression | get_compression () const
| returns the compression algorithm used on filesystem
U_I | get_compression_level () const
| returns the compression level used on file
std::string | get_database_version () const
| return the database format version
void | get_files (database_listing_show_files_callback callback, void *context, archive_num num, const database_used_options &opt) const
| list files which are present in a given archive
void | get_version (database_listing_get_version_callback callback, void *context, path chemin) const
| list the archive where a give file is present
void | show_most_recent_stats (database_listing_statistics_callback callback, void *context) const
| compute some statistics about the location of most recent file versions
void | restore (const std::vector< std::string > &filename, const database_restore_options &opt)
| restore files calling dar on the appropriated archive
void | restore (const archive_options_read &read_options, const path &fs_root, archive_options_extract extract_options, const database_restore_options &opt, statistics *progressive_report)
| restore files calling libdar directly rather than spawning dar CLI and parsing options as CLI
bool | check_order () const
| check that all files's Data and EA are more recent when archive number grows within the database, only warn the user
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

## Private Member Functions
void | build (generic_file &f, bool partial, bool read_only, unsigned char db_version)
| used by constructors
archive_num | get_real_archive_num (archive_num num, bool revert) const
const datetime & | get_root_last_mod (const archive_num &num) const

## Private Attributes
std::deque< struct archive_data > | coordinate
| list of archive used to build the database
std::vector< std::string > | options_to_dar
| options to use when calling dar for restoration
std::string | dar_path
| path to dar
data_dir * | files
| structure containing files and their status in the set of archive used for that database (is set to nullptr in partial mode)
storage * | data_files
| when reading archive in partial mode, this is where is located the "not readed" part of the archive (is set to nullptr in partial-read-only mode)
bool | check_order_asked
| whether order check has been asked
unsigned char | cur_db_version
| current db version (for informational purposes)
compression | algo
| compression used/to use when writing down the base to file
U_I | compr_level
| the compression level to use

## Additional Inherited Members
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

## Detailed Description

the class i_database is the implementation of class database

Definition at line 54 of file i_database.hpp.

## Member Function Documentation

## ◆ check_order()

bool libdar::database::i_database::check_order | ( |  | ) | const
| inline

check that all files's Data and EA are more recent when archive number grows within the database, only warn the user

Definition at line 165 of file i_database.hpp.

References check_order_asked, files, and libdar::mem_ui::get_ui().

## ◆ get_compression()

compression libdar::database::i_database::get_compression | ( |  | ) | const
| inline

returns the compression algorithm used on filesystem

Definition at line 127 of file i_database.hpp.

References algo.

## ◆ get_compression_level()

U_I libdar::database::i_database::get_compression_level | ( |  | ) | const
| inline

returns the compression level used on file

Definition at line 130 of file i_database.hpp.

References compr_level.

## ◆ get_dar_path()

std::string libdar::database::i_database::get_dar_path | ( |  | ) | const
| inline

returns the path for dar

Definition at line 124 of file i_database.hpp.

References dar_path.

## ◆ get_database_version()

std::string libdar::database::i_database::get_database_version | ( |  | ) | const
| inline

return the database format version

Definition at line 133 of file i_database.hpp.

References cur_db_version.

## ◆ get_options()

std::vector< std::string > libdar::database::i_database::get_options | ( |  | ) | const
| inline

return the options used with dar for restoration

Definition at line 121 of file i_database.hpp.

References options_to_dar.

## ◆ set_compression()

void libdar::database::i_database::set_compression | ( | compression | algozip | ) | const
| inline

change compression to use when storing base on file

Definition at line 107 of file i_database.hpp.

References algo.

## ◆ set_compression_level()

void libdar::database::i_database::set_compression_level | ( | U_I | level | ) | const
| inline

change the compression level to use when storing base in file

Definition at line 110 of file i_database.hpp.

References compr_level.

## ◆ set_dar_path()

void libdar::database::i_database::set_dar_path | ( | const std::string & | chemin | ) |
| inline

change the path to dar command

Definition at line 104 of file i_database.hpp.

References dar_path.

## ◆ set_options()

void libdar::database::i_database::set_options | ( | const std::vector< std::string > & | opt | ) |
| inline

change the default options given to dar when performing restoration

Definition at line 101 of file i_database.hpp.

References options_to_dar.

## Member Data Documentation

## ◆ algo

compression libdar::database::i_database::algo
| mutableprivate

compression used/to use when writing down the base to file

Definition at line 195 of file i_database.hpp.

Referenced by get_compression(), and set_compression().

## ◆ check_order_asked

bool libdar::database::i_database::check_order_asked
| private

whether order check has been asked

Definition at line 193 of file i_database.hpp.

Referenced by check_order().

## ◆ compr_level

U_I libdar::database::i_database::compr_level
| mutableprivate

the compression level to use

Definition at line 196 of file i_database.hpp.

Referenced by get_compression_level(), and set_compression_level().

## ◆ coordinate

std::deque<struct archive_data> libdar::database::i_database::coordinate
| private

list of archive used to build the database

Definition at line 188 of file i_database.hpp.

## ◆ cur_db_version

unsigned char libdar::database::i_database::cur_db_version
| private

current db version (for informational purposes)

Definition at line 194 of file i_database.hpp.

Referenced by get_database_version().

## ◆ dar_path

std::string libdar::database::i_database::dar_path
| private

path to dar

Definition at line 190 of file i_database.hpp.

Referenced by get_dar_path(), and set_dar_path().

## ◆ data_files

storage* libdar::database::i_database::data_files
| private

when reading archive in partial mode, this is where is located the "not readed" part of the archive (is set to nullptr in partial-read-only mode)

Definition at line 192 of file i_database.hpp.

## ◆ files

data_dir* libdar::database::i_database::files
| private

structure containing files and their status in the set of archive used for that database (is set to nullptr in partial mode)

Definition at line 191 of file i_database.hpp.

Referenced by check_order().

## ◆ options_to_dar

std::vector<std::string> libdar::database::i_database::options_to_dar
| private

options to use when calling dar for restoration

Definition at line 189 of file i_database.hpp.

Referenced by get_options(), and set_options().

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

- i_database.hpp