26 #ifndef COMPRESSOR_HPP
27 #define COMPRESSOR_HPP
29 #include "../my_config.h"
49 U_I compression_level = 9
64 virtual void suspend_compression()
override;
65 virtual void resume_compression()
override;
66 virtual bool is_compression_suspended()
const override {
return suspended; };
94 xfer(U_I sz, wrapperlib_mode mode);
compression class for gzip and bzip2 algorithms
compression algo
compression algorithm used
void flush_write()
drop all pending write and reset compression engine
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_file * compressed
where to read from/write to compressed data
bool suspended
whether compression is temporary suspended
virtual void inherited_sync_write() override
write down any pending data
bool read_mode
read-only mode or write-only mode, read-write is write-only mode
compressor(const compressor &ref)=delete
virtual void inherited_truncate(const infinint &pos) override
truncate file at the give offset
virtual infinint get_position() const override
get the current read/write position
virtual bool skippable(skippability direction, const infinint &amount) override
whether the implementation is able to skip
virtual void inherited_write(const char *a, U_I size) override
implementation of the write() operation
virtual bool skip_to_eof() override
skip to the end of file
virtual void inherited_terminate() override
destructor-like call, except that it is allowed to throw exceptions
virtual bool skip(const infinint &pos) override
skip at the absolute position
compressor(compression x_algo, generic_file &compressed_side, U_I compression_level=9)
virtual bool truncatable(const infinint &pos) const override
whether the implementation is able to truncate to the given position
virtual void inherited_flush_read() override
reset internal engine, flush caches in order to read the data at current position
virtual U_I inherited_read(char *a, U_I size) override
implementation of read() operation
virtual bool skip_relative(S_I x) override
skip relatively to the current position
xfer * compr
datastructure for bzip2, gzip and zx compression (not use with compression::none
this is the interface class from which all other data transfer classes inherit
virtual bool truncatable(const infinint &pos) const =0
whether the implementation is able to truncate to the given position
virtual bool skip(const infinint &pos)=0
skip at the absolute position
virtual bool skippable(skippability direction, const infinint &amount)=0
whether the implementation is able to skip
void read_ahead(const infinint &amount)
virtual infinint get_position() const =0
get the current read/write position
virtual bool skip_relative(S_I x)=0
skip relatively to the current position
virtual bool skip_to_eof()=0
skip to the end of file
the arbitrary large positive integer class
this class encapsulates calls to libz or libbz2
compression
the different compression algorithm available
switch module to limitint (32 ou 64 bits integers) or infinint
are defined here basic integer types that tend to be portable
libdar namespace encapsulate all libdar symbols
abstracted ancestor class for compressor and parallel_compressor classes
libz and libbz2 wrapper to have identical interface to these libraries.