Original Symbian headers
Selected EUSER, Window Server, networking, graphics and device declarations
Loading...
Searching...
No Matches
TLex16 Class Reference

Provides general string-parsing functions suitable for numeric format conversions and syntactical-element parsing. More...

#include <e32std.h>

Public Member Functions

IMPORT_C TLex16 ()
 Default cosntructor.
 
 TLex16 (const TUint16 *aString)
 Constructs the object with a pointer to a string.
 
 TLex16 (const TDesC16 &aDes)
 Constructs the object with a descriptor.
 
TLex16 & operator= (const TUint16 *aString)
 Allows strings to be assigned to a TLex16.
 
TLex16 & operator= (const TDesC16 &aDes)
 Allows descriptors to be assigned to a TLex16.
 
TBool Eos () const
 Tests whether the next character position is at the end of the string.
 
void Mark ()
 Sets the TLex16's next character position to its extraction mark.
 
void Mark (TLexMark16 &aMark) const
 Sets the supplied extraction mark to the TLex16's next character position.
 
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 the 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 TLexMark16 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, TLexMark16 &aMark)
 Moves the next character position a specified number of characters and copies it to the specified extraction mark.
 
IMPORT_C void SkipSpaceAndMark (TLexMark16 &aMark)
 Moves the next character position past any white space and copies it to the specified extraction mark.
 
void SkipSpaceAndMark ()
 Moves the next character position past any white space and copies it to the TLex16's 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 TLexMark16 aMark) const
 Gets the length of the token starting at the specified extraction mark.
 
IMPORT_C TPtrC16 MarkedToken () const
 Extracts the marked token.
 
IMPORT_C TPtrC16 MarkedToken (const TLexMark16 aMark) const
 Extracts the token, starting at the specified mark.
 
IMPORT_C TPtrC16 NextToken ()
 Strips any white space and extracts the next token.
 
IMPORT_C TPtrC16 Remainder () const
 Gets a descriptor containing all the text from the next character position to the end of the string.
 
IMPORT_C TPtrC16 RemainderFromMark () const
 Gets a descriptor containing all the text from the extraction mark to the end of the string.
 
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.
 
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 TLexMark16 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 TLex16 &aLex)
 Assigns a string to this object from another TLex16 object.
 
IMPORT_C void Assign (const TUint16 *aString)
 Assigns a string to this object from another string.
 
IMPORT_C void Assign (const TDesC16 &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)
 

Detailed Description

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
API status
Published to all clients. Released API.

Definition at line 1329 of file e32std.h.

Constructor & Destructor Documentation

◆ TLex16() [1/3]

IMPORT_C TLex16::TLex16 ( )

Default cosntructor.

Constructs a TLex16, initialising its members to NULL.

(generated from Symbian Developer Library)

◆ TLex16() [2/3]

TLex16::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
aStringString to be assigned.

(generated from Symbian Developer Library)

◆ TLex16() [3/3]

TLex16::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
aDesDescriptor to be assigned by reference.

(generated from Symbian Developer Library)

Member Function Documentation

◆ Assign() [1/3]

IMPORT_C void TLex16::Assign ( const TDesC16 &  aDes)

Assigns a string to this object from a descriptor.

Parameters
aDesThe descriptor to be assigned.

(generated from Symbian Developer Library)

◆ Assign() [2/3]

void TLex16::Assign ( const TLex16 &  aLex)
inline

Assigns a string to this object from another TLex16 object.

Parameters
aLexThe object to be assigned.

(generated from Symbian Developer Library)

◆ Assign() [3/3]

IMPORT_C void TLex16::Assign ( const TUint16 *  aString)

Assigns a string to this object from another string.

Parameters
aStringA pointer to a string to be assigned.

(generated from Symbian Developer Library)

◆ BoundedVal() [1/4]

IMPORT_C TInt TLex16::BoundedVal ( TInt32 &  aVal,
TInt  aLimit 
)

Parses the string to extract a 32-bit signed integer, and checks that it is within the specified limit.

Parameters
aValOn return, contains the extracted integer.
aLimitThe upper limit.

(generated from Symbian Developer Library)

◆ BoundedVal() [2/4]

IMPORT_C TInt TLex16::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.

Parameters
aValOn return, contains the extracted integer.
aLimitThe upper limit.

(generated from Symbian Developer Library)

◆ BoundedVal() [3/4]

IMPORT_C TInt TLex16::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.

Parameters
aValOn return, contains the extracted integer.
aRadixThe radix to use when converting the number.
aLimitThe upper limit.

(generated from Symbian Developer Library)

◆ BoundedVal() [4/4]

IMPORT_C TInt TLex16::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.

Parameters
aValOn return, contains the extracted integer.
aRadixThe radix to use when converting the number.
aLimitThe upper limit.

(generated from Symbian Developer Library)

◆ Eos()

TBool TLex16::Eos ( ) const
inline

Tests whether the next character position is at the end of the string.

(generated from Symbian Developer Library)

◆ Get()

IMPORT_C TChar TLex16::Get ( )

Gets the next character in the string and increments the next character position.

(generated from Symbian Developer Library)

