#include <codec.h>
|
virtual | ~ICodec () |
| note: the implementation should not check whether any data remains - codecs are sometimes destroyed without completing a transfer. More...
|
|
virtual size_t | MaxOutputSize (size_t inSize) const =0 |
|
virtual Status | Reset ()=0 |
| clear all previous state and prepare for reuse. More...
|
|
virtual Status | Process (const u8 *in, size_t inSize, u8 *out, size_t outSize, size_t &inConsumed, size_t &outProduced)=0 |
| process (i.e. More...
|
|
virtual Status | Finish (u32 &checksum, size_t &outProduced)=0 |
| Flush buffers and make sure all output has been produced. More...
|
|
virtual u32 | UpdateChecksum (u32 checksum, const u8 *in, size_t inSize) const =0 |
| update a checksum to reflect the contents of a buffer. More...
|
|
Definition at line 34 of file codec.h.
note: the implementation should not check whether any data remains - codecs are sometimes destroyed without completing a transfer.
Definition at line 26 of file codec.cpp.
virtual Status ICodec::Finish |
( |
u32 & |
checksum, |
|
|
size_t & |
outProduced |
|
) |
| |
|
pure virtual |
Flush buffers and make sure all output has been produced.
- Parameters
-
checksum | Checksum over all input data. |
outProduced | |
- Returns
- error status for the entire operation.
Implemented in Decompressor_ZLib, Compressor_ZLib, and Codec_ZLibNone.
virtual size_t ICodec::MaxOutputSize |
( |
size_t |
inSize | ) |
const |
|
pure virtual |
virtual Status ICodec::Process |
( |
const u8 * |
in, |
|
|
size_t |
inSize, |
|
|
u8 * |
out, |
|
|
size_t |
outSize, |
|
|
size_t & |
inConsumed, |
|
|
size_t & |
outProduced |
|
) |
| |
|
pure virtual |
process (i.e.
compress or decompress) data.
- Parameters
-
in | |
inSize | |
out | |
outSize | Bytes remaining in the output buffer; shall not be zero. |
inConsumed,outProduced | How many bytes in the input and output buffers were used. either or both of these can be zero if the input size is small or there's not enough output space. |
Implemented in Decompressor_ZLib, Compressor_ZLib, and Codec_ZLibNone.
virtual Status ICodec::Reset |
( |
| ) |
|
|
pure virtual |
clear all previous state and prepare for reuse.
this is as if the object were destroyed and re-created, but more efficient since it avoids reallocating a considerable amount of memory (about 200KB for LZ).
Implemented in Decompressor_ZLib, Compressor_ZLib, and Codec_ZLibNone.
virtual u32 ICodec::UpdateChecksum |
( |
u32 |
checksum, |
|
|
const u8 * |
in, |
|
|
size_t |
inSize |
|
) |
| const |
|
pure virtual |
update a checksum to reflect the contents of a buffer.
- Parameters
-
checksum | the initial value (must be 0 on first call) |
in | |
inSize | |
- Returns
- the new checksum. note: after all data has been seen, this is identical to the what Finish would return.
Implemented in Codec_ZLib.
The documentation for this struct was generated from the following files:
- /home/sathyam/0ad.svn/source/lib/file/archive/codec.h
- /home/sathyam/0ad.svn/source/lib/file/archive/codec.cpp