26 #ifndef HEADER_VERSION_HPP 27 #define HEADER_VERSION_HPP 29 #include "../my_config.h" 63 void set_compression_algo(
const compression & zip) { algo_zip = zip; };
64 void set_command_line(
const std::string & line) { cmd_line = line; };
65 void set_initial_offset(
const infinint & offset) { initial_offset = offset; };
66 void set_sym_crypto_algo(
const crypto_algo & algo) { sym = algo; };
69 void set_crypted_key(memory_file *key) {
if(key ==
nullptr)
throw SRC_BUG; clear_crypted_key(); crypted_key = key; };
70 void clear_crypted_key() {
if(crypted_key !=
nullptr) {
delete crypted_key; crypted_key =
nullptr; } };
73 void set_slice_layout(slice_layout *layout) {
if(layout ==
nullptr)
throw SRC_BUG; clear_slice_layout(); ref_layout = layout; };
74 void clear_slice_layout() {
if(ref_layout !=
nullptr) {
delete ref_layout; ref_layout =
nullptr; } };
76 void set_tape_marks(
bool presence) { has_tape_marks = presence; };
77 void set_signed(
bool is_signed) { arch_signed = is_signed; };
82 compression get_compression_algo()
const {
return algo_zip; };
83 const std::string & get_command_line()
const {
return cmd_line; };
84 const infinint & get_initial_offset()
const {
return initial_offset; };
86 bool is_ciphered()
const {
return ciphered || sym !=
crypto_none; };
87 bool is_signed()
const {
return arch_signed; };
88 crypto_algo get_sym_crypto_algo()
const {
return sym; };
89 memory_file *get_crypted_key()
const {
return crypted_key; };
90 const slice_layout *get_slice_layout()
const {
return ref_layout; };
91 bool get_tape_marks()
const {
return has_tape_marks; };
100 memory_file *crypted_key;
101 slice_layout *ref_layout;
112 static const U_I FLAG_SAVED_EA_ROOT = 0x80;
113 static const U_I FLAG_SAVED_EA_USER = 0x40;
114 static const U_I FLAG_SCRAMBLED = 0x20;
115 static const U_I FLAG_SEQUENCE_MARK = 0x10;
116 static const U_I FLAG_INITIAL_OFFSET = 0x08;
117 static const U_I FLAG_HAS_CRYPTED_KEY = 0x04;
118 static const U_I FLAG_HAS_REF_SLICING = 0x02;
119 static const U_I FLAG_HAS_AN_EXTENDED_SIZE = 0x01;
120 static const U_I FLAG_ARCHIVE_IS_SIGNED = 0x0200;
121 static const U_I FLAG_HAS_AN_SECOND_EXTENDED_SIZE = 0x0101;
void read(generic_file &f, user_interaction &dialog, bool lax_mode)
read the header or trailer from the archive
class generic_file is defined here as well as class fichierthe generic_file interface is widely used ...
void set_crypted_key(memory_file *key)
the object pointed to by key passes to the responsibility of this header_version object ...
This is a pure virtual class that is used by libdar when interaction with the user is required...
the crypto algoritm definition
object describing the slicing of an archive
void write(generic_file &f) const
write down the object to the archive (as header if wrote at the beginning of the archive, as trailer is at the end)
switch module to limitint (32 ou 64 bits integers) or infinint
compression
the different compression algorithm available
this is the interface class from which all other data transfer classes inherit
compression engine implementation
class archive_version that rules which archive format to follow
this is the base class of object that can be allocated on a memory pool
void set_slice_layout(slice_layout *layout)
the object pointed to by layout is passed under the responsibility of this header_version object ...
the arbitrary large positive integer class
libdar namespace encapsulate all libdar symbols