 |
Disk ARchive
2.6.8
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"
64 void suspend_compression();
65 void resume_compression();
66 bool is_compression_suspended()
const {
return suspended; };
71 virtual bool skip(
const infinint & pos)
override { compr_flush_write(); compr_flush_read(); clean_read();
return compressed->
skip(pos); };
72 virtual bool skip_to_eof()
override { compr_flush_write(); compr_flush_read(); clean_read();
return compressed->
skip_to_eof(); };
73 virtual bool skip_relative(S_I x)
override { compr_flush_write(); compr_flush_read(); clean_read();
return compressed->
skip_relative(x); };
78 virtual U_I
inherited_read(
char *a, U_I size)
override {
return (this->*read_ptr)(a, size); };
79 virtual void inherited_write(
const char *a, U_I size)
override { (this->*write_ptr)(a, size); };
91 xfer(U_I sz, wrapperlib_mode mode);
95 struct lzo_block_header
118 bool compressed_owner;
125 void local_terminate();
126 U_I (
compressor::*read_ptr) (
char *a, U_I size);
127 U_I none_read(
char *a, U_I size);
128 U_I gzip_read(
char *a, U_I size);
131 U_I lzo_read(
char *a, U_I size);
133 void (
compressor::*write_ptr) (
const char *a, U_I size);
134 void none_write(
const char *a, U_I size);
135 void gzip_write(
const char *a, U_I size);
138 void lzo_write(
const char *a, U_I size);
140 void lzo_compress_buffer_and_write();
141 void lzo_read_and_uncompress_to_buffer();
158 void compr_flush_write();
160 void compr_flush_read();
generic_file(gf_mode m)
main constructor
libz and libbz2 wrapper to have identical interface to these libraries.
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
compression parameters for API
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
the arbitrary large positive integer class
char * lzo_wrkmem
work memory for LZO library
virtual bool skip(const infinint &pos)=0
skip at the absolute position
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
lzo degraded algo corresponding to lzop -1
virtual bool skip_relative(S_I x) override
skip relatively to the current position
class generic_file is defined here as well as class fichier
virtual bool skippable(skippability direction, const infinint &amount)=0
whether the implementation is able to skip
U_I lzo_write_size
number of available bytes to compress and next place where to add more data in the wite buffer
virtual void inherited_write(const char *a, U_I size) override
implementation of the write() operation
xfer * decompr
datastructure for bzip2 an gzip compression
void read_ahead(const infinint &amount)
char * lzo_write_buffer
stores the clear data to be compressed and written to the compressed generic_file
virtual bool skip_to_eof() override
skip to the end of file
void change_algo(compression new_algo)
changes the compression algorithm keeping the same compression level
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 lzo_read_reached_eof
whether reading reached end of file and the lzo engine has to be reset to uncompress further data
U_I lzo_read_size
number of available bytes in the read buffer for lzo decompression
void change_algo(compression new_algo, U_I new_compression_level)
changes compression algorithm used by the compressor
U_I lzo_read_start
location of the next byte to read out from the read buffer
virtual infinint get_position() const =0
get the current read/write position
virtual bool skip(const infinint &pos) override
skip at the absolute position
bool lzo_write_flushed
whether write flushing has been done
lzo degraded algo corresponding to lzo -2 to lzo -6
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...
char * lzo_compressed
compressed data just read or about to be written
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
char * lzo_read_buffer
stores clear data (uncompressed) read from the compressed generic_file
libdar namespace encapsulate all libdar symbols