26 #ifndef ARCHIVE_OPTIONS_HPP 27 #define ARCHIVE_OPTIONS_HPP 29 #include "../my_config.h" 110 void set_input_pipe(
const std::string & input_pipe) { x_input_pipe = input_pipe; };
116 void set_output_pipe(
const std::string & output_pipe) { x_output_pipe = output_pipe; };
129 void set_execute(
const std::string & execute) { x_execute = execute; };
153 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; };
165 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; };
189 void set_ref_execute(
const std::string & ref_execute) { x_ref_execute = ref_execute; };
197 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; };
208 crypto_algo get_crypto_algo()
const {
return x_crypto; };
209 const secu_string & get_crypto_pass()
const {
return x_pass; };
210 U_32 get_crypto_size()
const {
return x_crypto_size; };
211 const std::string & get_input_pipe()
const {
return x_input_pipe; };
212 const std::string & get_output_pipe()
const {
return x_output_pipe; };
213 const std::string & get_execute()
const {
return x_execute; };
214 bool get_info_details()
const {
return x_info_details; };
215 bool get_lax()
const {
return x_lax; };
216 bool get_sequential_read()
const {
return x_sequential_read; };
217 infinint get_slice_min_digits()
const {
return x_slice_min_digits; };
218 const std::shared_ptr<entrepot> & get_entrepot()
const {
return x_entrepot; };
219 bool get_ignore_signature_check_failure()
const {
return x_ignore_signature_check_failure; };
220 bool get_multi_threaded()
const {
return x_multi_threaded; };
223 bool is_external_catalogue_set()
const {
return external_cat; };
224 const path & get_ref_path()
const;
225 const std::string & get_ref_basename()
const;
226 crypto_algo get_ref_crypto_algo()
const {
return x_ref_crypto; };
227 const secu_string & get_ref_crypto_pass()
const {
return x_ref_pass; };
228 U_32 get_ref_crypto_size()
const {
return x_ref_crypto_size; };
229 const std::string & get_ref_execute()
const {
return x_ref_execute; };
230 infinint get_ref_slice_min_digits()
const {
return x_ref_slice_min_digits; };
231 const std::shared_ptr<entrepot> & get_ref_entrepot()
const {
return x_ref_entrepot; };
232 bool get_header_only()
const {
return x_header_only; };
239 std::string x_input_pipe;
240 std::string x_output_pipe;
241 std::string x_execute;
244 bool x_sequential_read;
246 std::shared_ptr<entrepot> x_entrepot;
247 bool x_ignore_signature_check_failure;
248 bool x_multi_threaded;
254 std::string x_ref_basename;
257 U_32 x_ref_crypto_size;
258 std::string x_ref_execute;
260 std::shared_ptr<entrepot> x_ref_entrepot;
298 void set_reference(std::shared_ptr<archive> ref_arch) { x_ref_arch = ref_arch; };
301 void set_selection(
const mask & selection);
304 void set_subtree(
const mask & subtree);
324 void set_display_treated(
bool display_treated,
bool only_dir) { x_display_treated = display_treated; x_display_treated_only_dir = only_dir; };
351 x_file_size = file_size;
352 if(first_file_size.is_zero())
353 x_first_file_size = file_size;
355 x_first_file_size = first_file_size;
360 void set_ea_mask(
const mask & ea_mask);
373 void set_execute(
const std::string & execute) { x_execute = execute; };
392 void set_gnupg_recipients(
const std::vector<std::string> & gnupg_recipients) { x_gnupg_recipients = gnupg_recipients; };
396 void set_gnupg_signatories(
const std::vector<std::string> & gnupg_signatories) { x_gnupg_signatories = gnupg_signatories; };
399 void set_compr_mask(
const mask & compr_mask);
410 { exclude_by_ea = (ea_name ==
"" ?
"user.libdar_no_backup" : ea_name); };
428 x_old_alter_atime = alter_atime;
430 x_alter_atime = alter_atime;
458 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; };
482 void set_backup_hook(
const std::string & execute,
const mask & which_files);
488 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; };
505 void set_delta_mask(
const mask & delta_mask);
535 std::shared_ptr<archive> get_reference()
const {
return x_ref_arch; };
536 const mask & get_selection()
const {
if(x_selection ==
nullptr)
throw SRC_BUG;
return *x_selection; };
537 const mask & get_subtree()
const {
if(x_subtree ==
nullptr)
throw SRC_BUG;
return *x_subtree; };
538 bool get_allow_over()
const {
return x_allow_over; };
539 bool get_warn_over()
const {
return x_warn_over; };
540 bool get_info_details()
const {
return x_info_details; };
541 bool get_display_treated()
const {
return x_display_treated; };
542 bool get_display_treated_only_dir()
const {
return x_display_treated_only_dir; };
543 bool get_display_skipped()
const {
return x_display_skipped; };
544 bool get_display_finished()
const {
return x_display_finished; };
545 const infinint & get_pause()
const {
return x_pause; };
546 bool get_empty_dir()
const {
return x_empty_dir; };
547 compression get_compression()
const {
return x_compr_algo; };
548 U_I get_compression_level()
const {
return x_compression_level; };
549 const infinint & get_slice_size()
const {
return x_file_size; };
550 const infinint & get_first_slice_size()
const {
return x_first_file_size; };
551 const mask & get_ea_mask()
const {
if(x_ea_mask ==
nullptr)
throw SRC_BUG;
return *x_ea_mask; };
552 const std::string & get_execute()
const {
return x_execute; };
553 crypto_algo get_crypto_algo()
const {
return x_crypto; };
554 const secu_string & get_crypto_pass()
const {
return x_pass; };
555 U_32 get_crypto_size()
const {
return x_crypto_size; };
556 const std::vector<std::string> & get_gnupg_recipients()
const {
return x_gnupg_recipients; };
557 const std::vector<std::string> & get_gnupg_signatories()
const {
return x_gnupg_signatories; };
558 const mask & get_compr_mask()
const {
if(x_compr_mask ==
nullptr)
throw SRC_BUG;
return *x_compr_mask; };
559 const infinint & get_min_compr_size()
const {
return x_min_compr_size; };
560 bool get_nodump()
const {
return x_nodump; };
561 const std::string & get_exclude_by_ea()
const {
return exclude_by_ea; };
563 const infinint & get_hourshift()
const {
return x_hourshift; };
564 bool get_empty()
const {
return x_empty; };
565 bool get_alter_atime()
const {
return x_alter_atime; };
566 bool get_furtive_read_mode()
const {
return x_furtive_read; };
567 bool get_same_fs()
const {
return x_same_fs; };
568 bool get_snapshot()
const {
return x_snapshot; };
569 bool get_cache_directory_tagging()
const {
return x_cache_directory_tagging; };
570 const infinint & get_fixed_date()
const {
return x_fixed_date; };
571 const std::string & get_slice_permission()
const {
return x_slice_permission; };
572 const std::string & get_slice_user_ownership()
const {
return x_slice_user_ownership; };
573 const std::string & get_slice_group_ownership()
const {
return x_slice_group_ownership; };
574 const infinint & get_repeat_count()
const {
return x_repeat_count; };
575 const infinint & get_repeat_byte()
const {
return x_repeat_byte; };
576 bool get_sequential_marks()
const {
return x_sequential_marks; };
577 infinint get_sparse_file_min_size()
const {
return x_sparse_file_min_size; };
578 bool get_security_check()
const {
return x_security_check; };
579 const std::string & get_user_comment()
const {
return x_user_comment; };
580 hash_algo get_hash_algo()
const {
return x_hash; };
581 infinint get_slice_min_digits()
const {
return x_slice_min_digits; };
582 const std::string & get_backup_hook_file_execute()
const {
return x_backup_hook_file_execute; };
583 const mask & get_backup_hook_file_mask()
const {
return *x_backup_hook_file_mask; };
584 bool get_ignore_unknown_inode_type()
const {
return x_ignore_unknown; };
585 const std::shared_ptr<entrepot> & get_entrepot()
const {
return x_entrepot; };
586 const fsa_scope & get_fsa_scope()
const {
return x_scope; };
587 bool get_multi_threaded()
const {
return x_multi_threaded; };
588 bool get_delta_diff()
const {
return x_delta_diff; };
589 bool get_delta_signature()
const {
return x_delta_signature; };
590 const mask & get_delta_mask()
const {
return *x_delta_mask; }
591 bool get_has_delta_mask_been_set()
const {
return has_delta_mask_been_set; };
592 const infinint & get_delta_sig_min_size()
const {
return x_delta_sig_min_size; };
593 bool get_auto_zeroing_neg_dates()
const {
return x_auto_zeroing_neg_dates; };
594 const std::set<std::string> & get_ignored_as_symlink()
const {
return x_ignored_as_symlink; };
596 const infinint & get_iteration_count()
const {
return x_iteration_count; };
606 bool x_display_treated;
607 bool x_display_treated_only_dir;
608 bool x_display_skipped;
609 bool x_display_finished;
613 U_I x_compression_level;
617 std::string x_execute;
621 std::vector<std::string> x_gnupg_recipients;
622 std::vector<std::string> x_gnupg_signatories;
626 std::string exclude_by_ea;
635 bool x_cache_directory_tagging;
637 std::string x_slice_permission;
638 std::string x_slice_user_ownership;
639 std::string x_slice_group_ownership;
642 bool x_sequential_marks;
644 bool x_security_check;
645 std::string x_user_comment;
648 mask * x_backup_hook_file_mask;
649 std::string x_backup_hook_file_execute;
650 bool x_ignore_unknown;
651 std::shared_ptr<entrepot> x_entrepot;
653 bool x_multi_threaded;
655 bool x_delta_signature;
657 bool has_delta_mask_been_set;
659 bool x_auto_zeroing_neg_dates;
660 std::set<std::string> x_ignored_as_symlink;
665 void nullifyptr() noexcept;
666 void destroy() noexcept;
669 void destroy_mask(
mask * & ptr);
670 void clean_mask(
mask * & ptr);
671 void check_mask(const
mask & m);
688 archive_options_isolate();
689 archive_options_isolate(
const archive_options_isolate & ref);
690 archive_options_isolate(archive_options_isolate && ref) noexcept { nullifyptr(); move_from(std::move(ref)); };
691 archive_options_isolate & operator = (
const archive_options_isolate & ref) { destroy(); copy_from(ref);
return *
this; };
692 archive_options_isolate & operator = (archive_options_isolate && ref) noexcept { move_from(std::move(ref));
return *
this; };
693 ~archive_options_isolate() { destroy(); };
726 x_file_size = file_size;
727 if(first_file_size.is_zero())
728 x_first_file_size = file_size;
730 x_first_file_size = first_file_size;
744 void set_execute(
const std::string & execute) { x_execute = execute; };
757 void set_gnupg_recipients(
const std::vector<std::string> & gnupg_recipients) { x_gnupg_recipients = gnupg_recipients; };
760 void set_gnupg_signatories(
const std::vector<std::string> & gnupg_signatories) { x_gnupg_signatories = gnupg_signatories; };
787 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; };
796 void set_delta_mask(
const mask & delta_mask);
813 bool get_allow_over()
const {
return x_allow_over; };
814 bool get_warn_over()
const {
return x_warn_over; };
815 bool get_info_details()
const {
return x_info_details; };
816 const infinint & get_pause()
const {
return x_pause; };
817 compression get_compression()
const {
return x_algo; };
818 U_I get_compression_level()
const {
return x_compression_level; };
819 const infinint & get_slice_size()
const {
return x_file_size; };
820 const infinint & get_first_slice_size()
const {
return x_first_file_size; };
821 const std::string & get_execute()
const {
return x_execute; };
822 crypto_algo get_crypto_algo()
const {
return x_crypto; };
823 const secu_string & get_crypto_pass()
const {
return x_pass; };
824 U_32 get_crypto_size()
const {
return x_crypto_size; };
825 const std::vector<std::string> & get_gnupg_recipients()
const {
return x_gnupg_recipients; };
826 const std::vector<std::string> & get_gnupg_signatories()
const {
return x_gnupg_signatories; };
827 bool get_empty()
const {
return x_empty; };
828 const std::string & get_slice_permission()
const {
return x_slice_permission; };
829 const std::string & get_slice_user_ownership()
const {
return x_slice_user_ownership; };
830 const std::string & get_slice_group_ownership()
const {
return x_slice_group_ownership; };
831 const std::string & get_user_comment()
const {
return x_user_comment; };
832 hash_algo get_hash_algo()
const {
return x_hash; };
833 infinint get_slice_min_digits()
const {
return x_slice_min_digits; };
834 bool get_sequential_marks()
const {
return x_sequential_marks; };
835 const std::shared_ptr<entrepot> & get_entrepot()
const {
return x_entrepot; };
836 bool get_multi_threaded()
const {
return x_multi_threaded; };
837 bool get_delta_signature()
const {
return x_delta_signature; };
838 const mask & get_delta_mask()
const {
return *x_delta_mask; }
839 bool get_has_delta_mask_been_set()
const {
return has_delta_mask_been_set; };
840 const infinint & get_delta_sig_min_size()
const {
return x_delta_sig_min_size; };
841 const infinint & get_iteration_count()
const {
return x_iteration_count; };
842 hash_algo get_kdf_hash()
const {
return x_kdf_hash; };
850 U_I x_compression_level;
853 std::string x_execute;
857 std::vector<std::string> x_gnupg_recipients;
858 std::vector<std::string> x_gnupg_signatories;
860 std::string x_slice_permission;
861 std::string x_slice_user_ownership;
862 std::string x_slice_group_ownership;
863 std::string x_user_comment;
866 bool x_sequential_marks;
867 std::shared_ptr<entrepot> x_entrepot;
868 bool x_multi_threaded;
869 bool x_delta_signature;
871 bool has_delta_mask_been_set;
876 void copy_from(
const archive_options_isolate & ref);
877 void move_from(archive_options_isolate && ref) noexcept;
878 void destroy() noexcept;
879 void nullifyptr() noexcept;
905 void set_auxiliary_ref(std::shared_ptr<archive> ref) { x_ref = ref; };
908 void set_selection(
const mask & selection);
911 void set_subtree(
const mask & subtree);
920 void set_overwriting_rules(
const crit_action & overwrite);
934 void set_display_treated(
bool display_treated,
bool only_dir) { x_display_treated = display_treated; x_display_treated_only_dir = only_dir; };
958 x_file_size = file_size;
959 if(first_file_size.is_zero())
960 x_first_file_size = file_size;
962 x_first_file_size = first_file_size;
966 void set_ea_mask(
const mask & ea_mask);
979 void set_execute(
const std::string & execute) { x_execute = execute; };
993 void set_gnupg_recipients(
const std::vector<std::string> & gnupg_recipients) { x_gnupg_recipients = gnupg_recipients; };
996 void set_gnupg_signatories(
const std::vector<std::string> & gnupg_signatories) { x_gnupg_signatories = gnupg_signatories; };
999 void set_compr_mask(
const mask & compr_mask);
1038 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; };
1054 void set_delta_mask(
const mask & delta_mask);
1072 std::shared_ptr<archive> get_auxiliary_ref()
const {
return x_ref; };
1073 const mask & get_selection()
const {
if(x_selection ==
nullptr)
throw SRC_BUG;
return *x_selection; };
1074 const mask & get_subtree()
const {
if(x_subtree ==
nullptr)
throw SRC_BUG;
return *x_subtree; };
1075 bool get_allow_over()
const {
return x_allow_over; };
1076 bool get_warn_over()
const {
return x_warn_over; };
1077 const crit_action & get_overwriting_rules()
const {
if(x_overwrite ==
nullptr)
throw SRC_BUG;
return *x_overwrite; };
1078 bool get_info_details()
const {
return x_info_details; };
1079 bool get_display_treated()
const {
return x_display_treated; };
1080 bool get_display_treated_only_dir()
const {
return x_display_treated_only_dir; };
1081 bool get_display_skipped()
const {
return x_display_skipped; };
1082 const infinint & get_pause()
const {
return x_pause; };
1083 bool get_empty_dir()
const {
return x_empty_dir; };
1084 compression get_compression()
const {
return x_compr_algo; };
1085 U_I get_compression_level()
const {
return x_compression_level; };
1086 const infinint & get_slice_size()
const {
return x_file_size; };
1087 const infinint & get_first_slice_size()
const {
return x_first_file_size; };
1088 const mask & get_ea_mask()
const {
if(x_ea_mask ==
nullptr)
throw SRC_BUG;
return *x_ea_mask; };
1089 const std::string & get_execute()
const {
return x_execute; };
1090 crypto_algo get_crypto_algo()
const {
return x_crypto; };
1091 const secu_string & get_crypto_pass()
const {
return x_pass; };
1092 U_32 get_crypto_size()
const {
return x_crypto_size; };
1093 const std::vector<std::string> & get_gnupg_recipients()
const {
return x_gnupg_recipients; };
1094 const std::vector<std::string> & get_gnupg_signatories()
const {
return x_gnupg_signatories; };
1095 const mask & get_compr_mask()
const {
if(x_compr_mask ==
nullptr)
throw SRC_BUG;
return *x_compr_mask; };
1096 const infinint & get_min_compr_size()
const {
return x_min_compr_size; };
1097 bool get_empty()
const {
return x_empty; };
1098 bool get_keep_compressed()
const {
return x_keep_compressed; };
1099 const std::string & get_slice_permission()
const {
return x_slice_permission; };
1100 const std::string & get_slice_user_ownership()
const {
return x_slice_user_ownership; };
1101 const std::string & get_slice_group_ownership()
const {
return x_slice_group_ownership; };
1102 bool get_decremental_mode()
const {
return x_decremental; };
1103 bool get_sequential_marks()
const {
return x_sequential_marks; };
1104 infinint get_sparse_file_min_size()
const {
return x_sparse_file_min_size; };
1105 const std::string & get_user_comment()
const {
return x_user_comment; };
1106 hash_algo get_hash_algo()
const {
return x_hash; };
1107 infinint get_slice_min_digits()
const {
return x_slice_min_digits; };
1108 const std::shared_ptr<entrepot> & get_entrepot()
const {
return x_entrepot; };
1109 const fsa_scope & get_fsa_scope()
const {
return x_scope; };
1110 bool get_multi_threaded()
const {
return x_multi_threaded; };
1111 bool get_delta_signature()
const {
return x_delta_signature; };
1112 const mask & get_delta_mask()
const {
return *x_delta_mask; }
1113 bool get_has_delta_mask_been_set()
const {
return has_delta_mask_been_set; };
1114 const infinint & get_delta_sig_min_size()
const {
return x_delta_sig_min_size; };
1115 const infinint & get_iteration_count()
const {
return x_iteration_count; };
1116 hash_algo get_kdf_hash()
const {
return x_kdf_hash; };
1119 std::shared_ptr<archive> x_ref;
1125 bool x_info_details;
1126 bool x_display_treated;
1127 bool x_display_treated_only_dir;
1128 bool x_display_skipped;
1132 U_I x_compression_level;
1136 std::string x_execute;
1140 std::vector<std::string> x_gnupg_recipients;
1141 std::vector<std::string> x_gnupg_signatories;
1142 mask * x_compr_mask;
1145 bool x_keep_compressed;
1146 std::string x_slice_permission;
1147 std::string x_slice_user_ownership;
1148 std::string x_slice_group_ownership;
1150 bool x_sequential_marks;
1152 std::string x_user_comment;
1155 std::shared_ptr<entrepot> x_entrepot;
1157 bool x_multi_threaded;
1158 bool x_delta_signature;
1160 bool has_delta_mask_been_set;
1165 void destroy() noexcept;
1168 void nullifyptr() noexcept;
1180 enum t_dirty { dirty_ignore, dirty_warn, dirty_ok };
1195 void set_selection(
const mask & selection);
1198 void set_subtree(
const mask & subtree);
1214 void set_display_treated(
bool display_treated,
bool only_dir) { x_display_treated = display_treated; x_display_treated_only_dir = only_dir; };
1220 void set_ea_mask(
const mask & ea_mask);
1241 void set_dirty_behavior(
bool ignore,
bool warn) { x_dirty = ignore ? dirty_ignore : (warn ? dirty_warn : dirty_ok); };
1247 void set_overwriting_rules(
const crit_action & over);
1267 const mask & get_selection()
const {
if(x_selection ==
nullptr)
throw SRC_BUG;
return *x_selection; };
1268 const mask & get_subtree()
const {
if(x_subtree ==
nullptr)
throw SRC_BUG;
return *x_subtree; };
1269 bool get_warn_over()
const {
return x_warn_over; };
1270 bool get_info_details()
const {
return x_info_details; };
1271 bool get_display_treated()
const {
return x_display_treated; };
1272 bool get_display_treated_only_dir()
const {
return x_display_treated_only_dir; };
1273 bool get_display_skipped()
const {
return x_display_skipped; };
1274 const mask & get_ea_mask()
const {
if(x_ea_mask ==
nullptr)
throw SRC_BUG;
return *x_ea_mask; };
1275 bool get_flat()
const {
return x_flat; };
1277 bool get_warn_remove_no_match()
const {
return x_warn_remove_no_match; };
1278 bool get_empty()
const {
return x_empty; };
1279 bool get_empty_dir()
const {
return x_empty_dir; };
1280 t_dirty get_dirty_behavior()
const {
return x_dirty; }
1281 const crit_action & get_overwriting_rules()
const {
if(x_overwrite ==
nullptr)
throw SRC_BUG;
return *x_overwrite; };
1282 bool get_only_deleted()
const {
return x_only_deleted; };
1283 bool get_ignore_deleted()
const {
return x_ignore_deleted; };
1284 const fsa_scope & get_fsa_scope()
const {
return x_scope; };
1290 bool x_info_details;
1291 bool x_display_treated;
1292 bool x_display_treated_only_dir;
1293 bool x_display_skipped;
1297 bool x_warn_remove_no_match;
1302 bool x_only_deleted;
1303 bool x_ignore_deleted;
1306 void destroy() noexcept;
1307 void nullifyptr() noexcept;
1330 virtual void clear();
1342 void set_selection(
const mask & selection);
1347 void set_subtree(
const mask & subtree);
1360 void set_user_slicing(
const infinint & slicing_first,
const infinint & slicing_others);
1371 bool get_info_details()
const {
return x_info_details; };
1372 const mask & get_selection()
const;
1373 const mask & get_subtree()
const;
1374 bool get_filter_unsaved()
const {
return x_filter_unsaved; };
1375 bool get_user_slicing(
infinint & slicing_first,
infinint & slicing_others)
const;
1376 bool get_slicing_location()
const {
return x_slicing_location; };
1377 bool get_display_ea()
const {
return x_display_ea; };
1380 bool x_info_details;
1383 bool x_filter_unsaved;
1386 bool x_slicing_location;
1389 void destroy() noexcept;
1390 void nullifyptr() noexcept;
1400 class archive_options_diff
1403 archive_options_diff() { nullifyptr();
clear(); };
1404 archive_options_diff(
const archive_options_diff & ref) { copy_from(ref); };
1405 archive_options_diff(archive_options_diff && ref) noexcept { nullifyptr(); move_from(std::move(ref)); };
1406 archive_options_diff & operator = (
const archive_options_diff & ref) { destroy(); copy_from(ref);
return *
this; };
1407 archive_options_diff & operator = (archive_options_diff && ref) noexcept { move_from(std::move(ref));
return *
this; };
1408 ~archive_options_diff() { destroy(); };
1416 void set_selection(
const mask & selection);
1419 void set_subtree(
const mask & subtree);
1427 void set_info_details(
bool info_details) { x_info_details = info_details; };
1432 void set_display_treated(
bool display_treated,
bool only_dir) { x_display_treated = display_treated; x_display_treated_only_dir = only_dir; };
1435 void set_display_skipped(
bool display_skipped) { x_display_skipped = display_skipped; };
1438 void set_ea_mask(
const mask & ea_mask);
1441 void set_what_to_check(
comparison_fields what_to_check) { x_what_to_check = what_to_check; };
1447 void set_alter_atime(
bool alter_atime)
1450 x_old_alter_atime = alter_atime;
1452 x_alter_atime = alter_atime;
1456 void set_furtive_read_mode(
bool furtive_read);
1459 void set_hourshift(
const infinint & hourshift) { x_hourshift = hourshift; };
1462 void set_compare_symlink_date(
bool compare_symlink_date) { x_compare_symlink_date = compare_symlink_date; };
1465 void set_fsa_scope(
const fsa_scope & scope) { x_scope = scope; };
1471 const mask & get_selection()
const {
if(x_selection ==
nullptr)
throw SRC_BUG;
return *x_selection; };
1472 const mask & get_subtree()
const {
if(x_subtree ==
nullptr)
throw SRC_BUG;
return *x_subtree; };
1473 bool get_info_details()
const {
return x_info_details; };
1474 bool get_display_treated()
const {
return x_display_treated; };
1475 bool get_display_treated_only_dir()
const {
return x_display_treated_only_dir; };
1476 bool get_display_skipped()
const {
return x_display_skipped; };
1477 const mask & get_ea_mask()
const {
if(x_ea_mask ==
nullptr)
throw SRC_BUG;
return *x_ea_mask; };
1479 bool get_alter_atime()
const {
return x_alter_atime; };
1480 bool get_furtive_read_mode()
const {
return x_furtive_read; };
1481 const infinint & get_hourshift()
const {
return x_hourshift; };
1482 bool get_compare_symlink_date()
const {
return x_compare_symlink_date; };
1483 const fsa_scope & get_fsa_scope()
const {
return x_scope; };
1488 bool x_info_details;
1489 bool x_display_treated;
1490 bool x_display_treated_only_dir;
1491 bool x_display_skipped;
1495 bool x_old_alter_atime;
1496 bool x_furtive_read;
1498 bool x_compare_symlink_date;
1501 void destroy() noexcept;
1502 void nullifyptr() noexcept;
1503 void copy_from(
const archive_options_diff & ref);
1504 void move_from(archive_options_diff && ref) noexcept;
1531 void set_selection(
const mask & selection);
1534 void set_subtree(
const mask & subtree);
1550 void set_display_treated(
bool display_treated,
bool only_dir) { x_display_treated = display_treated; x_display_treated_only_dir = only_dir; };
1559 const mask & get_selection()
const {
if(x_selection ==
nullptr)
throw SRC_BUG;
return *x_selection; };
1560 const mask & get_subtree()
const {
if(x_subtree ==
nullptr)
throw SRC_BUG;
return *x_subtree; };
1561 bool get_info_details()
const {
return x_info_details; };
1562 bool get_display_treated()
const {
return x_display_treated; };
1563 bool get_display_treated_only_dir()
const {
return x_display_treated_only_dir; };
1564 bool get_display_skipped()
const {
return x_display_skipped; };
1565 bool get_empty()
const {
return x_empty; };
1570 bool x_info_details;
1571 bool x_display_treated;
1572 bool x_display_treated_only_dir;
1573 bool x_display_skipped;
1576 void destroy() noexcept;
1577 void nullifyptr() noexcept;
1629 void set_display_treated(
bool display_treated,
bool only_dir) { x_display_treated = display_treated; x_display_treated_only_dir = only_dir; };
1647 x_file_size = file_size;
1648 if(first_file_size.is_zero())
1649 x_first_file_size = file_size;
1651 x_first_file_size = first_file_size;
1665 void set_execute(
const std::string & execute) { x_execute = execute; };
1683 void set_gnupg_recipients(
const std::vector<std::string> & gnupg_recipients) { x_gnupg_recipients = gnupg_recipients; };
1687 void set_gnupg_signatories(
const std::vector<std::string> & gnupg_signatories) { x_gnupg_signatories = gnupg_signatories; };
1713 void set_entrepot(
const std::shared_ptr<entrepot> & entr) {
if(!entr)
throw Erange(
"archive_options_repair::set_entrepot",
"null entrepot pointer given in argument"); x_entrepot = entr; };
1722 bool get_allow_over()
const {
return x_allow_over; };
1723 bool get_warn_over()
const {
return x_warn_over; };
1724 bool get_info_details()
const {
return x_info_details; };
1725 bool get_display_treated()
const {
return x_display_treated; };
1726 bool get_display_treated_only_dir()
const {
return x_display_treated_only_dir; };
1727 bool get_display_skipped()
const {
return x_display_skipped; };
1728 bool get_display_finished()
const {
return x_display_finished; };
1729 const infinint & get_pause()
const {
return x_pause; };
1730 const infinint & get_slice_size()
const {
return x_file_size; };
1731 const infinint & get_first_slice_size()
const {
return x_first_file_size; };
1732 const std::string & get_execute()
const {
return x_execute; };
1733 crypto_algo get_crypto_algo()
const {
return x_crypto; };
1734 const secu_string & get_crypto_pass()
const {
return x_pass; };
1735 U_32 get_crypto_size()
const {
return x_crypto_size; };
1736 const std::vector<std::string> & get_gnupg_recipients()
const {
return x_gnupg_recipients; };
1737 const std::vector<std::string> & get_gnupg_signatories()
const {
return x_gnupg_signatories; };
1738 bool get_empty()
const {
return x_empty; };
1739 const std::string & get_slice_permission()
const {
return x_slice_permission; };
1740 const std::string & get_slice_user_ownership()
const {
return x_slice_user_ownership; };
1741 const std::string & get_slice_group_ownership()
const {
return x_slice_group_ownership; };
1742 const std::string & get_user_comment()
const {
return x_user_comment; };
1743 hash_algo get_hash_algo()
const {
return x_hash; };
1744 infinint get_slice_min_digits()
const {
return x_slice_min_digits; };
1745 const std::shared_ptr<entrepot> & get_entrepot()
const {
return x_entrepot; };
1746 bool get_multi_threaded()
const {
return x_multi_threaded; };
1751 bool x_info_details;
1752 bool x_display_treated;
1753 bool x_display_treated_only_dir;
1754 bool x_display_skipped;
1755 bool x_display_finished;
1759 std::string x_execute;
1763 std::vector<std::string> x_gnupg_recipients;
1764 std::vector<std::string> x_gnupg_signatories;
1766 std::string x_slice_permission;
1767 std::string x_slice_user_ownership;
1768 std::string x_slice_group_ownership;
1769 std::string x_user_comment;
1772 std::shared_ptr<entrepot> x_entrepot;
1773 bool x_multi_threaded;
1775 void nullifyptr() noexcept {};
comparison_fields
how to consider file change during comparison and incremental backup
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't ask whether to pursue)
here lies a mask that selects files present in a given listThe mask_list classes defined here is to b...
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_hash_algo(hash_algo hash)
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
the generic class, parent of all masks
void set_display_skipped(bool display_skipped)
whether to display files that have been excluded by filters
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)
defines whether to show treated files
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_kdf_hash(hash_algo algo)
hash algo used for key derivation
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_slice_user_ownership(const std::string &slice_user_ownership)
if not an empty string set the user ownership of slices accordingly
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_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_slice_permission(const std::string &slice_permission)
if not an empty string set the slice permission according to the octal value given.
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
void set_delta_signature(bool val)
archive_options_read(const archive_options_read &ref)
the copy constructor, assignment operator and destructor
void set_multi_threaded(bool val)
whether libdar is allowed to spawn several threads to possibily work faster on multicore CPU (require...
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 ...
void set_allow_over(bool allow_over)
defines whether overwritting is allowed or not
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 ...
void set_entrepot(const std::shared_ptr< entrepot > &entr)
defines the protocol to use for slices
class holding optional parameters used to test the structure coherence of an existing archive ...
void set_warn_over(bool warn_over)
defines whether a warning shall be issued before overwriting
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!)
mask * x_subtree
points to a local copy of mask (must be allocated / releases by the archive_option_create objects) ...
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_what_to_check(comparison_fields what_to_check)
set the fields to consider when comparing inodes with reference archive (see comparison_fields enumer...
void set_ignored_as_symlink(const std::set< std::string > &list)
provide a list of full path which if are symlinks will be considered as the inode they point to ...
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)
nested namespace containing routines that give features activated at compile time ...
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 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_entrepot(const std::shared_ptr< entrepot > &entr)
defines the protocol to use to retrieve slices
void set_delta_sig_min_size(const infinint &val)
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_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_user_comment(const std::string &comment)
specify a user comment in the archive (always in clear text!)
void set_filter_unsaved(bool filter_unsaved)
whether to only show entries that have their data fully saved
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)
set the list of recipients that will be able to read the archive
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_sparse_file_min_size(const infinint &size)
whether to try to detect sparse files
void set_display_ea(bool display_ea)
whether to fetch EA for listing
bool librsync() noexcept
returns whether delta compression is available and delta diff stuff with it
void set_user_comment(const std::string &comment)
specify a user comment in the archive (always in clear text!)
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_delta_signature(bool val)
whether signature to base binary delta on the future has to be calculated and stored beside saved fil...
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_display_treated(bool display_treated, bool only_dir)
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_delta_signature(bool val)
whether signature to base binary delta on the future has to be calculated and stored beside saved fil...
void set_crypto_size(U_32 crypto_size)
set the size of the encryption by block to use
void set_info_details(bool info_details)
void set_reference(std::shared_ptr< archive > ref_arch)
set the archive to take as reference (nullptr for a full backup)
void set_ref_entrepot(const std::shared_ptr< entrepot > &entr)
defines the protocol to use to retrieve slices of the reference archive (where the external catalogue...
mask * x_compr_mask
points to a local copy of mask (must be allocated / releases by the archive_option_create objects) ...
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 ...
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
the different cypher available for encryption (strong or weak)
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
compression parameters for API
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) ...
void set_crypto_pass(const secu_string &pass)
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_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_info_details(bool info_details)
whether output should be verbosed –> to be moved to shell output
void set_compression_level(U_I compression_level)
the compression level (from 1 to 9)
void set_keep_compressed(bool keep_compressed)
make dar ignore the 'algo' argument and do not uncompress / compress files that are selected for merg...
the global action for overwriting
void set_crypto_size(U_32 crypto_size)
size of the encryption by block to use
void set_info_details(bool info_details)
defines whether the user needs detailed output of the operation
void set_warn_over(bool warn_over)
whether a warning shall be issued before overwriting
void set_crypto_algo(crypto_algo crypto)
set the cypher to use
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_execute(const std::string &execute)
set the command to execute after each slice creation
void set_slicing_location(bool val)
whether to calculate the slice location of each file
void set_iteration_count(const infinint &val)
key derivation
void set_iteration_count(const infinint &val)
key derivation
void set_cache_directory_tagging(bool cache_directory_tagging)
whether to consider the Cache Directory Tagging Standard
bool furtive_read() noexcept
returns whether libdar can support furtive read mode when run by privileged user
void set_gnupg_recipients(const std::vector< std::string > &gnupg_recipients)
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...
std::set< fsa_family > fsa_scope
set of fsa families
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...
mask * x_ea_mask
points to a local copy of mask (must be allocated / releases by the archive_option_create objects) ...
exception used to signal range error
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_compression(compression compr_algo)
set the compression algorithm to be used
modified_data_detection
how to detect data has changed when some fields
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)
void set_slicing(const infinint &file_size, const infinint &first_file_size=0)
define the archive slicing
void set_modified_data_detection(modified_data_detection val)
defines when to resave a file's data which inode metadata changed
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_kdf_hash(hash_algo algo)
hash algo used for key derivation
void set_crypto_size(U_32 crypto_size)
set the size of the encryption by block to use
void set_crypto_algo(crypto_algo crypto)
set the cypher to use
compression
the different compression algorithm available
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 "-")
void set_delta_sig_min_size(const infinint &val)
whether to never calculate delta signature for files which size is smaller or equal to the given argu...
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_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_slice_permission(const std::string &slice_permission)
if not an empty string set the slice permission according to the octal value given.
void set_delta_sig_min_size(const infinint &val)
whether to never calculate delta signature for files which size is smaller or equal to the given argu...
class holding optional parameters used to create an archive
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_execute(const std::string &execute)
command to execute after each slice creation
void set_empty(bool empty)
whether to make a dry-run operation
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)
defines whether to show treated files
class holding optional parameters used to list the contents of an existing archive ...
void set_info_details(bool info_details)
defines whether the user needs detailed output of the operation
void set_multi_threaded(bool val)
whether libdar is allowed to spawn several threads to possibily work faster on multicore CPU (require...
hash_algo
hashing algorithm available
bool x_old_alter_atime
used to backup origina alter_atime value when activating furtive read mode
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_entrepot(const std::shared_ptr< entrepot > &entr)
defines the protocol to use for slices
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)
defines the the crypto cypher to use to read the archive (default is crypto_none) ...
void set_iteration_count(const infinint &val)
key derivation
void set_ref_execute(const std::string &ref_execute)
set the command to execute before reading each slice of the reference catalogue
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_warn_over(bool warn_over)
defines whether a warning shall be issued before overwriting
contains classes that let the user define the policy for overwriting files
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
void set_delta_diff(bool val)
whether binary delta has to be computed for differential/incremental backup
class holding optional parameters used to proceed to the merge operation
mask * x_selection
points to a local copy of mask (must be allocated / releases by the archive_option_create object) ...
std::shared_ptr< archive > x_ref_arch
just contains the address of an existing object, no local copy of object is done here ...
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_entrepot(const std::shared_ptr< entrepot > &entr)
defines the protocol to use for slices
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
libdar namespace encapsulate all libdar symbols
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 ...
set of datastructures used to interact with a catalogue object
void set_sparse_file_min_size(const infinint &size)
whether to try to detect sparse files
bool nodump() noexcept
returns whether nodump flag support has been activated at compilation time
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_kdf_hash(hash_algo algo)
hash algo used for key derivation
void set_sequential_read(bool val)
defines whether to try reading the archive sequentially (ala tar) or using the final catalogue ...
void set_entrepot(const std::shared_ptr< entrepot > &entr)
defines the protocol to use for slices
the class path is here to manipulate paths in the Unix notation: using'/'
void set_compression_level(U_I compression_level)
set the compression level (from 1 to 9)