Loading...
Searching...
No Matches
archive_options.hpp
Go to the documentation of this file.
/*********************************************************************/
// dar - disk archive - a backup/restoration program
// Copyright (C) 2002-2024 Denis Corbin
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//
// to contact the author, see the AUTHOR file
/*********************************************************************/
#ifndef ARCHIVE_OPTIONS_HPP
#define ARCHIVE_OPTIONS_HPP
#include "../my_config.h"
#include "crypto.hpp"
#include "integers.hpp"
#include "mask.hpp"
#include "mask_list.hpp"
#include "crit_action.hpp"
#include "secu_string.hpp"
#include "entrepot.hpp"
#include "fsa_family.hpp"
#include "compile_time_features.hpp"
#include "archive_aux.hpp"
#include "compression.hpp"
#include "delta_sig_block_size.hpp"
#include "filesystem_ids.hpp"
#include <string>
#include <vector>
#include <set>
#include <memory>
namespace libdar
{
class archive; // needed to be able to use pointer on archive object.
class archive_options_read
{
public:
archive_options_read();
archive_options_read(const archive_options_read & ref) : x_ref_chem(ref.x_ref_chem) { copy_from(ref); };
archive_options_read(archive_options_read && ref) noexcept;
archive_options_read & operator = (const archive_options_read & ref) { copy_from(ref); return *this; };
archive_options_read & operator = (archive_options_read && ref) noexcept { move_from(std::move(ref)); return *this; };
~archive_options_read() = default;
// set back to default (this is the state just after the object is constructed
// this method is to be used to reuse a given object
void clear();
// setting methods
void set_crypto_algo(crypto_algo val) { x_crypto = val; };
void set_crypto_pass(const secu_string & pass) { x_pass = pass; };
void set_crypto_size(U_32 crypto_size) { x_crypto_size = crypto_size; };
void set_default_crypto_size();
void set_input_pipe(const std::string & input_pipe) { x_input_pipe = input_pipe; };
void set_output_pipe(const std::string & output_pipe) { x_output_pipe = output_pipe; };
void set_execute(const std::string & execute) { x_execute = execute; };
void set_info_details(bool info_details) { x_info_details = info_details; };
void set_lax(bool val) { x_lax = val; };
void set_sequential_read(bool val) { x_sequential_read = val; };
void set_slice_min_digits(infinint val) { x_slice_min_digits = val; };
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; };
void set_ignore_signature_check_failure(bool val) { x_ignore_signature_check_failure = val; };
void set_multi_threaded(bool val) { x_multi_threaded_crypto = 2; x_multi_threaded_compress = 2; };
void set_multi_threaded_crypto(U_I num) { x_multi_threaded_crypto = num; };
void set_multi_threaded_compress(U_I num) { x_multi_threaded_compress = num; };
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; };
void unset_external_catalogue();
void set_ref_crypto_algo(crypto_algo ref_crypto) { x_ref_crypto = ref_crypto; };
void set_ref_crypto_pass(const secu_string & ref_pass) { x_ref_pass = ref_pass; };
void set_ref_crypto_size(U_32 ref_crypto_size) { x_ref_crypto_size = ref_crypto_size; };
void set_ref_execute(const std::string & ref_execute) { x_ref_execute = ref_execute; };
void set_ref_slice_min_digits(infinint val) { x_ref_slice_min_digits = val; };
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; };
void set_header_only(bool val) { x_header_only = val; };
// getting methods (mainly used inside libdar, but kept public and part of the API in the case it is needed)
crypto_algo get_crypto_algo() const { return x_crypto; };
const secu_string & get_crypto_pass() const { return x_pass; };
U_32 get_crypto_size() const { return x_crypto_size; };
const std::string & get_input_pipe() const { return x_input_pipe; };
const std::string & get_output_pipe() const { return x_output_pipe; };
const std::string & get_execute() const { return x_execute; };
bool get_info_details() const { return x_info_details; };
bool get_lax() const { return x_lax; };
bool get_sequential_read() const { return x_sequential_read; };
infinint get_slice_min_digits() const { return x_slice_min_digits; };
const std::shared_ptr<entrepot> & get_entrepot() const { return x_entrepot; };
bool get_ignore_signature_check_failure() const { return x_ignore_signature_check_failure; };
U_I get_multi_threaded_crypto() const { return x_multi_threaded_crypto; };
U_I get_multi_threaded_compress() const { return x_multi_threaded_compress; };
// All methods that follow concern the archive where to fetch the (isolated) catalogue from
bool is_external_catalogue_set() const { return external_cat; };
const path & get_ref_path() const;
const std::string & get_ref_basename() const;
crypto_algo get_ref_crypto_algo() const { return x_ref_crypto; };
const secu_string & get_ref_crypto_pass() const { return x_ref_pass; };
U_32 get_ref_crypto_size() const { return x_ref_crypto_size; };
const std::string & get_ref_execute() const { return x_ref_execute; };
infinint get_ref_slice_min_digits() const { return x_ref_slice_min_digits; };
const std::shared_ptr<entrepot> & get_ref_entrepot() const { return x_ref_entrepot; };
bool get_header_only() const { return x_header_only; };
private:
crypto_algo x_crypto;
secu_string x_pass;
U_32 x_crypto_size;
std::string x_input_pipe;
std::string x_output_pipe;
std::string x_execute;
bool x_info_details;
bool x_lax;
bool x_sequential_read;
infinint x_slice_min_digits;
std::shared_ptr<entrepot> x_entrepot;
bool x_ignore_signature_check_failure;
U_I x_multi_threaded_crypto;
U_I x_multi_threaded_compress;
// external catalogue relative fields
bool external_cat;
path x_ref_chem;
std::string x_ref_basename;
crypto_algo x_ref_crypto;
secu_string x_ref_pass;
U_32 x_ref_crypto_size;
std::string x_ref_execute;
infinint x_ref_slice_min_digits;
std::shared_ptr<entrepot> x_ref_entrepot;
bool x_header_only;
void copy_from(const archive_options_read & ref);
void move_from(archive_options_read && ref) noexcept;
};
class archive_options_create
{
public:
// default constructors and destructor.
archive_options_create();
archive_options_create(const archive_options_create & ref);
archive_options_create(archive_options_create && ref) noexcept { nullifyptr(); move_from(std::move(ref)); };
archive_options_create & operator = (const archive_options_create & ref) { destroy(); copy_from(ref); return *this; };
archive_options_create & operator = (archive_options_create && ref) noexcept { move_from(std::move(ref)); return *this; };
~archive_options_create() { destroy(); };
// set back to default (this is the state just after the object is constructed
// this method is to be used to reuse a given object
void clear();
// setting methods
void set_reference(std::shared_ptr<archive> ref_arch) { x_ref_arch = ref_arch; };
void set_selection(const mask & selection);
void set_subtree(const mask & subtree);
void set_allow_over(bool allow_over) { x_allow_over = allow_over; };
void set_warn_over(bool warn_over) { x_warn_over = warn_over; };
void set_info_details(bool info_details) { x_info_details = info_details; };
void set_display_treated(bool display_treated, bool only_dir) { x_display_treated = display_treated; x_display_treated_only_dir = only_dir; };
void set_display_skipped(bool display_skipped) { x_display_skipped = display_skipped; };
void set_display_finished(bool display_finished) { x_display_finished = display_finished; };
void set_pause(const infinint & pause) { x_pause = pause; };
void set_empty_dir(bool empty_dir) { x_empty_dir = empty_dir; };
void set_compression(compression compr_algo) { x_compr_algo = compr_algo; };
void set_compression_level(U_I compression_level) { x_compression_level = compression_level; };
void set_compression_block_size(U_I compression_block_size) { x_compression_block_size = compression_block_size; };
void set_slicing(const infinint & file_size, const infinint & first_file_size = 0)
{
x_file_size = file_size;
if(first_file_size.is_zero())
x_first_file_size = file_size;
else
x_first_file_size = first_file_size;
};
void set_ea_mask(const mask & ea_mask);
void set_execute(const std::string & execute) { x_execute = execute; };
void set_crypto_algo(crypto_algo crypto) { x_crypto = crypto; };
void set_crypto_pass(const secu_string & pass) { x_pass = pass; };
void set_crypto_size(U_32 crypto_size) { x_crypto_size = crypto_size; };
void set_gnupg_recipients(const std::vector<std::string> & gnupg_recipients) { x_gnupg_recipients = gnupg_recipients; };
void set_gnupg_signatories(const std::vector<std::string> & gnupg_signatories) { x_gnupg_signatories = gnupg_signatories; };
void set_compr_mask(const mask & compr_mask);
void set_min_compr_size(const infinint & min_compr_size) { x_min_compr_size = min_compr_size; };
void set_nodump(bool nodump) { x_nodump = nodump; };
void set_exclude_by_ea(const std::string & ea_name)
{ exclude_by_ea = (ea_name == "" ? "user.libdar_no_backup" : ea_name); };
void set_what_to_check(comparison_fields what_to_check) { x_what_to_check = what_to_check; };
void set_hourshift(const infinint & hourshift) { x_hourshift = hourshift; };
void set_empty(bool empty) { x_empty = empty; };
void set_alter_atime(bool alter_atime)
{
if(x_furtive_read)
x_old_alter_atime = alter_atime;
else
x_alter_atime = alter_atime;
};
void set_furtive_read_mode(bool furtive_read);
void set_same_fs(bool same_fs) { x_same_fs = same_fs; x_same_fs_include.clear(); x_same_fs_exclude.clear(); };
void set_same_fs_include(const std::string & included_path_to_fs) { x_same_fs_include.push_back(included_path_to_fs); };
void set_same_fs_exclude(const std::string & excluded_path_to_fs) { x_same_fs_exclude.push_back(excluded_path_to_fs); };
void set_snapshot(bool snapshot) { x_snapshot = snapshot; };
void set_cache_directory_tagging(bool cache_directory_tagging) { x_cache_directory_tagging = cache_directory_tagging; };
void set_fixed_date(const infinint & fixed_date) { x_fixed_date = fixed_date; };
void set_slice_permission(const std::string & slice_permission) { x_slice_permission = slice_permission; };
void set_slice_user_ownership(const std::string & slice_user_ownership) { x_slice_user_ownership = slice_user_ownership; };
void set_slice_group_ownership(const std::string & slice_group_ownership) { x_slice_group_ownership = slice_group_ownership; };
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; };
void set_sequential_marks(bool sequential) { x_sequential_marks = sequential; };
void set_sparse_file_min_size(const infinint & size) { x_sparse_file_min_size = size; };
void set_security_check(bool check) { x_security_check = check; };
void set_user_comment(const std::string & comment) { x_user_comment = comment; };
void set_hash_algo(hash_algo hash);
void set_slice_min_digits(infinint val) { x_slice_min_digits = val; };
void set_backup_hook(const std::string & execute, const mask & which_files);
void set_ignore_unknown_inode_type(bool val) { x_ignore_unknown = val; };
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; };
void set_fsa_scope(const fsa_scope & scope) { x_scope = scope; };
void set_multi_threaded(bool val) { x_multi_threaded_crypto = 2; x_multi_threaded_compress = 2; };
void set_multi_threaded_crypto(U_I num) { x_multi_threaded_crypto = num; };
void set_multi_threaded_compress(U_I num) { x_multi_threaded_compress = num; };
void set_delta_diff(bool val) { if(val && !compile_time::librsync()) throw Ecompilation("librsync"); x_delta_diff = val; };
void set_delta_signature(bool val) { x_delta_signature = val; };
void set_delta_mask(const mask & delta_mask);
void set_delta_sig_min_size(const infinint & val) { x_delta_sig_min_size = val; };
void set_auto_zeroing_neg_dates(bool val) { x_auto_zeroing_neg_dates = val; };
void set_ignored_as_symlink(const std::set<std::string> & list) { x_ignored_as_symlink = list; };
void set_modified_data_detection(modified_data_detection val) { x_modified_data_detection = val; };
void set_iteration_count(const infinint & val) { x_iteration_count = val; };
void set_kdf_hash(hash_algo algo) { x_kdf_hash = algo; };
void set_sig_block_len(delta_sig_block_size val) { val.check(); x_sig_block_len = val; };
// getting methods
std::shared_ptr<archive> get_reference() const { return x_ref_arch; };
const mask & get_selection() const { if(x_selection == nullptr) throw SRC_BUG; return *x_selection; };
const mask & get_subtree() const { if(x_subtree == nullptr) throw SRC_BUG; return *x_subtree; };
bool get_allow_over() const { return x_allow_over; };
bool get_warn_over() const { return x_warn_over; };
bool get_info_details() const { return x_info_details; };
bool get_display_treated() const { return x_display_treated; };
bool get_display_treated_only_dir() const { return x_display_treated_only_dir; };
bool get_display_skipped() const { return x_display_skipped; };
bool get_display_finished() const { return x_display_finished; };
const infinint & get_pause() const { return x_pause; };
bool get_empty_dir() const { return x_empty_dir; };
compression get_compression() const { return x_compr_algo; };
U_I get_compression_level() const { return x_compression_level; };
U_I get_compression_block_size() const { return x_compression_block_size; };
const infinint & get_slice_size() const { return x_file_size; };
const infinint & get_first_slice_size() const { return x_first_file_size; };
const mask & get_ea_mask() const { if(x_ea_mask == nullptr) throw SRC_BUG; return *x_ea_mask; };
const std::string & get_execute() const { return x_execute; };
crypto_algo get_crypto_algo() const { return x_crypto; };
const secu_string & get_crypto_pass() const { return x_pass; };
U_32 get_crypto_size() const { return x_crypto_size; };
const std::vector<std::string> & get_gnupg_recipients() const { return x_gnupg_recipients; };
const std::vector<std::string> & get_gnupg_signatories() const { return x_gnupg_signatories; };
const mask & get_compr_mask() const { if(x_compr_mask == nullptr) throw SRC_BUG; return *x_compr_mask; };
const infinint & get_min_compr_size() const { return x_min_compr_size; };
bool get_nodump() const { return x_nodump; };
const std::string & get_exclude_by_ea() const { return exclude_by_ea; };
comparison_fields get_comparison_fields() const { return x_what_to_check; };
const infinint & get_hourshift() const { return x_hourshift; };
bool get_empty() const { return x_empty; };
bool get_alter_atime() const { return x_alter_atime; };
bool get_furtive_read_mode() const { return x_furtive_read; };
bool get_same_fs() const { return x_same_fs; };
std::deque<std::string> get_same_fs_include() const { return x_same_fs_include; };
std::deque<std::string> get_same_fs_exclude() const { return x_same_fs_exclude; };
bool get_snapshot() const { return x_snapshot; };
bool get_cache_directory_tagging() const { return x_cache_directory_tagging; };
const infinint & get_fixed_date() const { return x_fixed_date; };
const std::string & get_slice_permission() const { return x_slice_permission; };
const std::string & get_slice_user_ownership() const { return x_slice_user_ownership; };
const std::string & get_slice_group_ownership() const { return x_slice_group_ownership; };
const infinint & get_repeat_count() const { return x_repeat_count; };
const infinint & get_repeat_byte() const { return x_repeat_byte; };
bool get_sequential_marks() const { return x_sequential_marks; };
infinint get_sparse_file_min_size() const { return x_sparse_file_min_size; };
bool get_security_check() const { return x_security_check; };
const std::string & get_user_comment() const { return x_user_comment; };
hash_algo get_hash_algo() const { return x_hash; };
infinint get_slice_min_digits() const { return x_slice_min_digits; };
const std::string & get_backup_hook_file_execute() const { return x_backup_hook_file_execute; };
const mask & get_backup_hook_file_mask() const { return *x_backup_hook_file_mask; };
bool get_ignore_unknown_inode_type() const { return x_ignore_unknown; };
const std::shared_ptr<entrepot> & get_entrepot() const { return x_entrepot; };
const fsa_scope & get_fsa_scope() const { return x_scope; };
U_I get_multi_threaded_crypto() const { return x_multi_threaded_crypto; };
U_I get_multi_threaded_compress() const { return x_multi_threaded_compress; };
bool get_delta_diff() const { return x_delta_diff; };
bool get_delta_signature() const { return x_delta_signature; };
const mask & get_delta_mask() const { return *x_delta_mask; }
bool get_has_delta_mask_been_set() const { return has_delta_mask_been_set; };
const infinint & get_delta_sig_min_size() const { return x_delta_sig_min_size; };
bool get_auto_zeroing_neg_dates() const { return x_auto_zeroing_neg_dates; };
const std::set<std::string> & get_ignored_as_symlink() const { return x_ignored_as_symlink; };
modified_data_detection get_modified_data_detection() const { return x_modified_data_detection; };
const infinint & get_iteration_count() const { return x_iteration_count; };
hash_algo get_kdf_hash() const { return x_kdf_hash; };
delta_sig_block_size get_sig_block_len() const { return x_sig_block_len; };
private:
std::shared_ptr<archive> x_ref_arch;
mask * x_selection;
mask * x_subtree;
bool x_allow_over;
bool x_warn_over;
bool x_info_details;
bool x_display_treated;
bool x_display_treated_only_dir;
bool x_display_skipped;
bool x_display_finished;
infinint x_pause;
bool x_empty_dir;
compression x_compr_algo;
U_I x_compression_level;
U_I x_compression_block_size;
infinint x_file_size;
infinint x_first_file_size;
mask * x_ea_mask;
std::string x_execute;
crypto_algo x_crypto;
secu_string x_pass;
U_32 x_crypto_size;
std::vector<std::string> x_gnupg_recipients;
std::vector<std::string> x_gnupg_signatories;
mask * x_compr_mask;
infinint x_min_compr_size;
bool x_nodump;
std::string exclude_by_ea;
comparison_fields x_what_to_check;
infinint x_hourshift;
bool x_empty;
bool x_alter_atime;
bool x_old_alter_atime;
bool x_furtive_read;
bool x_same_fs;
std::deque<std::string> x_same_fs_include;
std::deque<std::string> x_same_fs_exclude;
bool x_snapshot;
bool x_cache_directory_tagging;
infinint x_fixed_date;
std::string x_slice_permission;
std::string x_slice_user_ownership;
std::string x_slice_group_ownership;
infinint x_repeat_count;
infinint x_repeat_byte;
bool x_sequential_marks;
infinint x_sparse_file_min_size;
bool x_security_check;
std::string x_user_comment;
hash_algo x_hash;
infinint x_slice_min_digits;
mask * x_backup_hook_file_mask;
std::string x_backup_hook_file_execute;
bool x_ignore_unknown;
std::shared_ptr<entrepot> x_entrepot;
fsa_scope x_scope;
U_I x_multi_threaded_crypto;
U_I x_multi_threaded_compress;
bool x_delta_diff;
bool x_delta_signature;
mask *x_delta_mask;
bool has_delta_mask_been_set;
infinint x_delta_sig_min_size;
bool x_auto_zeroing_neg_dates;
std::set<std::string> x_ignored_as_symlink;
modified_data_detection x_modified_data_detection;
infinint x_iteration_count;
hash_algo x_kdf_hash;
delta_sig_block_size x_sig_block_len;
void nullifyptr() noexcept;
void destroy() noexcept;
void copy_from(const archive_options_create & ref);
void move_from(archive_options_create && ref) noexcept;
void destroy_mask(mask * & ptr);
void clean_mask(mask * & ptr);
void check_mask(const mask & m);
};
class archive_options_isolate
{
public:
archive_options_isolate();
archive_options_isolate(const archive_options_isolate & ref);
archive_options_isolate(archive_options_isolate && ref) noexcept { nullifyptr(); move_from(std::move(ref)); };
archive_options_isolate & operator = (const archive_options_isolate & ref) { destroy(); copy_from(ref); return *this; };
archive_options_isolate & operator = (archive_options_isolate && ref) noexcept { move_from(std::move(ref)); return *this; };
~archive_options_isolate() { destroy(); };
void clear();
// setting methods
void set_allow_over(bool allow_over) { x_allow_over = allow_over; };
void set_warn_over(bool warn_over) { x_warn_over = warn_over; };
void set_info_details(bool info_details) { x_info_details = info_details; };
void set_pause(const infinint & pause) { x_pause = pause; };
void set_compression(compression algo) { x_algo = algo; };
void set_compression_level(U_I compression_level) { x_compression_level = compression_level; };
void set_compression_block_size(U_I compression_block_size) { x_compression_block_size = compression_block_size; };
void set_slicing(const infinint & file_size, const infinint & first_file_size = 0)
{
x_file_size = file_size;
if(first_file_size.is_zero())
x_first_file_size = file_size;
else
x_first_file_size = first_file_size;
};
void set_execute(const std::string & execute) { x_execute = execute; };
void set_crypto_algo(crypto_algo crypto) { x_crypto = crypto; };
void set_crypto_pass(const secu_string & pass) { x_pass = pass; };
void set_crypto_size(U_32 crypto_size) { x_crypto_size = crypto_size; };
void set_gnupg_recipients(const std::vector<std::string> & gnupg_recipients) { x_gnupg_recipients = gnupg_recipients; };
void set_gnupg_signatories(const std::vector<std::string> & gnupg_signatories) { x_gnupg_signatories = gnupg_signatories; };
void set_empty(bool empty) { x_empty = empty; };
void set_slice_permission(const std::string & slice_permission) { x_slice_permission = slice_permission; };
void set_slice_user_ownership(const std::string & slice_user_ownership) { x_slice_user_ownership = slice_user_ownership; };
void set_slice_group_ownership(const std::string & slice_group_ownership) { x_slice_group_ownership = slice_group_ownership; };
void set_user_comment(const std::string & comment) { x_user_comment = comment; };
void set_hash_algo(hash_algo hash);
void set_slice_min_digits(infinint val) { x_slice_min_digits = val; };
void set_sequential_marks(bool sequential) { x_sequential_marks = sequential; };
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; };
void set_multi_threaded(bool val) { x_multi_threaded_crypto = 2; x_multi_threaded_compress = 2; };
void set_multi_threaded_crypto(U_I num) { x_multi_threaded_crypto = num; };
void set_multi_threaded_compress(U_I num) { x_multi_threaded_compress = num; };
void set_delta_signature(bool val) { x_delta_signature = val; };
void set_delta_mask(const mask & delta_mask);
void set_delta_sig_min_size(const infinint & val) { x_delta_sig_min_size = val; };
void set_iteration_count(const infinint & val) { x_iteration_count = val; };
void set_kdf_hash(hash_algo algo) { x_kdf_hash = algo; };
void set_sig_block_len(delta_sig_block_size val) { val.check(); x_sig_block_len = val; };
// getting methods
bool get_allow_over() const { return x_allow_over; };
bool get_warn_over() const { return x_warn_over; };
bool get_info_details() const { return x_info_details; };
const infinint & get_pause() const { return x_pause; };
compression get_compression() const { return x_algo; };
U_I get_compression_level() const { return x_compression_level; };
U_I get_compression_block_size() const { return x_compression_block_size; };
const infinint & get_slice_size() const { return x_file_size; };
const infinint & get_first_slice_size() const { return x_first_file_size; };
const std::string & get_execute() const { return x_execute; };
crypto_algo get_crypto_algo() const { return x_crypto; };
const secu_string & get_crypto_pass() const { return x_pass; };
U_32 get_crypto_size() const { return x_crypto_size; };
const std::vector<std::string> & get_gnupg_recipients() const { return x_gnupg_recipients; };
const std::vector<std::string> & get_gnupg_signatories() const { return x_gnupg_signatories; };
bool get_empty() const { return x_empty; };
const std::string & get_slice_permission() const { return x_slice_permission; };
const std::string & get_slice_user_ownership() const { return x_slice_user_ownership; };
const std::string & get_slice_group_ownership() const { return x_slice_group_ownership; };
const std::string & get_user_comment() const { return x_user_comment; };
hash_algo get_hash_algo() const { return x_hash; };
infinint get_slice_min_digits() const { return x_slice_min_digits; };
bool get_sequential_marks() const { return x_sequential_marks; };
const std::shared_ptr<entrepot> & get_entrepot() const { return x_entrepot; };
U_I get_multi_threaded_crypto() const { return x_multi_threaded_crypto; };
U_I get_multi_threaded_compress() const { return x_multi_threaded_compress; };
bool get_delta_signature() const { return x_delta_signature; };
const mask & get_delta_mask() const { return *x_delta_mask; }
bool get_has_delta_mask_been_set() const { return has_delta_mask_been_set; };
const infinint & get_delta_sig_min_size() const { return x_delta_sig_min_size; };
const infinint & get_iteration_count() const { return x_iteration_count; };
hash_algo get_kdf_hash() const { return x_kdf_hash; };
delta_sig_block_size get_sig_block_len() const { return x_sig_block_len; };
private:
bool x_allow_over;
bool x_warn_over;
bool x_info_details;
infinint x_pause;
compression x_algo;
U_I x_compression_level;
U_I x_compression_block_size;
infinint x_file_size;
infinint x_first_file_size;
std::string x_execute;
crypto_algo x_crypto;
secu_string x_pass;
U_32 x_crypto_size;
std::vector<std::string> x_gnupg_recipients;
std::vector<std::string> x_gnupg_signatories;
bool x_empty;
std::string x_slice_permission;
std::string x_slice_user_ownership;
std::string x_slice_group_ownership;
std::string x_user_comment;
hash_algo x_hash;
infinint x_slice_min_digits;
bool x_sequential_marks;
std::shared_ptr<entrepot> x_entrepot;
U_I x_multi_threaded_crypto;
U_I x_multi_threaded_compress;
bool x_delta_signature;
mask *x_delta_mask;
bool has_delta_mask_been_set;
infinint x_delta_sig_min_size;
infinint x_iteration_count;
hash_algo x_kdf_hash;
delta_sig_block_size x_sig_block_len;
void copy_from(const archive_options_isolate & ref);
void move_from(archive_options_isolate && ref) noexcept;
void destroy() noexcept;
void nullifyptr() noexcept;
};
class archive_options_merge
{
public:
archive_options_merge() { nullifyptr(); clear(); };
archive_options_merge(const archive_options_merge & ref) { copy_from(ref); };
archive_options_merge(archive_options_merge && ref) noexcept { nullifyptr(); move_from(std::move(ref)); };
archive_options_merge & operator = (const archive_options_merge & ref) { destroy(); copy_from(ref); return *this; };
archive_options_merge & operator = (archive_options_merge && ref) noexcept { move_from(std::move(ref)); return *this; };
~archive_options_merge() { destroy(); };
void clear();
// setting methods
void set_auxiliary_ref(std::shared_ptr<archive> ref) { x_ref = ref; };
void set_selection(const mask & selection);
void set_subtree(const mask & subtree);
void set_allow_over(bool allow_over) { x_allow_over = allow_over; };
void set_warn_over(bool warn_over) { x_warn_over = warn_over; };
void set_overwriting_rules(const crit_action & overwrite);
void set_info_details(bool info_details) { x_info_details = info_details; };
void set_display_treated(bool display_treated, bool only_dir) { x_display_treated = display_treated; x_display_treated_only_dir = only_dir; };
void set_display_skipped(bool display_skipped) { x_display_skipped = display_skipped; };
void set_pause(const infinint & pause) { x_pause = pause; };
void set_empty_dir(bool empty_dir) { x_empty_dir = empty_dir; };
void set_compression(compression compr_algo) { x_compr_algo = compr_algo; };
void set_compression_level(U_I compression_level) { x_compression_level = compression_level; };
void set_compression_block_size(U_I compression_block_size) { x_compression_block_size = compression_block_size; };
void set_slicing(const infinint & file_size, const infinint & first_file_size = 0)
{
x_file_size = file_size;
if(first_file_size.is_zero())
x_first_file_size = file_size;
else
x_first_file_size = first_file_size;
};
void set_ea_mask(const mask & ea_mask);
void set_execute(const std::string & execute) { x_execute = execute; };
void set_crypto_algo(crypto_algo crypto) { x_crypto = crypto; };
void set_crypto_pass(const secu_string & pass) { x_pass = pass; };
void set_crypto_size(U_32 crypto_size) { x_crypto_size = crypto_size; };
void set_gnupg_recipients(const std::vector<std::string> & gnupg_recipients) { x_gnupg_recipients = gnupg_recipients; };
void set_gnupg_signatories(const std::vector<std::string> & gnupg_signatories) { x_gnupg_signatories = gnupg_signatories; };
void set_compr_mask(const mask & compr_mask);
void set_min_compr_size(const infinint & min_compr_size) { x_min_compr_size = min_compr_size; };
void set_empty(bool empty) { x_empty = empty; };
void set_keep_compressed(bool keep_compressed) { x_keep_compressed = keep_compressed; };
void set_slice_permission(const std::string & slice_permission) { x_slice_permission = slice_permission; };
void set_slice_user_ownership(const std::string & slice_user_ownership) { x_slice_user_ownership = slice_user_ownership; };
void set_slice_group_ownership(const std::string & slice_group_ownership) { x_slice_group_ownership = slice_group_ownership; };
void set_decremental_mode(bool mode) { x_decremental = mode; };
void set_sequential_marks(bool sequential) { x_sequential_marks = sequential; };
void set_sparse_file_min_size(const infinint & size) { x_sparse_file_min_size = size; };
void set_user_comment(const std::string & comment) { x_user_comment = comment; };
void set_hash_algo(hash_algo hash);
void set_slice_min_digits(infinint val) { x_slice_min_digits = val; };
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; };
void set_fsa_scope(const fsa_scope & scope) { x_scope = scope; };
void set_multi_threaded(bool val) { x_multi_threaded_crypto = 2; x_multi_threaded_compress = 2; };
void set_multi_threaded_crypto(U_I num) { x_multi_threaded_crypto = num; };
void set_multi_threaded_compress(U_I num) { x_multi_threaded_compress = num; };
void set_delta_signature(bool val) { x_delta_signature = val; };
void set_delta_mask(const mask & delta_mask);
void set_delta_sig_min_size(const infinint & val) { x_delta_sig_min_size = val; };
void set_iteration_count(const infinint & val) { x_iteration_count = val; };
void set_kdf_hash(hash_algo algo) { x_kdf_hash = algo; };
void set_sig_block_len(delta_sig_block_size val) { val.check(); x_sig_block_len = val; };
// getting methods
std::shared_ptr<archive> get_auxiliary_ref() const { return x_ref; };
const mask & get_selection() const { if(x_selection == nullptr) throw SRC_BUG; return *x_selection; };
const mask & get_subtree() const { if(x_subtree == nullptr) throw SRC_BUG; return *x_subtree; };
bool get_allow_over() const { return x_allow_over; };
bool get_warn_over() const { return x_warn_over; };
const crit_action & get_overwriting_rules() const { if(x_overwrite == nullptr) throw SRC_BUG; return *x_overwrite; };
bool get_info_details() const { return x_info_details; };
bool get_display_treated() const { return x_display_treated; };
bool get_display_treated_only_dir() const { return x_display_treated_only_dir; };
bool get_display_skipped() const { return x_display_skipped; };
const infinint & get_pause() const { return x_pause; };
bool get_empty_dir() const { return x_empty_dir; };
compression get_compression() const { return x_compr_algo; };
U_I get_compression_level() const { return x_compression_level; };
U_I get_compression_block_size() const { return x_compression_block_size; };
const infinint & get_slice_size() const { return x_file_size; };
const infinint & get_first_slice_size() const { return x_first_file_size; };
const mask & get_ea_mask() const { if(x_ea_mask == nullptr) throw SRC_BUG; return *x_ea_mask; };
const std::string & get_execute() const { return x_execute; };
crypto_algo get_crypto_algo() const { return x_crypto; };
const secu_string & get_crypto_pass() const { return x_pass; };
U_32 get_crypto_size() const { return x_crypto_size; };
const std::vector<std::string> & get_gnupg_recipients() const { return x_gnupg_recipients; };
const std::vector<std::string> & get_gnupg_signatories() const { return x_gnupg_signatories; };
const mask & get_compr_mask() const { if(x_compr_mask == nullptr) throw SRC_BUG; return *x_compr_mask; };
const infinint & get_min_compr_size() const { return x_min_compr_size; };
bool get_empty() const { return x_empty; };
bool get_keep_compressed() const { return x_keep_compressed; };
const std::string & get_slice_permission() const { return x_slice_permission; };
const std::string & get_slice_user_ownership() const { return x_slice_user_ownership; };
const std::string & get_slice_group_ownership() const { return x_slice_group_ownership; };
bool get_decremental_mode() const { return x_decremental; };
bool get_sequential_marks() const { return x_sequential_marks; };
infinint get_sparse_file_min_size() const { return x_sparse_file_min_size; };
const std::string & get_user_comment() const { return x_user_comment; };
hash_algo get_hash_algo() const { return x_hash; };
infinint get_slice_min_digits() const { return x_slice_min_digits; };
const std::shared_ptr<entrepot> & get_entrepot() const { return x_entrepot; };
const fsa_scope & get_fsa_scope() const { return x_scope; };
U_I get_multi_threaded_crypto() const { return x_multi_threaded_crypto; };
U_I get_multi_threaded_compress() const { return x_multi_threaded_compress; };
bool get_delta_signature() const { return x_delta_signature; };
const mask & get_delta_mask() const { return *x_delta_mask; }
bool get_has_delta_mask_been_set() const { return has_delta_mask_been_set; };
const infinint & get_delta_sig_min_size() const { return x_delta_sig_min_size; };
const infinint & get_iteration_count() const { return x_iteration_count; };
hash_algo get_kdf_hash() const { return x_kdf_hash; };
delta_sig_block_size get_sig_block_len() const { return x_sig_block_len; };
private:
std::shared_ptr<archive> x_ref;
mask * x_selection;
mask * x_subtree;
bool x_allow_over;
bool x_warn_over;
crit_action * x_overwrite;
bool x_info_details;
bool x_display_treated;
bool x_display_treated_only_dir;
bool x_display_skipped;
infinint x_pause;
bool x_empty_dir;
compression x_compr_algo;
U_I x_compression_level;
U_I x_compression_block_size;
infinint x_file_size;
infinint x_first_file_size;
mask * x_ea_mask;
std::string x_execute;
crypto_algo x_crypto;
secu_string x_pass;
U_32 x_crypto_size;
std::vector<std::string> x_gnupg_recipients;
std::vector<std::string> x_gnupg_signatories;
mask * x_compr_mask;
infinint x_min_compr_size;
bool x_empty;
bool x_keep_compressed;
std::string x_slice_permission;
std::string x_slice_user_ownership;
std::string x_slice_group_ownership;
bool x_decremental;
bool x_sequential_marks;
infinint x_sparse_file_min_size;
std::string x_user_comment;
hash_algo x_hash;
infinint x_slice_min_digits;
std::shared_ptr<entrepot> x_entrepot;
fsa_scope x_scope;
U_I x_multi_threaded_crypto;
U_I x_multi_threaded_compress;
bool x_delta_signature;
mask *x_delta_mask;
bool has_delta_mask_been_set;
infinint x_delta_sig_min_size;
infinint x_iteration_count;
hash_algo x_kdf_hash;
delta_sig_block_size x_sig_block_len;
void destroy() noexcept;
void copy_from(const archive_options_merge & ref);
void move_from(archive_options_merge && ref) noexcept;
void nullifyptr() noexcept;
};
class archive_options_extract
{
public:
enum t_dirty { dirty_ignore, dirty_warn, dirty_ok };
archive_options_extract() { nullifyptr(); clear(); };
archive_options_extract(const archive_options_extract & ref) { copy_from(ref); };
archive_options_extract(archive_options_extract && ref) noexcept { nullifyptr(); move_from(std::move(ref)); };
archive_options_extract & operator = (const archive_options_extract & ref) { destroy(); copy_from(ref); return *this; };
archive_options_extract & operator = (archive_options_extract && ref) noexcept { move_from(std::move(ref)); return *this; };
~archive_options_extract() { destroy(); };
void clear();
// setting methods
void set_selection(const mask & selection);
void set_subtree(const mask & subtree);
void set_warn_over(bool warn_over) { x_warn_over = warn_over; };
void set_info_details(bool info_details) { x_info_details = info_details; };
void set_display_treated(bool display_treated, bool only_dir) { x_display_treated = display_treated; x_display_treated_only_dir = only_dir; };
void set_display_skipped(bool display_skipped) { x_display_skipped = display_skipped; };
void set_ea_mask(const mask & ea_mask);
void set_flat(bool flat) { x_flat = flat; };
void set_what_to_check(comparison_fields what_to_check) { x_what_to_check = what_to_check; };
void set_warn_remove_no_match(bool warn_remove_no_match) { x_warn_remove_no_match = warn_remove_no_match; };
void set_empty(bool empty) { x_empty = empty; };
void set_empty_dir(bool empty_dir) { x_empty_dir = empty_dir; };
void set_dirty_behavior(bool ignore, bool warn) { x_dirty = ignore ? dirty_ignore : (warn ? dirty_warn : dirty_ok); };
void set_dirty_behavior(t_dirty val) { x_dirty = val; };
void set_overwriting_rules(const crit_action & over);
void set_only_deleted(bool val) { x_only_deleted = val; };
void set_ignore_deleted(bool val) { x_ignore_deleted = val; };
void set_fsa_scope(const fsa_scope & scope) { x_scope = scope; };
void set_ignore_unix_sockets(bool val) { x_ignore_unix_sockets = val; };
void set_in_place(bool arg) { x_in_place = arg; };
// getting methods
const mask & get_selection() const { if(x_selection == nullptr) throw SRC_BUG; return *x_selection; };
const mask & get_subtree() const { if(x_subtree == nullptr) throw SRC_BUG; return *x_subtree; };
bool get_warn_over() const { return x_warn_over; };
bool get_info_details() const { return x_info_details; };
bool get_display_treated() const { return x_display_treated; };
bool get_display_treated_only_dir() const { return x_display_treated_only_dir; };
bool get_display_skipped() const { return x_display_skipped; };
const mask & get_ea_mask() const { if(x_ea_mask == nullptr) throw SRC_BUG; return *x_ea_mask; };
bool get_flat() const { return x_flat; };
comparison_fields get_what_to_check() const { return x_what_to_check; };
bool get_warn_remove_no_match() const { return x_warn_remove_no_match; };
bool get_empty() const { return x_empty; };
bool get_empty_dir() const { return x_empty_dir; };
t_dirty get_dirty_behavior() const { return x_dirty; }
const crit_action & get_overwriting_rules() const { if(x_overwrite == nullptr) throw SRC_BUG; return *x_overwrite; };
bool get_only_deleted() const { return x_only_deleted; };
bool get_ignore_deleted() const { return x_ignore_deleted; };
const fsa_scope & get_fsa_scope() const { return x_scope; };
bool get_ignore_unix_sockets() const { return x_ignore_unix_sockets; };
bool get_in_place() const { return x_in_place; };
private:
mask * x_selection;
mask * x_subtree;
bool x_warn_over;
bool x_info_details;
bool x_display_treated;
bool x_display_treated_only_dir;
bool x_display_skipped;
mask * x_ea_mask;
bool x_flat;
comparison_fields x_what_to_check;
bool x_warn_remove_no_match;
bool x_empty;
bool x_empty_dir;
t_dirty x_dirty;
crit_action *x_overwrite;
bool x_only_deleted;
bool x_ignore_deleted;
fsa_scope x_scope;
bool x_ignore_unix_sockets;
bool x_in_place;
void destroy() noexcept;
void nullifyptr() noexcept;
void copy_from(const archive_options_extract & ref);
void move_from(archive_options_extract && ref) noexcept;
};
class archive_options_listing
{
public:
archive_options_listing() { nullifyptr(); clear(); };
archive_options_listing(const archive_options_listing & ref) { copy_from(ref); };
archive_options_listing(archive_options_listing && ref) noexcept { nullifyptr(); move_from(std::move(ref)); };
archive_options_listing & operator = (const archive_options_listing & ref) { destroy(); copy_from(ref); return *this; };
archive_options_listing & operator = (archive_options_listing && ref) noexcept { move_from(std::move(ref)); return *this; };
virtual ~archive_options_listing() { destroy(); };
virtual void clear();
// setting methods
void set_info_details(bool info_details) { x_info_details = info_details; };
void set_selection(const mask & selection);
void set_subtree(const mask & subtree);
void set_filter_unsaved(bool filter_unsaved) { x_filter_unsaved = filter_unsaved; };
void set_slicing_location(bool val) { x_slicing_location = val; };
void set_user_slicing(const infinint & slicing_first, const infinint & slicing_others);
void set_display_ea(bool display_ea) { x_display_ea = display_ea; };
// getting methods
bool get_info_details() const { return x_info_details; };
const mask & get_selection() const;
const mask & get_subtree() const;
bool get_filter_unsaved() const { return x_filter_unsaved; };
bool get_user_slicing(infinint & slicing_first, infinint & slicing_others) const;
bool get_slicing_location() const { return x_slicing_location; };
bool get_display_ea() const { return x_display_ea; };
private:
bool x_info_details;
mask * x_selection;
mask * x_subtree;
bool x_filter_unsaved;
infinint *x_slicing_first;
infinint *x_slicing_others;
bool x_slicing_location;
bool x_display_ea;
void destroy() noexcept;
void nullifyptr() noexcept;
void copy_from(const archive_options_listing & ref);
void move_from(archive_options_listing && ref) noexcept;
};
class archive_options_diff
{
public:
archive_options_diff() { nullifyptr(); clear(); };
archive_options_diff(const archive_options_diff & ref) { copy_from(ref); };
archive_options_diff(archive_options_diff && ref) noexcept { nullifyptr(); move_from(std::move(ref)); };
archive_options_diff & operator = (const archive_options_diff & ref) { destroy(); copy_from(ref); return *this; };
archive_options_diff & operator = (archive_options_diff && ref) noexcept { move_from(std::move(ref)); return *this; };
~archive_options_diff() { destroy(); };
void clear();
// setting methods
void set_selection(const mask & selection);
void set_subtree(const mask & subtree);
void set_info_details(bool info_details) { x_info_details = info_details; };
void set_display_treated(bool display_treated, bool only_dir) { x_display_treated = display_treated; x_display_treated_only_dir = only_dir; };
void set_display_skipped(bool display_skipped) { x_display_skipped = display_skipped; };
void set_ea_mask(const mask & ea_mask);
void set_what_to_check(comparison_fields what_to_check) { x_what_to_check = what_to_check; };
void set_alter_atime(bool alter_atime)
{
if(x_furtive_read)
x_old_alter_atime = alter_atime;
else
x_alter_atime = alter_atime;
};
void set_furtive_read_mode(bool furtive_read);
void set_hourshift(const infinint & hourshift) { x_hourshift = hourshift; };
void set_compare_symlink_date(bool compare_symlink_date) { x_compare_symlink_date = compare_symlink_date; };
void set_fsa_scope(const fsa_scope & scope) { x_scope = scope; };
void set_in_place(bool arg) { x_in_place = arg; };
// getting methods
const mask & get_selection() const { if(x_selection == nullptr) throw SRC_BUG; return *x_selection; };
const mask & get_subtree() const { if(x_subtree == nullptr) throw SRC_BUG; return *x_subtree; };
bool get_info_details() const { return x_info_details; };
bool get_display_treated() const { return x_display_treated; };
bool get_display_treated_only_dir() const { return x_display_treated_only_dir; };
bool get_display_skipped() const { return x_display_skipped; };
const mask & get_ea_mask() const { if(x_ea_mask == nullptr) throw SRC_BUG; return *x_ea_mask; };
comparison_fields get_what_to_check() const { return x_what_to_check; };
bool get_alter_atime() const { return x_alter_atime; };
bool get_furtive_read_mode() const { return x_furtive_read; };
const infinint & get_hourshift() const { return x_hourshift; };
bool get_compare_symlink_date() const { return x_compare_symlink_date; };
const fsa_scope & get_fsa_scope() const { return x_scope; };
bool get_in_place() const { return x_in_place; };
private:
mask * x_selection;
mask * x_subtree;
bool x_info_details;
bool x_display_treated;
bool x_display_treated_only_dir;
bool x_display_skipped;
mask * x_ea_mask;
comparison_fields x_what_to_check;
bool x_alter_atime;
bool x_old_alter_atime;
bool x_furtive_read;
infinint x_hourshift;
bool x_compare_symlink_date;
fsa_scope x_scope;
bool x_in_place;
void destroy() noexcept;
void nullifyptr() noexcept;
void copy_from(const archive_options_diff & ref);
void move_from(archive_options_diff && ref) noexcept;
};
class archive_options_test
{
public:
archive_options_test() { nullifyptr(); clear(); };
archive_options_test(const archive_options_test & ref) { copy_from(ref); };
archive_options_test(archive_options_test && ref) noexcept { nullifyptr(); move_from(std::move(ref)); };
archive_options_test & operator = (const archive_options_test & ref) { destroy(); copy_from(ref); return *this; };
archive_options_test & operator = (archive_options_test && ref) noexcept { move_from(std::move(ref)); return *this; };
~archive_options_test() { destroy(); };
void clear();
// setting methods
void set_selection(const mask & selection);
void set_subtree(const mask & subtree);
void set_info_details(bool info_details) { x_info_details = info_details; };
void set_display_skipped(bool display_skipped) { x_display_skipped = display_skipped; };
void set_display_treated(bool display_treated, bool only_dir) { x_display_treated = display_treated; x_display_treated_only_dir = only_dir; };
void set_empty(bool empty) { x_empty = empty; };
// getting methods
const mask & get_selection() const { if(x_selection == nullptr) throw SRC_BUG; return *x_selection; };
const mask & get_subtree() const { if(x_subtree == nullptr) throw SRC_BUG; return *x_subtree; };
bool get_info_details() const { return x_info_details; };
bool get_display_treated() const { return x_display_treated; };
bool get_display_treated_only_dir() const { return x_display_treated_only_dir; };
bool get_display_skipped() const { return x_display_skipped; };
bool get_empty() const { return x_empty; };
private:
mask * x_selection;
mask * x_subtree;
bool x_info_details;
bool x_display_treated;
bool x_display_treated_only_dir;
bool x_display_skipped;
bool x_empty;
void destroy() noexcept;
void nullifyptr() noexcept;
void copy_from(const archive_options_test & ref);
void move_from(archive_options_test && ref) noexcept;
};
class archive_options_repair
{
public:
// default constructors and destructor.
archive_options_repair();
archive_options_repair(const archive_options_repair & ref);
archive_options_repair(archive_options_repair && ref) noexcept { nullifyptr(); move_from(std::move(ref)); };
archive_options_repair & operator = (const archive_options_repair & ref) { copy_from(ref); return *this; };
archive_options_repair & operator = (archive_options_repair && ref) noexcept { move_from(std::move(ref)); return *this; };
~archive_options_repair() = default;
// set back to default (this is the state just after the object is constructed
// this method is to be used to reuse a given object
void clear();
// setting methods
void set_allow_over(bool allow_over) { x_allow_over = allow_over; };
void set_warn_over(bool warn_over) { x_warn_over = warn_over; };
void set_info_details(bool info_details) { x_info_details = info_details; };
void set_display_treated(bool display_treated, bool only_dir) { x_display_treated = display_treated; x_display_treated_only_dir = only_dir; };
void set_display_skipped(bool display_skipped) { x_display_skipped = display_skipped; };
void set_display_finished(bool display_finished) { x_display_finished = display_finished; };
void set_pause(const infinint & pause) { x_pause = pause; };
void set_slicing(const infinint & file_size, const infinint & first_file_size = 0)
{
x_file_size = file_size;
if(first_file_size.is_zero())
x_first_file_size = file_size;
else
x_first_file_size = first_file_size;
};
void set_execute(const std::string & execute) { x_execute = execute; };
void set_crypto_algo(crypto_algo crypto) { x_crypto = crypto; };
void set_crypto_pass(const secu_string & pass) { x_pass = pass; };
void set_crypto_size(U_32 crypto_size) { x_crypto_size = crypto_size; };
void set_gnupg_recipients(const std::vector<std::string> & gnupg_recipients) { x_gnupg_recipients = gnupg_recipients; };
void set_gnupg_signatories(const std::vector<std::string> & gnupg_signatories) { x_gnupg_signatories = gnupg_signatories; };
void set_empty(bool empty) { x_empty = empty; };
void set_slice_permission(const std::string & slice_permission) { x_slice_permission = slice_permission; };
void set_slice_user_ownership(const std::string & slice_user_ownership) { x_slice_user_ownership = slice_user_ownership; };
void set_slice_group_ownership(const std::string & slice_group_ownership) { x_slice_group_ownership = slice_group_ownership; };
void set_user_comment(const std::string & comment) { x_user_comment = comment; };
void set_hash_algo(hash_algo hash);
void set_slice_min_digits(infinint val) { x_slice_min_digits = val; };
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; };
void set_multi_threaded(bool val) { x_multi_threaded_crypto = 2; x_multi_threaded_compress = 2; };
void set_multi_threaded_crypto(U_I num) { x_multi_threaded_crypto = num; };
void set_multi_threaded_compress(U_I num) { x_multi_threaded_compress = num; };
// getting methods
bool get_allow_over() const { return x_allow_over; };
bool get_warn_over() const { return x_warn_over; };
bool get_info_details() const { return x_info_details; };
bool get_display_treated() const { return x_display_treated; };
bool get_display_treated_only_dir() const { return x_display_treated_only_dir; };
bool get_display_skipped() const { return x_display_skipped; };
bool get_display_finished() const { return x_display_finished; };
const infinint & get_pause() const { return x_pause; };
const infinint & get_slice_size() const { return x_file_size; };
const infinint & get_first_slice_size() const { return x_first_file_size; };
const std::string & get_execute() const { return x_execute; };
crypto_algo get_crypto_algo() const { return x_crypto; };
const secu_string & get_crypto_pass() const { return x_pass; };
U_32 get_crypto_size() const { return x_crypto_size; };
const std::vector<std::string> & get_gnupg_recipients() const { return x_gnupg_recipients; };
const std::vector<std::string> & get_gnupg_signatories() const { return x_gnupg_signatories; };
bool get_empty() const { return x_empty; };
const std::string & get_slice_permission() const { return x_slice_permission; };
const std::string & get_slice_user_ownership() const { return x_slice_user_ownership; };
const std::string & get_slice_group_ownership() const { return x_slice_group_ownership; };
const std::string & get_user_comment() const { return x_user_comment; };
hash_algo get_hash_algo() const { return x_hash; };
infinint get_slice_min_digits() const { return x_slice_min_digits; };
const std::shared_ptr<entrepot> & get_entrepot() const { return x_entrepot; };
U_I get_multi_threaded_crypto() const { return x_multi_threaded_crypto; };
U_I get_multi_threaded_compress() const { return x_multi_threaded_compress; };
private:
bool x_allow_over;
bool x_warn_over;
bool x_info_details;
bool x_display_treated;
bool x_display_treated_only_dir;
bool x_display_skipped;
bool x_display_finished;
infinint x_pause;
infinint x_file_size;
infinint x_first_file_size;
std::string x_execute;
crypto_algo x_crypto;
secu_string x_pass;
U_32 x_crypto_size;
std::vector<std::string> x_gnupg_recipients;
std::vector<std::string> x_gnupg_signatories;
bool x_empty;
std::string x_slice_permission;
std::string x_slice_user_ownership;
std::string x_slice_group_ownership;
std::string x_user_comment;
hash_algo x_hash;
infinint x_slice_min_digits;
std::shared_ptr<entrepot> x_entrepot;
U_I x_multi_threaded_crypto;
U_I x_multi_threaded_compress;
void nullifyptr() noexcept {};
void copy_from(const archive_options_repair & ref);
void move_from(archive_options_repair && ref) noexcept;
};
} // end of namespace
#endif
archive_aux.hpp
set of datastructures used to interact with a catalogue object
libdar::Ecompilation
exception used when a requested fearture has not beed activated at compilation time
Definition erreurs.hpp:366
libdar::Erange
exception used to signal range error
Definition erreurs.hpp:220
libdar::archive_options_create
class holding optional parameters used to create an archive
Definition archive_options.hpp:288
libdar::archive_options_create::clear
void clear()
reset all the options to their default values
libdar::archive_options_create::set_slicing
void set_slicing(const infinint &file_size, const infinint &first_file_size=0)
define the archive slicing
Definition archive_options.hpp:374
libdar::archive_options_create::set_delta_sig_min_size
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...
Definition archive_options.hpp:561
libdar::archive_options_create::set_crypto_pass
void set_crypto_pass(const secu_string &pass)
Definition archive_options.hpp:405
libdar::archive_options_create::set_compression_block_size
void set_compression_block_size(U_I compression_block_size)
set the compression block size
Definition archive_options.hpp:367
libdar::archive_options_create::set_auto_zeroing_neg_dates
void set_auto_zeroing_neg_dates(bool val)
whether to automatically zeroing negative dates read from the filesystem (just warn,...
Definition archive_options.hpp:564
libdar::archive_options_create::set_same_fs_include
void set_same_fs_include(const std::string &included_path_to_fs)
files on the filesystem pointed to by the given path will be considered for the backup operation if n...
Definition archive_options.hpp:474
libdar::archive_options_create::set_display_finished
void set_display_finished(bool display_finished)
whether to display a summary for each completed directory with total saved data and compression ratio
Definition archive_options.hpp:343
libdar::archive_options_create::set_allow_over
void set_allow_over(bool allow_over)
defines whether overwritting is allowed or not
Definition archive_options.hpp:320
libdar::archive_options_create::set_crypto_algo
void set_crypto_algo(crypto_algo crypto)
set the cypher to use
Definition archive_options.hpp:401
libdar::archive_options_create::set_backup_hook
void set_backup_hook(const std::string &execute, const mask &which_files)
defines the backup hook for files
libdar::archive_options_create::set_compression_level
void set_compression_level(U_I compression_level)
set the compression level (from 1 to 9)
Definition archive_options.hpp:355
libdar::archive_options_create::set_retry_on_change
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
Definition archive_options.hpp:500
libdar::archive_options_create::set_info_details
void set_info_details(bool info_details)
defines whether the user needs detailed output of the operation
Definition archive_options.hpp:331
libdar::archive_options_create::set_warn_over
void set_warn_over(bool warn_over)
defines whether a warning shall be issued before overwriting
Definition archive_options.hpp:323
libdar::archive_options_create::set_execute
void set_execute(const std::string &execute)
set the command to execute after each slice creation
Definition archive_options.hpp:398
libdar::archive_options_create::set_security_check
void set_security_check(bool check)
whether to check for ctime changes since with the archive of reference
Definition archive_options.hpp:509
libdar::archive_options_create::set_min_compr_size
void set_min_compr_size(const infinint &min_compr_size)
defines file size under which to never compress
Definition archive_options.hpp:431
libdar::archive_options_create::set_fixed_date
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 ...
Definition archive_options.hpp:488
libdar::archive_options_create::set_delta_signature
void set_delta_signature(bool val)
whether signature to base binary delta on the future has to be calculated and stored beside saved fil...
Definition archive_options.hpp:553
libdar::archive_options_create::set_slice_permission
void set_slice_permission(const std::string &slice_permission)
if not an empty string set the slice permission according to the octal value given.
Definition archive_options.hpp:491
libdar::archive_options_create::set_gnupg_signatories
void set_gnupg_signatories(const std::vector< std::string > &gnupg_signatories)
Definition archive_options.hpp:425
libdar::archive_options_create::set_subtree
void set_subtree(const mask &subtree)
defines the directory and files to consider (this mask will be applied to the absolute path of files ...
libdar::archive_options_create::set_modified_data_detection
void set_modified_data_detection(modified_data_detection val)
defines when to resave a file's data which inode metadata changed
Definition archive_options.hpp:574
libdar::archive_options_create::set_furtive_read_mode
void set_furtive_read_mode(bool furtive_read)
whether to use furtive read mode (if activated, alter_atime() has no meaning/use)
libdar::archive_options_create::set_sequential_marks
void set_sequential_marks(bool sequential)
whether to add escape sequence aka tape marks to allow sequential reading of the archive
Definition archive_options.hpp:503
libdar::archive_options_create::x_ref_arch
std::shared_ptr< archive > x_ref_arch
just contains the address of an existing object, no local copy of object is done here
Definition archive_options.hpp:659
libdar::archive_options_create::set_multi_threaded_compress
void set_multi_threaded_compress(U_I num)
how much thread libdar will use for compression (need libthreadar too and compression_block_size > 0)
Definition archive_options.hpp:545
libdar::archive_options_create::set_cache_directory_tagging
void set_cache_directory_tagging(bool cache_directory_tagging)
whether to consider the Cache Directory Tagging Standard
Definition archive_options.hpp:485
libdar::archive_options_create::set_compr_mask
void set_compr_mask(const mask &compr_mask)
defines files to compress
libdar::archive_options_create::set_pause
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...
Definition archive_options.hpp:346
libdar::archive_options_create::x_ea_mask
mask * x_ea_mask
points to a local copy of mask (must be allocated / releases by the archive_option_create objects)
Definition archive_options.hpp:676
libdar::archive_options_create::set_slice_min_digits
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...
Definition archive_options.hpp:521
libdar::archive_options_create::set_multi_threaded
void set_multi_threaded(bool val)
whether libdar is allowed to spawn several threads to possibily work faster on multicore CPU (require...
Definition archive_options.hpp:539
libdar::archive_options_create::set_same_fs
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...
Definition archive_options.hpp:469
libdar::archive_options_create::set_iteration_count
void set_iteration_count(const infinint &val)
key derivation
Definition archive_options.hpp:577
libdar::archive_options_create::set_empty_dir
void set_empty_dir(bool empty_dir)
defines whether we need to store ignored directories as empty
Definition archive_options.hpp:349
libdar::archive_options_create::set_delta_mask
void set_delta_mask(const mask &delta_mask)
whether to derogate to defaut delta file consideration while calculation delta signatures
libdar::archive_options_create::set_sparse_file_min_size
void set_sparse_file_min_size(const infinint &size)
whether to try to detect sparse files
Definition archive_options.hpp:506
libdar::archive_options_create::x_subtree
mask * x_subtree
points to a local copy of mask (must be allocated / releases by the archive_option_create objects)
Definition archive_options.hpp:661
libdar::archive_options_create::set_delta_diff
void set_delta_diff(bool val)
whether binary delta has to be computed for differential/incremental backup
Definition archive_options.hpp:550
libdar::archive_options_create::set_display_skipped
void set_display_skipped(bool display_skipped)
whether to display files that have been excluded by filters
Definition archive_options.hpp:340
libdar::archive_options_create::set_hourshift
void set_hourshift(const infinint &hourshift)
ignore differences of at most this integer number of hours while looking for changes in dates
Definition archive_options.hpp:445
libdar::archive_options_create::x_selection
mask * x_selection
points to a local copy of mask (must be allocated / releases by the archive_option_create object)
Definition archive_options.hpp:660
libdar::archive_options_create::set_crypto_size
void set_crypto_size(U_32 crypto_size)
set the size of the encryption by block to use
Definition archive_options.hpp:408
libdar::archive_options_create::set_ea_mask
void set_ea_mask(const mask &ea_mask)
defines which Extended Attributes to save
libdar::archive_options_create::set_fsa_scope
void set_fsa_scope(const fsa_scope &scope)
defines the FSA (Filesystem Specific Attribute) to only consider (by default all FSA activated at com...
Definition archive_options.hpp:533
libdar::archive_options_create::set_nodump
void set_nodump(bool nodump)
defines whether to ignore files with the nodump flag set
Definition archive_options.hpp:434
libdar::archive_options_create::set_same_fs_exclude
void set_same_fs_exclude(const std::string &excluded_path_to_fs)
files on the filesystem pointed to by the given path will not be considered for backup operation
Definition archive_options.hpp:479
libdar::archive_options_create::set_ignored_as_symlink
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
Definition archive_options.hpp:570
libdar::archive_options_create::set_exclude_by_ea
void set_exclude_by_ea(const std::string &ea_name)
Definition archive_options.hpp:438
libdar::archive_options_create::set_entrepot
void set_entrepot(const std::shared_ptr< entrepot > &entr)
defines the protocol to use for slices
Definition archive_options.hpp:530
libdar::archive_options_create::set_slice_user_ownership
void set_slice_user_ownership(const std::string &slice_user_ownership)
if not an empty string set the user ownership of slices accordingly
Definition archive_options.hpp:494
libdar::archive_options_create::set_compression
void set_compression(compression compr_algo)
set the compression algorithm to be used
Definition archive_options.hpp:352
libdar::archive_options_create::x_compr_mask
mask * x_compr_mask
points to a local copy of mask (must be allocated / releases by the archive_option_create objects)
Definition archive_options.hpp:683
libdar::archive_options_create::set_ignore_unknown_inode_type
void set_ignore_unknown_inode_type(bool val)
whether to ignore unknown inode types instead of issuing a warning
Definition archive_options.hpp:527
libdar::archive_options_create::set_snapshot
void set_snapshot(bool snapshot)
whether to make an emtpy archive only referencing the current state of files in the filesystem
Definition archive_options.hpp:482
libdar::archive_options_create::set_slice_group_ownership
void set_slice_group_ownership(const std::string &slice_group_ownership)
if not an empty string set the group ownership of slices accordingly
Definition archive_options.hpp:497
libdar::archive_options_create::set_reference
void set_reference(std::shared_ptr< archive > ref_arch)
set the archive to take as reference (nullptr for a full backup)
Definition archive_options.hpp:311
libdar::archive_options_create::set_alter_atime
void set_alter_atime(bool alter_atime)
whether to alter atime or ctime in the filesystem when reading files to save
Definition archive_options.hpp:454
libdar::archive_options_create::x_old_alter_atime
bool x_old_alter_atime
used to backup origina alter_atime value when activating furtive read mode
Definition archive_options.hpp:691
libdar::archive_options_create::set_kdf_hash
void set_kdf_hash(hash_algo algo)
hash algo used for key derivation
Definition archive_options.hpp:580
libdar::archive_options_create::set_user_comment
void set_user_comment(const std::string &comment)
specify a user comment in the archive (always in clear text!)
Definition archive_options.hpp:512
libdar::archive_options_create::set_display_treated
void set_display_treated(bool display_treated, bool only_dir)
defines whether to show treated files
Definition archive_options.hpp:337
libdar::archive_options_create::set_hash_algo
void set_hash_algo(hash_algo hash)
specify whether to produce a hash file of the slice and which hash algo to use
libdar::archive_options_create::set_what_to_check
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...
Definition archive_options.hpp:442
libdar::archive_options_create::set_sig_block_len
void set_sig_block_len(delta_sig_block_size val)
block size to use to build delta signatures
Definition archive_options.hpp:583
libdar::archive_options_create::set_selection
void set_selection(const mask &selection)
defines the filenames to only save (except directory) as those that match the given mask
libdar::archive_options_create::set_gnupg_recipients
void set_gnupg_recipients(const std::vector< std::string > &gnupg_recipients)
set the list of recipients that will be able to read the archive
Definition archive_options.hpp:419
libdar::archive_options_create::set_multi_threaded_crypto
void set_multi_threaded_crypto(U_I num)
how much thread libdar will use for cryptography (need libthreadar to be effective)
Definition archive_options.hpp:542
libdar::archive_options_create::set_empty
void set_empty(bool empty)
whether to make a dry-run operation
Definition archive_options.hpp:448
libdar::archive_options_extract
class holding optional parameters used to extract files from an existing archive
Definition archive_options.hpp:1294
libdar::archive_options_extract::set_ea_mask
void set_ea_mask(const mask &ea_mask)
defines which Extended Attributes to save
libdar::archive_options_extract::set_empty_dir
void set_empty_dir(bool empty_dir)
whether to restore directories where no file has been triggered for backup (no file/inode change,...
Definition archive_options.hpp:1351
libdar::archive_options_extract::set_ignore_unix_sockets
void set_ignore_unix_sockets(bool val)
whether to ignore unix sockets while restoring
Definition archive_options.hpp:1380
libdar::archive_options_extract::set_overwriting_rules
void set_overwriting_rules(const crit_action &over)
overwriting policy
libdar::archive_options_extract::set_display_treated
void set_display_treated(bool display_treated, bool only_dir)
Definition archive_options.hpp:1330
libdar::archive_options_extract::set_info_details
void set_info_details(bool info_details)
Definition archive_options.hpp:1325
libdar::archive_options_extract::set_flat
void set_flat(bool flat)
whether to ignore directory structure and restore all files in the same directory
Definition archive_options.hpp:1339
libdar::archive_options_extract::set_only_deleted
void set_only_deleted(bool val)
only consider deleted files (if set, no data get restored)
Definition archive_options.hpp:1368
libdar::archive_options_extract::set_dirty_behavior
void set_dirty_behavior(t_dirty val)
alternative method to modify dirty behavior
Definition archive_options.hpp:1360
libdar::archive_options_extract::set_ignore_deleted
void set_ignore_deleted(bool val)
do not consider deleted files (if set, no inode will be removed)
Definition archive_options.hpp:1374
libdar::archive_options_extract::set_subtree
void set_subtree(const mask &subtree)
defines the directory and files to consider (this mask will be applied to the absolute path of files ...
libdar::archive_options_extract::set_in_place
void set_in_place(bool arg)
whether to ignore fs_root and use in-place path stored in the archive
Definition archive_options.hpp:1383
libdar::archive_options_extract::set_warn_remove_no_match
void set_warn_remove_no_match(bool warn_remove_no_match)
whether a warning must be issue if a file to remove does not match the expected type of file
Definition archive_options.hpp:1345
libdar::archive_options_extract::set_display_skipped
void set_display_skipped(bool display_skipped)
whether to display files that have been excluded by filters
Definition archive_options.hpp:1333
libdar::archive_options_extract::set_empty
void set_empty(bool empty)
defines whether we need to store ignored directories as empty
Definition archive_options.hpp:1348
libdar::archive_options_extract::set_selection
void set_selection(const mask &selection)
defines the filenames to only save (except directory) as those that match the given mask
libdar::archive_options_extract::set_warn_over
void set_warn_over(bool warn_over)
defines whether a warning shall be issued before overwriting
Definition archive_options.hpp:1317
libdar::archive_options_extract::set_dirty_behavior
void set_dirty_behavior(bool ignore, bool warn)
whether to restore dirty files (those that changed during backup), warn before restoring or ignoring ...
Definition archive_options.hpp:1357
libdar::archive_options_extract::set_fsa_scope
void set_fsa_scope(const fsa_scope &scope)
defines the FSA (Filesystem Specific Attribute) to only consider (by default all FSA activated at com...
Definition archive_options.hpp:1377
libdar::archive_options_extract::set_what_to_check
void set_what_to_check(comparison_fields what_to_check)
fields to consider when comparing inodes with those on filesystem to determine if it is more recent (...
Definition archive_options.hpp:1342
libdar::archive_options_isolate
class holding optional parameters used to isolate an existing archive
Definition archive_options.hpp:750
libdar::archive_options_isolate::set_crypto_size
void set_crypto_size(U_32 crypto_size)
size of the encryption by block to use
Definition archive_options.hpp:821
libdar::archive_options_isolate::set_multi_threaded_crypto
void set_multi_threaded_crypto(U_I num)
how much thread libdar will use for cryptography (need libthreadar to be effective)
Definition archive_options.hpp:868
libdar::archive_options_isolate::set_warn_over
void set_warn_over(bool warn_over)
whether a warning shall be issued before overwriting
Definition archive_options.hpp:769
libdar::archive_options_isolate::set_gnupg_recipients
void set_gnupg_recipients(const std::vector< std::string > &gnupg_recipients)
Definition archive_options.hpp:827
libdar::archive_options_isolate::set_delta_mask
void set_delta_mask(const mask &delta_mask)
whether to derogate to defaut delta file consideration while calculation delta signatures
libdar::archive_options_isolate::set_delta_signature
void set_delta_signature(bool val)
whether signature to base binary delta on the future has to be calculated and stored beside saved fil...
Definition archive_options.hpp:875
libdar::archive_options_isolate::set_slice_permission
void set_slice_permission(const std::string &slice_permission)
if not an empty string set the slice permission according to the octal value given.
Definition archive_options.hpp:838
libdar::archive_options_isolate::set_slicing
void set_slicing(const infinint &file_size, const infinint &first_file_size=0)
define the archive slicing
Definition archive_options.hpp:792
libdar::archive_options_isolate::set_pause
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,...
Definition archive_options.hpp:775
libdar::archive_options_isolate::set_crypto_algo
void set_crypto_algo(crypto_algo crypto)
cypher to use
Definition archive_options.hpp:815
libdar::archive_options_isolate::set_allow_over
void set_allow_over(bool allow_over)
whether overwritting is allowed
Definition archive_options.hpp:766
libdar::archive_options_isolate::set_sequential_marks
void set_sequential_marks(bool sequential)
whether to add escape sequence aka tape marks to allow sequential reading of the archive
Definition archive_options.hpp:856
libdar::archive_options_isolate::set_entrepot
void set_entrepot(const std::shared_ptr< entrepot > &entr)
defines the protocol to use for slices
Definition archive_options.hpp:859
libdar::archive_options_isolate::set_sig_block_len
void set_sig_block_len(delta_sig_block_size val)
block size to use to build delta signatures
Definition archive_options.hpp:892
libdar::archive_options_isolate::set_user_comment
void set_user_comment(const std::string &comment)
specify a user comment in the archive (always in clear text!)
Definition archive_options.hpp:847
libdar::archive_options_isolate::set_compression_level
void set_compression_level(U_I compression_level)
the compression level (from 1 to 9)
Definition archive_options.hpp:781
libdar::archive_options_isolate::set_delta_sig_min_size
void set_delta_sig_min_size(const infinint &val)
Definition archive_options.hpp:883
libdar::archive_options_isolate::set_multi_threaded
void set_multi_threaded(bool val)
whether libdar is allowed to created several thread to work possibily faster on multicore CPU (requir...
Definition archive_options.hpp:865
libdar::archive_options_isolate::set_slice_user_ownership
void set_slice_user_ownership(const std::string &slice_user_ownership)
if not an empty string set the user ownership of slices accordingly
Definition archive_options.hpp:841
libdar::archive_options_isolate::set_execute
void set_execute(const std::string &execute)
command to execute after each slice creation
Definition archive_options.hpp:812
libdar::archive_options_isolate::set_hash_algo
void set_hash_algo(hash_algo hash)
specify whether to produce a hash file of the slice and which hash algo to use
libdar::archive_options_isolate::set_compression
void set_compression(compression algo)
the compression algorithm used
Definition archive_options.hpp:778
libdar::archive_options_isolate::set_compression_block_size
void set_compression_block_size(U_I compression_block_size)
set the compression block size
Definition archive_options.hpp:785
libdar::archive_options_isolate::set_slice_group_ownership
void set_slice_group_ownership(const std::string &slice_group_ownership)
if not an empty string set the group ownership of slices accordingly
Definition archive_options.hpp:844
libdar::archive_options_isolate::set_multi_threaded_compress
void set_multi_threaded_compress(U_I num)
how much thread libdar will use for compression (need libthreadar too and compression_block_size > 0)
Definition archive_options.hpp:871
libdar::archive_options_isolate::set_gnupg_signatories
void set_gnupg_signatories(const std::vector< std::string > &gnupg_signatories)
Definition archive_options.hpp:832
libdar::archive_options_isolate::set_slice_min_digits
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...
Definition archive_options.hpp:853
libdar::archive_options_isolate::set_info_details
void set_info_details(bool info_details)
whether the user needs detailed output of the operation
Definition archive_options.hpp:772
libdar::archive_options_isolate::set_kdf_hash
void set_kdf_hash(hash_algo algo)
hash algo used for key derivation
Definition archive_options.hpp:889
libdar::archive_options_isolate::set_iteration_count
void set_iteration_count(const infinint &val)
key derivation
Definition archive_options.hpp:886
libdar::archive_options_isolate::set_crypto_pass
void set_crypto_pass(const secu_string &pass)
password / passphrase to encrypt the data with (empty string for interactive question)
Definition archive_options.hpp:818
libdar::archive_options_isolate::set_empty
void set_empty(bool empty)
whether to make a dry-run operation
Definition archive_options.hpp:835
libdar::archive_options_listing
class holding optional parameters used to list the contents of an existing archive
Definition archive_options.hpp:1447
libdar::archive_options_listing::set_subtree
void set_subtree(const mask &subtree)
mask applied to the full path, only those matching it will be listed
libdar::archive_options_listing::set_display_ea
void set_display_ea(bool display_ea)
whether to fetch EA for listing
Definition archive_options.hpp:1491
libdar::archive_options_listing::set_user_slicing
void set_user_slicing(const infinint &slicing_first, const infinint &slicing_others)
when slice location is performed, user may modify the slice layout of the archive
libdar::archive_options_listing::set_filter_unsaved
void set_filter_unsaved(bool filter_unsaved)
whether to only show entries that have their data fully saved
Definition archive_options.hpp:1476
libdar::archive_options_listing::set_selection
void set_selection(const mask &selection)
mask applied to filename, only those marching it will be listed
libdar::archive_options_listing::set_info_details
void set_info_details(bool info_details)
whether output should be verbosed --> to be moved to shell output
Definition archive_options.hpp:1463
libdar::archive_options_listing::set_slicing_location
void set_slicing_location(bool val)
whether to calculate the slice location of each file
Definition archive_options.hpp:1479
libdar::archive_options_merge
class holding optional parameters used to proceed to the merge operation
Definition archive_options.hpp:981
libdar::archive_options_merge::set_delta_signature
void set_delta_signature(bool val)
Definition archive_options.hpp:1158
libdar::archive_options_merge::set_sequential_marks
void set_sequential_marks(bool sequential)
whether to activate escape sequence aka tape marks to allow sequential reading of the archive
Definition archive_options.hpp:1121
libdar::archive_options_merge::set_display_skipped
void set_display_skipped(bool display_skipped)
whether to display files that have been excluded by filters
Definition archive_options.hpp:1028
libdar::archive_options_merge::set_compr_mask
void set_compr_mask(const mask &compr_mask)
defines files to compress
libdar::archive_options_merge::set_sig_block_len
void set_sig_block_len(delta_sig_block_size val)
block size to use to build delta signatures
Definition archive_options.hpp:1175
libdar::archive_options_merge::set_empty
void set_empty(bool empty)
defines whether we do a dry-run execution
Definition archive_options.hpp:1103
libdar::archive_options_merge::set_ea_mask
void set_ea_mask(const mask &ea_mask)
defines which Extended Attributes to save
libdar::archive_options_merge::set_crypto_pass
void set_crypto_pass(const secu_string &pass)
Definition archive_options.hpp:1080
libdar::archive_options_merge::set_display_treated
void set_display_treated(bool display_treated, bool only_dir)
defines whether to show treated files
Definition archive_options.hpp:1025
libdar::archive_options_merge::set_multi_threaded_compress
void set_multi_threaded_compress(U_I num)
how much thread libdar will use for compression (need libthreadar too and compression_block_size > 0)
Definition archive_options.hpp:1151
libdar::archive_options_merge::set_slice_min_digits
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...
Definition archive_options.hpp:1133
libdar::archive_options_merge::set_overwriting_rules
void set_overwriting_rules(const crit_action &overwrite)
policy to solve merging conflict
libdar::archive_options_merge::set_delta_mask
void set_delta_mask(const mask &delta_mask)
whether to derogate to defaut delta file consideration while calculation delta signatures
libdar::archive_options_merge::set_min_compr_size
void set_min_compr_size(const infinint &min_compr_size)
defines file size under which to never compress
Definition archive_options.hpp:1100
libdar::archive_options_merge::set_iteration_count
void set_iteration_count(const infinint &val)
key derivation
Definition archive_options.hpp:1169
libdar::archive_options_merge::set_compression
void set_compression(compression compr_algo)
set the compression algorithm to be used
Definition archive_options.hpp:1037
libdar::archive_options_merge::set_sparse_file_min_size
void set_sparse_file_min_size(const infinint &size)
whether to try to detect sparse files
Definition archive_options.hpp:1124
libdar::archive_options_merge::set_multi_threaded
void set_multi_threaded(bool val)
whether libdar is allowed to spawn several threads to possibily work faster on multicore CPU (require...
Definition archive_options.hpp:1145
libdar::archive_options_merge::set_crypto_algo
void set_crypto_algo(crypto_algo crypto)
set the cypher to use
Definition archive_options.hpp:1076
libdar::archive_options_merge::set_crypto_size
void set_crypto_size(U_32 crypto_size)
set the size of the encryption by block to use
Definition archive_options.hpp:1083
libdar::archive_options_merge::set_keep_compressed
void set_keep_compressed(bool keep_compressed)
make dar ignore the 'algo' argument and do not uncompress / compress files that are selected for merg...
Definition archive_options.hpp:1106
libdar::archive_options_merge::set_gnupg_recipients
void set_gnupg_recipients(const std::vector< std::string > &gnupg_recipients)
Definition archive_options.hpp:1089
libdar::archive_options_merge::set_entrepot
void set_entrepot(const std::shared_ptr< entrepot > &entr)
defines the protocol to use for slices
Definition archive_options.hpp:1136
libdar::archive_options_merge::set_kdf_hash
void set_kdf_hash(hash_algo algo)
hash algo used for key derivation
Definition archive_options.hpp:1172
libdar::archive_options_merge::set_info_details
void set_info_details(bool info_details)
defines whether the user needs detailed output of the operation
Definition archive_options.hpp:1019
libdar::archive_options_merge::set_multi_threaded_crypto
void set_multi_threaded_crypto(U_I num)
how much thread libdar will use for cryptography (need libthreadar to be effective)
Definition archive_options.hpp:1148
libdar::archive_options_merge::set_decremental_mode
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...
Definition archive_options.hpp:1118
libdar::archive_options_merge::set_execute
void set_execute(const std::string &execute)
set the command to execute after each slice creation
Definition archive_options.hpp:1073
libdar::archive_options_merge::set_slicing
void set_slicing(const infinint &file_size, const infinint &first_file_size=0)
define the archive slicing
Definition archive_options.hpp:1050
libdar::archive_options_merge::set_pause
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...
Definition archive_options.hpp:1031
libdar::archive_options_merge::set_empty_dir
void set_empty_dir(bool empty_dir)
defines whether we need to store ignored directories as empty
Definition archive_options.hpp:1034
libdar::archive_options_merge::set_compression_block_size
void set_compression_block_size(U_I compression_block_size)
set the compression block size (0 for streamed compression)
Definition archive_options.hpp:1043
libdar::archive_options_merge::set_allow_over
void set_allow_over(bool allow_over)
defines whether overwritting is allowed or not
Definition archive_options.hpp:1005
libdar::archive_options_merge::set_delta_sig_min_size
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...
Definition archive_options.hpp:1166
libdar::archive_options_merge::set_subtree
void set_subtree(const mask &subtree)
defines the directory and files to consider (this mask will be applied to the absolute path of files ...
libdar::archive_options_merge::set_fsa_scope
void set_fsa_scope(const fsa_scope &scope)
defines the FSA (Filesystem Specific Attribute) to only consider (by default all FSA are considered)
Definition archive_options.hpp:1139
libdar::archive_options_merge::set_gnupg_signatories
void set_gnupg_signatories(const std::vector< std::string > &gnupg_signatories)
Definition archive_options.hpp:1094
libdar::archive_options_merge::set_slice_group_ownership
void set_slice_group_ownership(const std::string &slice_group_ownership)
if not an empty string set the group ownership of slices accordingly
Definition archive_options.hpp:1115
libdar::archive_options_merge::set_hash_algo
void set_hash_algo(hash_algo hash)
specify whether to produce a hash file of the slice and which hash algo to use
libdar::archive_options_merge::set_compression_level
void set_compression_level(U_I compression_level)
set the compression level (from 1 to 9)
Definition archive_options.hpp:1040
libdar::archive_options_merge::set_user_comment
void set_user_comment(const std::string &comment)
specify a user comment in the archive (always in clear text!)
Definition archive_options.hpp:1127
libdar::archive_options_merge::set_slice_permission
void set_slice_permission(const std::string &slice_permission)
if not an empty string set the slice permission according to the octal value given.
Definition archive_options.hpp:1109
libdar::archive_options_merge::set_warn_over
void set_warn_over(bool warn_over)
defines whether a warning shall be issued before overwriting
Definition archive_options.hpp:1008
libdar::archive_options_merge::set_slice_user_ownership
void set_slice_user_ownership(const std::string &slice_user_ownership)
if not an empty string set the user ownership of slices accordingly
Definition archive_options.hpp:1112
libdar::archive_options_merge::set_selection
void set_selection(const mask &selection)
defines the filenames to only save (except directory) as those that match the given mask
libdar::archive_options_read
class holding optional parameters used to read an existing archive
Definition archive_options.hpp:65
libdar::archive_options_read::set_input_pipe
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 "-")
Definition archive_options.hpp:112
libdar::archive_options_read::set_entrepot
void set_entrepot(const std::shared_ptr< entrepot > &entr)
defines the protocol to use to retrieve slices
Definition archive_options.hpp:155
libdar::archive_options_read::set_crypto_algo
void set_crypto_algo(crypto_algo val)
defines the the crypto cypher to use to read the archive (default is crypto_none)
Definition archive_options.hpp:97
libdar::archive_options_read::set_ref_crypto_size
void set_ref_crypto_size(U_32 ref_crypto_size)
defines the crypto size for the reference catalogue
Definition archive_options.hpp:187
libdar::archive_options_read::set_multi_threaded_compress
void set_multi_threaded_compress(U_I num)
how much thread libdar will use for compression (need libthreadar too and compression_block_size > 0)
Definition archive_options.hpp:170
libdar::archive_options_read::set_slice_min_digits
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...
Definition archive_options.hpp:151
libdar::archive_options_read::set_crypto_pass
void set_crypto_pass(const secu_string &pass)
defines the password or passphrase to decrypt (unused if encryption is not set)
Definition archive_options.hpp:100
libdar::archive_options_read::archive_options_read
archive_options_read()
build an object and set options to their default values
libdar::archive_options_read::set_multi_threaded
void set_multi_threaded(bool val)
whether libdar is allowed to create several thread to work possibly faster on multicore CPU (need lib...
Definition archive_options.hpp:164
libdar::archive_options_read::set_ref_crypto_pass
void set_ref_crypto_pass(const secu_string &ref_pass)
defines the pass for the reference catalogue
Definition archive_options.hpp:184
libdar::archive_options_read::set_ref_entrepot
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...
Definition archive_options.hpp:208
libdar::archive_options_read::clear
void clear()
reset all the options to their default values
libdar::archive_options_read::set_ignore_signature_check_failure
void set_ignore_signature_check_failure(bool val)
whether to warn (true) or ignore (false) signature failure (default is true)
Definition archive_options.hpp:158
libdar::archive_options_read::unset_external_catalogue
void unset_external_catalogue()
clear any reference to an external catalogue
libdar::archive_options_read::set_ref_crypto_algo
void set_ref_crypto_algo(crypto_algo ref_crypto)
defines the crypto algo for the reference catalogue
Definition archive_options.hpp:181
libdar::archive_options_read::set_lax
void set_lax(bool val)
defines whether any archive coherence error, system error or media error lead to the abortion of the ...
Definition archive_options.hpp:141
libdar::archive_options_read::set_info_details
void set_info_details(bool info_details)
defines whether the user needs detailed output of the operation
Definition archive_options.hpp:134
libdar::archive_options_read::set_header_only
void set_header_only(bool val)
whether we only read the archive header and exit
Definition archive_options.hpp:211
libdar::archive_options_read::set_ref_slice_min_digits
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...
Definition archive_options.hpp:205
libdar::archive_options_read::set_ref_execute
void set_ref_execute(const std::string &ref_execute)
set the command to execute before reading each slice of the reference catalogue
Definition archive_options.hpp:200
libdar::archive_options_read::set_output_pipe
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 "-")
Definition archive_options.hpp:118
libdar::archive_options_read::set_execute
void set_execute(const std::string &execute)
set the command to execute before reading each slice (empty string for no script)
Definition archive_options.hpp:131
libdar::archive_options_read::set_default_crypto_size
void set_default_crypto_size()
set the encryption block size to the default value
libdar::archive_options_read::set_sequential_read
void set_sequential_read(bool val)
defines whether to try reading the archive sequentially (ala tar) or using the final catalogue
Definition archive_options.hpp:147
libdar::archive_options_read::set_crypto_size
void set_crypto_size(U_32 crypto_size)
the encryption block size to use to decrypt
Definition archive_options.hpp:103
libdar::archive_options_read::set_multi_threaded_crypto
void set_multi_threaded_crypto(U_I num)
how much thread libdar will use for cryptography (need libthreadar to be effective)
Definition archive_options.hpp:167
libdar::archive_options_read::archive_options_read
archive_options_read(const archive_options_read &ref)
the copy constructor, assignment operator and destructor
Definition archive_options.hpp:71
libdar::archive_options_read::set_external_catalogue
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 ...
Definition archive_options.hpp:176
libdar::archive_options_repair
class holding optional parameters used to create an archive
Definition archive_options.hpp:1720
libdar::archive_options_repair::set_display_finished
void set_display_finished(bool display_finished)
whether to display a summary for each completed directory with total saved data and compression ratio
Definition archive_options.hpp:1766
libdar::archive_options_repair::set_allow_over
void set_allow_over(bool allow_over)
defines whether overwritting is allowed or not
Definition archive_options.hpp:1743
libdar::archive_options_repair::set_multi_threaded_compress
void set_multi_threaded_compress(U_I num)
how much thread libdar will use for compression (need libthreadar too and compression_block_size > 0)
Definition archive_options.hpp:1859
libdar::archive_options_repair::set_gnupg_signatories
void set_gnupg_signatories(const std::vector< std::string > &gnupg_signatories)
Definition archive_options.hpp:1821
libdar::archive_options_repair::set_crypto_algo
void set_crypto_algo(crypto_algo crypto)
set the cypher to use
Definition archive_options.hpp:1799
libdar::archive_options_repair::set_slice_min_digits
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...
Definition archive_options.hpp:1844
libdar::archive_options_repair::set_slice_user_ownership
void set_slice_user_ownership(const std::string &slice_user_ownership)
if not an empty string set the user ownership of slices accordingly
Definition archive_options.hpp:1830
libdar::archive_options_repair::set_execute
void set_execute(const std::string &execute)
set the command to execute after each slice creation
Definition archive_options.hpp:1796
libdar::archive_options_repair::set_slice_permission
void set_slice_permission(const std::string &slice_permission)
if not an empty string set the slice permission according to the octal value given.
Definition archive_options.hpp:1827
libdar::archive_options_repair::set_crypto_size
void set_crypto_size(U_32 crypto_size)
set the size of the encryption by block to use
Definition archive_options.hpp:1806
libdar::archive_options_repair::set_gnupg_recipients
void set_gnupg_recipients(const std::vector< std::string > &gnupg_recipients)
Definition archive_options.hpp:1816
libdar::archive_options_repair::clear
void clear()
reset all the options to their default values
libdar::archive_options_repair::set_info_details
void set_info_details(bool info_details)
Definition archive_options.hpp:1754
libdar::archive_options_repair::set_slice_group_ownership
void set_slice_group_ownership(const std::string &slice_group_ownership)
if not an empty string set the group ownership of slices accordingly
Definition archive_options.hpp:1833
libdar::archive_options_repair::set_pause
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...
Definition archive_options.hpp:1769
libdar::archive_options_repair::set_empty
void set_empty(bool empty)
whether to make a dry-run operation
Definition archive_options.hpp:1824
libdar::archive_options_repair::set_multi_threaded_crypto
void set_multi_threaded_crypto(U_I num)
how much thread libdar will use for cryptography (need libthreadar to be effective)
Definition archive_options.hpp:1856
libdar::archive_options_repair::set_display_treated
void set_display_treated(bool display_treated, bool only_dir)
Definition archive_options.hpp:1760
libdar::archive_options_repair::set_slicing
void set_slicing(const infinint &file_size, const infinint &first_file_size=0)
define the archive slicing
Definition archive_options.hpp:1776
libdar::archive_options_repair::set_display_skipped
void set_display_skipped(bool display_skipped)
whether to display files that have been excluded by filters
Definition archive_options.hpp:1763
libdar::archive_options_repair::set_user_comment
void set_user_comment(const std::string &comment)
specify a user comment in the archive (always in clear text!)
Definition archive_options.hpp:1836
libdar::archive_options_repair::set_multi_threaded
void set_multi_threaded(bool val)
whether libdar is allowed to spawn several threads to possibily work faster on multicore CPU (require...
Definition archive_options.hpp:1853
libdar::archive_options_repair::set_crypto_pass
void set_crypto_pass(const secu_string &pass)
Definition archive_options.hpp:1803
libdar::archive_options_repair::set_hash_algo
void set_hash_algo(hash_algo hash)
libdar::archive_options_repair::set_warn_over
void set_warn_over(bool warn_over)
defines whether a warning shall be issued before overwriting
Definition archive_options.hpp:1746
libdar::archive_options_repair::set_entrepot
void set_entrepot(const std::shared_ptr< entrepot > &entr)
defines the protocol to use for slices
Definition archive_options.hpp:1847
libdar::archive_options_test
class holding optional parameters used to test the structure coherence of an existing archive
Definition archive_options.hpp:1647
libdar::archive_options_test::set_selection
void set_selection(const mask &selection)
list of filenames to consider (directory not concerned by this fiter)
libdar::archive_options_test::set_display_skipped
void set_display_skipped(bool display_skipped)
whether to display files that have been excluded by filters
Definition archive_options.hpp:1676
libdar::archive_options_test::set_subtree
void set_subtree(const mask &subtree)
defines the directory and files to consider (this mask will be applied to the absolute path of files ...
libdar::archive_options_test::set_empty
void set_empty(bool empty)
dry-run exectution if set to true
Definition archive_options.hpp:1684
libdar::archive_options_test::set_display_treated
void set_display_treated(bool display_treated, bool only_dir)
Definition archive_options.hpp:1681
libdar::archive_options_test::set_info_details
void set_info_details(bool info_details)
Definition archive_options.hpp:1673
libdar::crit_action
the global action for overwriting
Definition crit_action.hpp:81
libdar::infinint
the arbitrary large positive integer class
Definition real_infinint.hpp:62
libdar::mask
the generic class, parent of all masks
Definition mask.hpp:62
libdar::path
the class path is here to manipulate paths in the Unix notation: using'/'
Definition path.hpp:51
libdar::secu_string
class secu_string
Definition secu_string.hpp:54
compile_time_features.hpp
nested namespace containing routines that give features activated at compile time
compression.hpp
compression parameters for API
crit_action.hpp
contains classes that let the user define the policy for overwriting files
crypto.hpp
the crypto algoritm definition
delta_sig_block_size.hpp
structure used to define how to select block size for delta signature
entrepot.hpp
defines the entrepot interface.
filesystem_ids.hpp
gather the ids of different filesystem to provide a filter based on filesystem
fsa_family.hpp
filesystem specific attributes available families and fsa_scope definition
libdar::modified_data_detection
modified_data_detection
how to detect data has changed when some fields
Definition archive_aux.hpp:44
libdar::comparison_fields
comparison_fields
how to consider file change during comparison and incremental backup
Definition archive_aux.hpp:53
libdar::fsa_scope
std::set< fsa_family > fsa_scope
set of fsa families
Definition fsa_family.hpp:70
libdar::hash_algo
hash_algo
hashing algorithm available
Definition archive_aux.hpp:63
libdar::compression
compression
the different compression algorithm available
Definition compression.hpp:46
libdar::crypto_algo
crypto_algo
the different cypher available for encryption (strong or weak)
Definition crypto.hpp:50
integers.hpp
are defined here basic integer types that tend to be portable
mask.hpp
here lies a collection of mask classes
mask_list.hpp
here lies a mask that selects files present in a given list
libdar::compile_time::librsync
bool librsync() noexcept
returns whether delta compression is available and delta diff stuff with it
libdar
libdar namespace encapsulate all libdar symbols
Definition archive.hpp:47
secu_string.hpp
this file contains the definition of secu_string class, a std::string like class but allocated in sec...
libdar::delta_sig_block_size
defines how to calculate delta signature block size based of file size to delta sign
Definition delta_sig_block_size.hpp:47
libdar::delta_sig_block_size::check
void check() const
check the sanity of the provided values