#include <gzfilterstream.h>
Public 型 | |
enum | CompressionLevel { DEFAULT_COMPRESSION = 6, NO_COMPRESSION = 0, BEST_SPEED = 1, BEST_COMPRESSION = 9, DEFAULT_COMPRESSION = -1, NO_COMPRESSION = 0, BEST_SPEED = 1, BEST_COMPRESSION = 9 } |
typical compression level enumeration [詳細] | |
enum | FlushType { NO_FLUSH = 0, PARTIAL_FLUSH = 1, SYNC_FLUSH = 2, FULL_FLUSH = 3, FINISH = 4 } |
flush type enumeration. | |
Public メソッド | |
gzfilterstreambuf (std::streambuf &strm, int level=DEFAULT_COMPRESSION, std::size_t buf_size=8192) | |
constructor with another stream buffer | |
~gzfilterstreambuf () | |
destructor | |
bool | setLevel (const int level) |
change complession level | |
Protected メソッド | |
bool | writeData (int flush_type=NO_FLUSH) |
write data to buffer and/or destination | |
int | readData (char *dest, int &dest_size) |
read data from destination. | |
virtual int_type | overflow (int_type c) |
flush current internal buffer. | |
virtual int | sync () |
syncronize data to output devide | |
virtual int_type | underflow () |
read data from input device |
typical compression level enumeration
The list of compresion level defined in zlib.h
rcsc::gzfilterstreambuf::gzfilterstreambuf | ( | std::streambuf & | strm, | |
int | level = DEFAULT_COMPRESSION , |
|||
std::size_t | buf_size = 8192 | |||
) | [explicit] |
constructor with another stream buffer
strm | filtered stream buffer. | |
level | gzip compression level | |
buf_size | allocated buffer size (default: 8192) |
rcsc::gzfilterstreambuf::~gzfilterstreambuf | ( | ) |
destructor
Destructor flushes buffered data and releases all allocated buffers.
bool rcsc::gzfilterstreambuf::setLevel | ( | const int | level | ) |
change complession level
level | new compression level(0-9) |
bool rcsc::gzfilterstreambuf::writeData | ( | int | flush_type = NO_FLUSH |
) | [protected] |
write data to buffer and/or destination
flush_type | zlib flush type parameter. see deflate in zlib.h. |
int rcsc::gzfilterstreambuf::readData | ( | char * | dest, | |
int & | dest_size | |||
) | [protected] |
read data from destination.
dest | buffer to record the data. | |
dest_size | reference to the buffer size variable |
gzfilterstreambuf::int_type rcsc::gzfilterstreambuf::overflow | ( | int_type | c | ) | [protected, virtual] |
flush current internal buffer.
this method is overrided method and called from close(), sync() and overflow().
int rcsc::gzfilterstreambuf::sync | ( | ) | [protected, virtual] |
syncronize data to output devide
this method is overrided method
gzfilterstreambuf::int_type rcsc::gzfilterstreambuf::underflow | ( | ) | [protected, virtual] |
read data from input device
this method is overrided method and supposed to read some bytes from the input device to internal buffer.