28 #ifndef COMPRESSOR_HPP
29 #define COMPRESSOR_HPP
31 #include "../my_config.h"
58 extern std::string compression2string(
compression c);
59 extern compression string2compression(
const std::string & a);
80 compression get_algo()
const {
return current_algo; };
99 bool skip(
const infinint & pos) { flush_write(); flush_read(); clean_read();
return compressed->
skip(pos); };
116 xfer(U_I sz, wrapperlib_mode mode);
120 struct lzo_block_header
130 xfer *compr, *decompr;
132 char *lzo_read_buffer;
133 char *lzo_write_buffer;
137 bool lzo_write_flushed;
138 bool lzo_read_reached_eof;
139 char *lzo_compressed;
143 bool compressed_owner;
148 void local_terminate();
149 U_I (compressor::*read_ptr) (
char *a, U_I size);
150 U_I none_read(
char *a, U_I size);
151 U_I gzip_read(
char *a, U_I size);
154 U_I lzo_read(
char *a, U_I size);
156 void (compressor::*write_ptr) (
const char *a, U_I size);
157 void none_write(
const char *a, U_I size);
158 void gzip_write(
const char *a, U_I size);
161 void lzo_write(
const char *a, U_I size);
163 void lzo_compress_buffer_and_write();
164 void lzo_read_and_uncompress_to_buffer();