Disk ARchive
2.4.17
|
the database class defines the dar_manager database More...
#include <database.hpp>
Public Member Functions | |
database () | |
this constructor build an empty database | |
database (user_interaction &dialog, const std::string &base, const database_open_options &opt) | |
this constructor reads database from a file More... | |
~database () | |
database destructor (no implicit file saving) | |
void | dump (user_interaction &dialog, const std::string &filename, const database_dump_options &opt) const |
write the database to a file (see database_header first) More... | |
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 More... | |
void | remove_archive (archive_num min, archive_num max, const database_remove_options &opt) |
remove an archive from a database More... | |
void | set_permutation (archive_num src, archive_num dst) |
change order of archive within the database More... | |
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 More... | |
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 More... | |
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 | show_contents (user_interaction &dialog) const |
show the list of archive used to build the database More... | |
std::vector< std::string > | get_options () const |
return the options used with dar for restoration | |
std::string | get_dar_path () const |
return the path for dar More... | |
void | show_files (user_interaction &dialog, archive_num num, const database_used_options &opt) const |
list files which are present in a given archive More... | |
void | show_version (user_interaction &dialog, path chemin) const |
list the archive where a give file is present More... | |
void | show_most_recent_stats (user_interaction &dialog) const |
compute some statistics about the location of most recent file versions More... | |
void | restore (user_interaction &dialog, const std::vector< std::string > &filename, const database_restore_options &opt) |
restore files calling dar on the appropriated archive More... | |
bool | check_order (user_interaction &dialog) const |
check that all files's Data and EA are more recent when archive number grows within the database, only warn the user More... | |
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 48 of file database.hpp.
libdar::database::database | ( | user_interaction & | dialog, |
const std::string & | base, | ||
const database_open_options & | opt | ||
) |
this constructor reads database from a file
[in] | dialog | for user interaction |
[in] | base | database filename |
[in] | opt | extendable list of options to use for this operation |
void libdar::database::add_archive | ( | const archive & | arch, |
const std::string & | chemin, | ||
const std::string & | basename, | ||
const database_add_options & | opt | ||
) |
add an archive to the database
[in] | arch | is the archive to add to the database (may be a partial archive) |
[in] | chemin | is the path to this archive to record in the database |
[in] | basename | is the archive's basename to record in the database |
[in] | opt | extendable list of options to use for this operation |
void libdar::database::change_name | ( | archive_num | num, |
const std::string & | basename, | ||
const database_change_basename_options & | opt | ||
) |
change one's archive basename recorded in the database
[in] | num | is the archive index to rename |
[in] | basename | is the new basename to give to that archive |
[in] | opt | optional parameters for this operation |
|
inline |
check that all files's Data and EA are more recent when archive number grows within the database, only warn the user
[in,out] | dialog | for user interaction |
Definition at line 183 of file database.hpp.
References libdar::data_dir::check_order().
void libdar::database::dump | ( | user_interaction & | dialog, |
const std::string & | filename, | ||
const database_dump_options & | opt | ||
) | const |
write the database to a file (see database_header first)
[in] | dialog | for user interaction |
[in] | filename | name of file to save database to |
[in] | opt | extendable list of options to use for this operation |
|
inline |
return the path for dar
Definition at line 143 of file database.hpp.
void libdar::database::remove_archive | ( | archive_num | min, |
archive_num | max, | ||
const database_remove_options & | opt | ||
) |
remove an archive from a database
[in] | min | first archive index to remove |
[in] | max | last archive index to remove |
[in] | opt | extendable list of options to use for this operation |
void libdar::database::restore | ( | user_interaction & | dialog, |
const std::vector< std::string > & | filename, | ||
const database_restore_options & | opt | ||
) |
restore files calling dar on the appropriated archive
[in,out] | dialog | where to have user interaction |
[in] | filename | list of filename to restore |
[in] | opt | extendable list of options to use for this operation |
|
inline |
change the path to dar command
[in] | chemin | is the full path to dar (including dar filename) to use for restoration |
Definition at line 125 of file database.hpp.
|
inline |
change the default options given to dar when performing restoration
[in] | opt | is a vector a arguments. |
Definition at line 119 of file database.hpp.
void libdar::database::set_path | ( | archive_num | num, |
const std::string & | chemin, | ||
const database_change_path_options & | opt | ||
) |
change one's archive path recorded in the database
[in] | num | is the archive index who's path to change |
[in] | chemin | is the new path to give to that archive |
[in] | opt | optional parameters for this operation |
void libdar::database::set_permutation | ( | archive_num | src, |
archive_num | dst | ||
) |
change order of archive within the database
[in] | src | archive index to move |
[in] | dst | archive index to move to |
void libdar::database::show_contents | ( | user_interaction & | dialog | ) | const |
show the list of archive used to build the database
[in,out] | dialog | is the user_interaction to use to report the listing |
void libdar::database::show_files | ( | user_interaction & | dialog, |
archive_num | num, | ||
const database_used_options & | opt | ||
) | const |
list files which are present in a given archive
[in,out] | dialog | where to display listing to |
[in] | num | is the archive number to look at |
[in] | opt | optional parameters for this operation |
void libdar::database::show_most_recent_stats | ( | user_interaction & | dialog | ) | const |
compute some statistics about the location of most recent file versions
[in] | dialog | where to display the listing to |
void libdar::database::show_version | ( | user_interaction & | dialog, |
path | chemin | ||
) | const |
list the archive where a give file is present
[in,out] | dialog | where to display the listing to |
[in] | chemin | path to the file to look for |