30 #ifndef ARCHIVE_OPTIONS_HPP
31 #define ARCHIVE_OPTIONS_HPP
33 #include "../my_config.h"
94 void set_input_pipe(
const std::string & input_pipe) { x_input_pipe = input_pipe; };
100 void set_output_pipe(
const std::string & output_pipe) { x_output_pipe = output_pipe; };
111 void set_execute(
const std::string & execute) { x_execute = execute; };
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; };
139 void set_ref_execute(
const std::string & ref_execute) { x_ref_execute = ref_execute; };
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; };
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; };
193 std::string x_input_pipe;
194 std::string x_output_pipe;
195 std::string x_execute;
198 bool x_sequential_read;
199 infinint x_slice_min_digits;
204 std::string x_ref_basename;
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;
276 x_file_size = file_size;
277 if(first_file_size == 0)
278 x_first_file_size = file_size;
280 x_first_file_size = first_file_size;
288 void set_execute(
const std::string & execute) { x_execute = execute; };
325 x_old_alter_atime = alter_atime;
327 x_alter_atime = alter_atime;
337 #if FURTIVE_READ_MODE_AVAILABLE
341 x_old_alter_atime = x_alter_atime;
342 x_alter_atime =
true;
346 x_alter_atime = x_old_alter_atime;
350 x_furtive_read =
false;
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; };
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; };
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; };
470 U_I x_compression_level;
471 infinint x_file_size;
472 infinint x_first_file_size;
474 std::string x_execute;
479 infinint x_min_compr_size;
482 infinint x_hourshift;
485 bool x_old_alter_atime;
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;
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;
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);
559 x_file_size = file_size;
560 if(first_file_size == 0)
561 x_first_file_size = file_size;
563 x_first_file_size = first_file_size;
567 void set_execute(
const std::string & execute) { x_execute = execute; };
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; };
634 U_I x_compression_level;
635 infinint x_file_size;
636 infinint x_first_file_size;
637 std::string x_execute;
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;
647 infinint x_slice_min_digits;
648 bool x_sequential_marks;
663 archive_options_merge() { x_selection = x_subtree = x_ea_mask = x_compr_mask = NULL; x_overwrite = NULL; clear(); };
673 void set_auxilliary_ref(
archive *ref) { x_ref = ref; };
712 x_file_size = file_size;
713 if(first_file_size == 0)
714 x_first_file_size = file_size;
716 x_first_file_size = first_file_size;
723 void set_execute(
const std::string & execute) { x_execute = execute; };
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; };
821 crit_action * x_overwrite;
826 U_I x_compression_level;
827 infinint x_file_size;
828 infinint x_first_file_size;
830 std::string x_execute;
835 infinint x_min_compr_size;
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;
843 bool x_sequential_marks;
844 infinint x_sparse_file_min_size;
845 std::string x_user_comment;
847 infinint x_slice_min_digits;
850 void copy_from(
const archive_options_merge & ref);
909 void set_dirty_behavior(
bool ignore,
bool warn) { x_dirty = ignore ? dirty_ignore : (warn ? dirty_warn : dirty_ok); };
929 enum t_dirty { dirty_ignore, dirty_warn, dirty_ok };
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; };
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; };
955 bool x_warn_remove_no_match;
957 bool x_display_skipped;
960 crit_action *x_overwrite;
962 bool x_ignore_deleted;
965 void copy_from(
const archive_options_extract & ref);
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; };
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; };
1016 bool x_info_details;
1020 bool x_filter_unsaved;
1024 void copy_from(
const archive_options_listing & ref);
1033 class archive_options_diff
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(); };
1047 void set_selection(
const mask & selection);
1050 void set_subtree(
const mask & subtree);
1053 void set_info_details(
bool info_details) { x_info_details = info_details; };
1056 void set_ea_mask(
const mask & ea_mask);
1065 void set_alter_atime(
bool alter_atime)
1068 x_old_alter_atime = alter_atime;
1070 x_alter_atime = alter_atime;
1077 void set_display_skipped(
bool display_skipped) { x_display_skipped = display_skipped; };
1080 void set_hourshift(
const infinint & hourshift) { x_hourshift = hourshift; };
1083 void set_compare_symlink_date(
bool compare_symlink_date) { x_compare_symlink_date = compare_symlink_date; };
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; };
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; };
1103 bool x_info_details;
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;
1114 void copy_from(
const archive_options_diff & ref);
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; };
1166 bool x_info_details;
1168 bool x_display_skipped;
1171 void copy_from(
const archive_options_test & ref);