27 #ifndef GENERIC_RSYNC_HPP
28 #define GENERIC_RSYNC_HPP
30 #include "../my_config.h"
62 U_I signature_block_size,
81 const crc **checksum);
103 virtual
bool skippable(skippability direction, const
infinint & amount)
override {
return false; };
104 virtual bool skip(
const infinint & pos)
override {
if(pos != 0 || !initial)
throw SRC_BUG;
else return true; };
106 virtual bool skip_relative(S_I x)
override {
if(x != 0)
throw SRC_BUG;
else return true; };
120 enum { sign, delta, patch } status;
126 char *working_buffer;
128 bool patching_completed;
131 #if LIBRSYNC_AVAILABLE
133 rs_signature_t *sumset;
136 static rs_result patch_callback(
void *opaque,
pure virtual class defining interface of a CRC object
this is the interface class from which all other data transfer classes inherit
virtual infinint get_position() const =0
get the current read/write position
generic_file interface to librsync
virtual void inherited_flush_read() override
reset internal engine, flush caches in order to read the data at current position
virtual void inherited_truncate(const infinint &pos) override
truncate file at the give offset
virtual void inherited_terminate() override
destructor-like call, except that it is allowed to throw exceptions
virtual bool skippable(skippability direction, const infinint &amount) override
whether the implementation is able to skip
virtual infinint get_position() const override
get the current read/write position
generic_rsync(generic_file *signature_storage, U_I signature_block_size, generic_file *below)
constructor for "signature" operation
virtual bool skip(const infinint &pos) override
skip at the absolute position
virtual void inherited_sync_write() override
write down any pending data
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...
generic_rsync(generic_file *current_data, generic_file *delta)
constructor for "patch" operation
generic_rsync(generic_file *base_signature, generic_file *below, const infinint &crc_size, const crc **checksum)
constructor for "delta" operation
bool step_forward(const char *buffer_in, U_I &avail_in, bool shift_input, char *buffer_out, U_I &avail_out)
feed librsync using rs_job_iter
virtual U_I inherited_read(char *a, U_I size) override
implementation of read() operation
virtual bool skip_to_eof() override
skip to the end of file
virtual void inherited_write(const char *a, U_I size) override
implementation of the write() operation
virtual bool skip_relative(S_I x) override
skip relatively to the current position
generic_file * x_below
underlying layer to read from / write to
virtual bool truncatable(const infinint &pos) const override
whether the implementation is able to truncate to the given position
the arbitrary large positive integer class
contains all the excetion class thrown by libdar
class generic_file is defined here as well as class fichier
libdar namespace encapsulate all libdar symbols