30#include "../my_config.h"
64 i_archive(
const std::shared_ptr<user_interaction> & dialog,
66 const std::string & basename,
67 const std::string & extension,
73 i_archive(
const std::shared_ptr<user_interaction> & dialog,
75 const path & sauv_path,
76 const std::string & filename,
77 const std::string & extension,
83 i_archive(
const std::shared_ptr<user_interaction> & dialog,
84 const path & sauv_path,
85 std::shared_ptr<archive> ref_arch1,
86 const std::string & filename,
87 const std::string & extension,
93 i_archive(
const std::shared_ptr<user_interaction> & dialog,
94 const path & chem_src,
95 const std::string & basename_src,
96 const std::string & extension_src,
98 const path & chem_dst,
99 const std::string & basename_dst,
100 const std::string & extension_dst,
139 const archive_options_diff & options,
154 const std::string & filename,
155 const std::string & extension,
163 const std::string & dir,
164 bool fetch_ea =
false);
208 enum operation { oper_create, oper_isolate, oper_merge, oper_repair };
221 void check_gnupg_signed()
const;
223 const catalogue & get_cat()
const {
if(
cat ==
nullptr)
throw SRC_BUG;
else return *
cat; };
226 bool get_sar_param(
infinint & sub_file_size,
235 const path & fs_root,
236 const std::shared_ptr<entrepot> & sauv_path_t,
238 const mask & selection,
239 const mask & subtree,
240 const std::string & filename,
241 const std::string & extension,
245 bool display_treated,
246 bool display_treated_only_dir,
247 bool display_skipped,
248 bool display_finished,
252 U_I compression_level,
253 U_I compression_block_size,
256 const mask & ea_mask,
257 const std::string & execute,
261 const std::vector<std::string> & gnupg_recipients,
262 const std::vector<std::string> & gnupg_signatories,
263 const mask & compr_mask,
266 const std::string & exclude_by_ea,
270 bool furtive_read_mode,
271 const filesystem_ids & same_fs,
274 bool cache_directory_tagging,
276 const std::string & slice_permission,
279 bool add_marks_for_sequential_reading,
281 const infinint & sparse_file_min_size,
282 const std::string & user_comment,
285 const std::string & backup_hook_file_execute,
286 const mask & backup_hook_file_mask,
289 U_I multi_threaded_crypto,
290 U_I multi_threaded_compress,
291 bool delta_signature,
292 bool build_delta_sig,
293 const mask & delta_mask,
294 const infinint & delta_sig_min_size,
296 bool zeroing_neg_date,
297 const std::set<std::string> & ignored_symlinks,
302 bool never_resave_uncompressed,
306 const path & fs_root,
307 const std::shared_ptr<entrepot> & sauv_path_t,
311 const mask & selection,
312 const mask & subtree,
313 const std::string & filename,
314 const std::string & extension,
319 bool display_treated,
320 bool display_treated_only_dir,
321 bool display_skipped,
322 bool display_finished,
326 U_I compression_level,
327 U_I compression_block_size,
330 const mask & ea_mask,
331 const std::string & execute,
335 const std::vector<std::string> & gnupg_recipients,
336 const std::vector<std::string> & gnupg_signatories,
337 const mask & compr_mask,
340 const std::string & exclude_by_ea,
344 bool furtive_read_mode,
345 const filesystem_ids & same_fs,
348 bool cache_directory_tagging,
349 bool keep_compressed,
351 const std::string & slice_permission,
355 bool add_marks_for_sequential_reading,
357 const infinint & sparse_file_min_size,
358 const std::string & user_comment,
361 const std::string & backup_hook_file_execute,
362 const mask & backup_hook_file_mask,
365 U_I multi_threaded_crypto,
366 U_I multi_threaded_compress,
367 bool delta_signature,
368 bool build_delta_sig,
369 const mask & delta_mask,
370 const infinint & delta_sig_min_size,
372 bool zeroing_neg_date,
373 const std::set<std::string> & ignored_symlinks,
378 bool never_resave_uncompressed,
382 void disable_natural_destruction();
383 void enable_natural_destruction();
384 const label & get_layer1_data_name()
const;
385 const label & get_catalogue_data_name()
const;
388 const cat_directory *get_dir_object(
const std::string & dir)
const;
389 void load_catalogue(
bool repairing);
the archive class is defined in this module
definition of the user defined callback function used for archive listing
this file contains a set of classes used to transmit options to archive operation
datastructure returned by archive::summary_data
here is defined the classe used to manage catalogue of archives
the archive::i_archive class implements the most general operations on archives
class holding optional parameters used to create an archive
class holding optional parameters used to isolate an existing archive
class holding optional parameters used to list the contents of an existing archive
class holding optional parameters used to proceed to the merge operation
class holding optional parameters used to read an existing archive
class holding optional parameters used to create an archive
class holding optional parameters used to test the structure coherence of an existing archive
the archive_summary class provides information about a given archive
the archive class realizes the most general operations on archives
the cat_directory inode class
the catalogue class which gather all objects contained in a give archive
the global action for overwriting
the arbitrary large positive integer class
manage label data structure used in archive slice headers
the generic class, parent of all masks
class mem_ui to keep a copy of a user_interaction object
the class path is here to manipulate paths in the Unix notation: using'/'
stores a stack of generic_files writing/reading on each others
class used by libdar::archive class to give a summary of treated file during and after an operation
the crypto algoritm definition
contains all the excetion class thrown by libdar
modified_data_detection
how to detect data has changed when some fields
comparison_fields
how to consider file change during comparison and incremental backup
const catalogue & get_catalogue() const
gives access to internal catalogue (not to be used from the API)
catalogue * cat
archive contents
i_archive(const std::shared_ptr< user_interaction > &dialog, const path &sauv_path, std::shared_ptr< archive > ref_arch1, const std::string &filename, const std::string &extension, const archive_options_merge &options, statistics *progressive_report)
this constructor builds an archive from two given archive [this is the "merge" constructor]
bool only_contains_an_isolated_catalogue() const
true if the current archive only contains an isolated catalogue
header_version ver
information for the archive header
pile stack
the different layer through which the archive contents is read or wrote
void(*)(const std::string &the_path, const list_entry &entry, void *context) archive_listing_callback
callback function type expected for archive::op_listing and archive::get_children_of()
i_archive(const std::shared_ptr< user_interaction > &dialog, const path &fs_root, const path &sauv_path, const std::string &filename, const std::string &extension, const archive_options_create &options, statistics *progressive_report)
this constuctor create an archive (full or differential) [this is the "create" constructor]
bool exploitable
is false if only the catalogue is available (for reference backup or isolation).
statistics op_diff(const path &fs_root, const archive_options_diff &options, statistics *progressive_report)
archive comparison with filesystem
std::set< fsa_family > fsa_scope
set of fsa families
U_64 get_first_slice_header_size() const
get the first slice header
i_archive(const std::shared_ptr< user_interaction > &dialog, const path &chem, const std::string &basename, const std::string &extension, const archive_options_read &options)
this constructor opens an already existing archive (for reading) [this is the "read" constructor]
void set_to_unsaved_data_and_FSA()
change all inode as unsaved (equal to differential backup with no change met)
bool sequential_read
whether the archive is read in sequential mode
void drop_all_filedescriptors(bool repairing)
closes all filedescriptors and associated even when in sequential read mode
void op_isolate(const path &sauv_path, const std::string &filename, const std::string &extension, const archive_options_isolate &options)
this methodes isolates the catalogue of a the current archive into a separated archive
const std::list< signator > & get_signatories() const
retrieving signature information about the archive
void op_listing(archive_listing_callback callback, void *context, const archive_options_listing &options) const
listing of the archive contents
void summary()
display a summary of the archive
hash_algo
hashing algorithm available
bool get_catalogue_slice_layout(slice_layout &slicing) const
returns the slice layout of the archive, or of the archive of reference in case of isolated catalogue
const entree_stats get_stats() const
retrieving statistics about archive contents
bool lax_read_mode
whether the archive has been openned in lax mode (unused for creation/merging/isolation)
i_archive(const i_archive &ref)=delete
copy constructor (not implemented, throw an exception if called explicitely or implicitely)
U_64 get_non_first_slice_header_size() const
get the non first slice header
void init_catalogue() const
void check_against_isolation(bool lax) const
throw Erange exception if the archive only contains an isolated catalogue
archive_summary summary_data()
same information as summary() but as broken out data
compression
the different compression algorithm available
const std::vector< list_entry > get_children_in_table(const std::string &dir, bool fetch_ea=false) const
getting information about the given directory (alternative to get_children_of)
statistics op_extract(const path &fs_root, const archive_options_extract &options, statistics *progressive_report)
extraction of data from an archive
~i_archive()
the destructor
i_archive(const std::shared_ptr< user_interaction > &dialog, const path &chem_src, const std::string &basename_src, const std::string &extension_src, const archive_options_read &options_read, const path &chem_dst, const std::string &basename_dst, const std::string &extension_dst, const archive_options_repair &options_repair, statistics *progressive_report)
this constructor create a new archive from a damaged one [this is the "repair" constructor]
crypto_algo
the different cypher available for encryption (strong or weak)
statistics op_test(const archive_options_test &options, bool reparing, statistics *progressive_report)
test the archive integrity
slice_layout slices
slice layout, archive is not sliced <=> first_size or other_size fields are set to zero (in practice ...
std::list< signator > gnupg_signed
list of signature found in the archive (reading an existing archive)
infinint local_cat_size
size of the catalogue on disk
std::shared_ptr< entrepot > get_entrepot()
this method may return nullptr if no entrepot is used (pipes used for archive building,...
bool get_children_of(archive_listing_callback callback, void *context, const std::string &dir, bool fetch_ea=false)
getting information about a given directory
void op_create_in_sub(operation op, const path &fs_root, const std::shared_ptr< entrepot > &sauv_path_t, catalogue *ref_cat1, const catalogue *ref_cat2, bool initial_pause, const mask &selection, const mask &subtree, const std::string &filename, const std::string &extension, bool allow_over, const crit_action &overwrite, bool warn_over, bool info_details, bool display_treated, bool display_treated_only_dir, bool display_skipped, bool display_finished, const infinint &pause, bool empty_dir, compression algo, U_I compression_level, U_I compression_block_size, const infinint &file_size, const infinint &first_file_size, const mask &ea_mask, const std::string &execute, crypto_algo crypto, const secu_string &pass, U_32 crypto_size, const std::vector< std::string > &gnupg_recipients, const std::vector< std::string > &gnupg_signatories, const mask &compr_mask, const infinint &min_compr_size, bool nodump, const std::string &exclude_by_ea, const infinint &hourshift, bool empty, bool alter_atime, bool furtive_read_mode, const filesystem_ids &same_fs, comparison_fields what_to_check, bool snapshot, bool cache_directory_tagging, bool keep_compressed, const infinint &fixed_date, const std::string &slice_permission, const infinint &repeat_count, const infinint &repeat_byte, bool decremental, bool add_marks_for_sequential_reading, bool security_check, const infinint &sparse_file_min_size, const std::string &user_comment, hash_algo hash, const infinint &slice_min_digits, const std::string &backup_hook_file_execute, const mask &backup_hook_file_mask, bool ignore_unknown, const fsa_scope &scope, U_I multi_threaded_crypto, U_I multi_threaded_compress, bool delta_signature, bool build_delta_sig, const mask &delta_mask, const infinint &delta_sig_min_size, bool delta_diff, bool zeroing_neg_date, const std::set< std::string > &ignored_symlinks, modified_data_detection mod_data_detect, const infinint &iteration_count, hash_algo kdf_hash, const delta_sig_block_size &sign_block_len, bool never_resave_uncompressed, statistics *st_ptr)
bool has_subdirectory(const std::string &dir) const
returns true if the pointed directory has one or more subdirectories
class of objects describing an entry in the archive, used by archive::get_children_in_table
class mem_ui definition. This class is to be used as parent class to handle user_interaction object m...
bool nodump() noexcept
returns whether nodump flag support has been activated at compilation time
libdar namespace encapsulate all libdar symbols
here is the definition of the path class
class pile definition. Used to manage a stack of generic_file objects
object describing the slicing of an archive
class handling access to the data summary of treated files after and during each operation
defines how to calculate delta signature block size based of file size to delta sign
holds the statistics contents of a catalogue