Marine Library
1.0
C++ library for Linux Networking Development
|
A convenient interface for zlib compression algorithm. More...
#include <compress_zlib.hh>
Public Member Functions | |||||||
CCompressorZlib (int level=Z_DEFAULT_COMPRESSION) | |||||||
Constructor. More... | |||||||
void | setLevel (int lv) | ||||||
Set compression level. More... | |||||||
int | getLevel () const | ||||||
Get compression level. More... | |||||||
Compression | |||||||
Compress given data. If
| |||||||
bool | compress (const std::vector< char > &input, std::vector< char > &output) const | ||||||
bool | compress (const std::vector< signed char > &input, std::vector< signed char > &output) const | ||||||
bool | compress (const std::vector< unsigned char > &input, std::vector< unsigned char > &output) const | ||||||
bool | compress (const std::string &input, std::string &output) const | ||||||
Decompression | |||||||
Decompress given data. If
| |||||||
bool | decompress (const std::vector< char > &input, std::vector< char > &output) const | ||||||
bool | decompress (const std::vector< signed char > &input, std::vector< signed char > &output) const | ||||||
bool | decompress (const std::vector< unsigned char > &input, std::vector< unsigned char > &output) const | ||||||
bool | decompress (const std::string &input, std::string &output) const | ||||||
A convenient interface for zlib compression algorithm.
You may need to link to zlib library (e.g. -lz
) if you use CCompressorZlib
.
|
inline |
Constructor.
The compression level
must be Z_DEFAULT_COMPRESSION
, or between 0 and 9:
1
gives best speed, 9
gives best compression, 0
gives no compression at all (the input data is simply copied a block at a time). Z_DEFAULT_COMPRESSION
requests a default compromise between speed and compression (currently equivalent to level 6).
level | Compression level (0 to 9, or Z_DEFAULT_COMPRESSION ) |
|
inline |
Get compression level.
|
inline |
Set compression level.
lv | Compression level (0 to 9, or Z_DEFAULT_COMPRESSION ) |