Sese Framework  2.3.0
A cross-platform framework
Loading...
Searching...
No Matches
sese::Decompressor Class Reference

Decompressor class. More...

#include <Decompressor.h>

Public Types

using OutputStream = sese::io::OutputStream
 

Public Member Functions

 Decompressor (CompressionType type, size_t buffer_size=ZLIB_CHUNK_SIZE)
 
virtual ~Decompressor ()
 
void input (const void *input, unsigned int input_size)
 
int inflate (OutputStream *out)
 
int reset ()
 Reset z_stream object.
 
size_t getTotalIn () const
 
size_t getTotalOut () const
 

Private Attributes

void * stream
 
size_t cap = 0
 Represents allocated buffer size.
 
size_t length = 0
 Represents filled buffer size.
 
size_t read = 0
 Represents read portion of the buffer.
 
unsigned char * buffer
 Internal buffer.
 

Detailed Description

Decompressor class.

Member Typedef Documentation

◆ OutputStream

Constructor & Destructor Documentation

◆ Decompressor()

sese::Decompressor::Decompressor ( sese::CompressionType type,
size_t buffer_size = ZLIB_CHUNK_SIZE )
explicit

Create a decompressor

Parameters
typeCompression format
buffer_sizeSet internal buffer size

References buffer, cap, and stream.

◆ ~Decompressor()

sese::Decompressor::~Decompressor ( )
virtual

Member Function Documentation

◆ getTotalIn()

size_t sese::Decompressor::getTotalIn ( ) const
nodiscard

Size of the currently processed input buffer

Returns
Buffer size

◆ getTotalOut()

size_t sese::Decompressor::getTotalOut ( ) const
nodiscard

Size of the currently processed output buffer

Returns
Buffer size

References read().

◆ inflate()

int sese::Decompressor::inflate ( OutputStream * out)

Perform decompression

Parameters
outDecompressed stream
Return values
Z_OK(0) Current buffer block decompressed successfully
Z_STREAM_ERROR(-2) Other errors
Z_BUF_ERROR(-5) Output stream capacity insufficient

References read(), and sese::io::OutputStream::write().

◆ input()

void sese::Decompressor::input ( const void * input,
unsigned int input_size )

Set the buffer to be decompressed

Parameters
inputBuffer to be decompressed
input_sizeSize of this buffer

◆ reset()

int sese::Decompressor::reset ( )

Reset z_stream object.

References read().

Member Data Documentation

◆ buffer

unsigned char* sese::Decompressor::buffer
private

Internal buffer.

Referenced by Decompressor().

◆ cap

size_t sese::Decompressor::cap = 0
private

Represents allocated buffer size.

Referenced by Decompressor().

◆ length

size_t sese::Decompressor::length = 0
private

Represents filled buffer size.

◆ read

size_t sese::Decompressor::read = 0
private

Represents read portion of the buffer.

◆ stream

void* sese::Decompressor::stream
private

Referenced by Decompressor().


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