libassetmap  1.0.0
Hash-table based archive format containing compressed data
Public Member Functions | List of all members
AssetMap::IDecompress Class Referenceabstract
Inheritance diagram for AssetMap::IDecompress:
Inheritance graph
[legend]

Public Member Functions

virtual size_t Decompress (const uint8_t *src, size_t srcLen, uint8_t *dst, size_t dstLen)=0
 Decompress a previously compressed sequence of data. More...
 
virtual size_t CalcDecompressSize (const uint8_t *src, size_t len) const noexcept=0
 Calculate the number of bytes required to decompress some data. More...
 
virtual std::pair< const uint8_t *, size_t > Dictionary () const noexcept=0
 Obtains a pointer to the dictionary and its size, if loaded. More...
 
virtual void UseDictionary (const uint8_t *dict, size_t len) noexcept=0
 Loads a dictionary to be used for decompression. More...
 

Member Function Documentation

◆ CalcDecompressSize()

virtual size_t AssetMap::IDecompress::CalcDecompressSize ( const uint8_t *  src,
size_t  len 
) const
pure virtualnoexcept

Calculate the number of bytes required to decompress some data.

Precondition
src must point to a sequence of data previously created by a compatible ICompress implementation. If the input data was compressed with a dictionary, UseDictionary() must have been called.
Parameters
srcA pointer to the compressed data
lenThe length of the input data, in bytes.
Returns
The size, in bytes, required to fully decompress the input.

Implemented in AssetMap::ZSTD.

◆ Decompress()

virtual size_t AssetMap::IDecompress::Decompress ( const uint8_t *  src,
size_t  srcLen,
uint8_t *  dst,
size_t  dstLen 
)
pure virtual

Decompress a previously compressed sequence of data.

Typically, when decompressing data, a call to CalcDecompressSize() will first be made to determine the destination buffer space needed.

Precondition
The data must have been compressed by a compatible ICompress implementation. It is implementation-defined as to whether src and dst may overlap and whether any size is permitted to be zero.
Parameters
srcThe buffer containing compressed data.
srcLenThe length of the source data.
dstDestination buffer for the output data.
dstLenMaximum number of bytes that can be written to dst
Returns
The number of bytes written into dst

Implemented in AssetMap::ZSTD.

◆ Dictionary()

virtual std::pair<const uint8_t*, size_t> AssetMap::IDecompress::Dictionary ( ) const
pure virtualnoexcept

Obtains a pointer to the dictionary and its size, if loaded.

See also
ICompress::Dictionary()
Returns
a pair containing the pointer and its size. or nullptr & <any>

Implemented in AssetMap::ZSTD.

◆ UseDictionary()

virtual void AssetMap::IDecompress::UseDictionary ( const uint8_t *  dict,
size_t  len 
)
pure virtualnoexcept

Loads a dictionary to be used for decompression.

Precondition
The dictionary must have been created with a compatible ICompress implementation.
Postcondition
dict must remain valid until all calls to Decompress() have completed and no further will be issued to this instance.
Parameters
dictThe dictionary to load.
lenThe size of the dictionary, in bytes.

Implemented in AssetMap::ZSTD.


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