diff options
author | Jack Lloyd <[email protected]> | 2016-10-11 12:51:34 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-10-11 12:51:34 -0400 |
commit | a718dc8c1e618adc9ee4485cc9a49484f27a446c (patch) | |
tree | 90e1139aedf25349ac1c4fdb3035407515f960d8 /src/lib | |
parent | f8528b22a78233fc956575c424eba58789ca1dff (diff) | |
parent | aaf1e3818c9a9681ad20d9858127c296548741eb (diff) |
Merge GH #663 Compression docs
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/compression/compression.h | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/src/lib/compression/compression.h b/src/lib/compression/compression.h index 81b863dcf..db2722305 100644 --- a/src/lib/compression/compression.h +++ b/src/lib/compression/compression.h @@ -13,6 +13,9 @@ namespace Botan { +/* +* Interface for a compression algorithm. +*/ class BOTAN_DLL Compression_Algorithm { public: @@ -44,6 +47,9 @@ class BOTAN_DLL Compression_Algorithm */ virtual void finish(secure_vector<byte>& final_block, size_t offset = 0) = 0; + /** + * @return name of the compression algorithm + */ virtual std::string name() const = 0; /** @@ -55,22 +61,44 @@ class BOTAN_DLL Compression_Algorithm virtual ~Compression_Algorithm() {} }; +/* +* Interface for a decompression algorithm. +*/ class BOTAN_DLL Decompression_Algorithm { public: typedef SCAN_Name Spec; /** - * Decompression does not support levels + * Begin decompressing. + * Decompression does not support levels, as compression does. */ virtual void start() = 0; + /** + * Process some data. Input must be in size update_granularity() byte blocks. + * @param blocks in/out parameter which will possibly be resized or swapped + * @param offset an offset into blocks to begin processing + */ virtual void update(secure_vector<byte>& buf, size_t offset = 0) = 0; + /** + * Finish decompressing + * + * @param final_block in/out parameter + * @param offset an offset into final_block to begin processing + */ virtual void finish(secure_vector<byte>& final_block, size_t offset = 0) = 0; + /** + * @return name of the decompression algorithm + */ virtual std::string name() const = 0; + /** + * Reset the state and abort the current message; start can be + * called again to process a new message. + */ virtual void clear() = 0; virtual ~Decompression_Algorithm() {} @@ -79,6 +107,9 @@ class BOTAN_DLL Decompression_Algorithm BOTAN_DLL Compression_Algorithm* make_compressor(const std::string& type); BOTAN_DLL Decompression_Algorithm* make_decompressor(const std::string& type); +/** +* FIXME add doc +*/ class Compression_Stream { public: @@ -99,6 +130,9 @@ class Compression_Stream virtual bool run(u32bit flags) = 0; }; +/** +* FIXME add doc +*/ class Stream_Compression : public Compression_Algorithm { public: @@ -119,6 +153,9 @@ class Stream_Compression : public Compression_Algorithm std::unique_ptr<Compression_Stream> m_stream; }; +/** +* FIXME add doc +*/ class Stream_Decompression : public Decompression_Algorithm { public: |