Disk ARchive  2.5.15
Full featured and portable backup and archiving tool
archive_options.hpp
Go to the documentation of this file.
1 /*********************************************************************/
2 // dar - disk archive - a backup/restoration program
3 // Copyright (C) 2002-2052 Denis Corbin
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 //
19 // to contact the author : http://dar.linux.free.fr/email.html
20 /*********************************************************************/
21 
25 
26 #ifndef ARCHIVE_OPTIONS_HPP
27 #define ARCHIVE_OPTIONS_HPP
28 
29 #include "../my_config.h"
30 #include "crypto.hpp"
31 #include "integers.hpp"
32 #include "mask.hpp"
33 #include "compressor.hpp"
34 #include "catalogue.hpp"
35 #include "criterium.hpp"
36 #include "hash_fichier.hpp"
37 #include "secu_string.hpp"
38 #include "nls_swap.hpp"
39 #include "entrepot.hpp"
40 #include "fsa_family.hpp"
41 #include "on_pool.hpp"
42 
43 #include <string>
44 
45 namespace libdar
46 {
47  class archive; // needed to be able to use pointer on archive object.
48 
49 
53 
56 
57 
60  {
61  public:
64 
66  archive_options_read(const archive_options_read & ref) : x_ref_chem(ref.x_ref_chem) { copy_from(ref); };
67  const archive_options_read & operator = (const archive_options_read & ref) { destroy(); copy_from(ref); return *this; };
68  ~archive_options_read() { destroy(); };
69 
70 
72  // set back to default (this is the state just after the object is constructed
73  // this method is to be used to reuse a given object
74 
76  void clear();
77 
78 
80  // setting methods
81 
82 
89  void set_crypto_algo(crypto_algo val) { x_crypto = val; };
90 
92  void set_crypto_pass(const secu_string & pass) { x_pass = pass; };
93 
95  void set_crypto_size(U_32 crypto_size) { x_crypto_size = crypto_size; };
96 
99 
101 
104  void set_input_pipe(const std::string & input_pipe) { x_input_pipe = input_pipe; };
105 
107 
110  void set_output_pipe(const std::string & output_pipe) { x_output_pipe = output_pipe; };
111 
113 
121  void set_execute(const std::string & execute) { x_execute = execute; };
122 
124  void set_info_details(bool info_details) { x_info_details = info_details; };
125 
127 
131  void set_lax(bool val) { x_lax = val; };
132 
134 
136 
137  void set_sequential_read(bool val) { x_sequential_read = val; };
138 
140 
141  void set_slice_min_digits(infinint val) { x_slice_min_digits = val; };
142 
143 
145  void set_entrepot(const entrepot & entr) { if(x_entrepot != nullptr) delete x_entrepot; x_entrepot = entr.clone(); if(x_entrepot == nullptr) throw Ememory("archive_options_read::set_entrepot"); };
146 
148  void set_ignore_signature_check_failure(bool val) { x_ignore_signature_check_failure = val; };
149 
151  void set_multi_threaded(bool val) { x_multi_threaded = val; };
152 
153 
155 
157  void set_external_catalogue(const path & ref_chem, const std::string & ref_basename) { x_ref_chem = ref_chem, x_ref_basename = ref_basename; external_cat = true; };
160 
162  void set_ref_crypto_algo(crypto_algo ref_crypto) { x_ref_crypto = ref_crypto; };
163 
165  void set_ref_crypto_pass(const secu_string & ref_pass) { x_ref_pass = ref_pass; };
166 
168  void set_ref_crypto_size(U_32 ref_crypto_size) { x_ref_crypto_size = ref_crypto_size; };
169 
171 
179  void set_ref_execute(const std::string & ref_execute) { x_ref_execute = ref_execute; };
180 
181 
183 
184  void set_ref_slice_min_digits(infinint val) { x_ref_slice_min_digits = val; };
185 
187  void set_ref_entrepot(const entrepot & entr) { if(x_ref_entrepot != nullptr) delete x_ref_entrepot; x_ref_entrepot = entr.clone(); if(x_ref_entrepot == nullptr) throw Ememory("archive_options_read::set_entrepot"); };
188 
190  void set_header_only(bool val) { x_header_only = val; };
191 
192 
193 
195  // getting methods (mainly used inside libdar, but kept public and part of the API in the case it is needed)
196 
197 
198  crypto_algo get_crypto_algo() const { return x_crypto; };
199  const secu_string & get_crypto_pass() const { return x_pass; };
200  U_32 get_crypto_size() const { return x_crypto_size; };
201  const std::string & get_input_pipe() const { return x_input_pipe; };
202  const std::string & get_output_pipe() const { return x_output_pipe; };
203  const std::string & get_execute() const { return x_execute; };
204  bool get_info_details() const { return x_info_details; };
205  bool get_lax() const { return x_lax; };
206  bool get_sequential_read() const { return x_sequential_read; };
207  infinint get_slice_min_digits() const { return x_slice_min_digits; };
208  const entrepot & get_entrepot() const { if(x_entrepot == nullptr) throw SRC_BUG; return *x_entrepot; };
209  bool get_ignore_signature_check_failure() const { return x_ignore_signature_check_failure; };
210  bool get_multi_threaded() const { return x_multi_threaded; };
211 
212  // All methods that follow concern the archive where to fetch the (isolated) catalogue from
213  bool is_external_catalogue_set() const { return external_cat; };
214  const path & get_ref_path() const;
215  const std::string & get_ref_basename() const;
216  crypto_algo get_ref_crypto_algo() const { return x_ref_crypto; };
217  const secu_string & get_ref_crypto_pass() const { return x_ref_pass; };
218  U_32 get_ref_crypto_size() const { return x_ref_crypto_size; };
219  const std::string & get_ref_execute() const { return x_ref_execute; };
220  infinint get_ref_slice_min_digits() const { return x_ref_slice_min_digits; };
221  const entrepot & get_ref_entrepot() const { if(x_ref_entrepot == nullptr) throw SRC_BUG; return *x_ref_entrepot; };
222  bool get_header_only() const { return x_header_only; };
223 
224 
225  private:
226  crypto_algo x_crypto;
227  secu_string x_pass;
228  U_32 x_crypto_size;
229  std::string x_input_pipe;
230  std::string x_output_pipe;
231  std::string x_execute;
232  bool x_info_details;
233  bool x_lax;
234  bool x_sequential_read;
235  infinint x_slice_min_digits;
236  entrepot *x_entrepot;
237  bool x_ignore_signature_check_failure;
238  bool x_multi_threaded;
239 
240 
241  // external catalogue relative fields
242  bool external_cat;
243  path x_ref_chem;
244  std::string x_ref_basename;
245  crypto_algo x_ref_crypto;
246  secu_string x_ref_pass;
247  U_32 x_ref_crypto_size;
248  std::string x_ref_execute;
249  infinint x_ref_slice_min_digits;
250  entrepot *x_ref_entrepot;
251  bool x_header_only;
252 
253  void copy_from(const archive_options_read & ref);
254  void destroy();
255  };
256 
257 
261 
264  {
265  public:
266  // default constructors and destructor.
267 
270  const archive_options_create & operator = (const archive_options_create & ref) { destroy(); copy_from(ref); return *this; };
271  ~archive_options_create() { destroy(); };
272 
274  // set back to default (this is the state just after the object is constructed
275  // this method is to be used to reuse a given object
276 
278  void clear();
279 
280 
282  // setting methods
283 
285  void set_reference(archive *ref_arch) { x_ref_arch = ref_arch; };
286 
288  void set_selection(const mask & selection);
289 
291  void set_subtree(const mask & subtree);
292 
294  void set_allow_over(bool allow_over) { x_allow_over = allow_over; };
295 
297  void set_warn_over(bool warn_over) { x_warn_over = warn_over; };
298 
305  void set_info_details(bool info_details) { x_info_details = info_details; };
306 
311  void set_display_treated(bool display_treated, bool only_dir) { x_display_treated = display_treated; x_display_treated_only_dir = only_dir; };
312 
314  void set_display_skipped(bool display_skipped) { x_display_skipped = display_skipped; };
315 
317  void set_display_finished(bool display_finished) { x_display_finished = display_finished; };
318 
320  void set_pause(const infinint & pause) { x_pause = pause; };
321 
323  void set_empty_dir(bool empty_dir) { x_empty_dir = empty_dir; };
324 
326  void set_compression(compression compr_algo) { x_compr_algo = compr_algo; };
327 
329  void set_compression_level(U_I compression_level) { x_compression_level = compression_level; };
330 
332 
336  void set_slicing(const infinint & file_size, const infinint & first_file_size = 0)
337  {
338  x_file_size = file_size;
339  if(first_file_size.is_zero())
340  x_first_file_size = file_size;
341  else
342  x_first_file_size = first_file_size;
343  };
344 
345 
347  void set_ea_mask(const mask & ea_mask);
348 
350  void set_execute(const std::string & execute) { x_execute = execute; };
351 
353  void set_crypto_algo(crypto_algo crypto) { x_crypto = crypto; };
354 
357  void set_crypto_pass(const secu_string & pass) { x_pass = pass; };
358 
360  void set_crypto_size(U_32 crypto_size) { x_crypto_size = crypto_size; };
361 
368  void set_gnupg_recipients(const std::vector<std::string> & gnupg_recipients) { x_gnupg_recipients = gnupg_recipients; };
369 
370 
372  void set_gnupg_signatories(const std::vector<std::string> & gnupg_signatories) { x_gnupg_signatories = gnupg_signatories; };
373 
375  void set_compr_mask(const mask & compr_mask);
376 
378  void set_min_compr_size(const infinint & min_compr_size) { x_min_compr_size = min_compr_size; };
379 
381  void set_nodump(bool nodump) { x_nodump = nodump; };
382 
385  void set_exclude_by_ea(const std::string & ea_name)
386  { exclude_by_ea = (ea_name == "" ? "user.libdar_no_backup" : ea_name); };
387 
389  void set_what_to_check(cat_inode::comparison_fields what_to_check) { x_what_to_check = what_to_check; };
390 
392  void set_hourshift(const infinint & hourshift) { x_hourshift = hourshift; };
393 
395  void set_empty(bool empty) { x_empty = empty; };
396 
398 
401  void set_alter_atime(bool alter_atime)
402  {
403  if(x_furtive_read)
404  x_old_alter_atime = alter_atime;
405  else
406  x_alter_atime = alter_atime;
407  };
408 
411  {
412  NLS_SWAP_IN;
413  try
414  {
415 
416 #if FURTIVE_READ_MODE_AVAILABLE
417  x_furtive_read = furtive_read;
418  if(furtive_read)
419  {
420  x_old_alter_atime = x_alter_atime;
421  x_alter_atime = true;
422  // this is required to avoid libdar manipulating ctime of inodes
423  }
424  else
425  x_alter_atime = x_old_alter_atime;
426 #else
427  if(furtive_read)
428  throw Ecompilation(gettext("Furtive read mode"));
429  x_furtive_read = false;
430 #endif
431  }
432  catch(...)
433  {
434  NLS_SWAP_OUT;
435  throw;
436  }
437  NLS_SWAP_OUT;
438  };
439 
441  void set_same_fs(bool same_fs) { x_same_fs = same_fs; };
442 
444  void set_snapshot(bool snapshot) { x_snapshot = snapshot; };
445 
447  void set_cache_directory_tagging(bool cache_directory_tagging) { x_cache_directory_tagging = cache_directory_tagging; };
448 
450  void set_fixed_date(const infinint & fixed_date) { x_fixed_date = fixed_date; };
451 
453  void set_slice_permission(const std::string & slice_permission) { x_slice_permission = slice_permission; };
454 
456  void set_slice_user_ownership(const std::string & slice_user_ownership) { x_slice_user_ownership = slice_user_ownership; };
457 
459  void set_slice_group_ownership(const std::string & slice_group_ownership) { x_slice_group_ownership = slice_group_ownership; };
460 
462  void set_retry_on_change(const infinint & count_max_per_file, const infinint & global_max_byte_overhead = 0) { x_repeat_count = count_max_per_file; x_repeat_byte = global_max_byte_overhead; };
463 
465  void set_sequential_marks(bool sequential) { x_sequential_marks = sequential; };
466 
468  void set_sparse_file_min_size(const infinint & size) { x_sparse_file_min_size = size; };
469 
471  void set_security_check(bool check) { x_security_check = check; };
472 
474  void set_user_comment(const std::string & comment) { x_user_comment = comment; };
475 
479  void set_hash_algo(hash_algo hash) { x_hash = hash; };
480 
482  void set_slice_min_digits(infinint val) { x_slice_min_digits = val; };
483 
485  void set_backup_hook(const std::string & execute, const mask & which_files);
486 
488  void set_ignore_unknown_inode_type(bool val) { x_ignore_unknown = val; };
489 
491  void set_entrepot(const entrepot & entr);
492 
494  void set_fsa_scope(const fsa_scope & scope) { x_scope = scope; };
495 
497  void set_multi_threaded(bool val) { x_multi_threaded = val; };
498 
500  void set_auto_zeroing_neg_dates(bool val) { x_auto_zeroing_neg_dates = val; };
501 
502 
504  // getting methods
505 
506  archive *get_reference() const { return x_ref_arch; };
507  const mask & get_selection() const { if(x_selection == nullptr) throw SRC_BUG; return *x_selection; };
508  const mask & get_subtree() const { if(x_subtree == nullptr) throw SRC_BUG; return *x_subtree; };
509  bool get_allow_over() const { return x_allow_over; };
510  bool get_warn_over() const { return x_warn_over; };
511  bool get_info_details() const { return x_info_details; };
512  bool get_display_treated() const { return x_display_treated; };
513  bool get_display_treated_only_dir() const { return x_display_treated_only_dir; };
514  bool get_display_skipped() const { return x_display_skipped; };
515  bool get_display_finished() const { return x_display_finished; };
516  const infinint & get_pause() const { return x_pause; };
517  bool get_empty_dir() const { return x_empty_dir; };
518  compression get_compression() const { return x_compr_algo; };
519  U_I get_compression_level() const { return x_compression_level; };
520  const infinint & get_slice_size() const { return x_file_size; };
521  const infinint & get_first_slice_size() const { return x_first_file_size; };
522  const mask & get_ea_mask() const { if(x_ea_mask == nullptr) throw SRC_BUG; return *x_ea_mask; };
523  const std::string & get_execute() const { return x_execute; };
524  crypto_algo get_crypto_algo() const { return x_crypto; };
525  const secu_string & get_crypto_pass() const { return x_pass; };
526  U_32 get_crypto_size() const { return x_crypto_size; };
527  const std::vector<std::string> & get_gnupg_recipients() const { return x_gnupg_recipients; };
528  const std::vector<std::string> & get_gnupg_signatories() const { return x_gnupg_signatories; };
529  const mask & get_compr_mask() const { if(x_compr_mask == nullptr) throw SRC_BUG; return *x_compr_mask; };
530  const infinint & get_min_compr_size() const { return x_min_compr_size; };
531  bool get_nodump() const { return x_nodump; };
532  const std::string & get_exclude_by_ea() const { return exclude_by_ea; };
533  cat_inode::comparison_fields get_comparison_fields() const { return x_what_to_check; };
534  const infinint & get_hourshift() const { return x_hourshift; };
535  bool get_empty() const { return x_empty; };
536  bool get_alter_atime() const { return x_alter_atime; };
537  bool get_furtive_read_mode() const { return x_furtive_read; };
538  bool get_same_fs() const { return x_same_fs; };
539  bool get_snapshot() const { return x_snapshot; };
540  bool get_cache_directory_tagging() const { return x_cache_directory_tagging; };
541  const infinint & get_fixed_date() const { return x_fixed_date; };
542  const std::string & get_slice_permission() const { return x_slice_permission; };
543  const std::string & get_slice_user_ownership() const { return x_slice_user_ownership; };
544  const std::string & get_slice_group_ownership() const { return x_slice_group_ownership; };
545  const infinint & get_repeat_count() const { return x_repeat_count; };
546  const infinint & get_repeat_byte() const { return x_repeat_byte; };
547  bool get_sequential_marks() const { return x_sequential_marks; };
548  infinint get_sparse_file_min_size() const { return x_sparse_file_min_size; };
549  bool get_security_check() const { return x_security_check; };
550  const std::string & get_user_comment() const { return x_user_comment; };
551  hash_algo get_hash_algo() const { return x_hash; };
552  infinint get_slice_min_digits() const { return x_slice_min_digits; };
553  const std::string & get_backup_hook_file_execute() const { return x_backup_hook_file_execute; };
554  const mask & get_backup_hook_file_mask() const { return *x_backup_hook_file_mask; };
555  bool get_ignore_unknown_inode_type() const { return x_ignore_unknown; };
556  const entrepot & get_entrepot() const { if(x_entrepot == nullptr) throw SRC_BUG; return *x_entrepot; };
557  const fsa_scope & get_fsa_scope() const { return x_scope; };
558  bool get_multi_threaded() const { return x_multi_threaded; };
559  bool get_auto_zeroing_neg_dates() const { return x_auto_zeroing_neg_dates; };
560 
561  private:
562  archive *x_ref_arch; //< just contains the address of an existing object, no local copy of object is done here
563  mask * x_selection; //< points to a local copy of mask (must be allocated / releases by the archive_option_create object)
564  mask * x_subtree; //< points to a local copy of mask (must be allocated / releases by the archive_option_create objects)
565  bool x_allow_over;
566  bool x_warn_over;
567  bool x_info_details;
568  bool x_display_treated;
569  bool x_display_treated_only_dir;
570  bool x_display_skipped;
571  bool x_display_finished;
572  infinint x_pause;
573  bool x_empty_dir;
574  compression x_compr_algo;
575  U_I x_compression_level;
576  infinint x_file_size;
577  infinint x_first_file_size;
578  mask * x_ea_mask; //< points to a local copy of mask (must be allocated / releases by the archive_option_create objects)
579  std::string x_execute;
580  crypto_algo x_crypto;
581  secu_string x_pass;
582  U_32 x_crypto_size;
583  std::vector<std::string> x_gnupg_recipients;
584  std::vector<std::string> x_gnupg_signatories;
585  mask * x_compr_mask; //< points to a local copy of mask (must be allocated / releases by the archive_option_create objects)
586  infinint x_min_compr_size;
587  bool x_nodump;
588  std::string exclude_by_ea;
589  cat_inode::comparison_fields x_what_to_check;
590  infinint x_hourshift;
591  bool x_empty;
592  bool x_alter_atime;
593  bool x_old_alter_atime; //< used to backup origina alter_atime value when activating furtive read mode
594  bool x_furtive_read;
595  bool x_same_fs;
596  bool x_snapshot;
597  bool x_cache_directory_tagging;
598  infinint x_fixed_date;
599  std::string x_slice_permission;
600  std::string x_slice_user_ownership;
601  std::string x_slice_group_ownership;
602  infinint x_repeat_count;
603  infinint x_repeat_byte;
604  bool x_sequential_marks;
605  infinint x_sparse_file_min_size;
606  bool x_security_check;
607  std::string x_user_comment;
608  hash_algo x_hash;
609  infinint x_slice_min_digits;
610  mask * x_backup_hook_file_mask;
611  std::string x_backup_hook_file_execute;
612  bool x_ignore_unknown;
613  entrepot *x_entrepot;
614  fsa_scope x_scope;
615  bool x_multi_threaded;
616  bool x_auto_zeroing_neg_dates;
617 
618  void destroy();
619  void copy_from(const archive_options_create & ref);
620  void destroy_mask(mask * & ptr);
621  void clean_mask(mask * & ptr);
622  void check_mask(const mask & m);
623  };
624 
625 
626 
627 
628 
629 
633 
636  {
637  public:
638  archive_options_isolate() { x_entrepot = nullptr; clear(); };
639  archive_options_isolate(const archive_options_isolate & ref) { x_entrepot = nullptr; copy_from(ref); };
640  const archive_options_isolate & operator = (const archive_options_isolate & ref) { destroy(); copy_from(ref); return *this; };
641  ~archive_options_isolate() { destroy(); };
642 
643 
644  void clear();
645 
647  // setting methods
648 
650  void set_allow_over(bool allow_over) { x_allow_over = allow_over; };
651 
653  void set_warn_over(bool warn_over) { x_warn_over = warn_over; };
654 
656  void set_info_details(bool info_details) { x_info_details = info_details; };
657 
659  void set_pause(const infinint & pause) { x_pause = pause; };
660 
662  void set_compression(compression algo) { x_algo = algo; };
663 
665  void set_compression_level(U_I compression_level) { x_compression_level = compression_level; };
666 
668 
672  void set_slicing(const infinint & file_size, const infinint & first_file_size = 0)
673  {
674  x_file_size = file_size;
675  if(first_file_size.is_zero())
676  x_first_file_size = file_size;
677  else
678  x_first_file_size = first_file_size;
679  };
680 
682  void set_execute(const std::string & execute) { x_execute = execute; };
683 
685  void set_crypto_algo(crypto_algo crypto) { x_crypto = crypto; };
686 
688  void set_crypto_pass(const secu_string & pass) { x_pass = pass; };
689 
691  void set_crypto_size(U_32 crypto_size) { x_crypto_size = crypto_size; };
692 
695  void set_gnupg_recipients(const std::vector<std::string> & gnupg_recipients) { x_gnupg_recipients = gnupg_recipients; };
696 
698  void set_gnupg_signatories(const std::vector<std::string> & gnupg_signatories) { x_gnupg_signatories = gnupg_signatories; };
699 
701  void set_empty(bool empty) { x_empty = empty; };
702 
704  void set_slice_permission(const std::string & slice_permission) { x_slice_permission = slice_permission; };
705 
707  void set_slice_user_ownership(const std::string & slice_user_ownership) { x_slice_user_ownership = slice_user_ownership; };
708 
710  void set_slice_group_ownership(const std::string & slice_group_ownership) { x_slice_group_ownership = slice_group_ownership; };
711 
713  void set_user_comment(const std::string & comment) { x_user_comment = comment; };
714 
716  void set_hash_algo(hash_algo hash) { x_hash = hash; };
717 
719  void set_slice_min_digits(infinint val) { x_slice_min_digits = val; };
720 
722  void set_sequential_marks(bool sequential) { x_sequential_marks = sequential; };
723 
725  void set_entrepot(const entrepot & entr);
726 
728  void set_multi_threaded(bool val) { x_multi_threaded = val; };
729 
730 
732  // getting methods
733 
734  bool get_allow_over() const { return x_allow_over; };
735  bool get_warn_over() const { return x_warn_over; };
736  bool get_info_details() const { return x_info_details; };
737  const infinint & get_pause() const { return x_pause; };
738  compression get_compression() const { return x_algo; };
739  U_I get_compression_level() const { return x_compression_level; };
740  const infinint & get_slice_size() const { return x_file_size; };
741  const infinint & get_first_slice_size() const { return x_first_file_size; };
742  const std::string & get_execute() const { return x_execute; };
743  crypto_algo get_crypto_algo() const { return x_crypto; };
744  const secu_string & get_crypto_pass() const { return x_pass; };
745  U_32 get_crypto_size() const { return x_crypto_size; };
746  const std::vector<std::string> & get_gnupg_recipients() const { return x_gnupg_recipients; };
747  const std::vector<std::string> & get_gnupg_signatories() const { return x_gnupg_signatories; };
748  bool get_empty() const { return x_empty; };
749  const std::string & get_slice_permission() const { return x_slice_permission; };
750  const std::string & get_slice_user_ownership() const { return x_slice_user_ownership; };
751  const std::string & get_slice_group_ownership() const { return x_slice_group_ownership; };
752  const std::string & get_user_comment() const { return x_user_comment; };
753  hash_algo get_hash_algo() const { return x_hash; };
754  infinint get_slice_min_digits() const { return x_slice_min_digits; };
755  bool get_sequential_marks() const { return x_sequential_marks; };
756  const entrepot & get_entrepot() const { if(x_entrepot == nullptr) throw SRC_BUG; return *x_entrepot; };
757  bool get_multi_threaded() const { return x_multi_threaded; };
758 
759 
760  private:
761  bool x_allow_over;
762  bool x_warn_over;
763  bool x_info_details;
764  infinint x_pause;
765  compression x_algo;
766  U_I x_compression_level;
767  infinint x_file_size;
768  infinint x_first_file_size;
769  std::string x_execute;
770  crypto_algo x_crypto;
771  secu_string x_pass;
772  U_32 x_crypto_size;
773  std::vector<std::string> x_gnupg_recipients;
774  std::vector<std::string> x_gnupg_signatories;
775  bool x_empty;
776  std::string x_slice_permission;
777  std::string x_slice_user_ownership;
778  std::string x_slice_group_ownership;
779  std::string x_user_comment;
780  hash_algo x_hash;
781  infinint x_slice_min_digits;
782  bool x_sequential_marks;
783  entrepot *x_entrepot;
784  bool x_multi_threaded;
785 
786  void copy_from(const archive_options_isolate & ref);
787  void destroy();
788  };
789 
790 
791 
795 
798  {
799  public:
800 
801  archive_options_merge() { x_selection = x_subtree = x_ea_mask = x_compr_mask = nullptr; x_overwrite = nullptr; x_entrepot = nullptr; clear(); };
802  archive_options_merge(const archive_options_merge & ref) { copy_from(ref); };
803  const archive_options_merge & operator = (const archive_options_merge & ref) { destroy(); copy_from(ref); return *this; };
804  ~archive_options_merge() { destroy(); };
805 
806  void clear();
807 
809  // setting methods
810 
811  void set_auxilliary_ref(archive *ref) { x_ref = ref; };
812 
814  void set_selection(const mask & selection);
815 
817  void set_subtree(const mask & subtree);
818 
820  void set_allow_over(bool allow_over) { x_allow_over = allow_over; };
821 
823  void set_warn_over(bool warn_over) { x_warn_over = warn_over; };
824 
826  void set_overwriting_rules(const crit_action & overwrite);
827 
834  void set_info_details(bool info_details) { x_info_details = info_details; };
835 
840  void set_display_treated(bool display_treated, bool only_dir) { x_display_treated = display_treated; x_display_treated_only_dir = only_dir; };
841 
843  void set_display_skipped(bool display_skipped) { x_display_skipped = display_skipped; };
844 
846  void set_pause(const infinint & pause) { x_pause = pause; };
847 
849  void set_empty_dir(bool empty_dir) { x_empty_dir = empty_dir; };
850 
852  void set_compression(compression compr_algo) { x_compr_algo = compr_algo; };
853 
855  void set_compression_level(U_I compression_level) { x_compression_level = compression_level; };
856 
858 
862  void set_slicing(const infinint & file_size, const infinint & first_file_size = 0)
863  {
864  x_file_size = file_size;
865  if(first_file_size.is_zero())
866  x_first_file_size = file_size;
867  else
868  x_first_file_size = first_file_size;
869  };
870 
872  void set_ea_mask(const mask & ea_mask);
873 
875  void set_execute(const std::string & execute) { x_execute = execute; };
876 
878  void set_crypto_algo(crypto_algo crypto) { x_crypto = crypto; };
879 
882  void set_crypto_pass(const secu_string & pass) { x_pass = pass; };
883 
885  void set_crypto_size(U_32 crypto_size) { x_crypto_size = crypto_size; };
886 
889  void set_gnupg_recipients(const std::vector<std::string> & gnupg_recipients) { x_gnupg_recipients = gnupg_recipients; };
890 
892  void set_gnupg_signatories(const std::vector<std::string> & gnupg_signatories) { x_gnupg_signatories = gnupg_signatories; };
893 
895  void set_compr_mask(const mask & compr_mask);
896 
898  void set_min_compr_size(const infinint & min_compr_size) { x_min_compr_size = min_compr_size; };
899 
901  void set_empty(bool empty) { x_empty = empty; };
902 
904  void set_keep_compressed(bool keep_compressed) { x_keep_compressed = keep_compressed; };
905 
907  void set_slice_permission(const std::string & slice_permission) { x_slice_permission = slice_permission; };
908 
910  void set_slice_user_ownership(const std::string & slice_user_ownership) { x_slice_user_ownership = slice_user_ownership; };
911 
913  void set_slice_group_ownership(const std::string & slice_group_ownership) { x_slice_group_ownership = slice_group_ownership; };
914 
916  void set_decremental_mode(bool mode) { x_decremental = mode; };
917 
919  void set_sequential_marks(bool sequential) { x_sequential_marks = sequential; };
920 
922  void set_sparse_file_min_size(const infinint & size) { x_sparse_file_min_size = size; };
923 
925  void set_user_comment(const std::string & comment) { x_user_comment = comment; };
926 
928  void set_hash_algo(hash_algo hash) { x_hash = hash; };
929 
931  void set_slice_min_digits(infinint val) { x_slice_min_digits = val; };
932 
934  void set_entrepot(const entrepot & entr);
935 
937  void set_fsa_scope(const fsa_scope & scope) { x_scope = scope; };
938 
940  void set_multi_threaded(bool val) { x_multi_threaded = val; };
941 
942 
944  // getting methods
945 
946  archive * get_auxilliary_ref() const { return x_ref; };
947  const mask & get_selection() const { if(x_selection == nullptr) throw SRC_BUG; return *x_selection; };
948  const mask & get_subtree() const { if(x_subtree == nullptr) throw SRC_BUG; return *x_subtree; };
949  bool get_allow_over() const { return x_allow_over; };
950  bool get_warn_over() const { return x_warn_over; };
951  const crit_action & get_overwriting_rules() const { if(x_overwrite == nullptr) throw SRC_BUG; return *x_overwrite; };
952  bool get_info_details() const { return x_info_details; };
953  bool get_display_treated() const { return x_display_treated; };
954  bool get_display_treated_only_dir() const { return x_display_treated_only_dir; };
955  bool get_display_skipped() const { return x_display_skipped; };
956  const infinint & get_pause() const { return x_pause; };
957  bool get_empty_dir() const { return x_empty_dir; };
958  compression get_compression() const { return x_compr_algo; };
959  U_I get_compression_level() const { return x_compression_level; };
960  const infinint & get_slice_size() const { return x_file_size; };
961  const infinint & get_first_slice_size() const { return x_first_file_size; };
962  const mask & get_ea_mask() const { if(x_ea_mask == nullptr) throw SRC_BUG; return *x_ea_mask; };
963  const std::string & get_execute() const { return x_execute; };
964  crypto_algo get_crypto_algo() const { return x_crypto; };
965  const secu_string & get_crypto_pass() const { return x_pass; };
966  U_32 get_crypto_size() const { return x_crypto_size; };
967  const std::vector<std::string> & get_gnupg_recipients() const { return x_gnupg_recipients; };
968  const std::vector<std::string> & get_gnupg_signatories() const { return x_gnupg_signatories; };
969  const mask & get_compr_mask() const { if(x_compr_mask == nullptr) throw SRC_BUG; return *x_compr_mask; };
970  const infinint & get_min_compr_size() const { return x_min_compr_size; };
971  bool get_empty() const { return x_empty; };
972  bool get_keep_compressed() const { return x_keep_compressed; };
973  const std::string & get_slice_permission() const { return x_slice_permission; };
974  const std::string & get_slice_user_ownership() const { return x_slice_user_ownership; };
975  const std::string & get_slice_group_ownership() const { return x_slice_group_ownership; };
976  bool get_decremental_mode() const { return x_decremental; };
977  bool get_sequential_marks() const { return x_sequential_marks; };
978  infinint get_sparse_file_min_size() const { return x_sparse_file_min_size; };
979  const std::string & get_user_comment() const { return x_user_comment; };
980  hash_algo get_hash_algo() const { return x_hash; };
981  infinint get_slice_min_digits() const { return x_slice_min_digits; };
982  const entrepot & get_entrepot() const { if(x_entrepot == nullptr) throw SRC_BUG; return *x_entrepot; };
983  const fsa_scope & get_fsa_scope() const { return x_scope; };
984  bool get_multi_threaded() const { return x_multi_threaded; };
985 
986  private:
987  archive * x_ref; //< points to an external existing object, must never be deleted by "this"
988  mask * x_selection;
989  mask * x_subtree;
990  bool x_allow_over;
991  bool x_warn_over;
992  crit_action * x_overwrite;
993  bool x_info_details;
994  bool x_display_treated;
995  bool x_display_treated_only_dir;
996  bool x_display_skipped;
997  infinint x_pause;
998  bool x_empty_dir;
999  compression x_compr_algo;
1000  U_I x_compression_level;
1001  infinint x_file_size;
1002  infinint x_first_file_size;
1003  mask * x_ea_mask;
1004  std::string x_execute;
1005  crypto_algo x_crypto;
1006  secu_string x_pass;
1007  U_32 x_crypto_size;
1008  std::vector<std::string> x_gnupg_recipients;
1009  std::vector<std::string> x_gnupg_signatories;
1010  mask * x_compr_mask;
1011  infinint x_min_compr_size;
1012  bool x_empty;
1013  bool x_keep_compressed;
1014  std::string x_slice_permission;
1015  std::string x_slice_user_ownership;
1016  std::string x_slice_group_ownership;
1017  bool x_decremental;
1018  bool x_sequential_marks;
1019  infinint x_sparse_file_min_size;
1020  std::string x_user_comment;
1021  hash_algo x_hash;
1022  infinint x_slice_min_digits;
1023  entrepot *x_entrepot;
1024  fsa_scope x_scope;
1025  bool x_multi_threaded;
1026 
1027  void destroy();
1028  void copy_from(const archive_options_merge & ref);
1029  };
1030 
1031 
1035 
1038  {
1039  public:
1040  enum t_dirty { dirty_ignore, dirty_warn, dirty_ok };
1041 
1042  archive_options_extract() { x_selection = x_subtree = x_ea_mask = nullptr; x_overwrite = nullptr; clear(); };
1043  archive_options_extract(const archive_options_extract & ref) { copy_from(ref); };
1044  const archive_options_extract & operator = (const archive_options_extract & ref) { destroy(); copy_from(ref); return *this; };
1045  ~archive_options_extract() { destroy(); };
1046 
1047  void clear();
1048 
1050  // setting methods
1051 
1053  void set_selection(const mask & selection);
1054 
1056  void set_subtree(const mask & subtree);
1057 
1059  void set_warn_over(bool warn_over) { x_warn_over = warn_over; };
1060 
1067  void set_info_details(bool info_details) { x_info_details = info_details; };
1068 
1072  void set_display_treated(bool display_treated, bool only_dir) { x_display_treated = display_treated; x_display_treated_only_dir = only_dir; };
1073 
1075  void set_display_skipped(bool display_skipped) { x_display_skipped = display_skipped; };
1076 
1078  void set_ea_mask(const mask & ea_mask);
1079 
1081  void set_flat(bool flat) { x_flat = flat; };
1082 
1084  void set_what_to_check(cat_inode::comparison_fields what_to_check) { x_what_to_check = what_to_check; };
1085 
1087  void set_warn_remove_no_match(bool warn_remove_no_match) { x_warn_remove_no_match = warn_remove_no_match; };
1088 
1090  void set_empty(bool empty) { x_empty = empty; };
1091 
1093  void set_empty_dir(bool empty_dir) { x_empty_dir = empty_dir; };
1094 
1096 
1099  void set_dirty_behavior(bool ignore, bool warn) { x_dirty = ignore ? dirty_ignore : (warn ? dirty_warn : dirty_ok); };
1100 
1102  void set_dirty_behavior(t_dirty val) { x_dirty = val; };
1103 
1105  void set_overwriting_rules(const crit_action & over);
1106 
1108 
1110  void set_only_deleted(bool val) { x_only_deleted = val; };
1111 
1112 
1114 
1116  void set_ignore_deleted(bool val) { x_ignore_deleted = val; };
1117 
1119  void set_fsa_scope(const fsa_scope & scope) { x_scope = scope; };
1120 
1121 
1123  // getting methods
1124 
1125  const mask & get_selection() const { if(x_selection == nullptr) throw SRC_BUG; return *x_selection; };
1126  const mask & get_subtree() const { if(x_subtree == nullptr) throw SRC_BUG; return *x_subtree; };
1127  bool get_warn_over() const { return x_warn_over; };
1128  bool get_info_details() const { return x_info_details; };
1129  bool get_display_treated() const { return x_display_treated; };
1130  bool get_display_treated_only_dir() const { return x_display_treated_only_dir; };
1131  bool get_display_skipped() const { return x_display_skipped; };
1132  const mask & get_ea_mask() const { if(x_ea_mask == nullptr) throw SRC_BUG; return *x_ea_mask; };
1133  bool get_flat() const { return x_flat; };
1134  cat_inode::comparison_fields get_what_to_check() const { return x_what_to_check; };
1135  bool get_warn_remove_no_match() const { return x_warn_remove_no_match; };
1136  bool get_empty() const { return x_empty; };
1137  bool get_empty_dir() const { return x_empty_dir; };
1138  t_dirty get_dirty_behavior() const { return x_dirty; }
1139  const crit_action & get_overwriting_rules() const { if(x_overwrite == nullptr) throw SRC_BUG; return *x_overwrite; };
1140  bool get_only_deleted() const { return x_only_deleted; };
1141  bool get_ignore_deleted() const { return x_ignore_deleted; };
1142  const fsa_scope & get_fsa_scope() const { return x_scope; };
1143 
1144  private:
1145  mask * x_selection;
1146  mask * x_subtree;
1147  bool x_warn_over;
1148  bool x_info_details;
1149  bool x_display_treated;
1150  bool x_display_treated_only_dir;
1151  bool x_display_skipped;
1152  mask * x_ea_mask;
1153  bool x_flat;
1154  cat_inode::comparison_fields x_what_to_check;
1155  bool x_warn_remove_no_match;
1156  bool x_empty;
1157  bool x_empty_dir;
1158  t_dirty x_dirty;
1159  crit_action *x_overwrite;
1160  bool x_only_deleted;
1161  bool x_ignore_deleted;
1162  fsa_scope x_scope;
1163 
1164  void destroy();
1165  void copy_from(const archive_options_extract & ref);
1166  };
1167 
1168 
1169 
1170 
1174 
1177  {
1178  public:
1179  archive_options_listing() { x_selection = x_subtree = nullptr; x_slicing_first = x_slicing_others = nullptr; clear(); };
1180  archive_options_listing(const archive_options_listing & ref) { copy_from(ref); };
1181  const archive_options_listing & operator = (const archive_options_listing & ref) { destroy(); copy_from(ref); return *this; };
1182  ~archive_options_listing() { destroy(); };
1183 
1184  void clear();
1185 
1187 
1189  {
1190  normal, //< the tar-like listing (this is the default)
1191  tree, //< the original dar's tree listing (for those that like forest)
1192  xml, //< the xml catalogue output
1193  slicing //< the slicing output (give info about where files are located)
1194  };
1195 
1197  // setting methods
1198 
1199  void set_info_details(bool info_details) { x_info_details = info_details; };
1200  void set_list_mode(listformat list_mode) { x_list_mode = list_mode; };
1201  void set_selection(const mask & selection);
1202  void set_subtree(const mask & subtree);
1203  void set_filter_unsaved(bool filter_unsaved) { x_filter_unsaved = filter_unsaved; };
1204  void set_display_ea(bool display_ea) { x_display_ea = display_ea; };
1205  void set_user_slicing(const infinint & slicing_first, const infinint & slicing_others);
1206  void set_sizes_in_bytes(bool arg) { x_sizes_in_bytes = arg; };
1207 
1209  // getting methods
1210 
1211  bool get_info_details() const { return x_info_details; };
1212  listformat get_list_mode() const { return x_list_mode; };
1213  const mask & get_selection() const;
1214  const mask & get_subtree() const;
1215  bool get_filter_unsaved() const { return x_filter_unsaved; };
1216  bool get_display_ea() const { return x_display_ea; };
1217  bool get_user_slicing(infinint & slicing_first, infinint & slicing_others) const;
1218  bool get_sizes_in_bytes() const { return x_sizes_in_bytes; };
1219 
1220  private:
1221  bool x_info_details;
1222  listformat x_list_mode;
1223  mask * x_selection;
1224  mask * x_subtree;
1225  bool x_filter_unsaved;
1226  bool x_display_ea;
1227  infinint *x_slicing_first;
1228  infinint *x_slicing_others;
1229  bool x_sizes_in_bytes;
1230 
1231  void destroy();
1232  void copy_from(const archive_options_listing & ref);
1233  };
1234 
1235 
1239 
1240 
1241  class archive_options_diff : public on_pool
1242  {
1243  public:
1244  archive_options_diff() { x_selection = x_subtree = x_ea_mask = nullptr; clear(); };
1245  archive_options_diff(const archive_options_diff & ref) { copy_from(ref); };
1246  const archive_options_diff & operator = (const archive_options_diff & ref) { destroy(); copy_from(ref); return *this; };
1247  ~archive_options_diff() { destroy(); };
1248 
1249  void clear();
1250 
1252  // setting methods
1253 
1255  void set_selection(const mask & selection);
1256 
1258  void set_subtree(const mask & subtree);
1259 
1266  void set_info_details(bool info_details) { x_info_details = info_details; };
1267 
1271  void set_display_treated(bool display_treated, bool only_dir) { x_display_treated = display_treated; x_display_treated_only_dir = only_dir; };
1272 
1274  void set_display_skipped(bool display_skipped) { x_display_skipped = display_skipped; };
1275 
1277  void set_ea_mask(const mask & ea_mask);
1278 
1280  void set_what_to_check(cat_inode::comparison_fields what_to_check) { x_what_to_check = what_to_check; };
1281 
1283 
1286  void set_alter_atime(bool alter_atime)
1287  {
1288  if(x_furtive_read)
1289  x_old_alter_atime = alter_atime;
1290  else
1291  x_alter_atime = alter_atime;
1292  };
1293 
1295  void set_furtive_read_mode(bool furtive_read);
1296 
1298  void set_hourshift(const infinint & hourshift) { x_hourshift = hourshift; };
1299 
1301  void set_compare_symlink_date(bool compare_symlink_date) { x_compare_symlink_date = compare_symlink_date; };
1302 
1304  void set_fsa_scope(const fsa_scope & scope) { x_scope = scope; };
1305 
1306 
1308  // getting methods
1309 
1310  const mask & get_selection() const { if(x_selection == nullptr) throw SRC_BUG; return *x_selection; };
1311  const mask & get_subtree() const { if(x_subtree == nullptr) throw SRC_BUG; return *x_subtree; };
1312  bool get_info_details() const { return x_info_details; };
1313  bool get_display_treated() const { return x_display_treated; };
1314  bool get_display_treated_only_dir() const { return x_display_treated_only_dir; };
1315  bool get_display_skipped() const { return x_display_skipped; };
1316  const mask & get_ea_mask() const { if(x_ea_mask == nullptr) throw SRC_BUG; return *x_ea_mask; };
1317  cat_inode::comparison_fields get_what_to_check() const { return x_what_to_check; };
1318  bool get_alter_atime() const { return x_alter_atime; };
1319  bool get_furtive_read_mode() const { return x_furtive_read; };
1320  const infinint & get_hourshift() const { return x_hourshift; };
1321  bool get_compare_symlink_date() const { return x_compare_symlink_date; };
1322  const fsa_scope & get_fsa_scope() const { return x_scope; };
1323 
1324  private:
1325  mask * x_selection;
1326  mask * x_subtree;
1327  bool x_info_details;
1328  bool x_display_treated;
1329  bool x_display_treated_only_dir;
1330  bool x_display_skipped;
1331  mask * x_ea_mask;
1332  cat_inode::comparison_fields x_what_to_check;
1333  bool x_alter_atime;
1334  bool x_old_alter_atime;
1335  bool x_furtive_read;
1336  infinint x_hourshift;
1337  bool x_compare_symlink_date;
1338  fsa_scope x_scope;
1339 
1340  void destroy();
1341  void copy_from(const archive_options_diff & ref);
1342  };
1343 
1344 
1345 
1346 
1350 
1353  {
1354  public:
1355  archive_options_test() { x_selection = x_subtree = nullptr; clear(); };
1356  archive_options_test(const archive_options_test & ref) { copy_from(ref); };
1357  const archive_options_test & operator = (const archive_options_test & ref) { destroy(); copy_from(ref); return *this; };
1358  ~archive_options_test() { destroy(); };
1359 
1360  void clear();
1361 
1363  // setting methods
1364 
1366  void set_selection(const mask & selection);
1367 
1369  void set_subtree(const mask & subtree);
1370 
1377  void set_info_details(bool info_details) { x_info_details = info_details; };
1378 
1380  void set_display_skipped(bool display_skipped) { x_display_skipped = display_skipped; };
1381 
1385  void set_display_treated(bool display_treated, bool only_dir) { x_display_treated = display_treated; x_display_treated_only_dir = only_dir; };
1386 
1388  void set_empty(bool empty) { x_empty = empty; };
1389 
1390 
1392  // getting methods
1393 
1394  const mask & get_selection() const { if(x_selection == nullptr) throw SRC_BUG; return *x_selection; };
1395  const mask & get_subtree() const { if(x_subtree == nullptr) throw SRC_BUG; return *x_subtree; };
1396  bool get_info_details() const { return x_info_details; };
1397  bool get_display_treated() const { return x_display_treated; };
1398  bool get_display_treated_only_dir() const { return x_display_treated_only_dir; };
1399  bool get_display_skipped() const { return x_display_skipped; };
1400  bool get_empty() const { return x_empty; };
1401 
1402  private:
1403  mask * x_selection;
1404  mask * x_subtree;
1405  bool x_info_details;
1406  bool x_display_treated;
1407  bool x_display_treated_only_dir;
1408  bool x_display_skipped;
1409  bool x_empty;
1410 
1411  void destroy();
1412  void copy_from(const archive_options_test & ref);
1413  };
1414 
1416 
1417 } // end of namespace
1418 
1419 #endif
contains classes that let the user define the policy for overwriting files
void set_slice_group_ownership(const std::string &slice_group_ownership)
if not an empty string set the group ownership of slices accordingly
void set_fsa_scope(const fsa_scope &scope)
defines the FSA (Filesystem Specific Attribute) to only consider (by default all FSA are considered) ...
void set_auto_zeroing_neg_dates(bool val)
whether to automatically zeroing negative dates read from the filesystem (just warn, don&#39;t ask whether to pursue)
defines the entrepot interface. Entrepot interface defines a generic way to interact with files (slic...
void set_display_skipped(bool display_skipped)
whether to display files that have been excluded by filters
void set_external_catalogue(const path &ref_chem, const std::string &ref_basename)
defines whether or not to use the catalogue from an extracted catalogue (instead of the one embedded ...
void set_gnupg_signatories(const std::vector< std::string > &gnupg_signatories)
the private keys matching the email of the provided list are used to sign the archive random key ...
void set_execute(const std::string &execute)
set the command to execute after each slice creation
void set_alter_atime(bool alter_atime)
whether to alter atime or ctime in the filesystem when reading files to save
filesystem specific attributes available families and fsa_scope definition
void set_display_treated(bool display_treated, bool only_dir)
the generic class, parent of all masks
Definition: mask.hpp:62
void set_crypto_size(U_32 crypto_size)
set the size of the encryption by block to use
void set_multi_threaded(bool val)
whether libdar is allowed to create several thread to work possilbiy faster on multicore CPU (need li...
void set_display_treated(bool display_treated, bool only_dir)
bool furtive_read()
returns whether libdar can support furtive read mode when run by privileged user
void set_crypto_algo(crypto_algo crypto)
cypher to use
are defined here basic integer types that tend to be portable
void set_ignore_unknown_inode_type(bool val)
whether to ignore unknown inode types instead of issuing a warning
void set_slice_user_ownership(const std::string &slice_user_ownership)
if not an empty string set the user ownership of slices accordingly
void set_sequential_marks(bool sequential)
whether to activate escape sequence aka tape marks to allow sequential reading of the archive ...
void set_fsa_scope(const fsa_scope &scope)
defines the FSA (Filesystem Specific Attribute) to only consider (by default all FSA activated at com...
void set_display_skipped(bool display_skipped)
whether to display files that have been excluded by filters
void set_slice_group_ownership(const std::string &slice_group_ownership)
if not an empty string set the group ownership of slices accordingly
void set_crypto_pass(const secu_string &pass)
void set_crypto_size(U_32 crypto_size)
the encryption block size to use to decrypt
void set_slice_group_ownership(const std::string &slice_group_ownership)
if not an empty string set the group ownership of slices accordingly
void set_decremental_mode(bool mode)
if set to true use a merging mode suitable to build a decremental backup from two full backups (see N...
void set_warn_remove_no_match(bool warn_remove_no_match)
whether a warning must be issue if a file to remove does not match the expected type of file ...
void set_execute(const std::string &execute)
set the command to execute before reading each slice (empty string for no script) ...
void set_header_only(bool val)
whether we only read the archive header and exit
void set_empty(bool empty)
whether to make a dry-run operation
void set_display_skipped(bool display_skipped)
whether to display files that have been excluded by filters
archive_options_read(const archive_options_read &ref)
the copy constructor, assignment operator and destructor
void set_only_deleted(bool val)
only consider deleted files (if set, no data get restored)
void set_warn_over(bool warn_over)
defines whether a warning shall be issued before overwriting
void set_slice_user_ownership(const std::string &slice_user_ownership)
if not an empty string set the user ownership of slices accordingly
exception used when a requested fearture has not beed activated at compilation time ...
Definition: erreurs.hpp:285
void set_gnupg_recipients(const std::vector< std::string > &gnupg_recipients)
void set_crypto_algo(crypto_algo crypto)
set the cypher to use
void set_fixed_date(const infinint &fixed_date)
whether to ignore any archive of reference and only save file which modification is more recent that ...
class holding optional parameters used to test the structure coherence of an existing archive ...
void set_sequential_marks(bool sequential)
whether to add escape sequence aka tape marks to allow sequential reading of the archive ...
void set_slice_permission(const std::string &slice_permission)
if not an empty string set the slice permission according to the octal value given.
void set_user_comment(const std::string &comment)
specify a user comment in the archive (always in clear text!)
void set_execute(const std::string &execute)
set the command to execute after each slice creation
void set_min_compr_size(const infinint &min_compr_size)
defines file size under which to never compress
void set_slice_min_digits(infinint val)
defines the minimum digit a slice must have concerning its number, zeros will be prepended as much as...
void set_default_crypto_size()
set the encryption block size to the default value
void set_gnupg_recipients(const std::vector< std::string > &gnupg_recipients)
void set_exclude_by_ea(const std::string &ea_name)
void set_gnupg_signatories(const std::vector< std::string > &gnupg_signatories)
the private keys matching the email of the provided list are used to sign the archive random key ...
archive_options_read()
build an object and set options to their default values
void set_slice_user_ownership(const std::string &slice_user_ownership)
if not an empty string set the user ownership of slices accordingly
void set_what_to_check(cat_inode::comparison_fields what_to_check)
fields to consider when comparing inodes with those on filesystem to determine if it is more recent (...
void set_empty_dir(bool empty_dir)
whether to restore directories where no file has been triggered for backup (no file/inode change...
void clear()
reset all the options to their default values
void set_hourshift(const infinint &hourshift)
ignore differences of at most this integer number of hours while looking for changes in dates ...
void set_reference(archive *ref_arch)
set the archive to take as reference (nullptr for a full backup)
void set_hash_algo(hash_algo hash)
specify whether to produce a hash file of the slice and which hash algo to use
void set_crypto_pass(const secu_string &pass)
defines the password or passphrase to decrypt (unused if encryption is not set)
void set_furtive_read_mode(bool furtive_read)
whether to use furtive read mode (if activated, alter_atime() has no meaning/use) ...
void set_pause(const infinint &pause)
Pause beteween slices. Set to zero does not pause at all, set to 1 makes libdar pauses each slice...
the crypto algoritm definition
void set_entrepot(const entrepot &entr)
defines the protocol to use to retrieve slices
void set_user_comment(const std::string &comment)
specify a user comment in the archive (always in clear text!)
void set_ref_entrepot(const entrepot &entr)
defines the protocol to use to retrieve slices of the reference archive (where the external catalogue...
void set_empty(bool empty)
defines whether we need to store ignored directories as empty
void set_display_finished(bool display_finished)
whether to display a summary for each completed directory with total saved data and compression ratio...
void set_gnupg_recipients(const std::vector< std::string > &gnupg_recipients)
void set_sparse_file_min_size(const infinint &size)
whether to try to detect sparse files
void set_allow_over(bool allow_over)
whether overwritting is allowed
void set_warn_over(bool warn_over)
defines whether a warning shall be issued before overwriting
void set_info_details(bool info_details)
whether the user needs detailed output of the operation
void set_ignore_signature_check_failure(bool val)
whether to warn (true) or ignore (false) signature failure (default is true)
void set_empty(bool empty)
whether to make a dry-run operation
void set_slice_permission(const std::string &slice_permission)
if not an empty string set the slice permission according to the octal value given.
void set_slice_min_digits(infinint val)
defines the minimum digit a slice must have concerning its number, zeros will be prepended as much as...
void set_compression(compression algo)
the compression algorithm used
void set_crypto_size(U_32 crypto_size)
set the size of the encryption by block to use
void set_empty(bool empty)
dry-run exectution if set to true
void set_sequential_marks(bool sequential)
whether to add escape sequence aka tape marks to allow sequential reading of the archive ...
the archive class realizes the most general operations on archives
Definition: archive.hpp:56
void set_snapshot(bool snapshot)
whether to make an emtpy archive only referencing the current state of files in the filesystem ...
void set_ref_crypto_size(U_32 ref_crypto_size)
defines the crypto size for the reference catalogue
crypto_algo
Definition: crypto.hpp:49
void set_empty(bool empty)
defines whether we do a dry-run execution
void set_same_fs(bool same_fs)
whether to limit the backup to files located on the same filesystem as the directory taken as root of...
void set_allow_over(bool allow_over)
defines whether overwritting is allowed or not
void set_user_comment(const std::string &comment)
specify a user comment in the archive (always in clear text!)
void set_fsa_scope(const fsa_scope &scope)
defines the FSA (Filesystem Specific Attribute) to only consider (by default all FSA activated at com...
void set_crypto_pass(const secu_string &pass)
password / passphrase to encrypt the data with (empty string for interactive question) ...
exception used when memory has been exhausted
Definition: erreurs.hpp:111
void set_slice_min_digits(infinint val)
defines the minimum digit a slice must have concerning its number, zeros will be prepended as much as...
void set_info_details(bool info_details)
defines whether the user needs detailed output of the operation
void set_ref_crypto_pass(const secu_string &ref_pass)
defines the pass for the reference catalogue
void set_compression_level(U_I compression_level)
the compression level (from 1 to 9)
void set_display_skipped(bool display_skipped)
whether to display files that have been excluded by filters
void set_dirty_behavior(bool ignore, bool warn)
whether to restore dirty files (those that changed during backup), warn before restoring or ignoring ...
listformat
defines the way archive listing is done:
void set_keep_compressed(bool keep_compressed)
make dar ignore the &#39;algo&#39; argument and do not uncompress / compress files that are selected for merg...
the global action for overwriting
Definition: criterium.hpp:77
void set_crypto_size(U_32 crypto_size)
size of the encryption by block to use
class holding optional parameters used to extract files from an existing archive
void set_info_details(bool info_details)
void set_warn_over(bool warn_over)
whether a warning shall be issued before overwriting
void set_compression(compression compr_algo)
set the compression algorithm to be used
void set_slice_min_digits(infinint val)
defines the minimum digit a slice must have concerning its number, zeros will be prepended as much as...
void set_flat(bool flat)
whether to ignore directory structure and restore all files in the same directory ...
void set_info_details(bool info_details)
void set_cache_directory_tagging(bool cache_directory_tagging)
whether to consider the Cache Directory Tagging Standard
void set_pause(const infinint &pause)
set a pause beteween slices. Set to zero does not pause at all, set to 1 makes libdar pauses each sli...
class hash_fichier definition.This is an inherited class from class fichier Objects of that class are...
void set_info_details(bool info_details)
here lies a collection of mask classes
void set_multi_threaded(bool val)
whether libdar is allowed to spawn several threads to possibily work faster on multicore CPU (require...
void set_ignore_deleted(bool val)
do not consider deleted files (if set, no inode will be removed)
void set_what_to_check(cat_inode::comparison_fields what_to_check)
set the fields to consider when comparing inodes with reference archive (see cat_inode::comparison_fi...
void set_dirty_behavior(t_dirty val)
alternative method to modify dirty behavior
void set_hash_algo(hash_algo hash)
void set_compression(compression compr_algo)
set the compression algorithm to be used
void set_retry_on_change(const infinint &count_max_per_file, const infinint &global_max_byte_overhead=0)
how much time to retry saving a file if it changed while being read
void set_crypto_pass(const secu_string &pass)
class secu_string
Definition: secu_string.hpp:57
void set_ref_slice_min_digits(infinint val)
defines the minim digit for slice number of the archive of reference (where the external catalogue is...
void set_crypto_algo(crypto_algo crypto)
set the cypher to use
compression
the different compression algorithm available
Definition: compressor.hpp:43
void set_input_pipe(const std::string &input_pipe)
set the name of the input pipe to read data from (when basename is set to "-")
provides a set of macro to change the NLS from user application domaine to libdar domain and vicevers...
void set_gnupg_signatories(const std::vector< std::string > &gnupg_signatories)
the private keys matching the email of the provided list are used to sign the archive random key ...
bool nodump()
returns whether nodump flag support has been activated at compilation time
void set_slice_permission(const std::string &slice_permission)
if not an empty string set the slice permission according to the octal value given.
void set_execute(const std::string &execute)
command to execute after each slice creation
compression engine implementation
void set_pause(const infinint &pause)
set a pause beteween slices. Set to zero does not pause at all, set to 1 makes libdar pauses each sli...
void set_slicing(const infinint &file_size, const infinint &first_file_size=0)
define the archive slicing
void set_hash_algo(hash_algo hash)
specify whether to produce a hash file of the slice and which hash algo to use
void set_ref_crypto_algo(crypto_algo ref_crypto)
defines the crypto algo for the reference catalogue
void set_display_treated(bool display_treated, bool only_dir)
this is the base class of object that can be allocated on a memory pool
class holding optional parameters used to list the contents of an existing archive ...
void set_info_details(bool info_details)
void set_multi_threaded(bool val)
whether libdar is allowed to spawn several threads to possibily work faster on multicore CPU (require...
void set_empty_dir(bool empty_dir)
defines whether we need to store ignored directories as empty
void set_slicing(const infinint &file_size, const infinint &first_file_size=0)
define the archive slicing
the arbitrary large positive integer class
void set_compression_level(U_I compression_level)
set the compression level (from 1 to 9)
void unset_external_catalogue()
clear any reference to an external catalogue
void set_crypto_algo(crypto_algo val)
void set_ref_execute(const std::string &ref_execute)
set the command to execute before reading each slice of the reference catalogue
void set_warn_over(bool warn_over)
defines whether a warning shall be issued before overwriting
void set_multi_threaded(bool val)
whether libdar is allowed to created several thread to work possibily faster on multicore CPU (requir...
class holding optional parameters used to read an existing archive
class holding optional parameters used to proceed to the merge operation
void set_output_pipe(const std::string &output_pipe)
set the name of the output pipe to send orders to (when basenale is set to "-")
void set_security_check(bool check)
whether to check for ctime changes since with the archive of reference
void set_slicing(const infinint &file_size, const infinint &first_file_size=0)
define the archive slicing
class holding optional parameters used to create an archive
void set_nodump(bool nodump)
defines whether to ignore files with the nodump flag set
void set_allow_over(bool allow_over)
defines whether overwritting is allowed or not
this file contains the definition of secu_string class, a std::string like class but allocated in sec...
class holding optional parameters used to isolate an existing archive
the Entrepot interface
Definition: entrepot.hpp:61
libdar namespace encapsulate all libdar symbols
Definition: archive.hpp:47
comparison_fields
flag used to only consider certain fields when comparing/restoring inodes
Definition: cat_inode.hpp:60
void set_display_treated(bool display_treated, bool only_dir)
void set_lax(bool val)
defines whether any archive coherence error, system error or media error lead to the abortion of the ...
here is defined the many classed which is build of the catalogue
void set_sparse_file_min_size(const infinint &size)
whether to try to detect sparse files
void set_empty_dir(bool empty_dir)
defines whether we need to store ignored directories as empty
void set_min_compr_size(const infinint &min_compr_size)
defines file size under which to never compress
void set_sequential_read(bool val)
defines whether to try reading the archive sequentially (ala tar) or using the final catalogue ...
the class path is here to manipulate paths in the Unix notation: using&#39;/&#39;
Definition: path.hpp:50
void set_compression_level(U_I compression_level)
set the compression level (from 1 to 9)