26 #ifndef ARCHIVE_OPTIONS_HPP
27 #define ARCHIVE_OPTIONS_HPP
29 #include "../my_config.h"
90 void set_input_pipe(
const std::string & input_pipe) { x_input_pipe = input_pipe; };
96 void set_output_pipe(
const std::string & output_pipe) { x_output_pipe = output_pipe; };
107 void set_execute(
const std::string & execute) { x_execute = execute; };
113 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; };
135 void set_ref_execute(
const std::string & ref_execute) { x_ref_execute = ref_execute; };
163 crypto_algo get_crypto_algo()
const {
return x_crypto; };
164 const secu_string & get_crypto_pass()
const {
return x_pass; };
165 U_32 get_crypto_size()
const {
return x_crypto_size; };
166 const std::string & get_input_pipe()
const {
return x_input_pipe; };
167 const std::string & get_output_pipe()
const {
return x_output_pipe; };
168 const std::string & get_execute()
const {
return x_execute; };
169 bool get_info_details()
const {
return x_info_details; };
170 bool get_lax()
const {
return x_lax; };
171 bool get_sequential_read()
const {
return x_sequential_read; };
172 infinint get_slice_min_digits()
const {
return x_slice_min_digits; };
175 bool is_external_catalogue_set()
const {
return external_cat; };
176 const path & get_ref_path()
const;
177 const std::string & get_ref_basename()
const;
178 crypto_algo get_ref_crypto_algo()
const {
return x_ref_crypto; };
179 const secu_string & get_ref_crypto_pass()
const {
return x_ref_pass; };
180 U_32 get_ref_crypto_size()
const {
return x_ref_crypto_size; };
181 const std::string & get_ref_execute()
const {
return x_ref_execute; };
182 infinint get_ref_slice_min_digits()
const {
return x_ref_slice_min_digits; };
189 std::string x_input_pipe;
190 std::string x_output_pipe;
191 std::string x_execute;
194 bool x_sequential_read;
195 infinint x_slice_min_digits;
200 std::string x_ref_basename;
202 secu_string x_ref_pass;
203 U_32 x_ref_crypto_size;
204 std::string x_ref_execute;
205 infinint x_ref_slice_min_digits;
272 x_file_size = file_size;
273 if(first_file_size == 0)
274 x_first_file_size = file_size;
276 x_first_file_size = first_file_size;
284 void set_execute(
const std::string & execute) { x_execute = execute; };
321 x_old_alter_atime = alter_atime;
323 x_alter_atime = alter_atime;
333 #if FURTIVE_READ_MODE_AVAILABLE
337 x_old_alter_atime = x_alter_atime;
338 x_alter_atime =
true;
342 x_alter_atime = x_old_alter_atime;
346 x_furtive_read =
false;
382 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; };
411 archive *get_reference()
const {
return x_ref_arch; };
412 const mask & get_selection()
const {
if(x_selection == NULL)
throw SRC_BUG;
return *x_selection; };
413 const mask & get_subtree()
const {
if(x_subtree == NULL)
throw SRC_BUG;
return *x_subtree; };
414 bool get_allow_over()
const {
return x_allow_over; };
415 bool get_warn_over()
const {
return x_warn_over; };
416 bool get_info_details()
const {
return x_info_details; };
417 const infinint & get_pause()
const {
return x_pause; };
418 bool get_empty_dir()
const {
return x_empty_dir; };
419 compression get_compression()
const {
return x_compr_algo; };
420 U_I get_compression_level()
const {
return x_compression_level; };
421 const infinint & get_slice_size()
const {
return x_file_size; };
422 const infinint & get_first_slice_size()
const {
return x_first_file_size; };
423 const mask & get_ea_mask()
const {
if(x_ea_mask == NULL)
throw SRC_BUG;
return *x_ea_mask; };
424 const std::string & get_execute()
const {
return x_execute; };
425 crypto_algo get_crypto_algo()
const {
return x_crypto; };
426 const secu_string & get_crypto_pass()
const {
return x_pass; };
427 U_32 get_crypto_size()
const {
return x_crypto_size; };
428 const mask & get_compr_mask()
const {
if(x_compr_mask == NULL)
throw SRC_BUG;
return *x_compr_mask; };
429 const infinint & get_min_compr_size()
const {
return x_min_compr_size; };
430 bool get_nodump()
const {
return x_nodump; };
432 const infinint & get_hourshift()
const {
return x_hourshift; };
433 bool get_empty()
const {
return x_empty; };
434 bool get_alter_atime()
const {
return x_alter_atime; };
435 bool get_furtive_read_mode()
const {
return x_furtive_read; };
436 bool get_same_fs()
const {
return x_same_fs; };
437 bool get_snapshot()
const {
return x_snapshot; };
438 bool get_cache_directory_tagging()
const {
return x_cache_directory_tagging; };
439 bool get_display_skipped()
const {
return x_display_skipped; };
440 const infinint & get_fixed_date()
const {
return x_fixed_date; };
441 const std::string & get_slice_permission()
const {
return x_slice_permission; };
442 const std::string & get_slice_user_ownership()
const {
return x_slice_user_ownership; };
443 const std::string & get_slice_group_ownership()
const {
return x_slice_group_ownership; };
444 const infinint & get_repeat_count()
const {
return x_repeat_count; };
445 const infinint & get_repeat_byte()
const {
return x_repeat_byte; };
446 bool get_sequential_marks()
const {
return x_sequential_marks; };
447 infinint get_sparse_file_min_size()
const {
return x_sparse_file_min_size; };
448 bool get_security_check()
const {
return x_security_check; };
449 const std::string & get_user_comment()
const {
return x_user_comment; };
450 hash_algo get_hash_algo()
const {
return x_hash; };
451 infinint get_slice_min_digits()
const {
return x_slice_min_digits; };
452 const std::string & get_backup_hook_file_execute()
const {
return x_backup_hook_file_execute; };
453 const mask & get_backup_hook_file_mask()
const {
return *x_backup_hook_file_mask; };
454 bool get_ignore_unknown_inode_type()
const {
return x_ignore_unknown; };
466 U_I x_compression_level;
467 infinint x_file_size;
468 infinint x_first_file_size;
470 std::string x_execute;
475 infinint x_min_compr_size;
478 infinint x_hourshift;
481 bool x_old_alter_atime;
485 bool x_cache_directory_tagging;
486 bool x_display_skipped;
487 infinint x_fixed_date;
488 std::string x_slice_permission;
489 std::string x_slice_user_ownership;
490 std::string x_slice_group_ownership;
491 infinint x_repeat_count;
492 infinint x_repeat_byte;
493 bool x_sequential_marks;
494 infinint x_sparse_file_min_size;
495 bool x_security_check;
496 std::string x_user_comment;
498 infinint x_slice_min_digits;
499 mask * x_backup_hook_file_mask;
500 std::string x_backup_hook_file_execute;
501 bool x_ignore_unknown;
504 void copy_from(
const archive_options_create & ref);
505 void destroy_mask(mask * & ptr);
506 void clean_mask(mask * & ptr);
507 void check_mask(
const mask & m);
555 x_file_size = file_size;
556 if(first_file_size == 0)
557 x_first_file_size = file_size;
559 x_first_file_size = first_file_size;
563 void set_execute(
const std::string & execute) { x_execute = execute; };
603 bool get_allow_over()
const {
return x_allow_over; };
604 bool get_warn_over()
const {
return x_warn_over; };
605 bool get_info_details()
const {
return x_info_details; };
606 const infinint & get_pause()
const {
return x_pause; };
607 compression get_compression()
const {
return x_algo; };
608 U_I get_compression_level()
const {
return x_compression_level; };
609 const infinint & get_slice_size()
const {
return x_file_size; };
610 const infinint & get_first_slice_size()
const {
return x_first_file_size; };
611 const std::string & get_execute()
const {
return x_execute; };
612 crypto_algo get_crypto_algo()
const {
return x_crypto; };
613 const secu_string & get_crypto_pass()
const {
return x_pass; };
614 U_32 get_crypto_size()
const {
return x_crypto_size; };
615 bool get_empty()
const {
return x_empty; };
616 const std::string & get_slice_permission()
const {
return x_slice_permission; };
617 const std::string & get_slice_user_ownership()
const {
return x_slice_user_ownership; };
618 const std::string & get_slice_group_ownership()
const {
return x_slice_group_ownership; };
619 const std::string & get_user_comment()
const {
return x_user_comment; };
620 hash_algo get_hash_algo()
const {
return x_hash; };
621 infinint get_slice_min_digits()
const {
return x_slice_min_digits; };
622 bool get_sequential_marks()
const {
return x_sequential_marks; };
630 U_I x_compression_level;
631 infinint x_file_size;
632 infinint x_first_file_size;
633 std::string x_execute;
638 std::string x_slice_permission;
639 std::string x_slice_user_ownership;
640 std::string x_slice_group_ownership;
641 std::string x_user_comment;
643 infinint x_slice_min_digits;
644 bool x_sequential_marks;
659 archive_options_merge() { x_selection = x_subtree = x_ea_mask = x_compr_mask = NULL; x_overwrite = NULL; clear(); };
669 void set_auxilliary_ref(
archive *ref) { x_ref = ref; };
708 x_file_size = file_size;
709 if(first_file_size == 0)
710 x_first_file_size = file_size;
712 x_first_file_size = first_file_size;
719 void set_execute(
const std::string & execute) { x_execute = execute; };
778 archive * get_auxilliary_ref()
const {
return x_ref; };
779 const mask & get_selection()
const {
if(x_selection == NULL)
throw SRC_BUG;
return *x_selection; };
780 const mask & get_subtree()
const {
if(x_subtree == NULL)
throw SRC_BUG;
return *x_subtree; };
781 bool get_allow_over()
const {
return x_allow_over; };
782 bool get_warn_over()
const {
return x_warn_over; };
783 const crit_action & get_overwriting_rules()
const {
if(x_overwrite == NULL)
throw SRC_BUG;
return *x_overwrite; };
784 bool get_info_details()
const {
return x_info_details; };
785 const infinint & get_pause()
const {
return x_pause; };
786 bool get_empty_dir()
const {
return x_empty_dir; };
787 compression get_compression()
const {
return x_compr_algo; };
788 U_I get_compression_level()
const {
return x_compression_level; };
789 const infinint & get_slice_size()
const {
return x_file_size; };
790 const infinint & get_first_slice_size()
const {
return x_first_file_size; };
791 const mask & get_ea_mask()
const {
if(x_ea_mask == NULL)
throw SRC_BUG;
return *x_ea_mask; };
792 const std::string & get_execute()
const {
return x_execute; };
793 crypto_algo get_crypto_algo()
const {
return x_crypto; };
794 const secu_string & get_crypto_pass()
const {
return x_pass; };
795 U_32 get_crypto_size()
const {
return x_crypto_size; };
796 const mask & get_compr_mask()
const {
if(x_compr_mask == NULL)
throw SRC_BUG;
return *x_compr_mask; };
797 const infinint & get_min_compr_size()
const {
return x_min_compr_size; };
798 bool get_empty()
const {
return x_empty; };
799 bool get_display_skipped()
const {
return x_display_skipped; };
800 bool get_keep_compressed()
const {
return x_keep_compressed; };
801 const std::string & get_slice_permission()
const {
return x_slice_permission; };
802 const std::string & get_slice_user_ownership()
const {
return x_slice_user_ownership; };
803 const std::string & get_slice_group_ownership()
const {
return x_slice_group_ownership; };
804 bool get_decremental_mode()
const {
return x_decremental; };
805 bool get_sequential_marks()
const {
return x_sequential_marks; };
806 infinint get_sparse_file_min_size()
const {
return x_sparse_file_min_size; };
807 const std::string & get_user_comment()
const {
return x_user_comment; };
808 hash_algo get_hash_algo()
const {
return x_hash; };
809 infinint get_slice_min_digits()
const {
return x_slice_min_digits; };
817 crit_action * x_overwrite;
822 U_I x_compression_level;
823 infinint x_file_size;
824 infinint x_first_file_size;
826 std::string x_execute;
831 infinint x_min_compr_size;
833 bool x_display_skipped;
834 bool x_keep_compressed;
835 std::string x_slice_permission;
836 std::string x_slice_user_ownership;
837 std::string x_slice_group_ownership;
839 bool x_sequential_marks;
840 infinint x_sparse_file_min_size;
841 std::string x_user_comment;
843 infinint x_slice_min_digits;
846 void copy_from(
const archive_options_merge & ref);
905 void set_dirty_behavior(
bool ignore,
bool warn) { x_dirty = ignore ? dirty_ignore : (warn ? dirty_warn : dirty_ok); };
925 enum t_dirty { dirty_ignore, dirty_warn, dirty_ok };
927 const mask & get_selection()
const {
if(x_selection == NULL)
throw SRC_BUG;
return *x_selection; };
928 const mask & get_subtree()
const {
if(x_subtree == NULL)
throw SRC_BUG;
return *x_subtree; };
929 bool get_warn_over()
const {
return x_warn_over; };
930 bool get_info_details()
const {
return x_info_details; };
931 const mask & get_ea_mask()
const {
if(x_ea_mask == NULL)
throw SRC_BUG;
return *x_ea_mask; };
932 bool get_flat()
const {
return x_flat; };
934 bool get_warn_remove_no_match()
const {
return x_warn_remove_no_match; };
935 bool get_empty()
const {
return x_empty; };
936 bool get_display_skipped()
const {
return x_display_skipped; };
937 bool get_empty_dir()
const {
return x_empty_dir; };
938 t_dirty get_dirty_behavior()
const {
return x_dirty; }
939 const crit_action & get_overwriting_rules()
const {
if(x_overwrite == NULL)
throw SRC_BUG;
return *x_overwrite; };
940 bool get_only_deleted()
const {
return x_only_deleted; };
941 bool get_ignore_deleted()
const {
return x_ignore_deleted; };
951 bool x_warn_remove_no_match;
953 bool x_display_skipped;
956 crit_action *x_overwrite;
958 bool x_ignore_deleted;
961 void copy_from(
const archive_options_extract & ref);
994 void set_info_details(
bool info_details) { x_info_details = info_details; };
995 void set_list_mode(
listformat list_mode) { x_list_mode = list_mode; };
996 void set_selection(
const mask & selection);
997 void set_subtree(
const mask & subtree);
998 void set_filter_unsaved(
bool filter_unsaved) { x_filter_unsaved = filter_unsaved; };
999 void set_display_ea(
bool display_ea) { x_display_ea = display_ea; };
1004 bool get_info_details()
const {
return x_info_details; };
1005 listformat get_list_mode()
const {
return x_list_mode; };
1006 const mask & get_selection()
const;
1007 const mask & get_subtree()
const;
1008 bool get_filter_unsaved()
const {
return x_filter_unsaved; };
1009 bool get_display_ea()
const {
return x_display_ea; };
1012 bool x_info_details;
1016 bool x_filter_unsaved;
1020 void copy_from(
const archive_options_listing & ref);
1029 class archive_options_diff
1032 archive_options_diff() { x_selection = x_subtree = x_ea_mask = NULL; clear(); };
1033 archive_options_diff(
const archive_options_diff & ref) { copy_from(ref); };
1034 const archive_options_diff & operator = (
const archive_options_diff & ref) { destroy(); copy_from(ref);
return *
this; };
1035 ~archive_options_diff() { destroy(); };
1043 void set_selection(
const mask & selection);
1046 void set_subtree(
const mask & subtree);
1049 void set_info_details(
bool info_details) { x_info_details = info_details; };
1052 void set_ea_mask(
const mask & ea_mask);
1061 void set_alter_atime(
bool alter_atime)
1064 x_old_alter_atime = alter_atime;
1066 x_alter_atime = alter_atime;
1073 void set_display_skipped(
bool display_skipped) { x_display_skipped = display_skipped; };
1076 void set_hourshift(
const infinint & hourshift) { x_hourshift = hourshift; };
1079 void set_compare_symlink_date(
bool compare_symlink_date) { x_compare_symlink_date = compare_symlink_date; };
1085 const mask & get_selection()
const {
if(x_selection == NULL)
throw SRC_BUG;
return *x_selection; };
1086 const mask & get_subtree()
const {
if(x_subtree == NULL)
throw SRC_BUG;
return *x_subtree; };
1087 bool get_info_details()
const {
return x_info_details; };
1088 const mask & get_ea_mask()
const {
if(x_ea_mask == NULL)
throw SRC_BUG;
return *x_ea_mask; };
1090 bool get_alter_atime()
const {
return x_alter_atime; };
1091 bool get_furtive_read_mode()
const {
return x_furtive_read; };
1092 bool get_display_skipped()
const {
return x_display_skipped; };
1093 const infinint & get_hourshift()
const {
return x_hourshift; };
1094 bool get_compare_symlink_date()
const {
return x_compare_symlink_date; };
1099 bool x_info_details;
1103 bool x_old_alter_atime;
1104 bool x_furtive_read;
1105 bool x_display_skipped;
1106 infinint x_hourshift;
1107 bool x_compare_symlink_date;
1110 void copy_from(
const archive_options_diff & ref);
1153 const mask & get_selection()
const {
if(x_selection == NULL)
throw SRC_BUG;
return *x_selection; };
1154 const mask & get_subtree()
const {
if(x_subtree == NULL)
throw SRC_BUG;
return *x_subtree; };
1155 bool get_info_details()
const {
return x_info_details; };
1156 bool get_empty()
const {
return x_empty; };
1157 bool get_display_skipped()
const {
return x_display_skipped; };
1162 bool x_info_details;
1164 bool x_display_skipped;
1167 void copy_from(
const archive_options_test & ref);