CEZCompressor Class Reference

class CEZCompressor : public CEZZStream

The CEZCompressor class provides in-memory compression functions, including integrity checks of the uncompressed data. This version of the library supports only one compression method (deflation). Compression can be done in a single step (using CompressL()) if the buffers are large enough (for example if an input file is mmap'ed), or can be done by repeated calls of the DeflateL() function. The source data is compressed to the target buffer (both source and target contained within the buffer manager argument), and various other arguments distinguish the different compression settings.

Note: In this version of the library a windowBits value of 8 is unsupported due to a problem with the window size being set to 256 bytes. Although a value of 8 will be accepted by the CEZCompressor constructors, as it is being changed internally by Zlib from 8 to 9, it will not be possible to use the same value for decompression. This is because the Zlib functions called by the CEZDecompressor constructors do not make the same change internally and as a result a KEZlibErrData is returned when calling InflateL(). It is therefore advised that for this version of the library windowBits of 9 is used in place of 8.

Inherits from

Public Member Functions
~CEZCompressor()
IMPORT_C voidCompressL(TDes8 &, const TDesC8 &, TInt)
IMPORT_C TBoolDeflateL()
IMPORT_C CEZCompressor *NewL(MEZBufferManager &, TInt, TInt, TInt, TStrategy)
IMPORT_C CEZCompressor *NewL(MEZBufferManager &, const TDesC8 &, TInt, TInt, TInt, TStrategy)
IMPORT_C CEZCompressor *NewLC(MEZBufferManager &, TInt, TInt, TInt, TStrategy)
IMPORT_C CEZCompressor *NewLC(MEZBufferManager &, const TDesC8 &, TInt, TInt, TInt, TStrategy)
IMPORT_C voidResetL(MEZBufferManager &)
Private Member Functions
CEZCompressor(MEZBufferManager *)
voidConstructL(TInt, const TUint8 *, TInt, TInt, TInt, TStrategy)
voidConstructL(TInt, TInt, TInt, TStrategy)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
CEZZStream::Adler32()const
CEZZStream::AvailIn()const
CEZZStream::AvailOut()const
CEZZStream::CEZZStream()
CEZZStream::OutputDescriptor()const
CEZZStream::Progress(TInt)const
CEZZStream::SetInput(const TDesC8 &)
CEZZStream::SetOutput(TDes8 &)
CEZZStream::TotalIn()const
CEZZStream::TotalOut()const
Public Member Enumerations
enumanonymous { EDefaultCompression = Z_DEFAULT_COMPRESSION, ENoCompression = Z_NO_COMPRESSION, EBestSpeed = Z_BEST_SPEED, EBestCompression = Z_BEST_COMPRESSION }
enumanonymous { EMaxWBits = MAX_WBITS }
enumanonymous { EDefMemLevel = MAX_MEM_LEVEL }
enumanonymous { EDeflateInitlialiserError = EUnexpected + 1, EDeflateTerminated }
enumTStrategy { EDefaultStrategy = Z_DEFAULT_STRATEGY, EFiltered = Z_FILTERED, EHuffmanOnly = Z_HUFFMAN_ONLY }
Private Member Enumerations
enumTDeflationState { ENoFlush, EFinish, EFinalize, ETerminated }
Inherited Enumerations
CEZZStream:@176
Private Attributes
MEZBufferManager *iBufferInit
TDeflationState iDeflationState
Inherited Attributes
CEZZStream::iOutputBufferLength
CEZZStream::iOutputPointer
CEZZStream::iStream

Constructor & Destructor Documentation

CEZCompressor(MEZBufferManager *)

CEZCompressor(MEZBufferManager *aInit)[private]

Parameters

MEZBufferManager * aInit

~CEZCompressor()

~CEZCompressor()

Member Functions Documentation

CompressL(TDes8 &, const TDesC8 &, TInt)

IMPORT_C voidCompressL(TDes8 &aDestination,
const TDesC8 &aSource,
TIntaLevel = EDefaultCompression
)[static]

Parameters

TDes8 & aDestination
const TDesC8 & aSource
TInt aLevel = EDefaultCompression

ConstructL(TInt, const TUint8 *, TInt, TInt, TInt, TStrategy)

voidConstructL(TIntaLevel,
const TUint8 *aDictionary,
TIntaLength,
TIntaWindowBits,
TIntaMemLevel,
TStrategyaStrategy
)[private]

Parameters

TInt aLevel
const TUint8 * aDictionary
TInt aLength
TInt aWindowBits
TInt aMemLevel
TStrategy aStrategy

ConstructL(TInt, TInt, TInt, TStrategy)

voidConstructL(TIntaLevel,
TIntaWindowBits,
TIntaMemLevel,
TStrategyaStrategy
)[private]

Parameters

TInt aLevel
TInt aWindowBits
TInt aMemLevel
TStrategy aStrategy

DeflateL()

IMPORT_C TBoolDeflateL()

NewL(MEZBufferManager &, TInt, TInt, TInt, TStrategy)

IMPORT_C CEZCompressor *NewL(MEZBufferManager &aInit,
TIntaLevel = EDefaultCompression,
TIntaWindowBits = EMaxWBits,
TIntaMemLevel = EDefMemLevel,
TStrategyaStrategy = EDefaultStrategy
)[static]

Parameters

MEZBufferManager & aInit
TInt aLevel = EDefaultCompression
TInt aWindowBits = EMaxWBits
TInt aMemLevel = EDefMemLevel
TStrategy aStrategy = EDefaultStrategy

NewL(MEZBufferManager &, const TDesC8 &, TInt, TInt, TInt, TStrategy)

IMPORT_C CEZCompressor *NewL(MEZBufferManager &aInit,
const TDesC8 &aDictionary,
TIntaLevel = EDefaultCompression,
TIntaWindowBits = EMaxWBits,
TIntaMemLevel = EDefMemLevel,
TStrategyaStrategy = EDefaultStrategy
)[static]

Parameters

MEZBufferManager & aInit
const TDesC8 & aDictionary
TInt aLevel = EDefaultCompression
TInt aWindowBits = EMaxWBits
TInt aMemLevel = EDefMemLevel
TStrategy aStrategy = EDefaultStrategy

NewLC(MEZBufferManager &, TInt, TInt, TInt, TStrategy)

IMPORT_C CEZCompressor *NewLC(MEZBufferManager &aInit,
TIntaLevel = EDefaultCompression,
TIntaWindowBits = EMaxWBits,
TIntaMemLevel = EDefMemLevel,
TStrategyaStrategy = EDefaultStrategy
)[static]

Parameters

MEZBufferManager & aInit
TInt aLevel = EDefaultCompression
TInt aWindowBits = EMaxWBits
TInt aMemLevel = EDefMemLevel
TStrategy aStrategy = EDefaultStrategy

NewLC(MEZBufferManager &, const TDesC8 &, TInt, TInt, TInt, TStrategy)

IMPORT_C CEZCompressor *NewLC(MEZBufferManager &aInit,
const TDesC8 &aDictionary,
TIntaLevel = EDefaultCompression,
TIntaWindowBits = EMaxWBits,
TIntaMemLevel = EDefMemLevel,
TStrategyaStrategy = EDefaultStrategy
)[static]

Parameters

MEZBufferManager & aInit
const TDesC8 & aDictionary
TInt aLevel = EDefaultCompression
TInt aWindowBits = EMaxWBits
TInt aMemLevel = EDefMemLevel
TStrategy aStrategy = EDefaultStrategy

ResetL(MEZBufferManager &)

IMPORT_C voidResetL(MEZBufferManager &aInit)

Parameters

MEZBufferManager & aInit

Member Enumerations Documentation

Enum anonymous

Compression levels

Enumerators

EDefaultCompression = Z_DEFAULT_COMPRESSION
ENoCompression = Z_NO_COMPRESSION
EBestSpeed = Z_BEST_SPEED
EBestCompression = Z_BEST_COMPRESSION

Enum anonymous

Window Bits - the base two logarithm of the window size (the size of the history buffer)

Enumerators

EMaxWBits = MAX_WBITS

Enum anonymous

Memory level - specifies how much memory should be allocated for the internal compression state

Enumerators

EDefMemLevel = MAX_MEM_LEVEL

Enum anonymous

Compression panic values

Enumerators

EDeflateInitlialiserError = EUnexpected + 1
EDeflateTerminated

Enum TDeflationState

Enumerators

ENoFlush
EFinish
EFinalize
ETerminated

Enum TStrategy

Compression strategy - used to tune the compression algorithm

Enumerators

EDefaultStrategy = Z_DEFAULT_STRATEGY

Use for normal data

EFiltered = Z_FILTERED

Use for data produced by a filter (or predictor)

EHuffmanOnly = Z_HUFFMAN_ONLY

Force Huffman encoding only (no string match)

Member Data Documentation

MEZBufferManager * iBufferInit

MEZBufferManager *iBufferInit[private]

TDeflationState iDeflationState

TDeflationState iDeflationState[private]