30 #include "../my_config.h"
55 database(
const std::shared_ptr<user_interaction> & dialog);
62 database(
const std::shared_ptr<user_interaction> & dialog,
63 const std::string & base,
86 void dump(
const std::string & filename,
99 const std::string & chemin,
100 const std::string & basename,
129 const std::string & basename,
139 const std::string & chemin,
216 void *context)
const;
225 void restore(
const std::vector<std::string> & filename,
236 std::unique_ptr<i_database> pimpl;
the archive class is defined in this module
class storing the position of an archive inside a database
class archive_num stores the position of an archive inside a dar_manager database
the archive class realizes the most general operations on archives
the class i_database is the implementation of class database
options to add an archive to base
options for changing a given archive's basename
options for changing a given archive's path
options to write a database to file
options to open a database
options to remove an archive from the base
options for restoration from database
options for file "used" in archive
the database class defines the dar_manager 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
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_dar_path(const std::string &chemin)
change the path to dar command
compression get_compression() const
returns the compression algorithm used on filesystem
bool check_order() const
check that all files's Data and EA are more recent when archive number grows within the database,...
void show_most_recent_stats(database_listing_statistics_callback callback, void *context) const
compute some statistics about the location of most recent file versions
U_I get_compression_level() const
returns the compression level used on file
database(const std::shared_ptr< user_interaction > &dialog)
this constructor build an empty database
~database()
database destructor (no implicit file saving)
void get_version(database_listing_get_version_callback callback, void *context, path chemin) const
list the archive where a give file is present
database_archives_list get_contents() const
provides the list of archive used to build the database
void set_compression_level(U_I compr_level) const
change the compression level to use when storing base in file
std::string get_dar_path() const
returns the path for dar
void dump(const std::string &filename, const database_dump_options &opt) const
write the database to a file (see database_header first)
database & operator=(const database &ref)=delete
disabling assignement operator
database(database &&ref) noexcept=delete
disabling move constructor
void restore(const std::vector< std::string > &filename, const database_restore_options &opt)
restore files calling dar on the appropriated archive
void remove_archive(archive_num min, archive_num max, const database_remove_options &opt)
remove an archive from a database
void set_options(const std::vector< std::string > &opt)
change the default options given to dar when performing restoration
void set_permutation(archive_num src, archive_num dst)
change order of archive within the database
std::vector< std::string > get_options() const
return the options used with dar for restoration
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 set_compression(compression algozip) const
change compression to use when storing base in file
database(const database &ref)=delete
disabling copy constructor
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
std::string get_database_version() const
return the database format version
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
the class path is here to manipulate paths in the Unix notation: using'/'
this file stores the list of archives a database has been built from. it is part of the database head...
definition of the user defined callback function used for database listing
this file holds the options for database operations
std::deque< database_archives > database_archives_list
list of archives found in a database
void(*)(void *context, const std::string &filename, bool available_data, bool available_ea) database_listing_show_files_callback
called by the database::get_files() routine
void(*)(void *context, U_I number, const infinint &data_count, const infinint &total_data, const infinint &ea_count, const infinint &total_ea) database_listing_statistics_callback
called with teh information of statistics for each archive in turn
void(*)(void *context, archive_num num, db_etat data_presence, bool has_data_date, datetime data, db_etat ea_presence, bool has_ea_date, datetime ea) database_listing_get_version_callback
called with the information of presence for an entry in archive number num
compression
the different compression algorithm available
libdar namespace encapsulate all libdar symbols