class TLex16 |
Provides general string-parsing functions suitable for numeric format conversions and syntactical-element parsing.
The class is the 16-bit variant for Unicode strings and 16-bit wide characters.
An instance of this class stores a string, maintaining an extraction mark to indicate the current lexical element being analysed and a pointer to the next character to be examined.
Objects of this type are normally accessed through the build independent type TLex.
Private Member Functions | |
---|---|
void | Scndig(TInt &, TInt &, TUint64 &) |
void | ValidateMark(const TLexMark16) |
Private Attributes | |
---|---|
__DECLARE_TEST | |
const TUint16 * | iBuf |
const TUint16 * | iEnd |
TLexMark16 | iMark |
const TUint16 * | iNext |
TLex16 | ( | const TUint16 * | aString | ) | [inline] |
Constructs the object with a pointer to a string.
The extraction mark and next character members are initialised to point to the start of the string.
const TUint16 * aString | String to be assigned. |
TLex16 | ( | const TDesC16 & | aDes | ) | [inline] |
Constructs the object with a descriptor.
The extraction mark and next character members are initialised to point to the start of the string.
const TDesC16 & aDes | Descriptor to be assigned by reference. |
void | Assign | ( | const TLex16 & | aLex | ) | [inline] |
Assigns a string to this object from another TLex16 object.
const TLex16 & aLex | The object to be assigned. |
IMPORT_C void | Assign | ( | const TUint16 * | aString | ) |
const TUint16 * aString |
IMPORT_C TInt | BoundedVal | ( | TUint32 & | aVal, |
TRadix | aRadix, | |||
TUint | aLimit | |||
) |
IMPORT_C TInt | BoundedVal | ( | TInt64 & | aVal, |
TRadix | aRadix, | |||
const TInt64 & | aLimit | |||
) |
TBool | Eos | ( | ) | const [inline] |
Tests whether the next character position is at the end of the string.
True if at end of string, false otherwise.
void | Mark | ( | TLexMark16 & | aMark | ) | const [inline] |
Sets the supplied extraction mark to the TLex16's next character position.
TLexMark16 & aMark | On return, set to the next character position. |
TInt | MarkedOffset | ( | ) | const [inline] |
Gets the offset of the extraction mark from the start of the string.
The offset of the extraction mark.
IMPORT_C TInt | MarkedOffset | ( | const TLexMark16 | aMark | ) | const |
const TLexMark16 aMark |
IMPORT_C TPtrC16 | MarkedToken | ( | const TLexMark16 | aMark | ) | const |
const TLexMark16 aMark |
IMPORT_C TPtrC16 | RemainderFromMark | ( | const TLexMark16 | aMark | ) | const |
const TLexMark16 aMark |
void | SkipAndMark | ( | TInt | aNumber | ) | [inline] |
Moves the next character position a specified number of characters.
panic
USER 68, if the skip moves the next character position either to before the start or beyond the end of the string.
TInt aNumber | Number of characters to skip. |
IMPORT_C void | SkipAndMark | ( | TInt | aNumber, |
TLexMark16 & | aMark | |||
) |
TInt aNumber | |
TLexMark16 & aMark |
IMPORT_C void | SkipSpaceAndMark | ( | TLexMark16 & | aMark | ) |
TLexMark16 & aMark |
void | SkipSpaceAndMark | ( | ) | [inline] |
Moves the next character position past any white space and copies it to the TLex16's extraction mark.
Stops if at the end of the string.
TInt | TokenLength | ( | ) | const [inline] |
Gets the length of the token.
This is the difference between the next character position and the extraction mark.
Length of the token.
IMPORT_C TInt | TokenLength | ( | const TLexMark16 | aMark | ) | const |
const TLexMark16 aMark |
void | UnGetToMark | ( | ) | [inline] |
Sets the next character position to the current extraction mark position.
panic
USER 68, if the specified mark is before the start or beyond the end of the string.
IMPORT_C void | UnGetToMark | ( | const TLexMark16 | aMark | ) |
const TLexMark16 aMark |
TInt | Val | ( | TInt & | aVal | ) | [inline] |
Parses the string to extract a signed integer.
KErrNone if successful. KErrGeneral if the next character position is initially at the end of the string or no valid characters found initially. KErrOverflow if there is sign overflow, i.e. converted value greater than limit. If error codes KErrGeneral or KErrOverflow are returned, the object's members are left unaltered.
TInt & aVal | On return, contains the extracted integer. |
TInt | Val | ( | TUint & | aVal, |
TRadix | aRadix = EDecimal | |||
) | [inline] |
Parses the string to extract an unsigned integer, using the specified radix.
KErrNone if successful. KErrGeneral if the next character position is initially at the end of the string or no valid characters found initially. KErrOverflow if there is sign overflow, i.e. converted value greater than limit. If error codes KErrGeneral or KErrOverflow are returned, the object's members are left unaltered.
TInt | Val | ( | TInt64 & | aVal, |
TRadix | aRadix, | |||
const TInt64 & | aLimit | |||
) | [inline] |
void | ValidateMark | ( | const TLexMark16 | aMark | ) | const [private] |
const TLexMark16 aMark |
TLex16 & | operator= | ( | const TUint16 * | aString | ) | [inline] |
const TUint16 * aString | String to be assigned to the TLex16. |
TLex16 & | operator= | ( | const TDesC16 & | aDes | ) | [inline] |
const TDesC16 & aDes | Descriptor to be assigned to the TLex16. |