TUnicodeExpander Class Reference

class TUnicodeExpander : public TUnicodeCompressionState

A class to hold functions to expand text using the Standard Compression Scheme for Unicode.

A note on error handling and leaving.

Although all the public functions except the constructor can leave, it is possible to guarantee success: that is, guarantee that a call will not leave, and that expansion will be completed. To do this, (i) supply a MUnicodeSink object with a non-leaving WriteUnicodeValueL function, such as a TMemoryUnicodeSink; (ii) read input from a RReadStream with a non-leaving ReadL function; (iii) supply a big enough buffer to write the ouput; you can find out how big by calling ExpandedSizeL, using methods (i) and (ii) to guarantee success.

This guarantee of success is particularly useful when expanding from one memory buffer to another.

Inherits from

Public Member Functions
TUnicodeExpander()
IMPORT_C voidExpandL(MUnicodeSink &, RReadStream &, TInt, TInt, TInt *, TInt *)
IMPORT_C voidExpandL(MUnicodeSink &, const TUint8 *, TInt, TInt, TInt *, TInt *)
IMPORT_C TIntExpandedSizeL(RReadStream &, TInt)
IMPORT_C TIntExpandedSizeL(const TUint8 *, TInt)
IMPORT_C TIntFlushL(MUnicodeSink &, TInt, TInt &)
Private Member Functions
TBool DefineExpansionWindowL()
TBool DefineWindowL(TInt)
voidDoExpandL(MUnicodeSink *, RReadStream *, const TUint8 *, TInt, TInt, TInt *, TInt *)
voidFlushOutputBufferL()
voidHandleByteL()
TBool HandleSByteL(TUint8)
TBool HandleUByteL(TUint8)
TBool QuoteUnicodeL()
TBool ReadByteL(TUint8 &)
voidWriteChar(TText)
voidWriteChar32(TUint)
Inherited Functions
TUnicodeCompressionState::DynamicWindowBase(TInt)
TUnicodeCompressionState::DynamicWindowOffsetIndex(TUint16)
TUnicodeCompressionState::EncodeAsIs(TUint16)
TUnicodeCompressionState::Panic(TPanic)
TUnicodeCompressionState::Reset()
TUnicodeCompressionState::StaticWindowIndex(TUint16)
TUnicodeCompressionState::TUnicodeCompressionState()
Private Member Enumerations
enumanonymous { EMaxInputBufferSize = 3, EMaxOutputBufferSize = 2 }
Inherited Enumerations
TUnicodeCompressionState:@47
TUnicodeCompressionState:TPanic
Private Attributes
TUint8 iInputBuffer
TInt iInputBufferSize
TInt iInputBufferStart
const TUint8 *iInputPointer
RReadStream *iInputStream
MUnicodeSink *iOutput
TUint16 iOutputBuffer
TInt iOutputBufferSize
TInt iOutputBufferStart
Inherited Attributes
TUnicodeCompressionState::iActiveWindowBase
TUnicodeCompressionState::iCompressedBytes
TUnicodeCompressionState::iDynamicWindow
TUnicodeCompressionState::iDynamicWindowDefault
TUnicodeCompressionState::iMaxCompressedBytes
TUnicodeCompressionState::iMaxUnicodeWords
TUnicodeCompressionState::iSpecialBase
TUnicodeCompressionState::iStaticWindow
TUnicodeCompressionState::iUnicodeMode
TUnicodeCompressionState::iUnicodeWords

Constructor & Destructor Documentation

TUnicodeExpander()

IMPORT_CTUnicodeExpander()

Member Functions Documentation

DefineExpansionWindowL()

TBool DefineExpansionWindowL()[private]

DefineWindowL(TInt)

TBool DefineWindowL(TIntaIndex)[private]

Parameters

TInt aIndex

DoExpandL(MUnicodeSink *, RReadStream *, const TUint8 *, TInt, TInt, TInt *, TInt *)

voidDoExpandL(MUnicodeSink *aOutput,
RReadStream *aInputStream,
const TUint8 *aInputPointer,
TIntaMaxOutputWords,
TIntaMaxInputBytes,
TInt *aOutputWords,
TInt *aInputBytes
)[private]

