aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/compression/bzip2/bzip2.h
blob: 06c80cb8ecd4744dd44c9da036e930b730974d64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
* Bzip2 Compressor
* (C) 2001 Peter J Jones
*     2001-2007,2014 Jack Lloyd
*
* Botan is released under the Simplified BSD License (see license.txt)
*/

#ifndef BOTAN_BZIP2_H__
#define BOTAN_BZIP2_H__

#include <botan/compression.h>

namespace Botan {

/**
* Bzip2 Compression
*/
class BOTAN_DLL Bzip2_Compression final : public Stream_Compression
   {
   public:
      /**
      * @param block_size in 1024 KiB increments, in range from 1 to 9.
      *
      * Lowering this does not noticably modify the compression or
      * decompression speed, though less memory is required for both
      * compression and decompression.
      */
      Bzip2_Compression(size_t block_size = 9) : m_block_size(block_size) {}

      std::string name() const override { return "Bzip2_Compression"; }

   private:
      Compression_Stream* make_stream() const override;

      const size_t m_block_size;
   };

/**
* Bzip2 Deccompression
*/
class BOTAN_DLL Bzip2_Decompression final : public Stream_Decompression
   {
   public:
      std::string name() const override { return "Bzip2_Decompression"; }
   private:
      Compression_Stream* make_stream() const override;
   };

}

#endif