Disk ARchive  2.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
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 // $Id: archive_options.hpp,v 1.35 2011/04/12 16:31:35 edrusb Rel $
22 //
23 /*********************************************************************/
24 //
25 
29 
30 #ifndef ARCHIVE_OPTIONS_HPP
31 #define ARCHIVE_OPTIONS_HPP
32 
33 #include "../my_config.h"
34 #include "crypto.hpp"
35 #include "integers.hpp"
36 #include "mask.hpp"
37 #include "compressor.hpp"
38 #include "catalogue.hpp"
39 #include "criterium.hpp"
40 #include "hash_fichier.hpp"
41 #include "secu_string.hpp"
42 #include "nls_swap.hpp"
43 
44 #include <string>
45 
46 namespace libdar
47 {
48  class archive; // needed to be able to use pointer on archive object.
49 
50 
54 
57 
58 
61  {
62  public:
65 
67  // set back to default (this is the state just after the object is constructed
68  // this method is to be used to reuse a given object
69 
71  void clear();
72 
73 
75  // setting methods
76 
77 
79  void set_crypto_algo(crypto_algo val) { x_crypto = val; };
80 
82  void set_crypto_pass(const secu_string & pass) { x_pass = pass; };
83 
85  void set_crypto_size(U_32 crypto_size) { x_crypto_size = crypto_size; };
86 
89 
91 
94  void set_input_pipe(const std::string & input_pipe) { x_input_pipe = input_pipe; };
95 
97 
100  void set_output_pipe(const std::string & output_pipe) { x_output_pipe = output_pipe; };
101 
103 
111  void set_execute(const std::string & execute) { x_execute = execute; };
112 
114  void set_info_details(bool info_details) { x_info_details = info_details; };
115 
117  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; };
120 
122  void set_ref_crypto_algo(crypto_algo ref_crypto) { x_ref_crypto = ref_crypto; };
123 
125  void set_ref_crypto_pass(const secu_string & ref_pass) { x_ref_pass = ref_pass; };
126 
128  void set_ref_crypto_size(U_32 ref_crypto_size) { x_ref_crypto_size = ref_crypto_size; };
129 
131 
139  void set_ref_execute(const std::string & ref_execute) { x_ref_execute = ref_execute; };
140 
142 
146  void set_lax(bool val) { x_lax = val; };
147 
149 
151 
152  void set_sequential_read(bool val) { x_sequential_read = val; };
153 
155 
156  void set_slice_min_digits(infinint val) { x_slice_min_digits = val; };
157 
159 
160  void set_ref_slice_min_digits(infinint val) { x_ref_slice_min_digits = val; };
161 
162 
164  // getting methods (mainly used inside libdar, but kept public and part of the API in the case it is needed)
165 
166 
167  crypto_algo get_crypto_algo() const { return x_crypto; };
168  const secu_string & get_crypto_pass() const { return x_pass; };
169  U_32 get_crypto_size() const { return x_crypto_size; };
170  const std::string & get_input_pipe() const { return x_input_pipe; };
171  const std::string & get_output_pipe() const { return x_output_pipe; };
172  const std::string & get_execute() const { return x_execute; };
173  bool get_info_details() const { return x_info_details; };
174  bool get_lax() const { return x_lax; };
175  bool get_sequential_read() const { return x_sequential_read; };
176  infinint get_slice_min_digits() const { return x_slice_min_digits; };
177 
178  // All methods that follow concern the archive where to fetch the (isolated) catalogue from
179  bool is_external_catalogue_set() const { return external_cat; };
180  const path & get_ref_path() const;
181  const std::string & get_ref_basename() const;
182  crypto_algo get_ref_crypto_algo() const { return x_ref_crypto; };
183  const secu_string & get_ref_crypto_pass() const { return x_ref_pass; };
184  U_32 get_ref_crypto_size() const { return x_ref_crypto_size; };
185  const std::string & get_ref_execute() const { return x_ref_execute; };
186  infinint get_ref_slice_min_digits() const { return x_ref_slice_min_digits; };
187 
188 
189  private:
190  crypto_algo x_crypto;
191  secu_string x_pass;
192  U_32 x_crypto_size;
193  std::string x_input_pipe;
194  std::string x_output_pipe;
195  std::string x_execute;
196  bool x_info_details;
197  bool x_lax;
198  bool x_sequential_read;
199  infinint x_slice_min_digits;
200 
201  // external catalogue relative fields
202  bool external_cat;
203  path x_ref_chem;
204  std::string x_ref_basename;
205  crypto_algo x_ref_crypto;
206  secu_string x_ref_pass;
207  U_32 x_ref_crypto_size;
208  std::string x_ref_execute;
209  infinint x_ref_slice_min_digits;
210  };
211 
212 
216 
219  {
220  public:
221  // default constructors and destructor.
222 
223  archive_options_create() { x_selection = x_subtree = x_ea_mask = x_compr_mask = x_backup_hook_file_mask = NULL; clear(); };
224  archive_options_create(const archive_options_create & ref) { copy_from(ref); };
225  const archive_options_create & operator = (const archive_options_create & ref) { destroy(); copy_from(ref); return *this; };
226  ~archive_options_create() { destroy(); };
227 
229  // set back to default (this is the state just after the object is constructed
230  // this method is to be used to reuse a given object
231 
233  void clear();
234 
235 
237  // setting methods
238 
240  void set_reference(archive *ref_arch) { x_ref_arch = ref_arch; };
241 
243  void set_selection(const mask & selection);
244 
246  void set_subtree(const mask & subtree);
247 
249  void set_allow_over(bool allow_over) { x_allow_over = allow_over; };
250 
252  void set_warn_over(bool warn_over) { x_warn_over = warn_over; };
253 
255  void set_info_details(bool info_details) { x_info_details = info_details; };
256 
258  void set_pause(const infinint & pause) { x_pause = pause; };
259 
261  void set_empty_dir(bool empty_dir) { x_empty_dir = empty_dir; };
262 
264  void set_compression(compression compr_algo) { x_compr_algo = compr_algo; };
265 
267  void set_compression_level(U_I compression_level) { x_compression_level = compression_level; };
268 
270 
274  void set_slicing(const infinint & file_size, const infinint & first_file_size = 0)
275  {
276  x_file_size = file_size;
277  if(first_file_size == 0)
278  x_first_file_size = file_size;
279  else
280  x_first_file_size = first_file_size;
281  };
282 
283 
285  void set_ea_mask(const mask & ea_mask);
286 
288  void set_execute(const std::string & execute) { x_execute = execute; };
289 
291  void set_crypto_algo(crypto_algo crypto) { x_crypto = crypto; };
292 
295  void set_crypto_pass(const secu_string & pass) { x_pass = pass; };
296 
298  void set_crypto_size(U_32 crypto_size) { x_crypto_size = crypto_size; };
299 
301  void set_compr_mask(const mask & compr_mask);
302 
304  void set_min_compr_size(const infinint & min_compr_size) { x_min_compr_size = min_compr_size; };
305 
307  void set_nodump(bool nodump) { x_nodump = nodump; };
308 
310  void set_what_to_check(inode::comparison_fields what_to_check) { x_what_to_check = what_to_check; };
311 
313  void set_hourshift(const infinint & hourshift) { x_hourshift = hourshift; };
314 
316  void set_empty(bool empty) { x_empty = empty; };
317 
319 
322  void set_alter_atime(bool alter_atime)
323  {
324  if(x_furtive_read)
325  x_old_alter_atime = alter_atime;
326  else
327  x_alter_atime = alter_atime;
328  };
329 
332  {
333  NLS_SWAP_IN;
334  try
335  {
336 
337 #if FURTIVE_READ_MODE_AVAILABLE
338  x_furtive_read = furtive_read;
339  if(furtive_read)
340  {
341  x_old_alter_atime = x_alter_atime;
342  x_alter_atime = true;
343  // this is required to avoid libdar manipulating ctime of inodes
344  }
345  else
346  x_alter_atime = x_old_alter_atime;
347 #else
348  if(furtive_read)
349  throw Ecompilation(gettext("Furtive read mode"));
350  x_furtive_read = false;
351 #endif
352  }
353  catch(...)
354  {
355  NLS_SWAP_OUT;
356  throw;
357  }
358  NLS_SWAP_OUT;
359  };
360 
362  void set_same_fs(bool same_fs) { x_same_fs = same_fs; };
363 
365  void set_snapshot(bool snapshot) { x_snapshot = snapshot; };
366 
368  void set_cache_directory_tagging(bool cache_directory_tagging) { x_cache_directory_tagging = cache_directory_tagging; };
369 
371  void set_display_skipped(bool display_skipped) { x_display_skipped = display_skipped; };
372 
374  void set_fixed_date(const infinint & fixed_date) { x_fixed_date = fixed_date; };
375 
377  void set_slice_permission(const std::string & slice_permission) { x_slice_permission = slice_permission; };
378 
380  void set_slice_user_ownership(const std::string & slice_user_ownership) { x_slice_user_ownership = slice_user_ownership; };
381 
383  void set_slice_group_ownership(const std::string & slice_group_ownership) { x_slice_group_ownership = slice_group_ownership; };
384 
386  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; };
387 
389  void set_sequential_marks(bool sequential) { x_sequential_marks = sequential; };
390 
392  void set_sparse_file_min_size(const infinint & size) { x_sparse_file_min_size = size; };
393 
395  void set_security_check(bool check) { x_security_check = check; };
396 
398  void set_user_comment(const std::string & comment) { x_user_comment = comment; };
399 
401  void set_hash_algo(hash_algo hash) { x_hash = hash; };
402 
404  void set_slice_min_digits(infinint val) { x_slice_min_digits = val; };
405 
407  void set_backup_hook(const std::string & execute, const mask & which_files);
408 
410  void set_ignore_unknown_inode_type(bool val) { x_ignore_unknown = val; };
411 
413  // getting methods
414 
415  archive *get_reference() const { return x_ref_arch; };
416  const mask & get_selection() const { if(x_selection == NULL) throw SRC_BUG; return *x_selection; };
417  const mask & get_subtree() const { if(x_subtree == NULL) throw SRC_BUG; return *x_subtree; };
418  bool get_allow_over() const { return x_allow_over; };
419  bool get_warn_over() const { return x_warn_over; };
420  bool get_info_details() const { return x_info_details; };
421  const infinint & get_pause() const { return x_pause; };
422  bool get_empty_dir() const { return x_empty_dir; };
423  compression get_compression() const { return x_compr_algo; };
424  U_I get_compression_level() const { return x_compression_level; };
425  const infinint & get_slice_size() const { return x_file_size; };
426  const infinint & get_first_slice_size() const { return x_first_file_size; };
427  const mask & get_ea_mask() const { if(x_ea_mask == NULL) throw SRC_BUG; return *x_ea_mask; };
428  const std::string & get_execute() const { return x_execute; };
429  crypto_algo get_crypto_algo() const { return x_crypto; };
430  const secu_string & get_crypto_pass() const { return x_pass; };
431  U_32 get_crypto_size() const { return x_crypto_size; };
432  const mask & get_compr_mask() const { if(x_compr_mask == NULL) throw SRC_BUG; return *x_compr_mask; };
433  const infinint & get_min_compr_size() const { return x_min_compr_size; };
434  bool get_nodump() const { return x_nodump; };
435  inode::comparison_fields get_comparison_fields() const { return x_what_to_check; };
436  const infinint & get_hourshift() const { return x_hourshift; };
437  bool get_empty() const { return x_empty; };
438  bool get_alter_atime() const { return x_alter_atime; };
439  bool get_furtive_read_mode() const { return x_furtive_read; };
440  bool get_same_fs() const { return x_same_fs; };
441  bool get_snapshot() const { return x_snapshot; };
442  bool get_cache_directory_tagging() const { return x_cache_directory_tagging; };
443  bool get_display_skipped() const { return x_display_skipped; };
444  const infinint & get_fixed_date() const { return x_fixed_date; };
445  const std::string & get_slice_permission() const { return x_slice_permission; };
446  const std::string & get_slice_user_ownership() const { return x_slice_user_ownership; };
447  const std::string & get_slice_group_ownership() const { return x_slice_group_ownership; };
448  const infinint & get_repeat_count() const { return x_repeat_count; };
449  const infinint & get_repeat_byte() const { return x_repeat_byte; };
450  bool get_sequential_marks() const { return x_sequential_marks; };
451  infinint get_sparse_file_min_size() const { return x_sparse_file_min_size; };
452  bool get_security_check() const { return x_security_check; };
453  const std::string & get_user_comment() const { return x_user_comment; };
454  hash_algo get_hash_algo() const { return x_hash; };
455  infinint get_slice_min_digits() const { return x_slice_min_digits; };
456  const std::string & get_backup_hook_file_execute() const { return x_backup_hook_file_execute; };
457  const mask & get_backup_hook_file_mask() const { return *x_backup_hook_file_mask; };
458  bool get_ignore_unknown_inode_type() const { return x_ignore_unknown; };
459 
460  private:
461  archive *x_ref_arch; //< just contains the address of an existing object, no local copy of object is done here
462  mask * x_selection; //< points to a local copy of mask (must be allocated / releases by the archive_option_create object)
463  mask * x_subtree; //< points to a local copy of mask (must be allocated / releases by the archive_option_create objects)
464  bool x_allow_over;
465  bool x_warn_over;
466  bool x_info_details;
467  infinint x_pause;
468  bool x_empty_dir;
469  compression x_compr_algo;
470  U_I x_compression_level;
471  infinint x_file_size;
472  infinint x_first_file_size;
473  mask * x_ea_mask; //< points to a local copy of mask (must be allocated / releases by the archive_option_create objects)
474  std::string x_execute;
475  crypto_algo x_crypto;
476  secu_string x_pass;
477  U_32 x_crypto_size;
478  mask * x_compr_mask; //< points to a local copy of mask (must be allocated / releases by the archive_option_create objects)
479  infinint x_min_compr_size;
480  bool x_nodump;
481  inode::comparison_fields x_what_to_check;
482  infinint x_hourshift;
483  bool x_empty;
484  bool x_alter_atime;
485  bool x_old_alter_atime; //< used to backup origina alter_atime value when activating furtive read mode
486  bool x_furtive_read;
487  bool x_same_fs;
488  bool x_snapshot;
489  bool x_cache_directory_tagging;
490  bool x_display_skipped;
491  infinint x_fixed_date;
492  std::string x_slice_permission;
493  std::string x_slice_user_ownership;
494  std::string x_slice_group_ownership;
495  infinint x_repeat_count;
496  infinint x_repeat_byte;
497  bool x_sequential_marks;
498  infinint x_sparse_file_min_size;
499  bool x_security_check;
500  std::string x_user_comment;
501  hash_algo x_hash;
502  infinint x_slice_min_digits;
503  mask * x_backup_hook_file_mask;
504  std::string x_backup_hook_file_execute;
505  bool x_ignore_unknown;
506 
507  void destroy();
508  void copy_from(const archive_options_create & ref);
509  void destroy_mask(mask * & ptr);
510  void clean_mask(mask * & ptr);
511  void check_mask(const mask & m);
512  };
513 
514 
515 
516 
517 
518 
522 
525  {
526  public:
527  archive_options_isolate() { clear(); };
528 
529  void clear();
530 
532  // setting methods
533 
535  void set_allow_over(bool allow_over) { x_allow_over = allow_over; };
536 
538  void set_warn_over(bool warn_over) { x_warn_over = warn_over; };
539 
541  void set_info_details(bool info_details) { x_info_details = info_details; };
542 
544  void set_pause(const infinint & pause) { x_pause = pause; };
545 
547  void set_compression(compression algo) { x_algo = algo; };
548 
550  void set_compression_level(U_I compression_level) { x_compression_level = compression_level; };
551 
553 
557  void set_slicing(const infinint & file_size, const infinint & first_file_size = 0)
558  {
559  x_file_size = file_size;
560  if(first_file_size == 0)
561  x_first_file_size = file_size;
562  else
563  x_first_file_size = first_file_size;
564  };
565 
567  void set_execute(const std::string & execute) { x_execute = execute; };
568 
570  void set_crypto_algo(crypto_algo crypto) { x_crypto = crypto; };
571 
573  void set_crypto_pass(const secu_string & pass) { x_pass = pass; };
574 
576  void set_crypto_size(U_32 crypto_size) { x_crypto_size = crypto_size; };
577 
579  void set_empty(bool empty) { x_empty = empty; };
580 
582  void set_slice_permission(const std::string & slice_permission) { x_slice_permission = slice_permission; };
583 
585  void set_slice_user_ownership(const std::string & slice_user_ownership) { x_slice_user_ownership = slice_user_ownership; };
586 
588  void set_slice_group_ownership(const std::string & slice_group_ownership) { x_slice_group_ownership = slice_group_ownership; };
589 
591  void set_user_comment(const std::string & comment) { x_user_comment = comment; };
592 
594  void set_hash_algo(hash_algo hash) { x_hash = hash; };
595 
597  void set_slice_min_digits(infinint val) { x_slice_min_digits = val; };
598 
600  void set_sequential_marks(bool sequential) { x_sequential_marks = sequential; };
601 
602 
603 
605  // getting methods
606 
607  bool get_allow_over() const { return x_allow_over; };
608  bool get_warn_over() const { return x_warn_over; };
609  bool get_info_details() const { return x_info_details; };
610  const infinint & get_pause() const { return x_pause; };
611  compression get_compression() const { return x_algo; };
612  U_I get_compression_level() const { return x_compression_level; };
613  const infinint & get_slice_size() const { return x_file_size; };
614  const infinint & get_first_slice_size() const { return x_first_file_size; };
615  const std::string & get_execute() const { return x_execute; };
616  crypto_algo get_crypto_algo() const { return x_crypto; };
617  const secu_string & get_crypto_pass() const { return x_pass; };
618  U_32 get_crypto_size() const { return x_crypto_size; };
619  bool get_empty() const { return x_empty; };
620  const std::string & get_slice_permission() const { return x_slice_permission; };
621  const std::string & get_slice_user_ownership() const { return x_slice_user_ownership; };
622  const std::string & get_slice_group_ownership() const { return x_slice_group_ownership; };
623  const std::string & get_user_comment() const { return x_user_comment; };
624  hash_algo get_hash_algo() const { return x_hash; };
625  infinint get_slice_min_digits() const { return x_slice_min_digits; };
626  bool get_sequential_marks() const { return x_sequential_marks; };
627 
628  private:
629  bool x_allow_over;
630  bool x_warn_over;
631  bool x_info_details;
632  infinint x_pause;
633  compression x_algo;
634  U_I x_compression_level;
635  infinint x_file_size;
636  infinint x_first_file_size;
637  std::string x_execute;
638  crypto_algo x_crypto;
639  secu_string x_pass;
640  U_32 x_crypto_size;
641  bool x_empty;
642  std::string x_slice_permission;
643  std::string x_slice_user_ownership;
644  std::string x_slice_group_ownership;
645  std::string x_user_comment;
646  hash_algo x_hash;
647  infinint x_slice_min_digits;
648  bool x_sequential_marks;
649 
650  };
651 
652 
653 
657 
660  {
661  public:
662 
663  archive_options_merge() { x_selection = x_subtree = x_ea_mask = x_compr_mask = NULL; x_overwrite = NULL; clear(); };
664  archive_options_merge(const archive_options_merge & ref) { copy_from(ref); };
665  const archive_options_merge & operator = (const archive_options_merge & ref) { destroy(); copy_from(ref); return *this; };
666  ~archive_options_merge() { destroy(); };
667 
668  void clear();
669 
671  // setting methods
672 
673  void set_auxilliary_ref(archive *ref) { x_ref = ref; };
674 
676  void set_selection(const mask & selection);
677 
679  void set_subtree(const mask & subtree);
680 
682  void set_allow_over(bool allow_over) { x_allow_over = allow_over; };
683 
685  void set_warn_over(bool warn_over) { x_warn_over = warn_over; };
686 
688  void set_overwriting_rules(const crit_action & overwrite);
689 
691  void set_info_details(bool info_details) { x_info_details = info_details; };
692 
694  void set_pause(const infinint & pause) { x_pause = pause; };
695 
697  void set_empty_dir(bool empty_dir) { x_empty_dir = empty_dir; };
698 
700  void set_compression(compression compr_algo) { x_compr_algo = compr_algo; };
701 
703  void set_compression_level(U_I compression_level) { x_compression_level = compression_level; };
704 
706 
710  void set_slicing(const infinint & file_size, const infinint & first_file_size = 0)
711  {
712  x_file_size = file_size;
713  if(first_file_size == 0)
714  x_first_file_size = file_size;
715  else
716  x_first_file_size = first_file_size;
717  };
718 
720  void set_ea_mask(const mask & ea_mask);
721 
723  void set_execute(const std::string & execute) { x_execute = execute; };
724 
726  void set_crypto_algo(crypto_algo crypto) { x_crypto = crypto; };
727 
730  void set_crypto_pass(const secu_string & pass) { x_pass = pass; };
731 
733  void set_crypto_size(U_32 crypto_size) { x_crypto_size = crypto_size; };
734 
736  void set_compr_mask(const mask & compr_mask);
737 
739  void set_min_compr_size(const infinint & min_compr_size) { x_min_compr_size = min_compr_size; };
740 
742  void set_empty(bool empty) { x_empty = empty; };
743 
745  void set_display_skipped(bool display_skipped) { x_display_skipped = display_skipped; };
746 
748  void set_keep_compressed(bool keep_compressed) { x_keep_compressed = keep_compressed; };
749 
751  void set_slice_permission(const std::string & slice_permission) { x_slice_permission = slice_permission; };
752 
754  void set_slice_user_ownership(const std::string & slice_user_ownership) { x_slice_user_ownership = slice_user_ownership; };
755 
757  void set_slice_group_ownership(const std::string & slice_group_ownership) { x_slice_group_ownership = slice_group_ownership; };
758 
760  void set_decremental_mode(bool mode) { x_decremental = mode; };
761 
763  void set_sequential_marks(bool sequential) { x_sequential_marks = sequential; };
764 
766  void set_sparse_file_min_size(const infinint & size) { x_sparse_file_min_size = size; };
767 
769  void set_user_comment(const std::string & comment) { x_user_comment = comment; };
770 
772  void set_hash_algo(hash_algo hash) { x_hash = hash; };
773 
775  void set_slice_min_digits(infinint val) { x_slice_min_digits = val; };
776 
777 
778 
780  // getting methods
781 
782  archive * get_auxilliary_ref() const { return x_ref; };
783  const mask & get_selection() const { if(x_selection == NULL) throw SRC_BUG; return *x_selection; };
784  const mask & get_subtree() const { if(x_subtree == NULL) throw SRC_BUG; return *x_subtree; };
785  bool get_allow_over() const { return x_allow_over; };
786  bool get_warn_over() const { return x_warn_over; };
787  const crit_action & get_overwriting_rules() const { if(x_overwrite == NULL) throw SRC_BUG; return *x_overwrite; };
788  bool get_info_details() const { return x_info_details; };
789  const infinint & get_pause() const { return x_pause; };
790  bool get_empty_dir() const { return x_empty_dir; };
791  compression get_compression() const { return x_compr_algo; };
792  U_I get_compression_level() const { return x_compression_level; };
793  const infinint & get_slice_size() const { return x_file_size; };
794  const infinint & get_first_slice_size() const { return x_first_file_size; };
795  const mask & get_ea_mask() const { if(x_ea_mask == NULL) throw SRC_BUG; return *x_ea_mask; };
796  const std::string & get_execute() const { return x_execute; };
797  crypto_algo get_crypto_algo() const { return x_crypto; };
798  const secu_string & get_crypto_pass() const { return x_pass; };
799  U_32 get_crypto_size() const { return x_crypto_size; };
800  const mask & get_compr_mask() const { if(x_compr_mask == NULL) throw SRC_BUG; return *x_compr_mask; };
801  const infinint & get_min_compr_size() const { return x_min_compr_size; };
802  bool get_empty() const { return x_empty; };
803  bool get_display_skipped() const { return x_display_skipped; };
804  bool get_keep_compressed() const { return x_keep_compressed; };
805  const std::string & get_slice_permission() const { return x_slice_permission; };
806  const std::string & get_slice_user_ownership() const { return x_slice_user_ownership; };
807  const std::string & get_slice_group_ownership() const { return x_slice_group_ownership; };
808  bool get_decremental_mode() const { return x_decremental; };
809  bool get_sequential_marks() const { return x_sequential_marks; };
810  infinint get_sparse_file_min_size() const { return x_sparse_file_min_size; };
811  const std::string & get_user_comment() const { return x_user_comment; };
812  hash_algo get_hash_algo() const { return x_hash; };
813  infinint get_slice_min_digits() const { return x_slice_min_digits; };
814 
815  private:
816  archive * x_ref;
817  mask * x_selection;
818  mask * x_subtree;
819  bool x_allow_over;
820  bool x_warn_over;
821  crit_action * x_overwrite;
822  bool x_info_details;
823  infinint x_pause;
824  bool x_empty_dir;
825  compression x_compr_algo;
826  U_I x_compression_level;
827  infinint x_file_size;
828  infinint x_first_file_size;
829  mask * x_ea_mask;
830  std::string x_execute;
831  crypto_algo x_crypto;
832  secu_string x_pass;
833  U_32 x_crypto_size;
834  mask * x_compr_mask;
835  infinint x_min_compr_size;
836  bool x_empty;
837  bool x_display_skipped;
838  bool x_keep_compressed;
839  std::string x_slice_permission;
840  std::string x_slice_user_ownership;
841  std::string x_slice_group_ownership;
842  bool x_decremental;
843  bool x_sequential_marks;
844  infinint x_sparse_file_min_size;
845  std::string x_user_comment;
846  hash_algo x_hash;
847  infinint x_slice_min_digits;
848 
849  void destroy();
850  void copy_from(const archive_options_merge & ref);
851  };
852 
853 
857 
860  {
861  public:
862  archive_options_extract() { x_selection = x_subtree = x_ea_mask = NULL; x_overwrite = NULL; clear(); };
863  archive_options_extract(const archive_options_extract & ref) { copy_from(ref); };
864  const archive_options_extract & operator = (const archive_options_extract & ref) { destroy(); copy_from(ref); return *this; };
865  ~archive_options_extract() { destroy(); };
866 
867  void clear();
868 
870  // setting methods
871 
873  void set_selection(const mask & selection);
874 
876  void set_subtree(const mask & subtree);
877 
879  void set_warn_over(bool warn_over) { x_warn_over = warn_over; };
880 
882  void set_info_details(bool info_details) { x_info_details = info_details; };
883 
885  void set_ea_mask(const mask & ea_mask);
886 
888  void set_flat(bool flat) { x_flat = flat; };
889 
891  void set_what_to_check(inode::comparison_fields what_to_check) { x_what_to_check = what_to_check; };
892 
894  void set_warn_remove_no_match(bool warn_remove_no_match) { x_warn_remove_no_match = warn_remove_no_match; };
895 
897  void set_empty(bool empty) { x_empty = empty; };
898 
900  void set_display_skipped(bool display_skipped) { x_display_skipped = display_skipped; };
901 
903  void set_empty_dir(bool empty_dir) { x_empty_dir = empty_dir; };
904 
906 
909  void set_dirty_behavior(bool ignore, bool warn) { x_dirty = ignore ? dirty_ignore : (warn ? dirty_warn : dirty_ok); };
910 
912  void set_overwriting_rules(const crit_action & over);
913 
915 
917  void set_only_deleted(bool val) { x_only_deleted = val; };
918 
919 
921 
923  void set_ignore_deleted(bool val) { x_ignore_deleted = val; };
924 
925 
927  // getting methods
928 
929  enum t_dirty { dirty_ignore, dirty_warn, dirty_ok };
930 
931  const mask & get_selection() const { if(x_selection == NULL) throw SRC_BUG; return *x_selection; };
932  const mask & get_subtree() const { if(x_subtree == NULL) throw SRC_BUG; return *x_subtree; };
933  bool get_warn_over() const { return x_warn_over; };
934  bool get_info_details() const { return x_info_details; };
935  const mask & get_ea_mask() const { if(x_ea_mask == NULL) throw SRC_BUG; return *x_ea_mask; };
936  bool get_flat() const { return x_flat; };
937  inode::comparison_fields get_what_to_check() const { return x_what_to_check; };
938  bool get_warn_remove_no_match() const { return x_warn_remove_no_match; };
939  bool get_empty() const { return x_empty; };
940  bool get_display_skipped() const { return x_display_skipped; };
941  bool get_empty_dir() const { return x_empty_dir; };
942  t_dirty get_dirty_behavior() const { return x_dirty; }
943  const crit_action & get_overwriting_rules() const { if(x_overwrite == NULL) throw SRC_BUG; return *x_overwrite; };
944  bool get_only_deleted() const { return x_only_deleted; };
945  bool get_ignore_deleted() const { return x_ignore_deleted; };
946 
947  private:
948  mask * x_selection;
949  mask * x_subtree;
950  bool x_warn_over;
951  bool x_info_details;
952  mask * x_ea_mask;
953  bool x_flat;
954  inode::comparison_fields x_what_to_check;
955  bool x_warn_remove_no_match;
956  bool x_empty;
957  bool x_display_skipped;
958  bool x_empty_dir;
959  t_dirty x_dirty;
960  crit_action *x_overwrite;
961  bool x_only_deleted;
962  bool x_ignore_deleted;
963 
964  void destroy();
965  void copy_from(const archive_options_extract & ref);
966  };
967 
968 
969 
970 
974 
977  {
978  public:
979  archive_options_listing() { x_selection = x_subtree = NULL; clear(); };
980  archive_options_listing(const archive_options_listing & ref) { copy_from(ref); };
981  const archive_options_listing & operator = (const archive_options_listing & ref) { destroy(); copy_from(ref); return *this; };
982  ~archive_options_listing() { destroy(); };
983 
984  void clear();
985 
987 
989  {
990  normal, //< the tar-like listing (this is the default)
991  tree, //< the original dar's tree listing (for those that like forest)
992  xml //< the xml catalogue output
993  };
994 
996  // setting methods
997 
998  void set_info_details(bool info_details) { x_info_details = info_details; };
999  void set_list_mode(listformat list_mode) { x_list_mode = list_mode; };
1000  void set_selection(const mask & selection);
1001  void set_subtree(const mask & subtree);
1002  void set_filter_unsaved(bool filter_unsaved) { x_filter_unsaved = filter_unsaved; };
1003  void set_display_ea(bool display_ea) { x_display_ea = display_ea; };
1004 
1006  // getting methods
1007 
1008  bool get_info_details() const { return x_info_details; };
1009  listformat get_list_mode() const { return x_list_mode; };
1010  const mask & get_selection() const;
1011  const mask & get_subtree() const;
1012  bool get_filter_unsaved() const { return x_filter_unsaved; };
1013  bool get_display_ea() const { return x_display_ea; };
1014 
1015  private:
1016  bool x_info_details;
1017  listformat x_list_mode;
1018  mask * x_selection;
1019  mask * x_subtree;
1020  bool x_filter_unsaved;
1021  bool x_display_ea;
1022 
1023  void destroy();
1024  void copy_from(const archive_options_listing & ref);
1025  };
1026 
1027 
1031 
1032 
1033  class archive_options_diff
1034  {
1035  public:
1036  archive_options_diff() { x_selection = x_subtree = x_ea_mask = NULL; clear(); };
1037  archive_options_diff(const archive_options_diff & ref) { copy_from(ref); };
1038  const archive_options_diff & operator = (const archive_options_diff & ref) { destroy(); copy_from(ref); return *this; };
1039  ~archive_options_diff() { destroy(); };
1040 
1041  void clear();
1042 
1044  // setting methods
1045 
1047  void set_selection(const mask & selection);
1048 
1050  void set_subtree(const mask & subtree);
1051 
1053  void set_info_details(bool info_details) { x_info_details = info_details; };
1054 
1056  void set_ea_mask(const mask & ea_mask);
1057 
1059  void set_what_to_check(inode::comparison_fields what_to_check) { x_what_to_check = what_to_check; };
1060 
1062 
1065  void set_alter_atime(bool alter_atime)
1066  {
1067  if(x_furtive_read)
1068  x_old_alter_atime = alter_atime;
1069  else
1070  x_alter_atime = alter_atime;
1071  };
1072 
1074  void set_furtive_read_mode(bool furtive_read);
1075 
1077  void set_display_skipped(bool display_skipped) { x_display_skipped = display_skipped; };
1078 
1080  void set_hourshift(const infinint & hourshift) { x_hourshift = hourshift; };
1081 
1083  void set_compare_symlink_date(bool compare_symlink_date) { x_compare_symlink_date = compare_symlink_date; };
1084 
1085 
1087  // getting methods
1088 
1089  const mask & get_selection() const { if(x_selection == NULL) throw SRC_BUG; return *x_selection; };
1090  const mask & get_subtree() const { if(x_subtree == NULL) throw SRC_BUG; return *x_subtree; };
1091  bool get_info_details() const { return x_info_details; };
1092  const mask & get_ea_mask() const { if(x_ea_mask == NULL) throw SRC_BUG; return *x_ea_mask; };
1093  inode::comparison_fields get_what_to_check() const { return x_what_to_check; };
1094  bool get_alter_atime() const { return x_alter_atime; };
1095  bool get_furtive_read_mode() const { return x_furtive_read; };
1096  bool get_display_skipped() const { return x_display_skipped; };
1097  const infinint & get_hourshift() const { return x_hourshift; };
1098  bool get_compare_symlink_date() const { return x_compare_symlink_date; };
1099 
1100  private:
1101  mask * x_selection;
1102  mask * x_subtree;
1103  bool x_info_details;
1104  mask * x_ea_mask;
1105  inode::comparison_fields x_what_to_check;
1106  bool x_alter_atime;
1107  bool x_old_alter_atime;
1108  bool x_furtive_read;
1109  bool x_display_skipped;
1110  infinint x_hourshift;
1111  bool x_compare_symlink_date;
1112 
1113  void destroy();
1114  void copy_from(const archive_options_diff & ref);
1115  };
1116 
1117 
1118 
1119 
1123 
1126  {
1127  public:
1128  archive_options_test() { x_selection = x_subtree = NULL; clear(); };
1129  archive_options_test(const archive_options_test & ref) { copy_from(ref); };
1130  const archive_options_test & operator = (const archive_options_test & ref) { destroy(); copy_from(ref); return *this; };
1131  ~archive_options_test() { destroy(); };
1132 
1133  void clear();
1134 
1136  // setting methods
1137 
1139  void set_selection(const mask & selection);
1140 
1142  void set_subtree(const mask & subtree);
1143 
1145  void set_info_details(bool info_details) { x_info_details = info_details; };
1146 
1148  void set_empty(bool empty) { x_empty = empty; };
1149 
1151  void set_display_skipped(bool display_skipped) { x_display_skipped = display_skipped; };
1152 
1153 
1155  // getting methods
1156 
1157  const mask & get_selection() const { if(x_selection == NULL) throw SRC_BUG; return *x_selection; };
1158  const mask & get_subtree() const { if(x_subtree == NULL) throw SRC_BUG; return *x_subtree; };
1159  bool get_info_details() const { return x_info_details; };
1160  bool get_empty() const { return x_empty; };
1161  bool get_display_skipped() const { return x_display_skipped; };
1162 
1163  private:
1164  mask * x_selection;
1165  mask * x_subtree;
1166  bool x_info_details;
1167  bool x_empty;
1168  bool x_display_skipped;
1169 
1170  void destroy();
1171  void copy_from(const archive_options_test & ref);
1172  };
1173 
1175 
1176 } // end of namespace
1177 
1178 #endif