Location:
DelimitedParser16.h
Link against: inetprotutil.lib
class TDelimitedParserBase16;
Comments : Provides non-modifying functionality for parsing data delimited by a single character. The data is delimited into segments. Uses 16-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 TDelimitedParserBase16
:
BackDelimiter()
, Dec()
, Des()
, Eos()
, FrontDelimiter()
, GetNext()
, Inc()
, Parse()
, ParseReverse()
, Peek()
, Remainder()
, SetDelimiter()
, TDelimitedParserBase16()
IMPORT_C TInt GetNext(TPtrC16 &aSegment) const;
The string must have been initially parsed by Parse()
or ParseReverse()
.
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 Parse()
or ParseReverse()
.
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 Parse()
or ParseReverse()
.
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(TPtrC16 &aSegment) const;
The string must have been initially parsed by Parse()
or ParseReverse()
.
Retrieves the current segment.
|
|
IMPORT_C TBool Eos() const;
The string must have been initially parsed by Parse()
or ParseReverse()
.
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 Parse()
or ParseReverse()
.
Checks for a delimiter at the front (left) of the data.
|
IMPORT_C TBool BackDelimiter() const;
The string must have been initially parsed by Parse()
or ParseReverse()
.
Checks for a delimiter at the back (right) of the data.
|
IMPORT_C const TDesC16 &Des() const;
Retrieves the descriptor reference with the data
|
IMPORT_C TInt Remainder(TPtrC16 &aRemainder) const;
The data must have been initially parsed by Parse()
or ParseReverse()
.
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 TDesC16 &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 TDesC16 &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.
|