32#ifndef RCSC_GZ_GZFILTERSTREAM_H
33#define RCSC_GZ_GZFILTERSTREAM_H
35#include <boost/scoped_ptr.hpp>
47 :
public std::streambuf {
59 DEFAULT_COMPRESSION = 6,
78 std::streambuf & M_strmbuf;
80 std::ostream * M_output_stream;
82 std::istream * M_input_stream;
84 std::streamsize M_buf_size;
86 char_type * M_read_buf;
88 char_type * M_input_buf;
90 char_type * M_output_buf;
92 char_type * M_write_buf;
98 std::unique_ptr< Impl > M_impl;
123 int level = DEFAULT_COMPRESSION,
124 std::size_t buf_size = 8192 );
194 :
public std::iostream {
213 int level = gzfilterstreambuf::DEFAULT_COMPRESSION,
214 std::size_t buf_size = 8192 );
224 int level = gzfilterstreambuf::DEFAULT_COMPRESSION,
225 std::size_t buf_size = 8192 );
236 return M_filter_buf.
setLevel( level );
248 :
public std::istream {
267 int level = gzfilterstreambuf::DEFAULT_COMPRESSION,
268 std::size_t buf_size = 8192 );
278 int level = gzfilterstreambuf::DEFAULT_COMPRESSION,
279 std::size_t buf_size = 8192 );
290 return M_filter_buf.
setLevel( level );
302 :
public std::ostream {
321 int level = gzfilterstreambuf::DEFAULT_COMPRESSION,
322 std::size_t buf_size = 8192 );
332 int level = gzfilterstreambuf::DEFAULT_COMPRESSION,
333 std::size_t buf_size = 8192 );
344 return M_filter_buf.
setLevel( level );
gzip filtering stream class.
Definition: gzfilterstream.h:194
gzfilterstream(std::iostream &strm, int level=gzfilterstreambuf::DEFAULT_COMPRESSION, std::size_t buf_size=8192)
constructor with another stream
bool setLevel(const int level)
change complession level
Definition: gzfilterstream.h:234
gzfilterstream(std::streambuf &strmbuf, int level=gzfilterstreambuf::DEFAULT_COMPRESSION, std::size_t buf_size=8192)
constructor with another stream buffer
gzip filtering stream buffer class.
Definition: gzfilterstream.h:47
bool writeData(int flush_type=NO_FLUSH)
write data to buffer and/or destination
virtual int_type overflow(int_type c)
flush current internal buffer.
virtual int sync()
syncronize data to output devide
FlushType
flush type enumeration.
Definition: gzfilterstream.h:68
CompressionLevel
typical compression level enumeration
Definition: gzfilterstream.h:58
~gzfilterstreambuf()
destructor
gzfilterstreambuf(std::streambuf &strm, int level=DEFAULT_COMPRESSION, std::size_t buf_size=8192)
constructor with another stream buffer
bool setLevel(const int level)
change complession level
int readData(char *dest, int &dest_size)
read data from destination.
virtual int_type underflow()
read data from input device
gzip filtering input stream class.
Definition: gzfilterstream.h:248
gzifilterstream(std::istream &src, int level=gzfilterstreambuf::DEFAULT_COMPRESSION, std::size_t buf_size=8192)
constructor with another stream
bool setLevel(const int level)
change complession level
Definition: gzfilterstream.h:288
gzifilterstream(std::streambuf &src, int level=gzfilterstreambuf::DEFAULT_COMPRESSION, std::size_t buf_size=8192)
constructor with another stream buffer
gzip filtering output stream class.
Definition: gzfilterstream.h:302
gzofilterstream(std::ostream &dest, int level=gzfilterstreambuf::DEFAULT_COMPRESSION, std::size_t buf_size=8192)
constructor with another stream
bool setLevel(const int level)
change complession level
Definition: gzfilterstream.h:342
gzofilterstream(std::streambuf &dest, int level=gzfilterstreambuf::DEFAULT_COMPRESSION, std::size_t buf_size=8192)
constructor with another stream buffer