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

Loading...
Searching...
No Matches
Public Member Functions | Static Private Member Functions | List of all members
libdar5::database Class Reference
API5

the database class defines the dar_manager database More...

`#include <database5.hpp>`

Inherits libdar::database.

## Public Member Functions
| database (user_interaction &dialog, const std::string &base, const database_open_options &opt)
| database (const database &ref)=delete
| disabling copy constructor
| database (database &&ref) noexcept=delete
| disabling move constructor
database & | operator= (const database &ref)=delete
| disabling assignement operator
database & | operator= (database &&ref) noexcept=delete
| disabling move assignment operator
| ~database ()=default
| database destructor (no implicit file saving)
void | dump (user_interaction &dialog, const std::string &filename, const database_dump_options &opt) const
void | show_contents (user_interaction &dialog) const
| show the list of archive used to build the database
void | show_files (user_interaction &dialog, archive_num num, const database_used_options &opt) const
| list files which are present in a given archive
void | show_version (user_interaction &dialog, path chemin) const
| list the archive where a give file is present
void | show_most_recent_stats (user_interaction &dialog) const
| compute some statistics about the location of most recent file versions
void | restore (user_interaction &dialog, const std::vector< std::string > &filename, const database_restore_options &opt)
bool | check_order (user_interaction &dialog) const
Public Member Functions inherited from libdar::database
| database (const std::shared_ptr< user_interaction > &dialog)
| this constructor build an empty database
| database (const std::shared_ptr< user_interaction > &dialog, const std::string &base, const database_open_options &opt)
| this constructor reads database from a file
| database (const database &ref)=delete
| disabling copy constructor
| database (database &&ref) noexcept=delete
| disabling move constructor
database & | operator= (const database &ref)=delete
| disabling assignement operator
database & | operator= (database &&ref) noexcept=delete
| disabling move assignment operator
| ~database ()
| 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 in file
void | set_compression_level (U_I compr_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
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

## Static Private Member Functions
static void | show_files_callback (void *tag, const std::string &filename, bool available_data, bool available_ea)
static void | get_version_callback (void *tag, archive_num num, db_etat data_presence, bool has_data_date, datetime data, db_etat ea_presence, bool has_ea_date, datetime ea)
static void | statistics_callback (void *tag, U_I number, const infinint &data_count, const infinint &total_data, const infinint &ea_count, const infinint &total_ea)

## Detailed Description

the database class defines the dar_manager database

all operations for a dar_manager database are defines through the use of this class interface. This class also defines internally the data structure of the database.

Definition at line 81 of file database5.hpp.

## Constructor & Destructor Documentation

## ◆ database() [1/2]

libdar5::database::database | ( |  | ) |
| inline

Definition at line 84 of file database5.hpp.

## ◆ database() [2/2]

libdar5::database::database | ( | user_interaction & | dialog,
|  | const std::string & | base,
|  | const database_open_options & | opt )
| inline

Definition at line 86 of file database5.hpp.

## Member Function Documentation

## ◆ check_order()

bool libdar5::database::check_order | ( | user_interaction & | dialog | ) | const
| inline

Definition at line 155 of file database5.hpp.

## ◆ dump()

void libdar5::database::dump | ( | user_interaction & | dialog,
|  | const std::string & | filename,
|  | const database_dump_options & | opt ) const
| inline

Definition at line 110 of file database5.hpp.

## ◆ restore()

void libdar5::database::restore | ( | user_interaction & | dialog,
|  | const std::vector< std::string > & | filename,
|  | const database_restore_options & | opt )
| inline

Definition at line 147 of file database5.hpp.

## ◆ show_contents()

void libdar5::database::show_contents | ( | user_interaction & | dialog | ) | const

show the list of archive used to build the database

Parameters

  [in,out] | dialog | is the user_interaction to use to report the listing

## ◆ show_files()

void libdar5::database::show_files | ( | user_interaction & | dialog,
|  | archive_num | num,
|  | const database_used_options & | opt ) const

list files which are present in a given archive

Parameters

  [in,out] | dialog | where to display listing to
  [in] | num | is the archive number to look at
  [in] | opt | optional parameters for this operation

Note
  if "num" is set to zero all archive contents is listed
  this method is not available with partially extracted databases.

## ◆ show_most_recent_stats()

void libdar5::database::show_most_recent_stats | ( | user_interaction & | dialog | ) | const

compute some statistics about the location of most recent file versions

Parameters

  [in] | dialog | where to display the listing to

Note
  this method is not available with partially extracted databases.

## ◆ show_version()

void libdar5::database::show_version | ( | user_interaction & | dialog,
|  | path | chemin ) const

list the archive where a give file is present

Parameters

  [in,out] | dialog | where to display the listing to
  [in] | chemin | path to the file to look for

Note
  this method is not available with partially extracted databases.

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

- database5.hpp