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();