|
Tkrzw
|
Complessor implemeted with ZLib. More...
#include <tkrzw_compress.h>
Public Types | |
| enum | MetadataMode : int32_t { METADATA_NONE = 0 , METADATA_ADLER32 = 1 , METADATA_CRC32 = 2 } |
| Enumeration for metadata modes. More... | |
Public Member Functions | |
| ZLibCompressor (int32_t level=6, MetadataMode metadata_mode=METADATA_NONE) | |
| Constructor. | |
| virtual | ~ZLibCompressor () |
| Destructor. | |
| bool | IsSupported () const override |
| Checks whether the implementation is actually supported. | |
| char * | Compress (const void *buf, size_t size, size_t *sp) override |
| Compresses a serial data. | |
| char * | Decompress (const void *buf, size_t size, size_t *sp) override |
| Decompresses a serial data. | |
| std::unique_ptr< Compressor > | MakeCompressor () const override |
| Makes a new Compressor object of the same concrete class. | |
Public Member Functions inherited from tkrzw::Compressor | |
| virtual | ~Compressor ()=default |
| Destructor. | |
| virtual bool | IsSupported () const =0 |
| Checks whether the implementation is actually supported. | |
| virtual char * | Compress (const void *buf, size_t size, size_t *sp)=0 |
| Compresses a serial data. | |
| virtual char * | Decompress (const void *buf, size_t size, size_t *sp)=0 |
| Decompresses a serial data. | |
| virtual std::unique_ptr< Compressor > | MakeCompressor () const =0 |
| Makes a new Compressor object of the same concrete class. | |
| const std::type_info & | GetType () const |
| Gets the type information of the actual class. | |
Complessor implemeted with ZLib.
| enum tkrzw::ZLibCompressor::MetadataMode : int32_t |
|
explicit |
Constructor.
| level | The compression level between 0 and 9. Higher means slower but better compression. 0 means no compression. |
| metadata_mode | The mode for the metadata added to the result. |
|
virtual |
Destructor.
|
overridevirtual |
Checks whether the implementation is actually supported.
Implements tkrzw::Compressor.
|
overridevirtual |
Compresses a serial data.
| buf | the input buffer. |
| size | the size of the input buffer. |
| sp | the pointer to the variable into which the size of the region of the return value is assigned. |
Because the region of the return value is allocated with the xmalloc function, it should be released with the xfree function.
Implements tkrzw::Compressor.
|
overridevirtual |
Decompresses a serial data.
| buf | the input buffer. |
| size | the size of the input buffer. |
| sp | the pointer to the variable into which the size of the region of the return value is assigned. |
Because the region of the return value is allocated with the xmalloc function, it should be released with the xfree function.
Implements tkrzw::Compressor.
|
overridevirtual |
Makes a new Compressor object of the same concrete class.
Implements tkrzw::Compressor.