 |
Disk ARchive
2.7.2
Full featured and portable backup and archiving tool
|
Go to the documentation of this file.
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);
libz and libbz2 wrapper to have identical interface to these libraries.
virtual bool truncatable(const infinint &pos) const =0
whether the implementation is able to truncate to the given position
virtual bool skip_to_eof()=0
skip to the end of file
compression
the different compression algorithm available
virtual U_I inherited_read(char *a, U_I size) override
implementation of read() operation
virtual bool skippable(skippability direction, const infinint &amount) override
whether the implementation is able to skip
virtual bool truncatable(const infinint &pos) const override
whether the implementation is able to truncate to the given position
generic_file * compressed
where to read from/write to compressed data
are defined here basic integer types that tend to be portable
compression class for gzip and bzip2 algorithms
switch module to limitint (32 ou 64 bits integers) or infinint
void flush_write()
drop all pending write and reset compression engine
the arbitrary large positive integer class
virtual bool skip(const infinint &pos)=0
skip at the absolute position
abstracted ancestor class for compressor and parallel_compressor classes
virtual void inherited_terminate() override
destructor-like call, except that it is allowed to throw exceptions
virtual infinint get_position() const override
get the current read/write position
virtual bool skip_relative(S_I x)=0
skip relatively to the current position
compressor(compression x_algo, generic_file &compressed_side, U_I compression_level=9)
virtual bool skip_relative(S_I x) override
skip relatively to the current position
compression algo
compression algorithm used
virtual bool skippable(skippability direction, const infinint &amount)=0
whether the implementation is able to skip
virtual void inherited_write(const char *a, U_I size) override
implementation of the write() operation
void read_ahead(const infinint &amount)
bool suspended
whether compression is temporary suspended
xfer * compr
datastructure for bzip2, gzip and zx compression (not use with compression::none
virtual bool skip_to_eof() override
skip to the end of file
this is the interface class from which all other data transfer classes inherit
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
virtual infinint get_position() const =0
get the current read/write position
virtual bool skip(const infinint &pos) override
skip at the absolute position
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 void inherited_truncate(const infinint &pos) override
truncate file at the give offset
virtual void inherited_flush_read() override
reset internal engine, flush caches in order to read the data at current position
this class encapsulates calls to libz or libbz2
libdar namespace encapsulate all libdar symbols