Parameters

MUnicodeSink * aOutput
RReadStream * aInputStream
const TUint8 * aInputPointer
TInt aMaxOutputWords
TInt aMaxInputBytes
TInt * aOutputWords
TInt * aInputBytes

ExpandL(MUnicodeSink &, RReadStream &, TInt, TInt, TInt *, TInt *)

IMPORT_C voidExpandL(MUnicodeSink &aOutput,
RReadStream &aInput,
TIntaMaxOutputWords =  KMaxTInt ,
TIntaMaxInputBytes =  KMaxTInt ,
TInt *aOutputWords = NULL,
TInt *aInputBytes = NULL
)

Parameters

MUnicodeSink & aOutput
RReadStream & aInput
TInt aMaxOutputWords =  KMaxTInt
TInt aMaxInputBytes =  KMaxTInt
TInt * aOutputWords = NULL
TInt * aInputBytes = NULL

ExpandL(MUnicodeSink &, const TUint8 *, TInt, TInt, TInt *, TInt *)

IMPORT_C voidExpandL(MUnicodeSink &aOutput,
const TUint8 *aInput,
TIntaMaxOutputWords =  KMaxTInt ,
TIntaMaxInputBytes =  KMaxTInt ,
TInt *aOutputWords = NULL,
TInt *aInputBytes = NULL
)

Parameters

MUnicodeSink & aOutput
const TUint8 * aInput
TInt aMaxOutputWords =  KMaxTInt
TInt aMaxInputBytes =  KMaxTInt
TInt * aOutputWords = NULL
TInt * aInputBytes = NULL

ExpandedSizeL(RReadStream &, TInt)

IMPORT_C TIntExpandedSizeL(RReadStream &aInput,
TIntaInputBytes
)[static]

Parameters

RReadStream & aInput
TInt aInputBytes

ExpandedSizeL(const TUint8 *, TInt)

IMPORT_C TIntExpandedSizeL(const TUint8 *aInput,
TIntaInputBytes
)[static]

Parameters

const TUint8 * aInput
TInt aInputBytes

FlushL(MUnicodeSink &, TInt, TInt &)

IMPORT_C TIntFlushL(MUnicodeSink &aOutput,
TIntaMaxOutputWords,
TInt &aOutputWords
)

Parameters

MUnicodeSink & aOutput
TInt aMaxOutputWords
TInt & aOutputWords

FlushOutputBufferL()

voidFlushOutputBufferL()[private]

HandleByteL()

voidHandleByteL()[private]

HandleSByteL(TUint8)

TBool HandleSByteL(TUint8aByte)[private]

Parameters

TUint8 aByte

HandleUByteL(TUint8)

TBool HandleUByteL(TUint8aByte)[private]

Parameters

TUint8 aByte

QuoteUnicodeL()

TBool QuoteUnicodeL()[private]

ReadByteL(TUint8 &)

TBool ReadByteL(TUint8 &aByte)[private]

Parameters

TUint8 & aByte

WriteChar(TText)

voidWriteChar(TTextaChar)[private]

Parameters

TText aChar

WriteChar32(TUint)

voidWriteChar32(TUintaChar)[private]

Parameters

TUint aChar

Member Enumerations Documentation

Enum anonymous

Enumerators

EMaxInputBufferSize = 3
EMaxOutputBufferSize = 2

Member Data Documentation

TUint8 iInputBuffer

TUint8 iInputBuffer[private]

TInt iInputBufferSize

TInt iInputBufferSize[private]

TInt iInputBufferStart

TInt iInputBufferStart[private]

const TUint8 * iInputPointer

const TUint8 *iInputPointer[private]

RReadStream * iInputStream

RReadStream *iInputStream[private]

MUnicodeSink * iOutput

MUnicodeSink *iOutput[private]

TUint16 iOutputBuffer

TUint16 iOutputBuffer[private]

TInt iOutputBufferSize

TInt iOutputBufferSize[private]

TInt iOutputBufferStart

TInt iOutputBufferStart[private]