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

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

#include <i_database.hpp>

+ Inheritance diagram for libdar::database::i_database:
+ Collaboration diagram for libdar::database::i_database:

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_databaseoperator= (const i_database &ref)=delete
 disabling assignement operator
 
i_databaseoperator= (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 More...
 
void set_dar_path (const std::string &chemin)
 change the path to dar command More...
 
void set_compression (compression algozip) const
 change compression to use when storing base on file More...
 
void set_compression_level (U_I level) const
 change the compression level to use when storing base in file More...
 
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 More...
 
std::string get_dar_path () const
 returns the path for dar More...
 
compression get_compression () const
 returns the compression algorithm used on filesystem More...
 
U_I get_compression_level () const
 returns the compression level used on file More...
 
std::string get_database_version () const
 return the database format version More...
 
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
 
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 More...
 
- 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...
 

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 datetimeget_root_last_mod (const archive_num &num) const
 

Private Attributes

std::deque< struct archive_datacoordinate
 list of archive used to build the database More...
 
std::vector< std::string > options_to_dar
 options to use when calling dar for restoration More...
 
std::string dar_path
 path to dar More...
 
data_dirfiles
 structure containing files and their status in the set of archive used for that database (is set to nullptr in partial mode) More...
 
storagedata_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) More...
 
bool check_order_asked
 whether order check has been asked More...
 
unsigned char cur_db_version
 current db version (for informational purposes) More...
 
compression algo
 compression used/to use when writing down the base to file More...
 
U_I compr_level
 the compression level to use More...
 

Additional Inherited Members

- 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...
 

Detailed Description

the class i_database is the implementation of class database

Definition at line 52 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 155 of file i_database.hpp.

References files.

◆ get_compression()

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

returns the compression algorithm used on filesystem

Definition at line 125 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 128 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 122 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 131 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 119 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 105 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 108 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 102 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 99 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 185 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 183 of file i_database.hpp.

◆ compr_level

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

the compression level to use

Definition at line 186 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 178 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 184 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 180 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 182 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 181 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 179 of file i_database.hpp.

Referenced by get_options(), and set_options().


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