| D++ (DPP) C++ Discord API Bot Library

Search
Loading...
Searching...
No Matches
dpp::zlibcontext Class Reference

This is an opaque class containing zlib library specific structures. This wraps the C pointers needed for zlib with unique_ptr and gives us a nice buffer abstraction so we don't need to wrestle with raw pointers. More...

`#include <zlibcontext.h>`

Collaboration diagram for dpp::zlibcontext:
[legend]

## Public Member Functions

| zlibcontext ()
| Initialise zlib struct via inflateInit() and size the buffer.
| ~zlibcontext ()
| Destroy zlib struct via inflateEnd().
exception_error_code | decompress (const std::string &buffer, std::string &decompressed)
| Decompress zlib deflated buffer.

## Public Attributes

z_stream * | d_stream {}
| Zlib stream struct. The actual type is defined in zlib.h so is only defined in the implementation file.
std::vector< unsigned char > | decomp_buffer {}
| ZLib decompression buffer. This is automatically set to DECOMP_BUFFER_SIZE bytes when the class is constructed.
uint64_t | decompressed_total {}
| Total decompressed received bytes counter.

## Detailed Description

This is an opaque class containing zlib library specific structures. This wraps the C pointers needed for zlib with unique_ptr and gives us a nice buffer abstraction so we don't need to wrestle with raw pointers.

## Constructor & Destructor Documentation

## ◆ zlibcontext()

dpp::zlibcontext::zlibcontext | ( |  | ) |

Initialise zlib struct via inflateInit() and size the buffer.

## ◆ ~zlibcontext()

dpp::zlibcontext::~zlibcontext | ( |  | ) |

Destroy zlib struct via inflateEnd().

## Member Function Documentation

## ◆ decompress()

exception_error_code dpp::zlibcontext::decompress | ( | const std::string & | buffer,
|  | std::string & | decompressed )

Decompress zlib deflated buffer.

Parameters

  buffer | input compressed stream
  decompressed | output decompressed content

Returns
  an error code on error, or err_no_code_specified (0) on success

## Member Data Documentation

## ◆ d_stream

z_stream* dpp::zlibcontext::d_stream {}

Zlib stream struct. The actual type is defined in zlib.h so is only defined in the implementation file.

## ◆ decomp_buffer

std::vector<unsigned char> dpp::zlibcontext::decomp_buffer {}

ZLib decompression buffer. This is automatically set to DECOMP_BUFFER_SIZE bytes when the class is constructed.

## ◆ decompressed_total

uint64_t dpp::zlibcontext::decompressed_total {}

Total decompressed received bytes counter.

D++ Library version 9.0.13 D++ Library version 9.0.12 D++ Library version 9.0.11 D++ Library version 9.0.10 D++ Library version 9.0.9 D++ Library version 9.0.8 D++ Library version 9.0.7 D++ Library version 9.0.6 D++ Library version 9.0.5 D++ Library version 9.0.4 D++ Library version 9.0.3 D++ Library version 9.0.2 D++ Library version 9.0.1 D++ Library version 9.0.0 D++ Library version 1.0.2 D++ Library version 1.0.1 D++ Library version 1.0.0