8#include <botan/compression.h>
10#include <botan/exceptn.h>
11#include <botan/mem_ops.h>
14#if defined(BOTAN_HAS_ZLIB)
15 #include <botan/zlib.h>
18#if defined(BOTAN_HAS_BZIP2)
19 #include <botan/bzip2.h>
22#if defined(BOTAN_HAS_LZMA)
23 #include <botan/lzma.h>
30#if defined(BOTAN_HAS_ZLIB)
31 if(
name ==
"Zlib" ||
name ==
"zlib") {
32 return std::make_unique<Zlib_Compression>();
35 return std::make_unique<Gzip_Compression>();
37 if(
name ==
"Deflate" ||
name ==
"deflate") {
38 return std::make_unique<Deflate_Compression>();
42#if defined(BOTAN_HAS_BZIP2)
43 if(
name ==
"bzip2" ||
name ==
"bz2" ||
name ==
"Bzip2") {
44 return std::make_unique<Bzip2_Compression>();
48#if defined(BOTAN_HAS_LZMA)
50 return std::make_unique<LZMA_Compression>();
68#if defined(BOTAN_HAS_ZLIB)
69 if(
name ==
"Zlib" ||
name ==
"zlib") {
70 return std::make_unique<Zlib_Decompression>();
73 return std::make_unique<Gzip_Decompression>();
75 if(
name ==
"Deflate" ||
name ==
"deflate") {
76 return std::make_unique<Deflate_Decompression>();
80#if defined(BOTAN_HAS_BZIP2)
81 if(
name ==
"bzip2" ||
name ==
"bz2" ||
name ==
"Bzip2") {
82 return std::make_unique<Bzip2_Decompression>();
86#if defined(BOTAN_HAS_LZMA)
88 return std::make_unique<LZMA_Decompression>();
static std::unique_ptr< Compression_Algorithm > create_or_throw(std::string_view algo_spec)
static std::unique_ptr< Compression_Algorithm > create(std::string_view algo_spec)
virtual std::string name() const =0
static std::unique_ptr< Decompression_Algorithm > create(std::string_view algo_spec)
virtual std::string name() const =0
static std::unique_ptr< Decompression_Algorithm > create_or_throw(std::string_view algo_spec)
Lookup_Error(std::string_view err)