TDelimitedParserBase8 Class Reference

class TDelimitedParserBase8

Comments : Provides non-modifying functionality for parsing data delimited by a single character. The data is delimited into segments. Uses 8-bit descriptors.

The object contains a descriptor with the data which can be parsed from left to right, or right to left. It is non-owning. The current segment can be extracted, which then parses the string for the next segment.

This is a base class and an object of this type cannot be instantiated. It should be derived. The derived class should ensure that the data iDataDes is set before calling one of the protected parsing functions. The derived class should also ensure that the delimiting character has been set.

If the data iDataDes has not been parsed, then calling any functionality that requires the data to have been parsed will result in a panic KDelimitedParserErrNotParsed. The data can only be parsed by calling one of the protected parsing functions from the derived class.

If the delimiting character iDelimiter has not been set, then calling the protected parsing functions and some of the other public functionality that requires the delimiter to be set will result in a panic KDelimitingParserErrNoDelimiter. 6.0

Public Member Functions
IMPORT_C TBoolBackDelimiter()
IMPORT_C TIntDec()
IMPORT_C const TDesC8 &Des()
IMPORT_C TBoolEos()
IMPORT_C TBoolFrontDelimiter()
IMPORT_C TIntGetNext(TPtrC8 &)
IMPORT_C TIntInc()
IMPORT_C TIntPeek(TPtrC8 &)
IMPORT_C TIntRemainder(TPtrC8 &)
IMPORT_C voidReset()
Protected Member Functions
TDelimitedParserBase8()
IMPORT_C voidParse(const TDesC8 &)
IMPORT_C voidParseReverse(const TDesC8 &)
IMPORT_C voidSetDelimiter(TChar)
Private Member Functions
voidDoParse(const TDesC8 &)
TInt FindNextSegment(TInt)
TInt FindPrevSegment(TInt)
Private Attributes
TPtrC8 iCurrentSegment
TPtrC8 iDataDes
TInt iDelimiter
TDelimitedDataParseMode iMode
TInt iNextSegmentPos

Constructor & Destructor Documentation

TDelimitedParserBase8()

IMPORT_CTDelimitedParserBase8()[protected]

Member Functions Documentation

BackDelimiter()

IMPORT_C TBoolBackDelimiter()const

Dec()

IMPORT_C TIntDec()const

Des()

IMPORT_C const TDesC8 &Des()const

DoParse(const TDesC8 &)

voidDoParse(const TDesC8 &aData)[private]

Parameters

const TDesC8 & aData

Eos()

IMPORT_C TBoolEos()const

FindNextSegment(TInt)

TInt FindNextSegment(TIntaStartPos)const [private]

Parameters

TInt aStartPos

FindPrevSegment(TInt)

TInt FindPrevSegment(TIntaStartPos)const [private]

Parameters

TInt aStartPos

FrontDelimiter()

IMPORT_C TBoolFrontDelimiter()const

GetNext(TPtrC8 &)

IMPORT_C TIntGetNext(TPtrC8 &aSegment)const

Parameters

TPtrC8 & aSegment

Inc()

IMPORT_C TIntInc()const

Parse(const TDesC8 &)

IMPORT_C voidParse(const TDesC8 &aData)[protected]

Parameters

const TDesC8 & aData

ParseReverse(const TDesC8 &)

IMPORT_C voidParseReverse(const TDesC8 &aData)[protected]

Parameters

const TDesC8 & aData

Peek(TPtrC8 &)

IMPORT_C TIntPeek(TPtrC8 &aSegment)const

Parameters

TPtrC8 & aSegment

Remainder(TPtrC8 &)

IMPORT_C TIntRemainder(TPtrC8 &aRemainder)const

Parameters

TPtrC8 & aRemainder

Reset()

IMPORT_C voidReset()const

SetDelimiter(TChar)

IMPORT_C voidSetDelimiter(TCharaDelimiter)[protected]

Parameters

TChar aDelimiter

Member Data Documentation

TPtrC8 iCurrentSegment

TPtrC8 iCurrentSegment[private]

Descriptor with the current segment.

TPtrC8 iDataDes

TPtrC8 iDataDes[private]

Descriptor with the string

TInt iDelimiter

TInt iDelimiter[private]

Delimiting character

TDelimitedDataParseMode iMode

TDelimitedDataParseMode iMode[private]

Direction of parsing.

TInt iNextSegmentPos

TInt iNextSegmentPos[private]

Position of next segment.