TUtf32Iterator Class Reference

class TUtf32Iterator

Constructor & Destructor Documentation

TUtf32Iterator(const TText16 *, const TText16 *, TInt)

TUtf32Iterator ( const TText16 * aStart,
const TText16 * aEnd,
TInt aOffset = 0
)
Construct iterator given UTF16 encoded byte array.
panic
EGdiPanic_InvalidInputParam Raised when array start if passed the array end.

Parameters

const TText16 * aStart Start address of the array.
const TText16 * aEnd Address of the byte just beyond the end of the array.
TInt aOffset = 0 Optional UTF16 offset into the array to initialise the current position to.

Member Functions Documentation

AtEnd()

TBool AtEnd ( ) const [inline]

BeforeStart()

TBool BeforeStart ( ) const [inline]

CurrentPosition()

const TText16 * CurrentPosition ( ) const

Get()

TChar Get ( ) const [inline]

Get(TInt)

TUint Get ( TInt offset )
Returns the UTF32 char value at the offset specified. 0xFFFF may be returned for unpaired surrogate and noncharacters. Does not change the current position.
panic
EGdiPanic_OutOfText Raised when offset found to be outside the bounds of the original text array.

Parameters

TInt offset UTF16 offset from current iterator position to get UTF32 char form.

GetThenNext()

TChar GetThenNext ( )
Return the UTF32 value at the current position.
panic
EGdiPanic_EndOfText Raised when current iterator position is not valid.

GetThenPrev()

TChar GetThenPrev ( )
Return the UTF32 value at the current position.
panic
EGdiPanic_EndOfText Raised when current iterator position is not valid.

LengthToEnd()

TInt LengthToEnd ( ) const

Returns the number of remaining TText16 codes still ahead of the iterator.

LengthToStart()

TInt LengthToStart ( ) const

Returns the number of TText16 codes between the start point and its current position.

Next()

TChar Next ( )
Moves the iterator forward to the next valid UTF32 character value.
panic
EGdiPanic_OutOfText Raised when there is no next position to move to.

Prev()

TChar Prev ( )
Moves the iterator backwards to the next valid UTF32 character value.
panic
EGdiPanic_OutOfText Raised when there is no next position to move to.

SetCurrentPosition(const TText16 *)

void SetCurrentPosition ( const TText16 * )

Parameters

const TText16 *

SetPos(TInt)

void SetPos ( TInt aOffset )
Moves the iterator to the position specified by array start+offset.
panic
EGdiPanic_OutOfText Raised when there is no next position to move to.

Parameters

TInt aOffset UTF16 offset into the array to set the current position to.

UTF16ToTChar(const TText16 *)

TUint UTF16ToTChar ( const TText16 * a ) [private]

This routine takes an encoded UTF16 byte array and decodes the first character at the start of the array and returns it as a TChar . If the char is "not a char" character 0xFFFF results.

Parameters

const TText16 * a UTF16 byte array to be decoded.

Member Data Documentation

TChar iChar

TChar iChar [private]

UTF32 value of the character at the current iterator position

const TText16 * iCurrent

const TText16 * iCurrent [private]

Address of current position in array

const TText16 * iEnd

const TText16 * iEnd [private]

Address of the first entry past the end of the array

const TText16 * iStart

const TText16 * iStart [private]

Start address of the UTF16 array