class TLex8 |
Provides general string-parsing functions suitable for numeric format conversions and syntactical-element parsing.
The class is the 8-bit variant for non-Unicode strings and 8-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 | ScndigAfterPoint(TInt &, TUint64 &) |
void | ValidateMark(const TLexMark8) |
Private Attributes | |
---|---|
__DECLARE_TEST | |
const TUint8 * | iBuf |
const TUint8 * | iEnd |
TLexMark8 | iMark |
const TUint8 * | iNext |
TLex8 | ( | const TUint8 * | 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 TUint8 * aString | String to be assigned. |
TLex8 | ( | const TDesC8 & | 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 TDesC8 & aDes | Descriptor to be assigned by reference. |
void | Assign | ( | const TLex8 & | aLex | ) | [inline] |
Assigns a string to this object from another TLex8 object.
const TLex8 & aLex | The object to be assigned. |
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 | ( | TLexMark8 & | aMark | ) | const [inline] |
Sets the supplied extraction mark to the TLex8's next character position.
TLexMark8 & aMark | On return, this is 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 TLexMark8 | aMark | ) | const |
const TLexMark8 aMark |
IMPORT_C TPtrC8 | MarkedToken | ( | const TLexMark8 | aMark | ) | const |
const TLexMark8 aMark |
IMPORT_C TPtrC8 | RemainderFromMark | ( | const TLexMark8 | aMark | ) | const |
const TLexMark8 aMark |
void | SkipAndMark | ( | TInt | aNumber | ) | [inline] |
Moves the next character position a specified number of characters.
panic
USER 61, 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. |
void | SkipSpaceAndMark | ( | ) | [inline] |
Moves the next character position past any white space and copies it to the TLex8's extraction mark.
Stops if at the end of the string.
IMPORT_C void | SkipSpaceAndMark | ( | TLexMark8 & | aMark | ) |
TLexMark8 & aMark |
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 TLexMark8 | aMark | ) | const |
const TLexMark8 aMark |
void | UnGetToMark | ( | ) | [inline] |
Sets the next character position to the current extraction mark position.
panic
USER 63, if the extraction mark is before the start or beyond the end of the string.
IMPORT_C void | UnGetToMark | ( | const TLexMark8 | aMark | ) |
const TLexMark8 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 TLexMark8 | aMark | ) | const [private] |
const TLexMark8 aMark |
TLex8 & | operator= | ( | const TUint8 * | aString | ) | [inline] |
const TUint8 * aString | String to be assigned to the TLex8. |
TLex8 & | operator= | ( | const TDesC8 & | aDes | ) | [inline] |
const TDesC8 & aDes | Descriptor to be assigned to the TLex8. |