26#ifndef ARCHIVE_OPTIONS_HPP
27#define ARCHIVE_OPTIONS_HPP
29#include "../my_config.h"
75 ~archive_options_read() =
default;
112 void set_input_pipe(
const std::string & input_pipe) { x_input_pipe = input_pipe; };
118 void set_output_pipe(
const std::string & output_pipe) { x_output_pipe = output_pipe; };
131 void set_execute(
const std::string & execute) { x_execute = execute; };
155 void set_entrepot(
const std::shared_ptr<entrepot> & entr) {
if(!entr)
throw Erange(
"archive_options_read::set_entrepot",
"null entrepot pointer given in argument"); x_entrepot = entr; };
176 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; };
200 void set_ref_execute(
const std::string & ref_execute) { x_ref_execute = ref_execute; };
208 void set_ref_entrepot(
const std::shared_ptr<entrepot> & entr) {
if(!entr)
throw Erange(
"archive_options_read::set_ref_entrepot",
"null entrepot pointer given in argument"); x_ref_entrepot = entr; };
219 crypto_algo get_crypto_algo()
const {
return x_crypto; };
220 const secu_string & get_crypto_pass()
const {
return x_pass; };
221 U_32 get_crypto_size()
const {
return x_crypto_size; };
222 const std::string & get_input_pipe()
const {
return x_input_pipe; };
223 const std::string & get_output_pipe()
const {
return x_output_pipe; };
224 const std::string & get_execute()
const {
return x_execute; };
225 bool get_info_details()
const {
return x_info_details; };
226 bool get_lax()
const {
return x_lax; };
227 bool get_sequential_read()
const {
return x_sequential_read; };
228 infinint get_slice_min_digits()
const {
return x_slice_min_digits; };
229 const std::shared_ptr<entrepot> & get_entrepot()
const {
return x_entrepot; };
230 bool get_ignore_signature_check_failure()
const {
return x_ignore_signature_check_failure; };
231 U_I get_multi_threaded_crypto()
const {
return x_multi_threaded_crypto; };
232 U_I get_multi_threaded_compress()
const {
return x_multi_threaded_compress; };
235 bool is_external_catalogue_set()
const {
return external_cat; };
236 const path & get_ref_path()
const;
237 const std::string & get_ref_basename()
const;
238 crypto_algo get_ref_crypto_algo()
const {
return x_ref_crypto; };
239 const secu_string & get_ref_crypto_pass()
const {
return x_ref_pass; };
240 U_32 get_ref_crypto_size()
const {
return x_ref_crypto_size; };
241 const std::string & get_ref_execute()
const {
return x_ref_execute; };
242 infinint get_ref_slice_min_digits()
const {
return x_ref_slice_min_digits; };
243 const std::shared_ptr<entrepot> & get_ref_entrepot()
const {
return x_ref_entrepot; };
244 bool get_header_only()
const {
return x_header_only; };
251 std::string x_input_pipe;
252 std::string x_output_pipe;
253 std::string x_execute;
256 bool x_sequential_read;
257 infinint x_slice_min_digits;
258 std::shared_ptr<entrepot> x_entrepot;
259 bool x_ignore_signature_check_failure;
260 U_I x_multi_threaded_crypto;
261 U_I x_multi_threaded_compress;
267 std::string x_ref_basename;
269 secu_string x_ref_pass;
270 U_32 x_ref_crypto_size;
271 std::string x_ref_execute;
272 infinint x_ref_slice_min_digits;
273 std::shared_ptr<entrepot> x_ref_entrepot;
345 void set_display_treated(
bool display_treated,
bool only_dir) { x_display_treated = display_treated; x_display_treated_only_dir = only_dir; };
384 x_file_size = file_size;
385 if(first_file_size.is_zero())
386 x_first_file_size = file_size;
388 x_first_file_size = first_file_size;
406 void set_execute(
const std::string & execute) { x_execute = execute; };
427 void set_gnupg_recipients(
const std::vector<std::string> & gnupg_recipients) { x_gnupg_recipients = gnupg_recipients; };
433 void set_gnupg_signatories(
const std::vector<std::string> & gnupg_signatories) { x_gnupg_signatories = gnupg_signatories; };
447 { exclude_by_ea = (ea_name ==
"" ?
"user.libdar_no_backup" : ea_name); };
467 x_alter_atime = alter_atime;
477 void set_same_fs(
bool same_fs) { x_same_fs = same_fs; x_same_fs_include.clear(); x_same_fs_exclude.clear(); };
482 void set_same_fs_include(
const std::string & included_path_to_fs) { x_same_fs_include.push_back(included_path_to_fs); };
487 void set_same_fs_exclude(
const std::string & excluded_path_to_fs) { x_same_fs_exclude.push_back(excluded_path_to_fs); };
508 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; };
538 void set_entrepot(
const std::shared_ptr<entrepot> & entr) {
if(!entr)
throw Erange(
"archive_options_create::set_entrepot",
"null entrepot pointer given in argument"); x_entrepot = entr; };
597 std::shared_ptr<archive> get_reference()
const {
return x_ref_arch; };
599 const mask & get_subtree()
const {
if(
x_subtree ==
nullptr)
throw SRC_BUG;
return *
x_subtree; };
600 bool get_allow_over()
const {
return x_allow_over; };
601 bool get_warn_over()
const {
return x_warn_over; };
602 bool get_info_details()
const {
return x_info_details; };
603 bool get_display_treated()
const {
return x_display_treated; };
604 bool get_display_treated_only_dir()
const {
return x_display_treated_only_dir; };
605 bool get_display_skipped()
const {
return x_display_skipped; };
606 bool get_display_finished()
const {
return x_display_finished; };
607 const infinint & get_pause()
const {
return x_pause; };
608 bool get_empty_dir()
const {
return x_empty_dir; };
609 compression get_compression()
const {
return x_compr_algo; };
610 U_I get_compression_level()
const {
return x_compression_level; };
611 U_I get_compression_block_size()
const {
return x_compression_block_size; };
612 const infinint & get_slice_size()
const {
return x_file_size; };
613 const infinint & get_first_slice_size()
const {
return x_first_file_size; };
614 const mask & get_ea_mask()
const {
if(
x_ea_mask ==
nullptr)
throw SRC_BUG;
return *
x_ea_mask; };
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 const std::vector<std::string> & get_gnupg_recipients()
const {
return x_gnupg_recipients; };
620 const std::vector<std::string> & get_gnupg_signatories()
const {
return x_gnupg_signatories; };
622 const infinint & get_min_compr_size()
const {
return x_min_compr_size; };
623 bool get_nodump()
const {
return x_nodump; };
624 const std::string & get_exclude_by_ea()
const {
return exclude_by_ea; };
626 const infinint & get_hourshift()
const {
return x_hourshift; };
627 bool get_empty()
const {
return x_empty; };
628 bool get_alter_atime()
const {
return x_alter_atime; };
629 bool get_furtive_read_mode()
const {
return x_furtive_read; };
630 bool get_same_fs()
const {
return x_same_fs; };
631 std::deque<std::string> get_same_fs_include()
const {
return x_same_fs_include; };
632 std::deque<std::string> get_same_fs_exclude()
const {
return x_same_fs_exclude; };
633 bool get_snapshot()
const {
return x_snapshot; };
634 bool get_cache_directory_tagging()
const {
return x_cache_directory_tagging; };
635 const infinint & get_fixed_date()
const {
return x_fixed_date; };
636 const std::string & get_slice_permission()
const {
return x_slice_permission; };
637 const std::string & get_slice_user_ownership()
const {
return x_slice_user_ownership; };
638 const std::string & get_slice_group_ownership()
const {
return x_slice_group_ownership; };
639 const infinint & get_repeat_count()
const {
return x_repeat_count; };
640 const infinint & get_repeat_byte()
const {
return x_repeat_byte; };
641 bool get_sequential_marks()
const {
return x_sequential_marks; };
642 infinint get_sparse_file_min_size()
const {
return x_sparse_file_min_size; };
643 bool get_security_check()
const {
return x_security_check; };
644 const std::string & get_user_comment()
const {
return x_user_comment; };
645 hash_algo get_hash_algo()
const {
return x_hash; };
646 infinint get_slice_min_digits()
const {
return x_slice_min_digits; };
647 const std::string & get_backup_hook_file_execute()
const {
return x_backup_hook_file_execute; };
648 const mask & get_backup_hook_file_mask()
const {
return *x_backup_hook_file_mask; };
649 bool get_ignore_unknown_inode_type()
const {
return x_ignore_unknown; };
650 const std::shared_ptr<entrepot> & get_entrepot()
const {
return x_entrepot; };
651 const fsa_scope & get_fsa_scope()
const {
return x_scope; };
652 U_I get_multi_threaded_crypto()
const {
return x_multi_threaded_crypto; };
653 U_I get_multi_threaded_compress()
const {
return x_multi_threaded_compress; };
654 bool get_delta_diff()
const {
return x_delta_diff; };
655 bool get_delta_signature()
const {
return x_delta_signature; };
656 const mask & get_delta_mask()
const {
return *x_delta_mask; }
657 bool get_has_delta_mask_been_set()
const {
return has_delta_mask_been_set; };
658 const infinint & get_delta_sig_min_size()
const {
return x_delta_sig_min_size; };
659 bool get_auto_zeroing_neg_dates()
const {
return x_auto_zeroing_neg_dates; };
660 const std::set<std::string> & get_ignored_as_symlink()
const {
return x_ignored_as_symlink; };
662 const infinint & get_iteration_count()
const {
return x_iteration_count; };
663 hash_algo get_kdf_hash()
const {
return x_kdf_hash; };
664 delta_sig_block_size get_sig_block_len()
const {
return x_sig_block_len; };
673 bool x_display_treated;
674 bool x_display_treated_only_dir;
675 bool x_display_skipped;
676 bool x_display_finished;
680 U_I x_compression_level;
681 U_I x_compression_block_size;
685 std::string x_execute;
689 std::vector<std::string> x_gnupg_recipients;
690 std::vector<std::string> x_gnupg_signatories;
694 std::string exclude_by_ea;
702 std::deque<std::string> x_same_fs_include;
703 std::deque<std::string> x_same_fs_exclude;
705 bool x_cache_directory_tagging;
707 std::string x_slice_permission;
708 std::string x_slice_user_ownership;
709 std::string x_slice_group_ownership;
712 bool x_sequential_marks;
714 bool x_security_check;
715 std::string x_user_comment;
718 mask * x_backup_hook_file_mask;
719 std::string x_backup_hook_file_execute;
720 bool x_ignore_unknown;
721 std::shared_ptr<entrepot> x_entrepot;
723 U_I x_multi_threaded_crypto;
724 U_I x_multi_threaded_compress;
726 bool x_delta_signature;
728 bool has_delta_mask_been_set;
730 bool x_auto_zeroing_neg_dates;
731 std::set<std::string> x_ignored_as_symlink;
737 void nullifyptr() noexcept;
738 void destroy() noexcept;
741 void destroy_mask(
mask * & ptr);
742 void clean_mask(
mask * & ptr);
743 void check_mask(const
mask & m);
802 x_file_size = file_size;
803 if(first_file_size.is_zero())
804 x_first_file_size = file_size;
806 x_first_file_size = first_file_size;
820 void set_execute(
const std::string & execute) { x_execute = execute; };
835 void set_gnupg_recipients(
const std::vector<std::string> & gnupg_recipients) { x_gnupg_recipients = gnupg_recipients; };
840 void set_gnupg_signatories(
const std::vector<std::string> & gnupg_signatories) { x_gnupg_signatories = gnupg_signatories; };
867 void set_entrepot(
const std::shared_ptr<entrepot> & entr) {
if(!entr)
throw Erange(
"archive_options_isolated::set_entrepot",
"null entrepot pointer given in argument"); x_entrepot = entr; };
905 bool get_allow_over()
const {
return x_allow_over; };
906 bool get_warn_over()
const {
return x_warn_over; };
907 bool get_info_details()
const {
return x_info_details; };
908 const infinint & get_pause()
const {
return x_pause; };
909 compression get_compression()
const {
return x_algo; };
910 U_I get_compression_level()
const {
return x_compression_level; };
911 U_I get_compression_block_size()
const {
return x_compression_block_size; };
912 const infinint & get_slice_size()
const {
return x_file_size; };
913 const infinint & get_first_slice_size()
const {
return x_first_file_size; };
914 const std::string & get_execute()
const {
return x_execute; };
915 crypto_algo get_crypto_algo()
const {
return x_crypto; };
916 const secu_string & get_crypto_pass()
const {
return x_pass; };
917 U_32 get_crypto_size()
const {
return x_crypto_size; };
918 const std::vector<std::string> & get_gnupg_recipients()
const {
return x_gnupg_recipients; };
919 const std::vector<std::string> & get_gnupg_signatories()
const {
return x_gnupg_signatories; };
920 bool get_empty()
const {
return x_empty; };
921 const std::string & get_slice_permission()
const {
return x_slice_permission; };
922 const std::string & get_slice_user_ownership()
const {
return x_slice_user_ownership; };
923 const std::string & get_slice_group_ownership()
const {
return x_slice_group_ownership; };
924 const std::string & get_user_comment()
const {
return x_user_comment; };
925 hash_algo get_hash_algo()
const {
return x_hash; };
926 infinint get_slice_min_digits()
const {
return x_slice_min_digits; };
927 bool get_sequential_marks()
const {
return x_sequential_marks; };
928 const std::shared_ptr<entrepot> & get_entrepot()
const {
return x_entrepot; };
929 U_I get_multi_threaded_crypto()
const {
return x_multi_threaded_crypto; };
930 U_I get_multi_threaded_compress()
const {
return x_multi_threaded_compress; };
931 bool get_delta_signature()
const {
return x_delta_signature; };
932 const mask & get_delta_mask()
const {
return *x_delta_mask; }
933 bool get_has_delta_mask_been_set()
const {
return has_delta_mask_been_set; };
934 const infinint & get_delta_sig_min_size()
const {
return x_delta_sig_min_size; };
935 const infinint & get_iteration_count()
const {
return x_iteration_count; };
936 hash_algo get_kdf_hash()
const {
return x_kdf_hash; };
937 delta_sig_block_size get_sig_block_len()
const {
return x_sig_block_len; };
946 U_I x_compression_level;
947 U_I x_compression_block_size;
948 infinint x_file_size;
949 infinint x_first_file_size;
950 std::string x_execute;
954 std::vector<std::string> x_gnupg_recipients;
955 std::vector<std::string> x_gnupg_signatories;
957 std::string x_slice_permission;
958 std::string x_slice_user_ownership;
959 std::string x_slice_group_ownership;
960 std::string x_user_comment;
962 infinint x_slice_min_digits;
963 bool x_sequential_marks;
964 std::shared_ptr<entrepot> x_entrepot;
965 U_I x_multi_threaded_crypto;
966 U_I x_multi_threaded_compress;
967 bool x_delta_signature;
969 bool has_delta_mask_been_set;
970 infinint x_delta_sig_min_size;
971 infinint x_iteration_count;
973 delta_sig_block_size x_sig_block_len;
975 void copy_from(
const archive_options_isolate & ref);
976 void move_from(archive_options_isolate && ref)
noexcept;
977 void destroy() noexcept;
978 void nullifyptr() noexcept;
1004 void set_auxiliary_ref(std::shared_ptr<archive> ref) { x_ref = ref; };
1043 void set_display_treated(
bool display_treated,
bool only_dir) { x_display_treated = display_treated; x_display_treated_only_dir = only_dir; };
1070 x_file_size = file_size;
1071 if(first_file_size.is_zero())
1072 x_first_file_size = file_size;
1074 x_first_file_size = first_file_size;
1091 void set_execute(
const std::string & execute) { x_execute = execute; };
1107 void set_gnupg_recipients(
const std::vector<std::string> & gnupg_recipients) { x_gnupg_recipients = gnupg_recipients; };
1112 void set_gnupg_signatories(
const std::vector<std::string> & gnupg_signatories) { x_gnupg_signatories = gnupg_signatories; };
1154 void set_entrepot(
const std::shared_ptr<entrepot> & entr) {
if(!entr)
throw Erange(
"archive_options_merge::set_entrepot",
"null entrepot pointer given in argument"); x_entrepot = entr; };
1199 std::shared_ptr<archive> get_auxiliary_ref()
const {
return x_ref; };
1201 const mask & get_subtree()
const {
if(
x_subtree ==
nullptr)
throw SRC_BUG;
return *
x_subtree; };
1202 bool get_allow_over()
const {
return x_allow_over; };
1203 bool get_warn_over()
const {
return x_warn_over; };
1204 const crit_action & get_overwriting_rules()
const {
if(x_overwrite ==
nullptr)
throw SRC_BUG;
return *x_overwrite; };
1205 bool get_info_details()
const {
return x_info_details; };
1206 bool get_display_treated()
const {
return x_display_treated; };
1207 bool get_display_treated_only_dir()
const {
return x_display_treated_only_dir; };
1208 bool get_display_skipped()
const {
return x_display_skipped; };
1209 const infinint & get_pause()
const {
return x_pause; };
1210 bool get_empty_dir()
const {
return x_empty_dir; };
1211 compression get_compression()
const {
return x_compr_algo; };
1212 U_I get_compression_level()
const {
return x_compression_level; };
1213 U_I get_compression_block_size()
const {
return x_compression_block_size; };
1214 const infinint & get_slice_size()
const {
return x_file_size; };
1215 const infinint & get_first_slice_size()
const {
return x_first_file_size; };
1216 const mask & get_ea_mask()
const {
if(
x_ea_mask ==
nullptr)
throw SRC_BUG;
return *
x_ea_mask; };
1217 const std::string & get_execute()
const {
return x_execute; };
1218 crypto_algo get_crypto_algo()
const {
return x_crypto; };
1219 const secu_string & get_crypto_pass()
const {
return x_pass; };
1220 U_32 get_crypto_size()
const {
return x_crypto_size; };
1221 const std::vector<std::string> & get_gnupg_recipients()
const {
return x_gnupg_recipients; };
1222 const std::vector<std::string> & get_gnupg_signatories()
const {
return x_gnupg_signatories; };
1224 const infinint & get_min_compr_size()
const {
return x_min_compr_size; };
1225 bool get_empty()
const {
return x_empty; };
1226 bool get_keep_compressed()
const {
return x_keep_compressed; };
1227 const std::string & get_slice_permission()
const {
return x_slice_permission; };
1228 const std::string & get_slice_user_ownership()
const {
return x_slice_user_ownership; };
1229 const std::string & get_slice_group_ownership()
const {
return x_slice_group_ownership; };
1230 bool get_decremental_mode()
const {
return x_decremental; };
1231 bool get_sequential_marks()
const {
return x_sequential_marks; };
1232 infinint get_sparse_file_min_size()
const {
return x_sparse_file_min_size; };
1233 const std::string & get_user_comment()
const {
return x_user_comment; };
1234 hash_algo get_hash_algo()
const {
return x_hash; };
1235 infinint get_slice_min_digits()
const {
return x_slice_min_digits; };
1236 const std::shared_ptr<entrepot> & get_entrepot()
const {
return x_entrepot; };
1237 const fsa_scope & get_fsa_scope()
const {
return x_scope; };
1238 U_I get_multi_threaded_crypto()
const {
return x_multi_threaded_crypto; };
1239 U_I get_multi_threaded_compress()
const {
return x_multi_threaded_compress; };
1240 bool get_delta_signature()
const {
return x_delta_signature; };
1241 const mask & get_delta_mask()
const {
return *x_delta_mask; }
1242 bool get_has_delta_mask_been_set()
const {
return has_delta_mask_been_set; };
1243 const infinint & get_delta_sig_min_size()
const {
return x_delta_sig_min_size; };
1244 const infinint & get_iteration_count()
const {
return x_iteration_count; };
1245 hash_algo get_kdf_hash()
const {
return x_kdf_hash; };
1246 delta_sig_block_size get_sig_block_len()
const {
return x_sig_block_len; };
1250 std::shared_ptr<archive> x_ref;
1255 crit_action * x_overwrite;
1256 bool x_info_details;
1257 bool x_display_treated;
1258 bool x_display_treated_only_dir;
1259 bool x_display_skipped;
1263 U_I x_compression_level;
1264 U_I x_compression_block_size;
1265 infinint x_file_size;
1266 infinint x_first_file_size;
1268 std::string x_execute;
1272 std::vector<std::string> x_gnupg_recipients;
1273 std::vector<std::string> x_gnupg_signatories;
1275 infinint x_min_compr_size;
1277 bool x_keep_compressed;
1278 std::string x_slice_permission;
1279 std::string x_slice_user_ownership;
1280 std::string x_slice_group_ownership;
1282 bool x_sequential_marks;
1283 infinint x_sparse_file_min_size;
1284 std::string x_user_comment;
1286 infinint x_slice_min_digits;
1287 std::shared_ptr<entrepot> x_entrepot;
1289 U_I x_multi_threaded_crypto;
1290 U_I x_multi_threaded_compress;
1291 bool x_delta_signature;
1293 bool has_delta_mask_been_set;
1294 infinint x_delta_sig_min_size;
1295 infinint x_iteration_count;
1297 delta_sig_block_size x_sig_block_len;
1299 void destroy() noexcept;
1300 void copy_from(const archive_options_merge & ref);
1301 void move_from(archive_options_merge && ref) noexcept;
1302 void nullifyptr() noexcept;
1314 enum t_dirty { dirty_ignore, dirty_warn, dirty_ok };
9span class="lineno"> 1320 get_has_dn class="keyword">this; a;
return*this< class="comment">// All methods that follow concern te="l01320">