Botan 2.19.1
Crypto and TLS for C&
Public Member Functions | Static Public Member Functions | List of all members
Botan::Decompression_Algorithm Class Referenceabstract

#include <compression.h>

Inheritance diagram for Botan::Decompression_Algorithm:
Botan::Stream_Decompression Botan::Bzip2_Decompression Botan::Deflate_Decompression Botan::Gzip_Decompression Botan::LZMA_Decompression Botan::Zlib_Decompression

Public Member Functions

virtual void clear ()=0
virtual void finish (secure_vector< uint8_t > &final_block, size_t offset=0)=0
virtual std::string name () const =0
virtual void start ()=0
virtual void update (secure_vector< uint8_t > &buf, size_t offset=0)=0
virtual ~Decompression_Algorithm ()=default

Static Public Member Functions

static std::unique_ptr< Decompression_Algorithmcreate (const std::string &algo_spec)
static std::unique_ptr< Decompression_Algorithmcreate_or_throw (const std::string &algo_spec)

Detailed Description

Definition at line 81 of file compression.h.

Constructor & Destructor Documentation

◆ ~Decompression_Algorithm()

virtual Botan::Decompression_Algorithm::~Decompression_Algorithm ( )

Member Function Documentation

◆ clear()

virtual void Botan::Decompression_Algorithm::clear ( )
pure virtual

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

Implemented in Botan::Stream_Decompression.

◆ create()

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

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 }
Decompression_Algorithm * make_decompressor(const std::string &name)
Definition: compression.cpp:71

References Botan::make_decompressor().

Referenced by create_or_throw().

◆ create_or_throw()

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

Create an instance based on a name

algo_specalgorithm 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 }
static std::unique_ptr< Decompression_Algorithm > create(const std::string &algo_spec)
Definition: compression.cpp:98

References create().

◆ finish()

virtual void Botan::Decompression_Algorithm::finish ( secure_vector< uint8_t > &  final_block,
size_t  offset = 0 
pure virtual

Finish decompressing

final_blockin/out parameter
offsetan offset into final_block to begin processing

Implemented in Botan::Stream_Decompression.

◆ name()

virtual std::string Botan::Decompression_Algorithm::name ( ) const
pure virtual

◆ start()

virtual void Botan::Decompression_Algorithm::start ( )
pure virtual

Begin decompressing. Decompression does not support levels, as compression does.

◆ update()

virtual void Botan::Decompression_Algorithm::update ( secure_vector< uint8_t > &  buf,
size_t  offset = 0 
pure virtual

Process some data.

bufin/out parameter which will possibly be resized or swapped
offsetan offset into blocks to begin processing

Implemented in Botan::Stream_Decompression.

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