diff options
Diffstat (limited to 'src/lib/compression/compression.h')
-rw-r--r-- | src/lib/compression/compression.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/lib/compression/compression.h b/src/lib/compression/compression.h index 2ebde3f2f..403b335e1 100644 --- a/src/lib/compression/compression.h +++ b/src/lib/compression/compression.h @@ -20,6 +20,22 @@ class BOTAN_PUBLIC_API(2,0) Compression_Algorithm { public: /** + * Create an instance based on a name, or return null if the + * algo/provider combination cannot be found. If provider is + * empty then best available is chosen. + */ + static std::unique_ptr<Compression_Algorithm> + create(const std::string& algo_spec); + + /** + * Create an instance based on a name + * @param algo_spec algorithm name + * Throws Lookup_Error if not not found. + */ + static std::unique_ptr<Compression_Algorithm> + create_or_throw(const std::string& algo_spec); + + /** * Begin compressing. Most compression algorithms offer a tunable * time/compression tradeoff parameter generally represented by * an integer in the range of 1 to 9. @@ -66,6 +82,22 @@ class BOTAN_PUBLIC_API(2,0) Decompression_Algorithm { public: /** + * Create an instance based on a name, or return null if the + * algo/provider combination cannot be found. If provider is + * empty then best available is chosen. + */ + static std::unique_ptr<Decompression_Algorithm> + create(const std::string& algo_spec); + + /** + * Create an instance based on a name + * @param algo_spec algorithm name + * Throws Lookup_Error if not not found. + */ + static std::unique_ptr<Decompression_Algorithm> + create_or_throw(const std::string& algo_spec); + + /** * Begin decompressing. * Decompression does not support levels, as compression does. */ |