Botan 2.19.5 Crypto and TLS for C&

Public Member Functions | Static Public Member Functions | List of all members
Botan::Deflate_Decompression Class Referencefinal

`#include <zlib.h>`

Inheritance diagram for Botan::Deflate_Decompression:

## Public Member Functions
void | clear () final override
void | finish (secure_vector< uint8_t > &buf, size_t offset) final override
std::string | name () const override
void | update (secure_vector< uint8_t > &buf, size_t offset) final override

## Static Public Member Functions
static std::unique_ptr< Decompression_Algorithm > | create (const std::string &algo_spec)
static std::unique_ptr< Decompression_Algorithm > | create_or_throw (const std::string &algo_spec)

## Detailed Description

Deflate Decompression

Definition at line 52 of file zlib.h.

## Member Function Documentation

## ◆ clear()

void Botan::Stream_Decompression::clear | ( |  | ) |
| final override virtual inherited

Reset the state and abort the current message; start can be called again to process a new message.

Implements Botan::Decompression_Algorithm.

Definition at line 125 of file compress_utils.cpp.

126 {
127 m_stream.reset();
128 }

## ◆ create()

std::unique_ptr< Decompression_Algorithm > Botan::Decompression_Algorithm::create | ( | const std::string & | algo_spec | ) |
| static inherited

Create an instance based on a name, or return null if the algo combination cannot be found.

Definition at line 98 of file compression.cpp.

99 {
100 std::unique_ptr<Decompression_Algorithm> decompressor(make_decompressor(algo));
101 return decompressor;
102 }
Botan::make_decompressor
Decompression_Algorithm * make_decompressor(const std::string &name)
Definition: compression.cpp:71

References Botan::make_decompressor().

Referenced by Botan::Decompression_Algorithm::create_or_throw().

## ◆ create_or_throw()

std::unique_ptr< Decompression_Algorithm > Botan::Decompression_Algorithm::create_or_throw | ( | const std::string & | algo_spec | ) |
| static inherited

Create an instance based on a name

Parameters

  algo_spec | algorithm name Throws Lookup_Error if not found.

Definition at line 106 of file compression.cpp.

107 {
108 if(auto decompressor = Decompression_Algorithm::create(algo))
109 {
110 return decompressor;
111 }
112 throw Lookup_Error("Decompression", algo, "");
113 }
Botan::Decompression_Algorithm::create
static std::unique_ptr< Decompression_Algorithm > create(const std::string &algo_spec)
Definition: compression.cpp:98

References Botan::Decompression_Algorithm::create().

## ◆ finish()

void Botan::Stream_Decompression::finish | ( | secure_vector< uint8_t > & | final_block,
|  | size_t | offset
| ) |  |
| final override virtual inherited

Finish decompressing

Parameters

  final_block | in/out parameter
  offset | an offset into final_block to begin processing

Implements Botan::Decompression_Algorithm.

Definition at line 187 of file compress_utils.cpp.

188 {
189 if(buf.size() != offset || m_stream.get())
190 process(buf, offset, m_stream->finish_flag());
191
192 if(m_stream.get())
193 throw Invalid_State(name() + " finished but not at stream end");
194 }
Botan::Decompression_Algorithm::name
virtual std::string name() const =0

References Botan::Decompression_Algorithm::name().

## ◆ name()

std::string Botan::Deflate_Decompression::name | ( |  | ) | const
| inline override virtual

Returns
  name of the decompression algorithm

Implements Botan::Decompression_Algorithm.

Definition at line 55 of file zlib.h.

55{ return "Deflate_Decompression"; }

## ◆ update()

void Botan::Stream_Decompression::update | ( | secure_vector< uint8_t > & | buf,
|  | size_t | offset
| ) |  |
| final override virtual inherited

Process some data.

Parameters

  buf | in/out parameter which will possibly be resized or swapped
  offset | an offset into blocks to begin processing

Implements Botan::Decompression_Algorithm.

Definition at line 182 of file compress_utils.cpp.

183 {
184 process(buf, offset, m_stream->run_flag());
185 }

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

- src/lib/compression/zlib/zlib.h
- src/lib/compression/zlib/zlib.cpp