StormByte C++ Library: Crypto module 0.0.9999
StormByte-Crypto is a StormByte library module for handling cryptographic operations
Loading...
Searching...
No Matches
bzip2.hxx
1#pragma once
2
3#include <StormByte/crypto/compressor/generic.hxx>
4
9namespace StormByte::Crypto::Compressor {
14 class STORMBYTE_CRYPTO_PUBLIC Bzip2 final: public Generic {
15 public:
20 Bzip2(unsigned short level = 5);
21
26 Bzip2(const Bzip2& other) = default;
27
32 Bzip2(Bzip2&& other) noexcept = default;
33
37 ~Bzip2() noexcept = default;
38
44 Bzip2& operator=(const Bzip2& other) = default;
45
51 Bzip2& operator=(Bzip2&& other) noexcept = default;
52
57 inline PointerType Clone() const override {
58 return std::make_unique<Bzip2>(*this);
59 }
60
65 inline PointerType Move() noexcept override {
66 return std::make_unique<Bzip2>(std::move(*this));
67 }
68
69 private:
77 bool DoCompress(std::span<const std::byte> input, Buffer::WriteOnly& output) const noexcept override;
78
85 Buffer::Consumer DoCompress(Buffer::Consumer consumer, ReadMode mode) const noexcept override;
86
94 bool DoDecompress(std::span<const std::byte> input, Buffer::WriteOnly& output) const noexcept override;
95
102 Buffer::Consumer DoDecompress(Buffer::Consumer consumer, ReadMode mode) const noexcept override;
103 };
104}
A class representing the Bzip2 compression algorithm.
Definition bzip2.hxx:14
PointerType Move() noexcept override
Move the Bzip2 compressor.
Definition bzip2.hxx:65
~Bzip2() noexcept=default
Virtual destructor.
Bzip2(Bzip2 &&other) noexcept=default
Move constructor.
Bzip2(unsigned short level=5)
Constructor.
Bzip2(const Bzip2 &other)=default
Copy constructor.
A generic compressor class.
Definition generic.hxx:26