29 #include "../my_config.h"
71 const std::string & base_name,
72 const std::string & extension,
77 const std::string & execute =
"");
104 const std::string & base_name,
105 const std::string & extension,
108 bool x_warn_overwrite,
109 bool x_allow_overwrite,
112 const label & data_name,
113 const std::string & slice_permission,
114 const std::string & slice_user_ownership,
115 const std::string & slice_group_ownership,
118 bool format_07_compatible,
119 const std::string & execute =
"");
135 infinint get_sub_file_size()
const {
return size; };
136 infinint get_first_sub_file_size()
const {
return first_size; };
137 bool get_total_file_number(infinint &num)
const { num = of_last_file_num;
return of_last_file_known; };
138 bool get_last_file_size(infinint &num)
const { num = of_last_file_size;
return of_last_file_known; };
141 void disable_natural_destruction() { natural_destruction =
false; };
144 void enable_natural_destruction() { natural_destruction =
true; };
147 bool is_an_old_start_end_archive()
const {
return old_sar; };
150 const label & get_internal_name_used()
const {
return of_internal_name; };
153 const label & get_data_name()
const {
return of_data_name; };
173 std::string slice_user;
174 std::string slice_group;
177 bool natural_destruction;
184 bool of_last_file_known;
187 label of_internal_name;
195 bool opt_warn_overwrite;
196 bool opt_allow_overwrite;
202 bool skip_forward(U_I x);
203 bool skip_backward(U_I x);
204 void close_file(
bool terminal);
205 void open_readonly(
const char *fic,
const infinint &num);
206 void open_writeonly(
const char *fic,
const infinint &num);
207 void open_file_init();
210 void open_last_file();
211 bool is_current_eof_a_normal_end_of_slice()
const;
212 infinint bytes_still_to_read_in_slice()
const;
216 void hook_execute(
const infinint &num);
227 const std::string & base_name,
228 const std::string & extension,
230 const label & data_name,
231 const std::string & execute,
234 const std::string & slice_permission,
235 const std::string & slice_user_ownership,
236 const std::string & slice_group_ownership,
239 bool format_07_compatible);
244 const std::string & pipename,
251 const label & data_name,
252 bool format_07_compatible,
253 const std::string & execute);
269 bool is_an_old_start_end_archive()
const {
return old_sar; };
270 const label & get_data_name()
const {
return of_data_name; };
293 const label & data_name,
294 const std::string & execute);
300 extern std::string
sar_make_filename(
const std::string & base_name,
const infinint & num,
const infinint & min_digits,
const std::string & ext);
sar(const sar &ref)
the destructor
void inherited_terminate()
destructor-like call, except that it is allowed to throw exceptions
sar(user_interaction &dialog, const std::string &base_name, const std::string &extension, const path &dir, 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
void inherited_sync_write()
write down any pending data
are defined here basic integer types that tend to be portable
infinint get_position()
get the current read/write position
bool skip_to_eof()
skip to the end of file
bool skip_to_eof()
skip to the end of file
class generic_file is defined here as well as class fichierthe generic_file interface is widely used ...
virtual bool skip(const infinint &pos)=0
skip at the absolute position
void inherited_sync_write()
write down any pending data
This is a pure virtual class that is used by libdar when interaction with the user is required...
void inherited_write(const char *a, U_I size)
implementation of the write() operation
Sar class stands for Segmentation And Reassembly class.
U_I inherited_read(char *a, U_I size)
implementation of read() operation
trivial_sar(const trivial_sar &ref)
copy constructor (disabled)
bool skip_relative(S_I x)
skip relatively to the current position
bool is_terminated() const
"trivial sar" emulates the behavior of sar when all data must be keept in a arbitrary length single s...
infinint get_position()
get the current read/write position
here is the definition of the path classthe path class handle path and provide several operation on t...
exception used when a requested feature is not (yet) implemented
void inherited_terminate()
destructor-like call, except that it is allowed to throw exceptions
switch module to limitint (32 ou 64 bits integers) or infinint
class hash_fichier definition.This is an inherited class from class fichier Objects of that class are...
U_I inherited_read(char *a, U_I size)
implementation of read() operation
std::string sar_make_filename(const std::string &base_name, const infinint &num, const infinint &min_digits, const std::string &ext)
return the name of a slice given the base_name, slice number and extension
this is the interface class from which all other data transfer classes inherit
class mem_ui to keep a copy of a user_interaction object
void write(const char *a, U_I size)
write data to the generic_file
bool skip(const infinint &pos)
skip at the absolute position
void inherited_write(const char *a, U_I size)
implementation of the write() operation
the arbitrary large positive integer class
bool skip_relative(S_I x)
skip relatively to the current position
trivial_sar(user_interaction &dialog, const std::string &base_name, const std::string &extension, const path &dir, const label &data_name, const std::string &execute, bool allow_over, bool warn_over, const std::string &slice_permission, const std::string &slice_user_ownership, const std::string &slice_group_ownership, hash_algo x_hash, const infinint &min_digits, bool format_07_compatible)
constructor to build a new single sliced archive
bool skip(const infinint &pos)
skip at the absolute position
virtual bool skip_to_eof()=0
skip to the end of file
libdar namespace encapsulate all libdar symbols
the class path is here to manipulate paths in the Unix notation: using'/'