◆ Inc() [1/2]

IMPORT_C void TLex16::Inc ( )

Increments to the next character position.

Panic condition: USER 65, if the increment puts the next character position before the start or beyond the end of the string.

(generated from Symbian Developer Library)

◆ Inc() [2/2]

IMPORT_C void TLex16::Inc ( TInt  aNumber)

Increments the next character position by aNumber.

Parameters
aNumberThe number of characters to increment the next character position by.

Panic condition: USER 65, if the increment puts the next character position before the start or beyond the end of the string.

(generated from Symbian Developer Library)

◆ Mark() [1/2]

void TLex16::Mark ( )
inline

Sets the TLex16's next character position to its extraction mark.

(generated from Symbian Developer Library)

◆ Mark() [2/2]

void TLex16::Mark ( TLexMark16 &  aMark) const
inline

Sets the supplied extraction mark to the TLex16's next character position.

Parameters
aMarkOn return, set to the next character position.

(generated from Symbian Developer Library)

◆ MarkedOffset() [1/2]

TInt TLex16::MarkedOffset ( ) const
inline

Gets the offset of the extraction mark from the start of the string.

(generated from Symbian Developer Library)

◆ MarkedOffset() [2/2]

IMPORT_C TInt TLex16::MarkedOffset ( const TLexMark16  aMark) const

Gets the offset of the specified extraction mark from the start of the string.

Parameters
aMarkExtraction mark.

Panic condition: USER 68, if the specified mark is before the start or beyond the end of the string.

(generated from Symbian Developer Library)

◆ MarkedToken() [1/2]

IMPORT_C TPtrC16 TLex16::MarkedToken ( ) const

Extracts the marked token.

Note that the function assumes that the current extraction mark is valid.

Panic condition: USER 68, if the specified mark is before the start or beyond the end of the string.

(generated from Symbian Developer Library)

◆ MarkedToken() [2/2]

IMPORT_C TPtrC16 TLex16::MarkedToken ( const TLexMark16  aMark) const

Extracts the token, starting at the specified mark.

Parameters
aMarkExtraction mark indicating the start of the token.

Panic condition: USER 68, if the specified mark is before the start or beyond the end of the string.

(generated from Symbian Developer Library)

◆ NextToken()

IMPORT_C TPtrC16 TLex16::NextToken ( )

Strips any white space and extracts the next token.

(generated from Symbian Developer Library)

◆ Offset()

IMPORT_C TInt TLex16::Offset ( ) const

Gets the offset of the next character position from the start of the string.

(generated from Symbian Developer Library)

◆ operator=() [1/2]

TLex16 & TLex16::operator= ( const TDesC16 &  aDes)
inline

Allows descriptors to be assigned to a TLex16.

Parameters
aDesDescriptor to be assigned to the TLex16.

(generated from Symbian Developer Library)

◆ operator=() [2/2]

TLex16 & TLex16::operator= ( const TUint16 *  aString)
inline

Allows strings to be assigned to a TLex16.

Parameters
aStringString to be assigned to the TLex16.

(generated from Symbian Developer Library)

◆ Peek()

IMPORT_C TChar TLex16::Peek ( ) const

Shows the next character to be returned by Get().

TLex16::Get

(generated from Symbian Developer Library)

◆ Remainder()

IMPORT_C TPtrC16 TLex16::Remainder ( ) const

Gets a descriptor containing all the text from the next character position to the end of the string.

Panic condition: USER 17, if the value of (next character position - extraction mark) is negative.

(generated from Symbian Developer Library)

◆ RemainderFromMark() [1/2]

IMPORT_C TPtrC16 TLex16::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.

(generated from Symbian Developer Library)

◆ RemainderFromMark() [2/2]

IMPORT_C TPtrC16 TLex16::RemainderFromMark ( const TLexMark16  aMark) const

Gets a descriptor containing all the text from the specified extraction mark to the end of the string.

Parameters
aMarkExtraction mark indicating where remaining text starts.

Panic condition: USER 17, if the value of (next character position - extraction mark) is negative.

Panic condition: USER 68, if the specified mark is before the start or beyond the end of the string.

(generated from Symbian Developer Library)

◆ SkipAndMark() [1/2]

void TLex16::SkipAndMark ( TInt  aNumber)
inline

Moves the next character position a specified number of characters.

Parameters
aNumberNumber of characters to skip.

Panic condition: USER 68, 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)

◆ SkipAndMark() [2/2]

IMPORT_C void TLex16::SkipAndMark ( TInt  aNumber,
TLexMark16 &  aMark 
)

Moves the next character position a specified number of characters and copies it to the specified extraction mark.

Parameters
aNumberNumber of characters to skip.
aMarkOn return, set to the next character position.

Panic condition: USER 66, 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)

◆ SkipCharacters()

IMPORT_C void TLex16::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)

◆ SkipSpace()

IMPORT_C void TLex16::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)

◆ SkipSpaceAndMark() [1/2]

void TLex16::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.

(generated from Symbian Developer Library)

◆ SkipSpaceAndMark() [2/2]

IMPORT_C void TLex16::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
aMarkOn return, contains a reference to the next character position.

