 |
Disk ARchive
2.6.8
Full featured and portable backup and archiving tool
|
Go to the documentation of this file.
29 #include "../my_config.h"
81 sar(
const std::shared_ptr<user_interaction> & dialog,
82 const std::string & base_name,
83 const std::string & extension,
84 const std::shared_ptr<entrepot> & where,
88 const std::string & execute =
"");
113 sar(
const std::shared_ptr<user_interaction> & dialog,
115 const std::string & base_name,
116 const std::string & extension,
119 bool x_warn_overwrite,
120 bool x_allow_overwrite,
122 const std::shared_ptr<entrepot> & where,
123 const label & internal_name,
124 const label & data_name,
125 bool force_permission,
129 bool format_07_compatible,
130 const std::string & execute =
"");
133 sar(
const sar & ref) =
delete;
136 sar(
sar && ref) noexcept =
delete;
148 virtual bool skippable(skippability direction,
const infinint & amount)
override;
155 const slice_layout & get_slicing()
const {
return slicing; };
174 const std::shared_ptr<entrepot> & get_entrepot()
const {
return entr; };
191 std::shared_ptr<entrepot>
entr;
243 void hook_execute(
const infinint &num);
hash_algo
hashing algorithm available
virtual bool skippable(skippability direction, const infinint &amount) override
whether the implementation is able to skip
hash_algo hash
whether to build a hashing when creating slices, and if so, which algorithm to use
bool lax
whether to try to go further reading problems
char of_flag
flags of the open file
label of_data_name
internal name linked to data (transparent to dar_xform and used by isolated catalogue as reference)
manage label data structure used in archive slice headers
U_I perm
if force_perm is true, value to use for slice permission
infinint bytes_still_to_read_in_slice() const
returns the number of bytes expected before the end of slice
class contextual adds the information of phases in the generic_file
virtual bool is_an_old_start_end_archive() const override
returns whether the archive is a old archive (format < 8)
sar(const std::shared_ptr< user_interaction > &dialog, const std::string &base_name, const std::string &extension, const std::shared_ptr< entrepot > &where, bool by_the_end, const infinint &x_min_digits, bool lax=false, const std::string &execute="")
this constructor reads data from a set of slices
are defined here basic integer types that tend to be portable
infinint pause
do we pause between slices
infinint file_offset
current reading/writing position in the current slice (relative to the whole slice file,...
gf_mode
generic_file openning modes
infinint of_current
number of the open slice
switch module to limitint (32 ou 64 bits integers) or infinint
the arbitrary large positive integer class
virtual void inherited_flush_read() override
reset internal engine, flush caches in order to read the data at current position
virtual const label & get_data_name() const override
obtain the data_name of the archive (label associated with the archive's data)
Sar class stands for Segmentation And Reassembly class.
infinint of_last_file_size
size of the last slice (if met)
std::shared_ptr< entrepot > entr
where are stored slices
virtual bool skip(const infinint &pos) override
skip at the absolute position
const infinint & get_first_slice_header_size() const
get the first slice header
bool is_current_eof_a_normal_end_of_slice() const
return true if current reading position is at end of slice
fichier_global * of_fd
file object currently openned
bool initial
do not launch hook command-line during sar initialization
bool skip_forward(U_I x)
skip forward in sar global contents
bool opt_warn_overwrite
a warning must be issued before overwriting a slice
virtual void inherited_write(const char *a, U_I size) override
implementation of the write() operation
void open_writeonly(const std::string &fic, const infinint &num, bool bytheend)
void close_file(bool terminal)
close current openned file, adding (in write mode only) a terminal mark (last slice) or not
class mem_ui to keep a copy of a user_interaction object
bool of_last_file_known
whether the T terminal slice has been met
virtual bool skip_relative(S_I x) override
skip relatively to the current position
defines the entrepot interface. Entrepot interface defines a generic way to interact with files (slic...
virtual bool skip_to_eof() override
skip to the end of file
label of_internal_name
internal name shared in all slice header
class generic_file is defined here as well as class fichier
object describing the slicing of an archive
infinint min_digits
minimum number of digits the slices number is stored with in the filename
virtual void inherited_terminate() override
destructor-like call, except that it is allowed to throw exceptions
bool skip_backward(U_I x)
skip backward in sar global contents
void set_offset(infinint offset)
skip to current slice relative offset
std::string ext
archive extension
bool force_perm
true if any future slice has its permission to be set explicitely
infinint to_read_ahead
amount of data to read ahead for next slices
this is the interface class from which all other data transfer classes inherit
virtual void inherited_read_ahead(const infinint &amount) override
tells the object that several calls to read() will follow to probably obtain at least the given amoun...
virtual U_I inherited_read(char *a, U_I size) override
implementation of read() operation
void open_file(infinint num, bool bytheend)
close current slice and open the slice 'num'
infinint of_max_seen
highest slice number seen so far
void open_readonly(const std::string &fic, const infinint &num, bool bytheend)
infinint of_last_file_num
number of the last slice (if met)
const infinint & get_non_first_slice_header_size() const
get the non first slice header
void open_last_file(bool bytheend)
open the last slice, ask the user, test, until last slice available
the contextual class adds the information of phases in the generic_file
virtual void inherited_sync_write() override
write down any pending data
std::string base
archive base name
slice_layout slicing
slice layout
abstraction of filesystem files for entrepot
sar & operator=(const sar &ref)=delete
assignment operator
bool opt_allow_overwrite
is slice overwriting allowed
infinint size_of_current
size of the current slice (used in reading mode only)
void open_file_init()
initialize some of_* fields
bool natural_destruction
whether to execute commands between slices on object destruction
std::string hook
command line to execute between slices
virtual infinint get_position() const override
get the current read/write position
class mem_ui definition. This class is to be used as parent class to handle user_interaction object m...
libdar namespace encapsulate all libdar symbols