StormByte C++ Library: Crypto module 0.0.9999
StormByte-Crypto is a StormByte library module for handling cryptographic operations
Loading...
Searching...
No Matches
zlib.hxx
1#pragma once
2
3#include <StormByte/crypto/compressor/generic.hxx>
4
9namespace StormByte::Crypto::Compressor {
14 class STORMBYTE_CRYPTO_PUBLIC Zlib final: public Generic {
15 public:
20 Zlib(unsigned short level = 5);
21
26 Zlib(const Zlib& other) = default;
27
32 Zlib(Zlib&& other) noexcept = default;
33
37 ~Zlib() noexcept = default;
38
44 Zlib& operator=(const Zlib& other) = default;
45
51 Zlib& operator=(Zlib&& other) noexcept = default;
52
57 PointerType Clone() const override {
58 return std::make_unique<Zlib>(*this);
59 }
60
65 PointerType Move() noexcept override {
66 return std::make_unique<Zlib>(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 generic compressor class.
Definition generic.hxx:26
A class representing the Zlib compression algorithm.
Definition zlib.hxx:14
Zlib(Zlib &&other) noexcept=default
Move constructor.
Zlib(unsigned short level=5)
Constructor.
~Zlib() noexcept=default
Virtual destructor.
PointerType Move() noexcept override
Move the Zlib compressor.
Definition zlib.hxx:65
Zlib(const Zlib &other)=default
Copy constructor.