8#ifndef BOTAN_COMPRESSION_TRANSFORM_H_
9#define BOTAN_COMPRESSION_TRANSFORM_H_
11#include <botan/exceptn.h>
12#include <botan/secmem.h>
26 static std::unique_ptr<Compression_Algorithm> create(std::string_view algo_spec);
33 static std::unique_ptr<Compression_Algorithm> create_or_throw(std::string_view algo_spec);
46 virtual void start(
size_t comp_level = 0) = 0;
78 virtual std::string
name()
const = 0;
98 static std::unique_ptr<Decompression_Algorithm> create(std::string_view algo_spec);
105 static std::unique_ptr<Decompression_Algorithm> create_or_throw(std::string_view algo_spec);
140 virtual std::string
name()
const = 0;
205 virtual bool run(uint32_t flags) = 0;
220 void start(
size_t level)
final;
224 virtual std::unique_ptr<Compression_Stream> make_stream(
size_t level)
const = 0;
227 std::unique_ptr<Compression_Stream> m_stream;
246 virtual std::unique_ptr<Compression_Stream> make_stream()
const = 0;
249 std::unique_ptr<Compression_Stream> m_stream;
virtual void start(size_t comp_level=0)=0
virtual void finish(secure_vector< uint8_t > &final_block, size_t offset=0)=0
static std::unique_ptr< Compression_Algorithm > create(std::string_view algo_spec)
virtual void update(secure_vector< uint8_t > &buf, size_t offset=0, bool flush=false)=0
virtual std::string name() const =0
virtual ~Compression_Algorithm()=default
ErrorType error_type() const noexcept override
int error_code() const noexcept override
virtual void next_in(uint8_t *b, size_t len)=0
virtual size_t avail_in() const =0
virtual ~Compression_Stream()=default
virtual uint32_t finish_flag() const =0
virtual size_t avail_out() const =0
virtual uint32_t run_flag() const =0
virtual bool run(uint32_t flags)=0
virtual void next_out(uint8_t *b, size_t len)=0
virtual uint32_t flush_flag() const =0
static std::unique_ptr< Decompression_Algorithm > create(std::string_view algo_spec)
virtual ~Decompression_Algorithm()=default
virtual std::string name() const =0
virtual void finish(secure_vector< uint8_t > &final_block, size_t offset=0)=0
virtual void update(secure_vector< uint8_t > &buf, size_t offset=0)=0
void finish(secure_vector< uint8_t > &buf, size_t offset) final
void finish(secure_vector< uint8_t > &buf, size_t offset) final
int(* update)(CTX *, const void *, CC_LONG len)
int(* final)(unsigned char *, CTX *)
#define BOTAN_PUBLIC_API(maj, min)
#define BOTAN_DEPRECATED(msg)
Decompression_Algorithm * make_decompressor(std::string_view type)
Compression_Algorithm * make_compressor(std::string_view type)
std::vector< T, secure_allocator< T > > secure_vector