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);
43 virtual void start(
size_t comp_level = 0) = 0;
64 virtual std::string
name()
const = 0;
84 static std::unique_ptr<Decompression_Algorithm> create(std::string_view algo_spec);
91 static std::unique_ptr<Decompression_Algorithm> create_or_throw(std::string_view algo_spec);
117 virtual std::string
name()
const = 0;
170 virtual void next_in(uint8_t* b,
size_t len) = 0;
182 virtual bool run(uint32_t flags) = 0;
197 void start(
size_t level)
final;
201 virtual std::unique_ptr<Compression_Stream> make_stream(
size_t level)
const = 0;
204 std::unique_ptr<Compression_Stream> m_stream;
223 virtual std::unique_ptr<Compression_Stream> make_stream()
const = 0;
226 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