#include <e32std.h>
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.
See also: TLex
IMPORT_C | TLex16 | ( | ) |
Default cosntructor.
Constructs a TLex16, initialising its members to NULL.
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.
Parameters | |
---|---|
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.
Parameters | |
---|---|
aDes | Descriptor to be assigned by reference. |
IMPORT_C void | Assign | ( | const TUint16 * | aString | ) |
Assigns a string to this object from another string.
Parameters | |
---|---|
aString | A pointer to a string to be assigned. |
IMPORT_C void | Assign | ( | const TDesC16 & | aDes | ) |
Assigns a string to this object from a descriptor.
Parameters | |
---|---|
aDes | The descriptor to be assigned. |
Parses the string to extract a 32-bit signed integer, and checks that it is within the specified limit.
Parameters | |
---|---|
aVal | On return, contains the extracted integer. |
aLimit | The upper limit. |
Parses the string to extract a 64-bit signed integer, and checks that it is within the specified limit.
Parameters | |
---|---|
aVal | On return, contains the extracted integer. |
aLimit | The upper limit. |
Parses the string to extract a 32-bit unsigned integer, using the specified radix, and checks that it is within the specified limit.
The specified radix is one of binary, octal, decimal, or hexadecimal.
Parameters | |
---|---|
aVal | On return, contains the extracted integer. |
aRadix | The radix to use when converting the number. |
aLimit | The upper limit. |
Parses the string to extract a 64-bit signed integer, using the specified radix, and checks that it is within the specified limit.
The specified radix is one of binary, octal, decimal, or hexadecimal.
Parameters | |
---|---|
aVal | On return, contains the extracted integer. |
aRadix | The radix to use when converting the number. |
aLimit | The upper limit. |
TBool | Eos | ( | ) | const [inline] |
Tests whether the next character position is at the end of the string.
IMPORT_C TChar | Get | ( | ) |
Gets the next character in the string and increments the next character position.
IMPORT_C void | Inc | ( | ) |
Increments to the next character position.
Panic Codes | |
---|---|
USER | 65, if the increment puts the next character position before the start or beyond the end of the string. |
IMPORT_C void | Inc | ( | TInt | aNumber | ) |
Increments the next character position by aNumber.
Parameters | |
---|---|
aNumber | The number of characters to increment the next character position by. |
Panic Codes | |
---|---|
USER | 65, if the increment puts the next character position before the start or beyond the end of the string. |
void | Mark | ( | TLexMark16 & | aMark | ) | const [inline] |
Sets the supplied extraction mark to the TLex16's next character position.
Parameters | |
---|---|
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.
IMPORT_C TInt | MarkedOffset | ( | const TLexMark16 | aMark | ) | const |
Gets the offset of the specified extraction mark from the start of the string.
Parameters | |
---|---|
aMark | Extraction mark. |
Panic Codes | |
---|---|
USER | 68, if the specified mark is before the start or beyond the end of the string. |
IMPORT_C TPtrC16 | MarkedToken | ( | ) | const |
Extracts the marked token.
Note that the function assumes that the current extraction mark is valid.
Panic Codes | |
---|---|
USER | 68, if the specified mark is before the start or beyond the end of the string. |
IMPORT_C TPtrC16 | MarkedToken | ( | const TLexMark16 | aMark | ) | const |
Extracts the token, starting at the specified mark
Parameters | |
---|---|
aMark | Extraction mark indicating the start of the token. |
Panic Codes | |
---|---|
USER | 68, if the specified mark is before the start or beyond the end of the string. |
IMPORT_C TPtrC16 | NextToken | ( | ) |
Strips any white space and extracts the next token.
IMPORT_C TInt | Offset | ( | ) | const |
Gets the offset of the next character position from the start of the string.
IMPORT_C TChar | Peek | ( | ) | const |
IMPORT_C TPtrC16 | Remainder | ( | ) | const |
Gets a descriptor containing all the text from the next character position to the end of the string.
Panic Codes | |
---|---|
USER | 17, if the value of (next character position - extraction mark) is negative. |
IMPORT_C TPtrC16 | RemainderFromMark | ( | ) | const |
Gets a descriptor containing all the text from the extraction mark to the end of the string.
The function assumes that the current extraction mark is valid.
IMPORT_C TPtrC16 | RemainderFromMark | ( | const TLexMark16 | aMark | ) | const |
Gets a descriptor containing all the text from the specified extraction mark to the end of the string.
Parameters | |
---|---|
aMark | Extraction mark indicating where remaining text starts. |
Panic Codes | |
---|---|
USER | 17, if the value of (next character position - extraction mark) is negative. |
USER | 68, if the specified mark is before the start or beyond the end of the string. |
void | SkipAndMark | ( | TInt | aNumber | ) | [inline] |
Moves the next character position a specified number of characters.
Parameters | |
---|---|
aNumber | Number of characters to skip. |
Panic Codes | |
---|---|
USER | 68, if the skip moves the next character position either to before the start or beyond the end of the string. |
IMPORT_C void | SkipAndMark | ( | TInt | aNumber, |
TLexMark16 & | aMark | |||
) |
Moves the next character position a specified number of characters and copies it to the specified extraction mark.
Parameters | |
---|---|
aNumber | Number of characters to skip. |
aMark | On return, set to the next character position. |
Panic Codes | |
---|---|
USER | 66, if the skip moves the next character position either to before the start or beyond the end of the string. |
IMPORT_C void | SkipCharacters | ( | ) |
Moves the next character position to the next white space (space or separator).
Stops if at the end of the string.
IMPORT_C void | SkipSpace | ( | ) |
Moves the next character position past any white space (space or separator).
Stops if at the end of string.
IMPORT_C void | SkipSpaceAndMark | ( | TLexMark16 & | aMark | ) |
Moves the next character position past any white space and copies it to the specified extraction mark.
Stops if at the end of the string.
Parameters | |
---|---|
aMark | On return, contains a reference to the next character position. |
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.
IMPORT_C TInt | TokenLength | ( | const TLexMark16 | aMark | ) | const |
Gets the length of the token starting at the specified extraction mark.
Parameters | |
---|---|
aMark | Extraction mark indicating the start of the token. |
Panic Codes | |
---|---|
USER | 68, if the specified mark is before the start or beyond the end of the string. |
IMPORT_C void | UnGet | ( | ) |
Decrements the next character position, allowing the previously "got" character to be re-read.
Panic Codes | |
---|---|
USER | 64, if the previous character is before the start of the string. |
void | UnGetToMark | ( | ) | [inline] |
Sets the next character position to the current extraction mark position.
Panic Codes | |
---|---|
USER | 68, if the specified mark is before the start or beyond the end of the string. |
IMPORT_C void | UnGetToMark | ( | const TLexMark16 | aMark | ) |
Sets the next character position to the supplied extraction mark position.
Parameters | |
---|---|
aMark | Mark to copy to the next character position. |
Panic Codes | |
---|---|
USER | 68, if the extraction mark is before the start or beyond the end of the string. |
Parses the string to extract a signed 8-bit integer.
Parameters | |
---|---|
aVal | On return, contains the extracted integer. |
Parses the string to extract a signed 16-bit integer.
Parameters | |
---|---|
aVal | On return, contains the extracted integer. |
Parses the string to extract a signed 32-bit integer.
Parameters | |
---|---|
aVal | On return, contains the extracted integer. |
Parses the string to extract a signed 64-bit integer.
Parameters | |
---|---|
aVal | On return, contains the extracted integer. |
Parses the string to extract a signed integer.
Parameters | |
---|---|
aVal | On return, contains the extracted integer. |
Parses the string to extract an 8-bit unsigned integer, using the specified radix.
The specified radix is one of binary, octal, decimal, or hexadecimal.
Parameters | |
---|---|
aVal | On return, contains the extracted integer. |
aRadix | The radix to use when converting the number. |
Parses the string to extract a 16-bit unsigned integer, using the specified radix.
The specified radix is one of binary, octal, decimal, or hexadecimal.
Parameters | |
---|---|
aVal | On return, contains the extracted integer. |
aRadix | The radix to use when converting the number. |
Parses the string to extract a 32-bit unsigned integer, using the specified radix.
The specified radix is one of binary, octal, decimal, or hexadecimal.
Parameters | |
---|---|
aVal | On return, contains the extracted integer. |
aRadix | The radix to use when converting the number. |
Parses the string to extract a 64-bit integer (treated as unsigned), using the specified radix.
The specified radix is one of binary, octal, decimal, or hexadecimal.
Parameters | |
---|---|
aVal | On return, contains the extracted integer. |
aRadix | The radix to use when converting the number. |
Parses the string to extract an unsigned integer, using the specified radix.
Parameters | |
---|---|
aVal | On return, contains the extracted integer. |
aRadix | The radix to use when converting the number. The default radix for this function overload is decimal. |
DeprecatedUse BoundedVal(TInt64& aVal,const TInt64& aLimit)
DeprecatedUse BoundedVal(TUint32& aVal,TRadix aRadix,TUint aLimit)
void | __DbgTest | ( | TAny * | aPtr | ) | const |