»
Developer Library »
API Reference »
C++ API reference »
Internet Protocol Utilities »
TDelimitedParserBase8
Location:
DelimitedParser8.h
Link against: InetProtUtil.lib
Class TDelimitedParserBase8
class TDelimitedParserBase8;
Support
Supported from 7.0
Description
Implements the functionality for parsing 8-bit data that is divided
into segments, each delimited by a single character.
The data to be parsed is neither owned nor modified by this class.
The class provides the functionality to retrieve pointers to successive
segments, either starting at the beginning of the data and working forwards, or
starting at the end of the data, and working backwards.
The class cannot be instantiated, and must be derived from. Derived
classes must ensure that they set up the data to be parsed by calling
Parse() or
ParseReverse(), and that they set the delimiting
character by calling
SetDelimiter() before invoking any of the parsing
functionality. Failure to do this will cause panics to be raised.
Defined in TDelimitedParserBase8:
BackDelimiter(), Dec(), Des(), DoParse(), Eos(), FindNextSegment(), FindPrevSegment(), FrontDelimiter(), GetNext(), Inc(), Parse(), ParseReverse(), Peek(), Remainder(), SetDelimiter(), TDelimitedParserBase8(), iCurrentSegment, iDataDes, iDelimiter, iMode, iNextSegmentPos
Construction
protected: TDelimitedParserBase8();
Description
Constructor.
TInt GetNext(TPtrC8& aSegment) const;
Description
Sets the pointer descriptor to represent the current segment,
and updates internal pointers to point to the next segment.
Parameters
TPtrC8& aSegment |
On return, a pointer descriptor representing the current
segment. If there are no more segments, this reference is unchanged. |
|
Return value
Panic codes
DELIM-PARSER -5005 |
if the data has not been parsed. |
DELIM-PARSER -5004 |
if the delimiter has not been set. |
|
TInt Peek(TPtrC8& aSegment) const;
Description
Sets the pointer descriptor to represent the current
segment.
Note that internal pointers are not updated, which means that
repeated calls to this function always gives the same result.
Parameters
TPtrC8& aSegment |
On return, a pointer descriptor representing the current
segment. If there are no more segments, this reference is unchanged. |
|
Return value
Panic codes
DELIM-PARSER -5005 |
if the data has not been parsed. |
DELIM-PARSER -5004 |
if the delimiter has not been set. |
|
TInt Inc() const;
Description
Updates internal pointers to point to the next segment.
Return value
Panic codes
DELIM-PARSER -5005 |
if the data has not been parsed. |
DELIM-PARSER -5004 |
if the delimiter has not been set. |
|
TInt Dec() const;
Description
Updates internal pointers to point to the previous
segment.
Return value
Panic codes
DELIM-PARSER -5005 |
if the data has not been parsed. |
DELIM-PARSER -5004 |
if the delimiter has not been set. |
|
TBool Eos() const;
Description
Tests whether there are any more segments.
Return value
TBool |
True, if there are more segments; false, otherwise. |
|
Panic codes
DELIM-PARSER -5005 |
if the data has not been parsed. |
DELIM-PARSER -5004 |
if the delimiter has not been set. |
|
TBool FrontDelimiter() const;
Description
Tests whether there is a delimiter at the start (left hand
side) of the data.
Return value
TBool
|
True, if there is a front delimiter; false, otherwise. |
|
Panic codes
DELIM-PARSER -5004 |
if the delimiter has not been set. |
|
TBool BackDelimiter() const;
Description
Tests whether there is a delimiter at the end (right hand side)
of the data.
Return value
TBool
|
True, if there is a front delimiter; false, otherwise. |
|
Panic codes
DELIM-PARSER -5004 |
if the delimiter has not been set. |
|
const TDesC8& Des() const;
Description
Gets a descriptor reference to the data.
Return value
const
TDesC8& |
A const descriptor reference to the data. |
|
TInt Remainder(TPtrC8& aRemainder) const;
Description
Sets the pointer descriptor to represent the remaining data,
including the current segment.
Note that internal pointers are not updated, which means that
repeated calls to this function always gives the same result.
Parameters
TPtrC8& aSegment |
On return, a pointer descriptor representing the remaining
data. If there are no more segments, this reference is unchanged. |
|
Return value
Panic codes
DELIM-PARSER -5005 |
if the data has not been parsed. |
DELIM-PARSER -5004 |
if the delimiter has not been set. |
|
protected: void Parse(const TDesC8& aData);
Description
Prepares the object for parsing in the forward (left to right)
direction.
Internal pointers are set to point to the first segment.
Parameters
const
TDesC8& aData |
The data to be parsed. |
|
Panic codes
DELIM-PARSER -5004 |
if the delimiter has not been set. |
|
protected: void ParseReverse(const TDesC8& aData);
Description
Prepares the object for parsing in the backwards (right to
left) direction.
Internal pointers are set to point to the last segment.
Parameters
const
TDesC8& aData |
The data to be parsed. |
|
Panic codes
DELIM-PARSER -5004 |
if the delimiter has not been set. |
|
protected: void SetDelimiter(TChar aDelimiter);
Description
Sets the delimiting character.
Parameters
TChar aDelimiter |
The delimiting character |
|
private: void DoParse(const TDesC8& aData);
Description
This is internal and is not intended for use.
private: TInt FindNextSegment(TInt aStartPos) const;
Description
This is internal and is not intended for use.
private: TInt FindPrevSegment(TInt aStartPos) const;
Description
This is internal and is not intended for use.
private: TPtrC8 iDataDes;
Description
This is internal and is not intended for use.
private: TPtrC8 iCurrentSegment;
Description
This is internal and is not intended for use.
private: TInt iNextSegmentPos;
Description
This is internal and is not intended for use.
private: TDelimitedDataParseMode iMode;
Description
This is internal and is not intended for use.
private: TInt iDelimiter;
Description
This is internal and is not intended for use.