galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
galaxy::math::ZLib Class Referencefinal

Compressor and Decompressor. More...

#include <ZLib.hpp>

+ Collaboration diagram for galaxy::math::ZLib:

Public Types

enum class  Mode : int { COMPRESS = 0 , DECOMPRESS = 1 }
 ZLib mode to start in. More...
 

Public Member Functions

 ZLib (const Mode mode)
 Constructor.
 
 ~ZLib ()
 Destructor.
 
std::string compressor (const std::string &input)
 Compresses string.
 
std::string finish ()
 Completes the compression.
 
std::string decompressor (const std::string &input)
 Decompresses a zlib string.
 

Private Attributes

Mode m_mode
 ZLib mode.
 
z_stream m_stream
 Stream object.
 
bool m_finished
 Has the compression finished.
 
char m_in [GALAXY_ZLIB_COMPLETE_CHUNK]
 Input buffer.
 
char m_out [GALAXY_ZLIB_COMPLETE_CHUNK]
 Output buffer.
 

Detailed Description

Compressor and Decompressor.

Do not create on stack due to class size.

Definition at line 25 of file ZLib.hpp.

Member Enumeration Documentation

◆ Mode

enum class galaxy::math::ZLib::Mode : int
strong

ZLib mode to start in.

Enumerator
COMPRESS 

ZLib deflation.

DECOMPRESS 

ZLib inflation.

Definition at line 31 of file ZLib.hpp.

Constructor & Destructor Documentation

◆ ZLib()

galaxy::math::ZLib::ZLib ( const Mode mode)

Constructor.

Parameters
modeZLib mode to start in.

Definition at line 26 of file ZLib.cpp.

◆ ~ZLib()

galaxy::math::ZLib::~ZLib ( )

Destructor.

Definition at line 65 of file ZLib.cpp.

Member Function Documentation

◆ compressor()

std::string galaxy::math::ZLib::compressor ( const std::string & input)
nodiscard

Compresses string.

Parameters
inputData to compress.
Returns
Compressed string.

Definition at line 84 of file ZLib.cpp.

◆ finish()

std::string galaxy::math::ZLib::finish ( )
nodiscard

Completes the compression.

Returns
Compressed string containing termination block.

Definition at line 138 of file ZLib.cpp.

◆ decompressor()

std::string galaxy::math::ZLib::decompressor ( const std::string & input)
nodiscard

Decompresses a zlib string.

Parameters
inputData to decompress.
Returns
String containing decompressed data.

Definition at line 184 of file ZLib.cpp.

Member Data Documentation

◆ m_mode

Mode galaxy::math::ZLib::m_mode
private

ZLib mode.

Definition at line 88 of file ZLib.hpp.

◆ m_stream

z_stream galaxy::math::ZLib::m_stream
private

Stream object.

Definition at line 93 of file ZLib.hpp.

◆ m_finished

bool galaxy::math::ZLib::m_finished
private

Has the compression finished.

Definition at line 98 of file ZLib.hpp.

◆ m_in

char galaxy::math::ZLib::m_in[GALAXY_ZLIB_COMPLETE_CHUNK]
private

Input buffer.

Definition at line 103 of file ZLib.hpp.

◆ m_out

char galaxy::math::ZLib::m_out[GALAXY_ZLIB_COMPLETE_CHUNK]
private

Output buffer.

Definition at line 108 of file ZLib.hpp.


The documentation for this class was generated from the following files: