|
Original Symbian headers
Selected EUSER, Window Server, networking, graphics and device declarations
|
Provides general string-parsing functions suitable for numeric format conversions and syntactical-element parsing. More...
#include <e32std.h>
Public Member Functions | |
| IMPORT_C | TLex8 () |
| Default constructor. | |
| TLex8 (const TUint8 *aString) | |
| Constructs the object with a pointer to a string. | |
| TLex8 (const TDesC8 &aDes) | |
| Constructs the object with a descriptor. | |
| TLex8 & | operator= (const TUint8 *aString) |
| Allows strings to be assigned to a TLex8. | |
| TLex8 & | operator= (const TDesC8 &aDes) |
| Allows descriptors to be assigned to a TLex8. | |
| TBool | Eos () const |
| Tests whether the next character position is at the end of the string. | |
| void | Mark (TLexMark8 &aMark) const |
| Sets the supplied extraction mark to the TLex8's next character position. | |
| void | Mark () |
| Sets the TLex8's next character position to its extraction mark. | |
| IMPORT_C void | Inc () |
| Increments to the next character position. | |
| IMPORT_C void | Inc (TInt aNumber) |
| Increments the next character position by aNumber. | |
| IMPORT_C TChar | Get () |
| Gets the next character in the string, and increments the next character position. | |
| IMPORT_C TChar | Peek () const |
| Shows the next character to be returned by Get(). | |
| IMPORT_C void | UnGet () |
| Decrements the next character position, allowing a previously "got" character to be re-read. | |
| void | UnGetToMark () |
| Sets the next character position to the current extraction mark position. | |
| IMPORT_C void | UnGetToMark (const TLexMark8 aMark) |
| Sets the next character position to the supplied extraction mark position. | |
| IMPORT_C void | SkipSpace () |
| Moves the next character position past any white space (space or separator). | |
| void | SkipAndMark (TInt aNumber) |
| Moves the next character position a specified number of characters. | |
| IMPORT_C void | SkipAndMark (TInt aNumber, TLexMark8 &aMark) |
| Moves the next character position a specified number of characters and copies it to the specified extraction mark. | |
| void | SkipSpaceAndMark () |
| Moves the next character position past any white space and copies it to the TLex8's extraction mark. | |
| IMPORT_C void | SkipSpaceAndMark (TLexMark8 &aMark) |
| Moves the next character position past any white space and copies it to the specified extraction mark. | |
| IMPORT_C void | SkipCharacters () |
| Moves the next character position to the next white space (space or separator). | |
| TInt | TokenLength () const |
| Gets the length of the token. | |
| IMPORT_C TInt | TokenLength (const TLexMark8 aMark) const |
| Gets the length of the token starting at the specified extraction mark. | |
| IMPORT_C TPtrC8 | MarkedToken () const |
| Extracts the marked token. | |
| IMPORT_C TPtrC8 | MarkedToken (const TLexMark8 aMark) const |
| Extracts the token, starting at the specified mark. | |
| IMPORT_C TPtrC8 | NextToken () |
| Strips any white space and extracts the next token. | |
| IMPORT_C TPtrC8 | Remainder () const |
| Gets a descriptor containing all the text from the next character position to the end of the string. | |
| IMPORT_C TPtrC8 | RemainderFromMark () const |
| Gets a descriptor containing all the text from the current extraction mark to the end of the string. | |
| IMPORT_C TPtrC8 | RemainderFromMark (const TLexMark8 aMark) const |
| Gets a descriptor containing all the text from the specified extraction mark to the end of the string. | |
| IMPORT_C TInt | Offset () const |
| Gets the offset of the next character position from the start of the string. | |
| TInt | MarkedOffset () const |
| Gets the offset of the extraction mark from the start of the string. | |
| IMPORT_C TInt | MarkedOffset (const TLexMark8 aMark) const |
| Gets the offset of the specified extraction mark from the start of the string. | |
| IMPORT_C TInt | Val (TInt8 &aVal) |
| Parses the string to extract a signed 8-bit integer. | |
| IMPORT_C TInt | Val (TInt16 &aVal) |
| Parses the string to extract a signed 16-bit integer. | |
| IMPORT_C TInt | Val (TInt32 &aVal) |
| Parses the string to extract a signed 32-bit integer. | |
| IMPORT_C TInt | Val (TInt64 &aVal) |
| Parses the string to extract a signed 64-bit integer. | |
| TInt | Val (TInt &aVal) |
| Parses the string to extract a signed integer. | |
| IMPORT_C TInt | Val (TUint8 &aVal, TRadix aRadix) |
| Parses the string to extract an 8-bit unsigned integer, using the specified radix. | |
| IMPORT_C TInt | Val (TUint16 &aVal, TRadix aRadix) |
| Parses the string to extract a 16-bit unsigned integer, using the specified radix. | |
| IMPORT_C TInt | Val (TUint32 &aVal, TRadix aRadix) |
| Parses the string to extract a 32-bit unsigned integer, using the specified radix. | |
| IMPORT_C TInt | Val (TInt64 &aVal, TRadix aRadix) |
| Parses the string to extract a 64-bit integer (treated as unsigned), using the specified radix. | |
| TInt | Val (TUint &aVal, TRadix aRadix=EDecimal) |
| Parses the string to extract an unsigned integer, using the specified radix. | |
| IMPORT_C TInt | BoundedVal (TInt32 &aVal, TInt aLimit) |
| Parses the string to extract a 32-bit signed integer, and checks that it is within the specified limit. | |
| IMPORT_C TInt | BoundedVal (TInt64 &aVal, const TInt64 &aLimit) |
| Parses the string to extract a 64-bit signed integer, and checks that it is within the specified limit. | |
| IMPORT_C TInt | BoundedVal (TUint32 &aVal, TRadix aRadix, TUint aLimit) |
| Parses the string to extract a 32-bit unsigned integer, using the specified radix, and checks that it is within the specified limit. | |
| IMPORT_C TInt | BoundedVal (TInt64 &aVal, TRadix aRadix, const TInt64 &aLimit) |
| Parses the string to extract a 64-bit signed integer, using the specified radix, and checks that it is within the specified limit. | |
| IMPORT_C TInt | Val (TReal32 &aVal) |
| IMPORT_C TInt | Val (TReal32 &aVal, TChar aPoint) |
| IMPORT_C TInt | Val (TReal64 &aVal) |
| IMPORT_C TInt | Val (TReal64 &aVal, TChar aPoint) |
| void | Assign (const TLex8 &aLex) |
| Assigns a string to this object from another TLex8 object. | |
| IMPORT_C void | Assign (const TUint8 *aString) |
| Assigns a string to this object from another string. | |
| IMPORT_C void | Assign (const TDesC8 &aDes) |
| Assigns a string to this object from a descriptor. | |
| TInt | Val (TRealX &aVal) |
| TInt | Val (TRealX &aVal, TChar aPoint) |
| TInt | Val (TInt32 &aVal, TInt aLimit) |
| TInt | Val (TInt64 &aVal, const TInt64 &aLimit) |
| TInt | Val (TUint32 &aVal, TRadix aRadix, TUint aLimit) |
| TInt | Val (TInt64 &aVal, TRadix aRadix, const TInt64 &aLimit) |
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.
| IMPORT_C TLex8::TLex8 | ( | ) |
Default constructor.
Constructs a TLex8, initialising its members to NULL.
(generated from Symbian Developer Library)
|
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.
| aString | String to be assigned. |
(generated from Symbian Developer Library)
|
inline |
Constructs the object with a descriptor.
The extraction mark and next character members are initialised to point to the start of the string.
| aDes | Descriptor to be assigned by reference. |
(generated from Symbian Developer Library)
| IMPORT_C void TLex8::Assign | ( | const TDesC8 & | aDes | ) |
Assigns a string to this object from a descriptor.
| aDes | The descriptor to be assigned. |
(generated from Symbian Developer Library)
|
inline |
Assigns a string to this object from another TLex8 object.
| aLex | The object to be assigned. |
(generated from Symbian Developer Library)
| IMPORT_C void TLex8::Assign | ( | const TUint8 * | aString | ) |
Assigns a string to this object from another string.
| aString | A pointer to a string to be assigned. |
(generated from Symbian Developer Library)
| IMPORT_C TInt TLex8::BoundedVal | ( | TInt32 & | aVal, |
| TInt | aLimit | ||
| ) |
Parses the string to extract a 32-bit signed integer, and checks that it is within the specified limit.
| aVal | On return, contains the extracted integer. |
| aLimit | The upper limit. |
(generated from Symbian Developer Library)
| IMPORT_C TInt TLex8::BoundedVal | ( | TInt64 & | aVal, |
| const TInt64 & | aLimit | ||
| ) |
Parses the string to extract a 64-bit signed integer, and checks that it is within the specified limit.
| aVal | On return, contains the extracted integer. |
| aLimit | The upper limit. |
(generated from Symbian Developer Library)
| IMPORT_C TInt TLex8::BoundedVal | ( | TInt64 & | aVal, |
| TRadix | aRadix, | ||
| const TInt64 & | aLimit | ||
| ) |
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.
| aVal | On return, contains the extracted integer. |
| aRadix | The radix to use when converting the number. |
| aLimit | The upper limit. |
(generated from Symbian Developer Library)
| IMPORT_C TInt TLex8::BoundedVal | ( | TUint32 & | aVal, |
| TRadix | aRadix, | ||
| TUint | aLimit | ||
| ) |
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.
| aVal | On return, contains the extracted integer. |
| aRadix | The radix to use when converting the number. |
| aLimit | The upper limit. |
(generated from Symbian Developer Library)
|
inline |
Tests whether the next character position is at the end of the string.
(generated from Symbian Developer Library)
| IMPORT_C TChar TLex8::Get | ( | ) |
Gets the next character in the string, and increments the next character position.
(generated from Symbian Developer Library)
| IMPORT_C void TLex8::Inc | ( | ) |
Increments to the next character position.
Panic condition: USER 60, if the increment puts the next character position beyond the end of the string.
(generated from Symbian Developer Library)
| IMPORT_C void TLex8::Inc | ( | TInt | aNumber | ) |
Increments the next character position by aNumber.
| aNumber | The number of characters to increment the next character position by. |
Panic condition: USER 60, if the increment puts the next character position before the start or beyond the end of the string.
(generated from Symbian Developer Library)
|
inline |
Sets the TLex8's next character position to its extraction mark.
(generated from Symbian Developer Library)
|
inline |
Sets the supplied extraction mark to the TLex8's next character position.
| aMark | On return, this is set to the next character position. |
(generated from Symbian Developer Library)
|
inline |
Gets the offset of the extraction mark from the start of the string.
(generated from Symbian Developer Library)
| IMPORT_C TInt TLex8::MarkedOffset | ( | const TLexMark8 | aMark | ) | const |
Gets the offset of the specified extraction mark from the start of the string.
| aMark | Extraction mark. |
Panic condition: USER 63, if the specified mark is before the start or beyond the end of the string.
(generated from Symbian Developer Library)
| IMPORT_C TPtrC8 TLex8::MarkedToken | ( | ) | const |
Extracts the marked token.
Note that the function assumes that the current extraction mark is valid.
Panic condition: USER 63, if the specified mark is before the start or beyond the end of the string.
(generated from Symbian Developer Library)
| IMPORT_C TPtrC8 TLex8::MarkedToken | ( | const TLexMark8 | aMark | ) | const |
Extracts the token, starting at the specified mark.
| aMark | Extraction mark indicating the start of the token. |
Panic condition: USER 63, if the specified mark is before the start or beyond the end of the string.
(generated from Symbian Developer Library)
| IMPORT_C TPtrC8 TLex8::NextToken | ( | ) |
Strips any white space and extracts the next token.
(generated from Symbian Developer Library)
| IMPORT_C TInt TLex8::Offset | ( | ) | const |
Gets the offset of the next character position from the start of the string.
(generated from Symbian Developer Library)
|
inline |
Allows descriptors to be assigned to a TLex8.
| aDes | Descriptor to be assigned to the TLex8. |
(generated from Symbian Developer Library)
|
inline |
Allows strings to be assigned to a TLex8.
| aString | String to be assigned to the TLex8. |
(generated from Symbian Developer Library)
| IMPORT_C TChar TLex8::Peek | ( | ) | const |
Shows the next character to be returned by Get().
(generated from Symbian Developer Library)
| IMPORT_C TPtrC8 TLex8::Remainder | ( | ) | const |
Gets a descriptor containing all the text from the next character position to the end of the string.
Panic condition: USER 29, if the value of (next character position - extraction mark) is negative.
(generated from Symbian Developer Library)
| IMPORT_C TPtrC8 TLex8::RemainderFromMark | ( | ) | const |
Gets a descriptor containing all the text from the current extraction mark to the end of the string.
The function assumes that the current extraction mark is valid.
(generated from Symbian Developer Library)
| IMPORT_C TPtrC8 TLex8::RemainderFromMark | ( | const TLexMark8 | aMark | ) | const |
Gets a descriptor containing all the text from the specified extraction mark to the end of the string.
| aMark | Extraction mark indicating where remaining text starts. |
Panic condition: USER 29, if the value of (next character position - extraction mark) is negative.
Panic condition: USER 63, if the specified mark is before the start or beyond the end of the string.
(generated from Symbian Developer Library)
|
inline |
Moves the next character position a specified number of characters.
| aNumber | Number of characters to skip. |
Panic condition: USER 61, if the skip moves the next character position either to before the start or beyond the end of the string.
(generated from Symbian Developer Library)
| IMPORT_C void TLex8::SkipAndMark | ( | TInt | aNumber, |
| TLexMark8 & | aMark | ||
| ) |
Moves the next character position a specified number of characters and copies it to the specified extraction mark.
| aNumber | Number of characters to skip. |
| aMark | On return, set to the next character position. |
Panic condition: USER 61, if the skip moves the next character position either to before the start or beyond the end of the string.
(generated from Symbian Developer Library)
| IMPORT_C void TLex8::SkipCharacters | ( | ) |
Moves the next character position to the next white space (space or separator).
Stops if at the end of the string.
(generated from Symbian Developer Library)
| IMPORT_C void TLex8::SkipSpace | ( | ) |
Moves the next character position past any white space (space or separator).
Stops if at the end of string.
(generated from Symbian Developer Library)
|
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.
(generated from Symbian Developer Library)
| IMPORT_C void TLex8::SkipSpaceAndMark | ( | TLexMark8 & | 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.
| aMark | On return, contains a reference to the next character position. |
(generated from Symbian Developer Library)
|
inline |
Gets the length of the token.
This is the difference between the next character position and the extraction mark.
(generated from Symbian Developer Library)
| IMPORT_C TInt TLex8::TokenLength | ( | const TLexMark8 | aMark | ) | const |
Gets the length of the token starting at the specified extraction mark.
| aMark | Extraction mark indicating the start of the token. |
Panic condition: USER 63, if the specified mark is before the start or beyond the end of the string.
(generated from Symbian Developer Library)
| IMPORT_C void TLex8::UnGet | ( | ) |
Decrements the next character position, allowing a previously "got" character to be re-read.
Panic condition: USER 59, if the previous character is before the start of the string.
(generated from Symbian Developer Library)
|
inline |
Sets the next character position to the current extraction mark position.
Panic condition: USER 63, if the extraction mark is before the start or beyond the end of the string.
(generated from Symbian Developer Library)
| IMPORT_C void TLex8::UnGetToMark | ( | const TLexMark8 | aMark | ) |
Sets the next character position to the supplied extraction mark position.
| aMark | Mark to copy to the next character position. |
Panic condition: USER 63, if the extraction mark is before the start or beyond the end of the string.
(generated from Symbian Developer Library)
|
inline |
Parses the string to extract a signed integer.
| aVal | On return, contains the extracted integer. |
(generated from Symbian Developer Library)
| IMPORT_C TInt TLex8::Val | ( | TInt16 & | aVal | ) |
Parses the string to extract a signed 16-bit integer.
| aVal | On return, contains the extracted integer. |
(generated from Symbian Developer Library)
| IMPORT_C TInt TLex8::Val | ( | TInt32 & | aVal | ) |
Parses the string to extract a signed 32-bit integer.
| aVal | On return, contains the extracted integer. |
(generated from Symbian Developer Library)
|
inline |
| IMPORT_C TInt TLex8::Val | ( | TInt64 & | aVal | ) |
Parses the string to extract a signed 64-bit integer.
| aVal | On return, contains the extracted integer. |
(generated from Symbian Developer Library)
|
inline |
| IMPORT_C TInt TLex8::Val | ( | TInt64 & | aVal, |
| TRadix | aRadix | ||
| ) |
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.
| aVal | On return, contains the extracted integer. |
| aRadix | The radix to use when converting the number. |
(generated from Symbian Developer Library)
|
inline |
| IMPORT_C TInt TLex8::Val | ( | TInt8 & | aVal | ) |
Parses the string to extract a signed 8-bit integer.
| aVal | On return, contains the extracted integer. |
(generated from Symbian Developer Library)
| IMPORT_C TInt TLex8::Val | ( | TReal32 & | aVal | ) |
| IMPORT_C TInt TLex8::Val | ( | TReal32 & | aVal, |
| TChar | aPoint | ||
| ) |
| IMPORT_C TInt TLex8::Val | ( | TReal64 & | aVal | ) |
| IMPORT_C TInt TLex8::Val | ( | TReal64 & | aVal, |
| TChar | aPoint | ||
| ) |
| TInt TLex8::Val | ( | TRealX & | aVal | ) |
|
inline |
Parses the string to extract an unsigned integer, using the specified radix.
| 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. |
(generated from Symbian Developer Library)
| IMPORT_C TInt TLex8::Val | ( | TUint16 & | aVal, |
| TRadix | aRadix | ||
| ) |
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.
| aVal | On return, contains the extracted integer. |
| aRadix | The radix to use when converting the number. |
(generated from Symbian Developer Library)
| IMPORT_C TInt TLex8::Val | ( | TUint32 & | aVal, |
| TRadix | aRadix | ||
| ) |
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.
| aVal | On return, contains the extracted integer. |
| aRadix | The radix to use when converting the number. |
(generated from Symbian Developer Library)
|
inline |
| IMPORT_C TInt TLex8::Val | ( | TUint8 & | aVal, |
| TRadix | aRadix | ||
| ) |
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.
| aVal | On return, contains the extracted integer. |
| aRadix | The radix to use when converting the number. |
(generated from Symbian Developer Library)