Pyrogenesis  trunk
Public Member Functions | List of all members
Compressor_ZLib Class Reference
Inheritance diagram for Compressor_ZLib:
Inheritance graph
[legend]
Collaboration diagram for Compressor_ZLib:
Collaboration graph
[legend]

Public Member Functions

 Compressor_ZLib ()
 
virtual ~Compressor_ZLib ()
 
virtual size_t MaxOutputSize (size_t inSize) const
 
virtual Status Reset ()
 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)
 process (i.e. More...
 
virtual Status Finish (u32 &checksum, size_t &outProduced)
 Flush buffers and make sure all output has been produced. More...
 
- Public Member Functions inherited from Codec_ZLib
u32 UpdateChecksum (u32 checksum, const u8 *in, size_t inSize) const
 update a checksum to reflect the contents of a buffer. More...
 
- Public Member Functions inherited from ICodec
virtual ~ICodec ()
 note: the implementation should not check whether any data remains - codecs are sometimes destroyed without completing a transfer. More...
 

Additional Inherited Members

- Protected Types inherited from CodecZLibStream
typedef int ZEXPORT(* ZLibFunc) (z_streamp strm, int flush)
 
- Protected Member Functions inherited from CodecZLibStream
 CodecZLibStream ()
 
Status CallStreamFunc (ZLibFunc func, int flush, const u8 *in, const size_t inSize, u8 *out, const size_t outSize, size_t &inConsumed, size_t &outProduced)
 
- Protected Member Functions inherited from Codec_ZLib
u32 InitializeChecksum ()
 
- Static Protected Member Functions inherited from CodecZLibStream
static Status LibError_from_zlib (int zlib_ret)
 
static void WarnIfZLibError (int zlib_ret)
 
- Protected Attributes inherited from CodecZLibStream
z_stream m_zs
 
u32 m_checksum
 

Constructor & Destructor Documentation

Compressor_ZLib::Compressor_ZLib ( )
inline
virtual Compressor_ZLib::~Compressor_ZLib ( )
inlinevirtual

Member Function Documentation

virtual Status Compressor_ZLib::Finish ( u32 checksum,
size_t &  outProduced 
)
inlinevirtual

Flush buffers and make sure all output has been produced.

Parameters
checksumChecksum over all input data.
outProduced
Returns
error status for the entire operation.

Implements ICodec.

virtual size_t Compressor_ZLib::MaxOutputSize ( size_t  inSize) const
inlinevirtual
Returns
an upper bound on the output size for the given amount of input. this is used when allocating a single buffer for the whole operation.

Implements ICodec.

virtual Status Compressor_ZLib::Process ( const u8 in,
size_t  inSize,
u8 out,
size_t  outSize,
size_t &  inConsumed,
size_t &  outProduced 
)
inlinevirtual

process (i.e.

compress or decompress) data.

Parameters
in
inSize
out
outSizeBytes remaining in the output buffer; shall not be zero.
inConsumed,outProducedHow 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.

Implements ICodec.

virtual Status Compressor_ZLib::Reset ( )
inlinevirtual

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).

Implements ICodec.


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