StormByte-Crypto 3.1.0
C++26 cryptography module of the StormByte suite
Loading...
Searching...
No Matches
StormByte::Crypto::Compressor::Zlib Class Referencefinal

zlib compressor. More...

#include <StormByte/crypto/compressor/zlib.hxx>

Inheritance diagram for StormByte::Crypto::Compressor::Zlib:
Collaboration diagram for StormByte::Crypto::Compressor::Zlib:

Public Member Functions

PointerType Clone () const override
 Clone this compressor.
PointerType Move () noexcept override
 Move this compressor into a new instance.
Construction
 Zlib (unsigned short level=5)
 Construct with a compression level.
 Zlib (const Zlib &other)=default
 Copy constructor.
 Zlib (Zlib &&other) noexcept=default
 Move constructor.
 ~Zlib () noexcept
 Destructor.
Zlib & operator= (const Zlib &other)=default
 Copy assignment.
Zlib & operator= (Zlib &&other) noexcept=default
 Move assignment.
Public Member Functions inherited from StormByte::Crypto::Compressor::Generic
unsigned short Level () const noexcept
 Compression level.
enum Type Type () const noexcept
 Codec of this compressor.
 Generic (const Generic &other)=default
 Copy constructor.
 Generic (Generic &&other) noexcept=default
 Move constructor.
virtual ~Generic () noexcept
 Destructor.
Generic & operator= (const Generic &other)=default
 Copy assignment.
Generic & operator= (Generic &&other) noexcept=default
 Move assignment.
bool Compress (const std::span< const std::byte > input, Buffer::WriteOnly &output) const noexcept
 Compress a byte span.
template<StormByte::Type::ByteInputRange Range>
bool Compress (const Range &input, Buffer::WriteOnly &output) const
 Compress an input range of byte-convertible values.
bool Compress (const Buffer::ReadOnly &input, Buffer::WriteOnly &output) const noexcept
 Compress a read-only buffer (copy).
bool Compress (Buffer::ReadOnly &input, Buffer::WriteOnly &output) const noexcept
 Compress a buffer, consuming it.
Buffer::Consumer Compress (Buffer::Consumer consumer, ReadMode mode=ReadMode::Move) const noexcept
 Compress a Consumer into another Consumer.
bool Decompress (const std::span< const std::byte > input, Buffer::WriteOnly &output) const noexcept
 Decompress a byte span.
template<StormByte::Type::ByteInputRange Range>
bool Decompress (const Range &input, Buffer::WriteOnly &output) const
 Decompress an input range of byte-convertible values.
bool Decompress (const Buffer::ReadOnly &input, Buffer::WriteOnly &output) const noexcept
 Decompress a read-only buffer (copy).
bool Decompress (Buffer::ReadOnly &input, Buffer::WriteOnly &output) const noexcept
 Decompress a buffer, consuming it.
Buffer::Consumer Decompress (Buffer::Consumer consumer, ReadMode mode=ReadMode::Move) const noexcept
 Decompress a Consumer into another Consumer.
Public Member Functions inherited from StormByte::Safe::Clonable< Generic >
constexpr Clonable ()=default
constexpr Clonable & operator= (const Clonable &)=default
virtual constexpr ~Clonable () noexcept=default

Additional Inherited Members

Public Types inherited from StormByte::Safe::Clonable< Generic >
typedef SmartPointer PointerType
Static Public Member Functions inherited from StormByte::Safe::Clonable< Generic >
static PointerType MakePointer (Args &&... args)
Protected Member Functions inherited from StormByte::Crypto::Compressor::Generic
 Generic (enum Type type, unsigned short level=5)
 Construct with a codec and level.
Protected Attributes inherited from StormByte::Crypto::Compressor::Generic
enum Type m_type
 Codec.
unsigned short m_level = 0
 Compression level.

Detailed Description

zlib compressor.

Note
MaybeSafe inherits all provider requirements of StormByte::Crypto::Compressor::Generic. This leaf adds no fields; exported Clone/Move bind ownership callbacks in Crypto.

Constructor & Destructor Documentation

◆ Zlib() [1/3]

StormByte::Crypto::Compressor::Zlib::Zlib ( unsigned short level = 5)

Construct with a compression level.

Parameters
levelCompression level.

◆ Zlib() [2/3]

StormByte::Crypto::Compressor::Zlib::Zlib ( const Zlib & other)
default

Copy constructor.

Parameters
otherCompressor to copy.

◆ Zlib() [3/3]

StormByte::Crypto::Compressor::Zlib::Zlib ( Zlib && other)
defaultnoexcept

Move constructor.

Parameters
otherCompressor to move.

◆ ~Zlib()

StormByte::Crypto::Compressor::Zlib::~Zlib ( )
noexcept

Destructor.

Member Function Documentation

◆ Clone()

PointerType StormByte::Crypto::Compressor::Zlib::Clone ( ) const
overridevirtual

Clone this compressor.

Returns
Shared pointer to the clone.

Implements StormByte::Safe::Clonable< Generic >.

◆ Move()

PointerType StormByte::Crypto::Compressor::Zlib::Move ( )
overridevirtualnoexcept

Move this compressor into a new instance.

Returns
Shared pointer to the moved compressor.

Implements StormByte::Safe::Clonable< Generic >.

◆ operator=() [1/2]

Zlib & StormByte::Crypto::Compressor::Zlib::operator= ( const Zlib & other)
default

Copy assignment.

Parameters
otherCompressor to copy.
Returns
Reference to this compressor.

◆ operator=() [2/2]

Zlib & StormByte::Crypto::Compressor::Zlib::operator= ( Zlib && other)
defaultnoexcept

Move assignment.

Parameters
otherCompressor to move.
Returns
Reference to this compressor.

The documentation for this class was generated from the following file:
  • lib/public/StormByte/crypto/compressor/zlib.hxx