Kicking it Olde Sküül! Burgerlib on Github Follow Olde Sküül on Twitter Burgerbecky on LinkedIn Burgerbecky on LinkedIn
Loading...
Searching...
No Matches
Burger::Decompress Class Referenceabstract

Base class for data decompression. More...

Inheritance diagram for Burger::Decompress:
Collaboration diagram for Burger::Decompress:

Public Member Functions

const Burger::StaticRTTIget_StaticRTTI (void) const noexcept override
 Get the description to the class.
 
 Decompress (void)
 Default constructor.
 
virtual eError Reset (void)=0
 Reset the decompression algorithm.
 
virtual eError Process (void *pOutput, uintptr_t uOutputChunkSize, const void *pInput, uintptr_t uInputChunkLength)=0
 Decompress data into the output buffer.
 
uintptr_t GetTotalInputSize (void) const noexcept
 Get the total processed input data in bytes.
 
uintptr_t GetTotalOutputSize (void) const noexcept
 Get the total processed output data in bytes.
 
uintptr_t GetProcessedInputSize (void) const noexcept
 Get the total processed output data in bytes from the last process pass.
 
uintptr_t GetProcessedOutputSize (void) const noexcept
 Get the total processed output data in bytes from the last process pass.
 
uint32_t GetSignature (void) const noexcept
 Return the signature for this decompressor.
 
- Public Member Functions inherited from Burger::Base
const char * get_class_name (void) const noexcept
 Get the name of the class.
 
virtual ~Base () noexcept=default
 Destructor.
 

Static Public Attributes

static const Burger::StaticRTTI g_StaticRTTI
 The global description of the class.
 
- Static Public Attributes inherited from Burger::Base
static const Burger::StaticRTTI g_StaticRTTI
 The global description of the class.
 

Protected Attributes

uintptr_t m_uTotalInput
 Total number of bytes processed for input.
 
uintptr_t m_uTotalOutput
 Total number of bytes processed for output.
 
uintptr_t m_uInputLength
 Number of input bytes processed from the last call to Process()
 
uintptr_t m_uOutputLength
 Number of output bytes processed from the last call to Process()
 
uint32_t m_uSignature
 4 character code to identify this decompresser
 

Detailed Description

Base class for data decompression.


For functions that allow decompression, this class will allow any decompression algorithm to be used as long as they derive from this base class.

See also
Burger::Compress

Constructor & Destructor Documentation

◆ Decompress()

Burger::Decompress::Decompress ( void )

Default constructor.


Initializes the defaults

Member Function Documentation

◆ get_StaticRTTI()

const Burger::StaticRTTI * Burger::Decompress::get_StaticRTTI ( void ) const
overridevirtualnoexcept

Get the description to the class.


This virtual function will pull the pointer to the StaticRTTI instance that has the name of the class. Due to it being virtual, it will be the name of the most derived class.

Returns
Pointer to a global, read only instance of StaticRTTI for the true class

Reimplemented from Burger::Base.

Reimplemented in Burger::Decompress16BitBEAudio, Burger::Decompress16BitLEAudio, Burger::Decompress32BitBEAudio, Burger::Decompress32BitLEAudio, Burger::DecompressALaw, Burger::DecompressAudio, Burger::DecompressDeflate, Burger::DecompressILBMRLE, Burger::DecompressLZSS, Burger::DecompressMace3, Burger::DecompressMace6, Burger::DecompressMicrosoftADPCM, Burger::DecompressMP3, Burger::DecompressSigned8BitAudio, Burger::DecompressULaw, and Burger::DecompressUnsigned8BitAudio.

◆ GetProcessedInputSize()

uintptr_t Burger::Decompress::GetProcessedInputSize ( void ) const
inlinenoexcept

Get the total processed output data in bytes from the last process pass.


Returns the number of input processed from the last call to Process().

Returns
Number of input bytes processed from the last call to Process().
See also
GetTotalInputSize(), GetTotalOutputSize() and GetProcessedOutputSize()

◆ GetProcessedOutputSize()

uintptr_t Burger::Decompress::GetProcessedOutputSize ( void ) const
inlinenoexcept

Get the total processed output data in bytes from the last process pass.


Returns the number of output processed from the last call to Process().

Returns
Number of output bytes processed from the last call to Process().
See also
GetTotalInputSize(), GetTotalOutputSize() and GetProcessedInputSize()

◆ GetSignature()

uint32_t Burger::Decompress::GetSignature ( void ) const
inlinenoexcept

Return the signature for this decompressor.


