RESTinio

Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
restinio::transforms::zlib::params_t Class Reference

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. More...
| params_t ()
| Default constructor for identiry transformator. More...
operation_t | operation () const
| Get operation. More...
format_t | format () const
| Get format. More...
int | level () const
| Get compression level. More...
params_t & | level (int level_value) &
| Set compression level. More...
params_t && | level (int level_value) &&
| Set compression level. More...
int | window_bits () const
| Get window_bits. More...
params_t & | window_bits (int window_bits_value) &
| Set window_bits. More...
params_t && | window_bits (int window_bits_value) &&
| Set window_bits. More...
int | mem_level () const
| Get compression mem_level. More...
params_t & | mem_level (int mem_level_value) &
| Set compression mem_level. More...
params_t && | mem_level (int mem_level_value) &&
| Set compression mem_level. More...
int | strategy () const
| Get compression strategy. More...
params_t & | strategy (int strategy_value) &
| Set compression strategy. More...
params_t && | strategy (int strategy_value) &&
| Set compression strategy. More...
std::size_t | reserve_buffer_size () const
| Get the size initially reserved for buffer. More...
params_t & | reserve_buffer_size (std::size_t size) &
| Set the size initially reserved for buffer. More...
params_t && | reserve_buffer_size (std::size_t size) &&
| Set the size initially reserved for buffer. More...

## Private Member Functions
params_t & | reference_to_self ()
| Get the reference to self. More...

## Private Attributes
operation_t | m_operation
| Transformation type. More...
format_t | m_format
| Format to be used for compressed data. More...
int | m_level
| Compression level. More...
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. More...

## Detailed Description

Parameters of performing data transformation with zlib.

Definition at line 63 of file zlib.hpp.

## Member Enumeration Documentation

## ◆ format_t

enum class restinio::transforms::zlib::params_t::format_t
| strong

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.

Definition at line 76 of file zlib.hpp.

## ◆ operation_t

enum class restinio::transforms::zlib::params_t::operation_t
| strong

Types of transformation.

Enumerator
compress | Compress the input data.
decompress | Decompress input data.

Definition at line 67 of file zlib.hpp.

## Constructor & Destructor Documentation

## ◆ params_t() [1/2]

restinio::transforms::zlib::params_t::params_t | ( | operation_t | op,
|  | format_t | f,
|  | int | l = `-1`
| ) |  |
| inline

Init constructor.

It's better to use special functions to cunstruct initial params_t, see: deflate_compress(), deflate_decompress(), gzip_compress(), gzip_decompress(),

Parameters

  op | Operation: compress or decompress.
  f | Foramt: deflate or gzip.
  l | Compression level.

Definition at line 96 of file zlib.hpp.

## ◆ params_t() [2/2]

restinio::transforms::zlib::params_t::params_t | ( |  | ) |
| inline

Default constructor for identiry transformator.

Definition at line 110 of file zlib.hpp.

## Member Function Documentation

## ◆ format()

format_t restinio::transforms::zlib::params_t::format | ( |  | ) | const
| inline

Get format.

Definition at line 121 of file zlib.hpp.

## ◆ level() [1/3]

int restinio::transforms::zlib::params_t::level | ( |  | ) | const
| inline

Get compression level.

Note
  Makes sense only for compression operation.

Definition at line 127 of file zlib.hpp.

## ◆ level() [2/3]

params_t & restinio::transforms::zlib::params_t::level | ( | int | level_value | ) | &
| inline

Set compression level.

Must be an integer value in the range of -1 to 9.

Note
  Makes sense only for compression operation.

Definition at line 136 of file zlib.hpp.

## ◆ level() [3/3]

params_t && restinio::transforms::zlib::params_t::level | ( | int | level_value | ) | &&
| inline

Set compression level.

Definition at line 154 of file zlib.hpp.

## ◆ mem_level() [1/3]

int restinio::transforms::zlib::params_t::mem_level | ( |  | ) | const
| inline

Get compression mem_level.

Note
  Makes sense only for compression operation.

Definition at line 219 of file zlib.hpp.

## ◆ mem_level() [2/3]

params_t & restinio::transforms::zlib::params_t::mem_level | ( | int | mem_level_value | ) | &
| 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.

Note
  Makes sense only for compression operation.

Definition at line 232 of file zlib.hpp.

## ◆ mem_level() [3/3]

