|
RESTinio
|
Parameters of performing data transformation with zlib. More...
#include <zlib.hpp>
Public Types | |
| enum class | operation_t { compress , decompress } |
| Types of transformation. More... | |
| enum class | format_t { deflate , gzip , identity } |
| Formats of compressed data. More... | |
Public Member Functions | |
| params_t (operation_t op, format_t f, int l=-1) | |
| Init constructor. | |
| params_t () | |
| Default constructor for identiry transformator. | |
| operation_t | operation () const |
| Get operation. | |
| format_t | format () const |
| Get format. | |
| int | level () const |
| Get compression level. | |
| params_t & | level (int level_value) & |
| Set compression level. | |
| params_t && | level (int level_value) && |
| Set compression level. | |
| int | window_bits () const |
| Get window_bits. | |
| params_t & | window_bits (int window_bits_value) & |
| Set window_bits. | |
| params_t && | window_bits (int window_bits_value) && |
| Set window_bits. | |
| int | mem_level () const |
| Get compression mem_level. | |
| params_t & | mem_level (int mem_level_value) & |
| Set compression mem_level. | |
| params_t && | mem_level (int mem_level_value) && |
| Set compression mem_level. | |
| int | strategy () const |
| Get compression strategy. | |
| params_t & | strategy (int strategy_value) & |
| Set compression strategy. | |
| params_t && | strategy (int strategy_value) && |
| Set compression strategy. | |
| std::size_t | reserve_buffer_size () const |
| Get the size initially reserved for buffer. | |
| params_t & | reserve_buffer_size (std::size_t size) & |
| Set the size initially reserved for buffer. | |
| params_t && | reserve_buffer_size (std::size_t size) && |
| Set the size initially reserved for buffer. | |
Private Member Functions | |
| params_t & | reference_to_self () |
| Get the reference to self. | |
Private Attributes | |
| operation_t | m_operation |
| Transformation type. | |
| format_t | m_format |
| Format to be used for compressed data. | |
| int | m_level |
| Compression level. | |
| int | m_window_bits { default_window_bits } |
| int | m_mem_level { default_mem_level } |
| int | m_strategy { default_strategy } |
| std::size_t | m_reserve_buffer_size { default_output_reserve_buffer_size } |
| Size initially reserved for buffer. | |
Formats of compressed data.
| Enumerator | |
|---|---|
| deflate | zlib format. |
| gzip | gzip format |
| identity | Identity. With semantics descrobed here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding. |
|
inline |
Init constructor.
It's better to use special functions to cunstruct initial params_t, see: deflate_compress(), deflate_decompress(), gzip_compress(), gzip_decompress(),
| op | Operation: compress or decompress. |
| f | Foramt: deflate or gzip. |
| l | Compression level. |
|
inline |
|
inline |
|
inline |
|
inline |
Set compression mem_level.
Must be an integer value in the range of 1 to 9. 1 stands for minimum memory usage and 9 stands for maximum memory usage. The amount of memory that can be used affects the quality of compression.
|
inline |
|
inlineprivate |
|
inline |
Get the size initially reserved for buffer.
When using zlib transformator the outout buffer is used. The initial size of such buffer must be defined. zlib_t instance will use this parameter as the initial size of out buffer and as an increment size if out buffer must be enlarged.
|
inline |
|
inline |
|
inline |
|
inline |
Set window_bits.
Must be an integer value in the range of 8 to MAX_WBITS.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |