26 #ifndef COMPRESSOR_HPP
27 #define COMPRESSOR_HPP
29 #include "../my_config.h"
56 extern std::string compression2string(
compression c);
57 extern compression string2compression(
const std::string & a);
78 compression get_algo()
const {
return current_algo; };
97 bool skip(
const infinint & pos) { flush_write(); flush_read(); clean_read();
return compressed->
skip(pos); };
114 xfer(U_I sz, wrapperlib_mode mode);
118 struct lzo_block_header
128 xfer *compr, *decompr;
130 char *lzo_read_buffer;
131 char *lzo_write_buffer;
135 bool lzo_write_flushed;
136 bool lzo_read_reached_eof;
137 char *lzo_compressed;
141 bool compressed_owner;
146 void local_terminate();
147 U_I (compressor::*read_ptr) (
char *a, U_I size);
148 U_I none_read(
char *a, U_I size);
149 U_I gzip_read(
char *a, U_I size);
152 U_I lzo_read(
char *a, U_I size);
154 void (compressor::*write_ptr) (
const char *a, U_I size);
155 void none_write(
const char *a, U_I size);
156 void gzip_write(
const char *a, U_I size);
159 void lzo_write(
const char *a, U_I size);
161 void lzo_compress_buffer_and_write();
162 void lzo_read_and_uncompress_to_buffer();
are defined here basic integer types that tend to be portable
void change_algo(compression new_algo)
changes the compression algorithm keeping the same compression level
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_terminate()
destructor-like call, except that it is allowed to throw exceptions
virtual bool skip_relative(S_I x)=0
skip relatively to the current position
bool skip_to_eof()
skip to the end of file
bool skip_relative(S_I x)
skip relatively to the current position
void inherited_sync_write()
write down any pending data
generic_file(gf_mode m)
main constructor
infinint get_position()
get the current read/write position
libz and libbz2 wrapper to have identical interface to these libraries.libz and libbz2 library differ...
this class encapsulates calls to libz or libbz2
switch module to limitint (32 ou 64 bits integers) or infinint
compression class for gzip and bzip2 algorithms
compression
the different compression algorithm available
this is the interface class from which all other data transfer classes inherit
compression char2compression(char a)
void inherited_write(const char *a, U_I size)
implementation of the write() operation
the arbitrary large positive integer class
bool skip(const infinint &pos)
skip at the absolute position
void change_algo(compression new_algo, U_I new_compression_level)
changes compression algorithm used by the compressor
virtual bool skip_to_eof()=0
skip to the end of file
virtual infinint get_position()=0
get the current read/write position
U_I inherited_read(char *a, U_I size)
implementation of read() operation