params_t && restinio::transforms::zlib::params_t::mem_level | ( | int | mem_level_value | ) | &&
| inline

Set compression mem_level.

Definition at line 251 of file zlib.hpp.

## ◆ operation()

operation_t restinio::transforms::zlib::params_t::operation | ( |  | ) | const
| inline

Get operation.

Definition at line 118 of file zlib.hpp.

## ◆ reference_to_self()

params_t & restinio::transforms::zlib::params_t::reference_to_self | ( |  | ) |
| inline private

Get the reference to self.

Definition at line 338 of file zlib.hpp.

## ◆ reserve_buffer_size() [1/3]

std::size_t restinio::transforms::zlib::params_t::reserve_buffer_size | ( |  | ) | const
| 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.

Definition at line 313 of file zlib.hpp.

## ◆ reserve_buffer_size() [2/3]

params_t & restinio::transforms::zlib::params_t::reserve_buffer_size | ( | std::size_t | size | ) | &
| inline

Set the size initially reserved for buffer.

Definition at line 317 of file zlib.hpp.

## ◆ reserve_buffer_size() [3/3]

params_t && restinio::transforms::zlib::params_t::reserve_buffer_size | ( | std::size_t | size | ) | &&
| inline

Set the size initially reserved for buffer.

Definition at line 331 of file zlib.hpp.

## ◆ strategy() [1/3]

int restinio::transforms::zlib::params_t::strategy | ( |  | ) | const
| inline

Get compression strategy.

Note
  Makes sense only for compression operation.

Definition at line 260 of file zlib.hpp.

## ◆ strategy() [2/3]

params_t & restinio::transforms::zlib::params_t::strategy | ( | int | strategy_value | ) | &
| inline

Set compression strategy.

Must be an integer value defined by one of zlib constants: Z_FILTERED, Z_HUFFMAN_ONLY, Z_RLE, Z_DEFAULT_STRATEGY.

Note
  Makes sense only for compression operation.

Definition at line 271 of file zlib.hpp.

## ◆ strategy() [3/3]

params_t && restinio::transforms::zlib::params_t::strategy | ( | int | strategy_value | ) | &&
| inline

Set compression strategy.

Definition at line 300 of file zlib.hpp.

## ◆ window_bits() [1/3]

int restinio::transforms::zlib::params_t::window_bits | ( |  | ) | const
| inline

Get window_bits.

Definition at line 160 of file zlib.hpp.

## ◆ window_bits() [2/3]

params_t & restinio::transforms::zlib::params_t::window_bits | ( | int | window_bits_value | ) | &
| inline

Set window_bits.

Must be an integer value in the range of 8 to MAX_WBITS.

Note
  For descompress operation it is better to use default value of windows beats. See https://zlib.net/manual.html inflateInit2() description for details.

Definition at line 171 of file zlib.hpp.

## ◆ window_bits() [3/3]

params_t && restinio::transforms::zlib::params_t::window_bits | ( | int | window_bits_value | ) | &&
| inline

Set window_bits.

Definition at line 210 of file zlib.hpp.

## Member Data Documentation

## ◆ m_format

format_t restinio::transforms::zlib::params_t::m_format
| private

Format to be used for compressed data.

Definition at line 344 of file zlib.hpp.

## ◆ m_level

int restinio::transforms::zlib::params_t::m_level
| private

Compression level.

An integer value in the range of -1 to 9.

Definition at line 350 of file zlib.hpp.

## ◆ m_mem_level

int restinio::transforms::zlib::params_t::m_mem_level { default_mem_level }
| private

Definition at line 353 of file zlib.hpp.

## ◆ m_operation

operation_t restinio::transforms::zlib::params_t::m_operation
| private

Transformation type.

Definition at line 341 of file zlib.hpp.

## ◆ m_reserve_buffer_size

std::size_t restinio::transforms::zlib::params_t::m_reserve_buffer_size { default_output_reserve_buffer_size }
| private

Size initially reserved for buffer.

Definition at line 357 of file zlib.hpp.

## ◆ m_strategy

int restinio::transforms::zlib::params_t::m_strategy { default_strategy }
| private

Definition at line 354 of file zlib.hpp.

## ◆ m_window_bits

int restinio::transforms::zlib::params_t::m_window_bits { default_window_bits }
| private

Definition at line 352 of file zlib.hpp.

The documentation for this class was generated from the following file:

- restinio/transforms/zlib.hpp