33 #ifndef LIBDAR_4_4_HPP 34 #define LIBDAR_4_4_HPP 36 #include "../my_config.h" 87 inline char compression2char(compression c) {
return libdar::compression2char(c); }
88 inline std::string compression2string(compression c) {
return libdar::compression2string(c); }
89 inline compression string2compression(
const std::string & a) {
return libdar::string2compression(a); }
119 typedef libdar::U_8 U_8;
120 typedef libdar::U_16 U_16;
121 typedef libdar::U_32 U_32;
122 typedef libdar::U_64 U_64;
123 typedef libdar::U_I U_I;
124 typedef libdar::S_8 S_8;
125 typedef libdar::S_16 S_16;
126 typedef libdar::S_32 S_32;
127 typedef libdar::S_64 S_64;
128 typedef libdar::S_I S_I;
153 virtual void dar_manager_show_version(U_I number,
154 const std::string & data_date,
155 const std::string & ea_date);
166 void dar_manager_show_version(U_I number,
167 const std::string & data_date,
168 const std::string & data_presence,
169 const std::string & ea_date,
170 const std::string & ea_presence)
172 dar_manager_show_version(number, data_date, ea_date);
203 inline void crypto_split_algo_pass(
const std::string & all, crypto_algo & algo, std::string & pass)
208 pass = spass.
c_str();
217 const std::string & password,
218 generic_file & encrypted_side,
256 static const listformat normal = libdar::archive_options_listing::normal;
257 static const listformat tree = libdar::archive_options_listing::tree;
258 static const listformat xml = libdar::archive_options_listing::xml;
262 const std::string & basename,
263 const std::string & extension,
265 const std::string &pass,
267 const std::string & input_pipe,
268 const std::string & output_pipe,
269 const std::string & execute,
273 const path & fs_root,
274 const path & sauv_path,
276 const mask & selection,
277 const mask & subtree,
278 const std::string & filename,
279 const std::string & extension,
286 U_I compression_level,
289 const mask & ea_mask,
290 const std::string & execute,
292 const std::string & pass,
294 const mask & compr_mask,
303 bool cache_directory_tagging,
304 bool display_skipped,
309 const path &sauv_path,
311 const std::string & filename,
312 const std::string & extension,
318 U_I compression_level,
321 const std::string & execute,
323 const std::string & pass,
329 const path & sauv_path,
332 const mask & selection,
333 const mask & subtree,
334 const std::string & filename,
335 const std::string & extension,
342 U_I compression_level,
345 const mask & ea_mask,
346 const std::string & execute,
348 const std::string & pass,
350 const mask & compr_mask,
353 bool display_skipped,
354 bool keep_compressed,
359 const mask &selection,
365 bool only_more_recent,
366 const mask & ea_mask,
369 bool warn_remove_no_match,
373 bool display_skipped,
379 const mask &selection,
380 bool filter_unsaved);
383 const path & fs_root,
384 const mask &selection,
387 const mask & ea_mask,
390 bool display_skipped,
395 const mask &selection,
398 bool display_skipped,
411 #define LIBDAR_XXXXXXXX 414 #define LIBDAR_NOEXCEPT 0 415 #define LIBDAR_EMEMORY 1 420 #define LIBDAR_EBUG 2 421 #define LIBDAR_EINFININT 3 423 #define LIBDAR_ELIMITINT 4 425 #define LIBDAR_ERANGE 5 427 #define LIBDAR_EDECI 6 429 #define LIBDAR_EFEATURE 7 431 #define LIBDAR_EHARDWARE 8 433 #define LIBDAR_EUSER_ABORT 9 435 #define LIBDAR_EDATA 10 437 #define LIBDAR_ESCRIPT 11 439 #define LIBDAR_ELIBCALL 12 441 #define LIBDAR_UNKNOWN 13 443 #define LIBDAR_ECOMPILATION 14 445 #define LIBDAR_THREAD_CANCEL 15 476 void get_version(U_I & major, U_I & minor,
bool init_libgcrypt =
true);
479 void get_version_noexcept(U_I & major, U_I & minor, U_16 & exception, std::string & except_msg,
bool init_libgcrypt =
true);
491 void get_version(U_I & major, U_I & medium, U_I & minor,
bool init_libgcrypt =
true);
506 void get_version_noexcept(U_I & major, U_I & medium, U_I & minor, U_16 & exception, std::string & except_msg,
bool init_libgcrypt =
true);
526 bool & new_blowfish);
543 const path & chem,
const std::string & basename,
544 const std::string & extension,
545 crypto_algo crypto,
const std::string &pass, U_32 crypto_size,
546 const std::string & input_pipe,
const std::string & output_pipe,
547 const std::string & execute,
bool info_details,
549 std::string & except_msg);
557 const path & fs_root,
558 const path & sauv_path,
560 const mask & selection,
561 const mask & subtree,
562 const std::string & filename,
563 const std::string & extension,
570 U_I compression_level,
573 const mask & ea_mask,
574 const std::string & execute,
576 const std::string & pass,
578 const mask & compr_mask,
587 bool cache_directory_tagging,
588 bool display_skipped,
592 std::string & except_msg);
601 const path &sauv_path,
603 const std::string & filename,
604 const std::string & extension,
610 U_I compression_level,
613 const std::string & execute,
615 const std::string & pass,
619 std::string & except_msg);
627 const path & sauv_path,
630 const mask & selection,
631 const mask & subtree,
632 const std::string & filename,
633 const std::string & extension,
640 U_I compression_level,
643 const mask & ea_mask,
644 const std::string & execute,
646 const std::string & pass,
648 const mask & compr_mask,
651 bool display_skipped,
652 bool keep_compressed,
655 std::string & except_msg);
665 std::string & except_msg);
676 const mask &selection,
682 bool only_more_recent,
683 const mask & ea_mask,
686 bool warn_remove_no_match,
690 bool display_skipped,
693 std::string & except_msg);
705 const mask &selection,
708 std::string & except_msg);
718 const path & fs_root,
719 const mask &selection,
722 const mask & ea_mask,
725 bool display_skipped,
728 std::string & except_msg);
738 const mask &selection,
741 bool display_skipped,
744 std::string & except_msg);
754 const std::string & dir,
756 std::string & except_msg);
812 inline void cancel_thread(pthread_t tid,
bool immediate =
true, U_64 flag = 0) { thread_cancellation::cancel(tid, immediate, flag); }
818 inline bool cancel_status(pthread_t tid) {
return thread_cancellation::cancel_status(tid); }
825 inline bool cancel_clear(pthread_t tid) {
return thread_cancellation::clear_pending_request(tid); }
contains classes that let the user define the policy for overwriting files
wrapper class for user_interaction
bool get_children_of_noexcept(user_interaction &dialog, archive *ptr, const std::string &dir, U_16 &exception, std::string &except_msg)
this is wrapper around the get_children_of method
exception used to signal an error in the argument given to libdar call of the API ...
the generic class, parent of all masks
makes the OR operator between two or more masks
const U_I LIBDAR_COMPILE_TIME_MEDIUM
libdar Medium version defined at compilation time
are defined here basic integer types that tend to be portable
the archive class is defined in this module
statistics op_diff_noexcept(user_interaction &dialog, archive *ptr, const path &fs_root, const mask &selection, const mask &subtree, bool info_details, const mask &ea_mask, inode::comparison_fields what_to_check, bool alter_atime, bool display_skipped, statistics *progressive_report, U_16 &exception, std::string &except_msg)
this is wrapper around the op_diff method
void get_version_noexcept(U_I &major, U_I &minor, U_16 &exception, std::string &except_msg, bool init_libgcrypt=true)
depreacted old get_version function
makes an AND operator between two or more masks
bool largefile()
returns whether largefile (>2GiB) support has been activated at compilation time
archive * merge_archive_noexcept(user_interaction &dialog, const path &sauv_path, archive *ref_arch1, archive *ref_arch2, const mask &selection, const mask &subtree, const std::string &filename, const std::string &extension, bool allow_over, bool warn_over, bool info_details, const infinint &pause, bool empty_dir, compression algo, U_I compression_level, const infinint &file_size, const infinint &first_file_size, const mask &ea_mask, const std::string &execute, crypto_algo crypto, const std::string &pass, U_32 crypto_size, const mask &compr_mask, const infinint &min_compr_size, bool empty, bool display_skipped, bool keep_compressed, statistics *progressive_report, U_16 &exception, std::string &except_msg)
this is a wrapper around the archive constructor known as the "merging" constructor ...
decimal class, convert infinint from and to decimal represention
exception used when hardware problem is found
exception used when a requested fearture has not beed activated at compilation time ...
compression char2compression(char a)
void get_version(U_I &major, U_I &minor, bool init_libgcrypt=true)
depreacted old get_version function
bool ea()
returns whether EA support has been activated at compilation time
matches regular expressions (see "man 7 regex")
This is a pure virtual class that is used by libdar when interaction with the user is required...
this is the parent class of all exception classes.
exception used when a limitint overflow is detected, the maximum value of the limitint has been excee...
void tools_4_4_build_compatible_overwriting_policy(bool allow_over, bool detruire, bool more_recent, const libdar::infinint &hourshift, bool ea_erase, const libdar::crit_action *&overwrite)
Defines an overwriting policy based on pre 2.4.0 options.
virtual void pause(const std::string &message)
method used to ask a boolean question to the user.
the crypto algoritm definition
comparison_fields
flag used to only consider certain fields when comparing/restoring inodes
boolean mask, either always true or false
void crypto_split_algo_pass(const secu_string &all, crypto_algo &algo, secu_string &pass)
exception used when an error concerning the treated data has been met
string matches if it is subdir of mask or mask is a subdir of expression
matches if string is exactly the given mask (no wilde card expression)
archive * open_archive_noexcept(user_interaction &dialog, const path &chem, const std::string &basename, const std::string &extension, crypto_algo crypto, const std::string &pass, U_32 crypto_size, const std::string &input_pipe, const std::string &output_pipe, const std::string &execute, bool info_details, U_16 &exception, std::string &except_msg)
this is a wrapper around the archive constructor known as the "read" constructor
bool libz()
returns whether libdar is dependent on libz and if so has gzip compression/decompression available ...
virtual std::string get_string(const std::string &message, bool echo)=0
method used to ask a question that needs an arbitrary answer.
the archive class realizes the most general operations on archives
crypto_algo
the different cypher available for encryption (strong or weak)
full implemented class for user_interaction based on callback functions.
defines the interaction between libdar and the user.Three classes are defined
matches as done on shell command lines (see "man 7 glob")
here is the definition of the path classthe path class handle path and provide several operation on t...
statistics op_extract_noexcept(user_interaction &dialog, archive *ptr, const path &fs_root, const mask &selection, const mask &subtree, bool allow_over, bool warn_over, bool info_details, bool detruire, bool only_more_recent, const mask &ea_mask, bool flat, inode::comparison_fields what_to_check, bool warn_remove_no_match, const infinint &hourshift, bool empty, bool ea_erase, bool display_skipped, statistics *progressive_report, U_16 &exception, std::string &except_msg)
this is wrapper around the op_extract method
the root class for all inode
exception used when the thread libdar is running in is asked to stop
exception used when memory has been exhausted
exception used when a requested feature is not (yet) implemented
const U_I LIBDAR_COMPILE_TIME_MINOR
libdar Minor version defined at compilation time
implementation of encryption using symetrical cryptography used in libgcrypt (among which is blowfish...
archive * isolate_archive_noexcept(user_interaction &dialog, const path &sauv_path, archive *ref_arch, const std::string &filename, const std::string &extension, bool allow_over, bool warn_over, bool info_details, const infinint &pause, compression algo, U_I compression_level, const infinint &file_size, const infinint &first_file_size, const std::string &execute, crypto_algo crypto, const std::string &pass, U_32 crypto_size, bool empty, U_16 &exception, std::string &except_msg)
this is a wrapper around the archive constructor known as the "isolate" constructor ...
exception used when arithmetic error is detected when operating on infinint
handle the statistic structure that gives a summary of treated files after each operatio ...
to be able to cancel libdar operation while running in a given thread.the class thread_cancellation i...
const U_I LIBDAR_COMPILE_TIME_MAJOR
libdar Major version defined at compilation time
wrapper class for blowfish
listformat
defines the way archive listing is done:
libdar::secu_string get_secu_string(const std::string &message, bool echo)
same a get_string() but uses secu_string instead
matches if string is the given constructor string or a sub directory of it
the global action for overwriting
exception used to signal convertion problem between infinint and string (decimal representation) ...
char * libdar_str2charptr_noexcept(const std::string &x, U_16 &exception, std::string &except_msg)
routine provided to convert std::string to char *
archive * create_archive_noexcept(user_interaction &dialog, const path &fs_root, const path &sauv_path, archive *ref_arch, const mask &selection, const mask &subtree, const std::string &filename, const std::string &extension, bool allow_over, bool warn_over, bool info_details, const infinint &pause, bool empty_dir, compression algo, U_I compression_level, const infinint &file_size, const infinint &first_file_size, const mask &ea_mask, const std::string &execute, crypto_algo crypto, const std::string &pass, U_32 crypto_size, const mask &compr_mask, const infinint &min_compr_size, bool nodump, inode::comparison_fields what_to_check, const infinint &hourshift, bool empty, bool alter_atime, bool same_fs, bool snapshot, bool cache_directory_tagging, bool display_skipped, const infinint &fixed_date, statistics *progressive_report, U_16 &exception, std::string &except_msg)
this is a wrapper around the archive constructor known as the "create" constructor ...
class to be used as parent to provide checkpoints to inherited classes
libdar::archive_options_listing::listformat listformat
defines the way archive listing is done:
void get_compile_time_features(bool &ea, bool &largefile, bool &nodump, bool &special_alloc, U_I &bits, bool &thread_safe, bool &libz, bool &libbz2, bool &libcrypto, bool &new_blowfish)
return the options activated that have been activated at compilation time
contains all the excetion class thrown by libdar
switch module to limitint (32 ou 64 bits integers) or infinint
here lies a collection of mask classes
compression class for gzip and bzip2 algorithms
manages the decimal representation of infinint
bool thread_safe()
returns whether the current libdar is thread safe
exception used to signal range error
U_I bits()
returns the internal integer type used
exception used to signal a bug. A bug is triggered when reaching some code that should never be reach...
compression
the different compression algorithm available
void op_listing_noexcept(user_interaction &dialog, archive *ptr, bool info_details, archive::listformat list_mode, const mask &selection, bool filter_unsaved, U_16 &exception, std::string &except_msg)
this is wrapper around the op_listing method
bool nodump()
returns whether nodump flag support has been activated at compilation time
compression engine implementation
blowfish strong encryption
class archive_version that rules which archive format to follow
exception used to signal that the user has aborted the operation
compression char2compression(char a)
libdar_4_4 namespace encapsulate all symbols of the backward compatible API
the arbitrary large positive integer class
exception used when error the inter-slice user command returned an error code
class archive_version manages the version of the archive format
scrambling weak encryption
bool libbz2()
returns whether libdar is dependent on libbz2 and if so has bzip2 compression/decompression available...
const char * c_str() const
get access to the secure string
void close_archive_noexcept(archive *ptr, U_16 &exception, std::string &except_msg)
this is wrapper around the archive destructor
wrapper class for archive
here is defined the many classed which is build of the catalogue
structure returned by libdar call to give a summary of the operation done in term of file treated ...
statistics op_test_noexcept(user_interaction &dialog, archive *ptr, const mask &selection, const mask &subtree, bool info_details, bool display_skipped, statistics *progressive_report, U_16 &exception, std::string &except_msg)
this is wrapper around the op_test method
the class path is here to manipulate paths in the Unix notation: using'/'