(generated from Symbian Developer Library)

◆ TokenLength() [1/2]

TInt TLex16::TokenLength ( ) const
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)

◆ TokenLength() [2/2]

IMPORT_C TInt TLex16::TokenLength ( const TLexMark16  aMark) const

Gets the length of the token starting at the specified extraction mark.

Parameters
aMarkExtraction mark indicating the start of the token.

Panic condition: USER 68, if the specified mark is before the start or beyond the end of the string.

(generated from Symbian Developer Library)

◆ UnGet()

IMPORT_C void TLex16::UnGet ( )

Decrements the next character position, allowing the previously "got" character to be re-read.

Panic condition: USER 64, if the previous character is before the start of the string.

(generated from Symbian Developer Library)

◆ UnGetToMark() [1/2]

void TLex16::UnGetToMark ( )
inline

Sets the next character position to the current extraction mark position.

Panic condition: USER 68, if the specified mark is before the start or beyond the end of the string.

(generated from Symbian Developer Library)

◆ UnGetToMark() [2/2]

IMPORT_C void TLex16::UnGetToMark ( const TLexMark16  aMark)

Sets the next character position to the supplied extraction mark position.

Parameters
aMarkMark to copy to the next character position.

Panic condition: USER 68, if the extraction mark is before the start or beyond the end of the string.

(generated from Symbian Developer Library)

◆ Val() [1/20]

TInt TLex16::Val ( TInt &  aVal)
inline

Parses the string to extract a signed integer.

Parameters
aValOn return, contains the extracted integer.

(generated from Symbian Developer Library)

◆ Val() [2/20]

IMPORT_C TInt TLex16::Val ( TInt16 &  aVal)

Parses the string to extract a signed 16-bit integer.

Parameters
aValOn return, contains the extracted integer.

(generated from Symbian Developer Library)

◆ Val() [3/20]

IMPORT_C TInt TLex16::Val ( TInt32 &  aVal)

Parses the string to extract a signed 32-bit integer.

Parameters
aValOn return, contains the extracted integer.

(generated from Symbian Developer Library)

◆ Val() [4/20]

TInt TLex16::Val ( TInt32 &  aVal,
TInt  aLimit 
)
inline

◆ Val() [5/20]

IMPORT_C TInt TLex16::Val ( TInt64 &  aVal)

Parses the string to extract a signed 64-bit integer.

Parameters
aValOn return, contains the extracted integer.

(generated from Symbian Developer Library)

◆ Val() [6/20]

TInt TLex16::Val ( TInt64 &  aVal,
const TInt64 &  aLimit 
)
inline

◆ Val() [7/20]

IMPORT_C TInt TLex16::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.

Parameters
aValOn return, contains the extracted integer.
aRadixThe radix to use when converting the number.

(generated from Symbian Developer Library)

◆ Val() [8/20]

TInt TLex16::Val ( TInt64 &  aVal,
TRadix  aRadix,
const TInt64 &  aLimit 
)
inline

◆ Val() [9/20]

IMPORT_C TInt TLex16::Val ( TInt8 &  aVal)

Parses the string to extract a signed 8-bit integer.

Parameters
aValOn return, contains the extracted integer.

(generated from Symbian Developer Library)

◆ Val() [10/20]

IMPORT_C TInt TLex16::Val ( TReal32 &  aVal)

◆ Val() [11/20]

IMPORT_C TInt TLex16::Val ( TReal32 &  aVal,
TChar  aPoint 
)

◆ Val() [12/20]

IMPORT_C TInt TLex16::Val ( TReal64 &  aVal)

◆ Val() [13/20]

IMPORT_C TInt TLex16::Val ( TReal64 &  aVal,
TChar  aPoint 
)

◆ Val() [14/20]

TInt TLex16::Val ( TRealX &  aVal)

◆ Val() [15/20]

TInt TLex16::Val ( TRealX &  aVal,
TChar  aPoint 
)

◆ Val() [16/20]

TInt TLex16::Val ( TUint &  aVal,
TRadix  aRadix = EDecimal 
)
inline

Parses the string to extract an unsigned integer, using the specified radix.

Parameters
aValOn return, contains the extracted integer.
aRadixThe radix to use when converting the number. The default radix for this function overload is decimal.

(generated from Symbian Developer Library)

◆ Val() [17/20]

IMPORT_C TInt TLex16::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.

Parameters
aValOn return, contains the extracted integer.
aRadixThe radix to use when converting the number.

(generated from Symbian Developer Library)

◆ Val() [18/20]

IMPORT_C TInt TLex16::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.

Parameters
aValOn return, contains the extracted integer.
aRadixThe radix to use when converting the number.

(generated from Symbian Developer Library)

◆ Val() [19/20]

TInt TLex16::Val ( TUint32 &  aVal,
TRadix  aRadix,
TUint  aLimit 
)
inline

◆ Val() [20/20]

IMPORT_C TInt TLex16::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.

Parameters
aValOn return, contains the extracted integer.
aRadixThe radix to use when converting the number.

(generated from Symbian Developer Library)


The documentation for this class was generated from the following files: