|
||
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.
Defined in TDelimitedParserBase8
:
BackDelimiter()const
Checks for a delimiter at the back (right) of the data.Dec()const
Parses back to the previous segment.Des()const
Retrieves the descriptor reference with the dataEos()const
Indicates whether the end of the data has been reached and there are no more seg...FrontDelimiter()const
Checks for a delimiter at the front (left) of the data.GetNext(TPtrC8 &)const
Retrieves the current segment and then parses the data to the next one.Inc()const
Parses to the next segment.Parse(const TDesC8 &)
This parses the data into segments from left to right.ParseReverse(const TDesC8 &)
This parses the data into segments from lright to left.Peek(TPtrC8 &)const
Retrieves the current segment.Remainder(TPtrC8 &)const
Gives the remainder of the data from (and including) the current segment. Any ot...Reset()const
Resets the internal pointer position to the start or end or the descriptor depen...SetDelimiter(TChar)
Sets the delimiting character.TDelimitedParserBase8()
Constructor.IMPORT_C void Reset() const;
Resets the internal pointer position to the start or end or the descriptor depending on whether the decriptor is parsing mode.
IMPORT_C TInt GetNext(TPtrC8 &aSegment) const;
The string must have been initially parsed by TDelimitedParserBase8::Parse(const TDesC8 &)
or TDelimitedParserBase8::ParseReverse(const TDesC8 &)
.
Retrieves the current segment and then parses the data to the next one.
The current segment is updated to the next one.
|
|
IMPORT_C TInt Inc() const;
The string must have been initially parsed by TDelimitedParserBase8::Parse(const TDesC8 &)
or TDelimitedParserBase8::ParseReverse(const TDesC8 &)
.
Parses to the next segment.
The current segment is updated to the next one.
|
IMPORT_C TInt Dec() const;
The string must have been initially parsed by TDelimitedParserBase8::Parse(const TDesC8 &)
or TDelimitedParserBase8::ParseReverse(const TDesC8 &)
.
Parses back to the previous segment.
If the parse was successful then the current segment is updated to the previous one. Otherwise there is no change.
|
IMPORT_C TInt Peek(TPtrC8 &aSegment) const;
The string must have been initially parsed by TDelimitedParserBase8::Parse(const TDesC8 &)
or TDelimitedParserBase8::ParseReverse(const TDesC8 &)
.
Retrieves the current segment.
|
|
IMPORT_C TBool Eos() const;
The string must have been initially parsed by TDelimitedParserBase8::Parse(const TDesC8 &)
or TDelimitedParserBase8::ParseReverse(const TDesC8 &)
.
Indicates whether the end of the data has been reached and there are no more segments to parse.
|
IMPORT_C TBool FrontDelimiter() const;
The string must have been initially parsed by TDelimitedParserBase8::Parse(const TDesC8 &)
or TDelimitedParserBase8::ParseReverse(const TDesC8 &)
.
Checks for a delimiter at the front (left) of the data.
|
IMPORT_C TBool BackDelimiter() const;
The string must have been initially parsed by TDelimitedParserBase8::Parse(const TDesC8 &)
or TDelimitedParserBase8::ParseReverse(const TDesC8 &)
.
Checks for a delimiter at the back (right) of the data.
|
IMPORT_C const TDesC8& Des() const;
Retrieves the descriptor reference with the data
|
IMPORT_C TInt Remainder(TPtrC8 &aRemainder) const;
The data must have been initially parsed by TDelimitedParserBase8::Parse(const TDesC8 &)
or TDelimitedParserBase8::ParseReverse(const TDesC8 &)
.
Gives the remainder of the data from (and including) the current segment. Any other segments that have parsed through are not included.
|
|
protected: IMPORT_C void Parse(const TDesC8 &aData);
The delimiter must have been set.
This parses the data into segments from left to right.
The current segment is the leftmost segment and the direction of parsing is set from left to right (EDelimitedDataFroward).
|
protected: IMPORT_C void ParseReverse(const TDesC8 &aData);
The delimiter must have been set.
This parses the data into segments from lright to left.
The current segment is the leftmost segment and the direction of parsing is set from right to left (EDelimitedDataReverse).
|
protected: IMPORT_C void SetDelimiter(TChar aDelimiter);
Sets the delimiting character.
The delimiting character is set.
|