Each decompressor has a unique signature to identify the algorithm used for compression. It's in the form of a 4 character code.

Popular codes are...

AlgorithmCode
LZSS LZSS
ILBM RLE RLE
Inflate (ZLib) ZLIB
LZARI LZAR
RefPack REFP
Huffman HUFF
Returns
A 32 bit number form of the 4 byte character code. It's an endian neutral text string

◆ GetTotalInputSize()

uintptr_t Burger::Decompress::GetTotalInputSize ( void ) const
inlinenoexcept

Get the total processed input data in bytes.


Returns the number of input processed since Init() was called.

Returns
Number of input bytes processed since Init() was called.
See also
GetTotalOutputSize(), GetProcessedInputSize() and GetProcessedOutputSize()

◆ GetTotalOutputSize()

uintptr_t Burger::Decompress::GetTotalOutputSize ( void ) const
inlinenoexcept

Get the total processed output data in bytes.


Returns the number of output processed since Init() was called.

Returns
Number of output bytes processed since Init() was called.
See also
GetTotalInputSize(), GetProcessedInputSize() and GetProcessedOutputSize()

◆ Process()

virtual eError Burger::Decompress::Process ( void * pOutput,
uintptr_t uOutputChunkSize,
const void * pInput,
uintptr_t uInputChunkLength )
pure virtual

Decompress data into the output buffer.


Pass data into the decompressor and store the output into the output buffer. Bounds checking is performed to ensure there are no buffer overruns or underruns on output. If the input decompressed into the output buffer without any excess, the code kErrorNone (0) is returned. If there wasn't enough input data to satisfy the output then Decompress::DECOMPRESS_INPUTUNDERRUN is returned and if there was input data unprocessed then kErrorBufferTooSmall is returned.

If kErrorDataCorruption is returned, there was an unrecoverable error.

Note
This is must be implemented by derived class.
Parameters
pOutputPointer to the buffer to accept the decompressed data
uOutputChunkSizeNumber of bytes in the output buffer
pInputPointer to data to compress
uInputChunkLengthNumber of bytes in the data to decompress
Returns
Decompress::eError code with zero if no failure, non-zero is an error code

Implemented in Burger::Decompress16BitBEAudio, Burger::Decompress16BitLEAudio, Burger::Decompress32BitBEAudio, Burger::Decompress32BitLEAudio, Burger::DecompressALaw, Burger::DecompressDeflate, Burger::DecompressILBMRLE, Burger::DecompressLZSS, Burger::DecompressMace3, Burger::DecompressMace6, Burger::DecompressMicrosoftADPCM, Burger::DecompressMP3, Burger::DecompressSigned8BitAudio, Burger::DecompressULaw, and Burger::DecompressUnsigned8BitAudio.

◆ Reset()

virtual eError Burger::Decompress::Reset ( void )
pure virtual

Reset the decompression algorithm.


This function will reset the decompression algorithm (Which may or may not require memory allocations) and returns an error code if there was a failure.

Note
This is must be implemented by derived class and it also acts as a "reset" function to recycle this class to perform decompression on new data.
Returns
Decompress::eError enum (Zero is a success code)

Implemented in Burger::Decompress16BitBEAudio, Burger::Decompress16BitLEAudio, Burger::Decompress32BitBEAudio, Burger::Decompress32BitLEAudio, Burger::DecompressALaw, Burger::DecompressDeflate, Burger::DecompressILBMRLE, Burger::DecompressLZSS, Burger::DecompressMace3, Burger::DecompressMace6, Burger::DecompressMicrosoftADPCM, Burger::DecompressMP3, Burger::DecompressSigned8BitAudio, Burger::DecompressULaw, and Burger::DecompressUnsigned8BitAudio.

Member Data Documentation

◆ g_StaticRTTI

const Burger::StaticRTTI Burger::Decompress::g_StaticRTTI
static

The global description of the class.


This record contains the name of this class and a reference to the parent

◆ m_uInputLength

uintptr_t Burger::Decompress::m_uInputLength
protected

Number of input bytes processed from the last call to Process()

◆ m_uOutputLength

uintptr_t Burger::Decompress::m_uOutputLength
protected

Number of output bytes processed from the last call to Process()

◆ m_uSignature

uint32_t Burger::Decompress::m_uSignature
protected

4 character code to identify this decompresser

◆ m_uTotalInput

uintptr_t Burger::Decompress::m_uTotalInput
protected

Total number of bytes processed for input.

◆ m_uTotalOutput

uintptr_t Burger::Decompress::m_uTotalOutput
protected

Total number of bytes processed for output.