#include <delimitedparser16.h>
class TDelimitedParserBase16 |
Public Member Functions | |
---|---|
IMPORT_C TBool | BackDelimiter() |
IMPORT_C TInt | Dec() |
IMPORT_C const TDesC16 & | Des() |
IMPORT_C TBool | Eos() |
IMPORT_C TBool | FrontDelimiter() |
IMPORT_C TInt | GetNext(TPtrC16 &) |
IMPORT_C TInt | Inc() |
IMPORT_C TInt | Peek(TPtrC16 &) |
IMPORT_C TInt | Remainder(TPtrC16 &) |
IMPORT_C void | Reset() |
Protected Member Functions | |
---|---|
TDelimitedParserBase16() | |
IMPORT_C void | Parse(const TDesC16 &) |
IMPORT_C void | ParseReverse(const TDesC16 &) |
IMPORT_C void | SetDelimiter(TChar) |
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.
IMPORT_C TBool | BackDelimiter | ( | ) | const |
Checks for a delimiter at the back (right) of the data.
There will be a KDelimitedParserErrNotParsed panic if the data has not been parsed, and a KDelimitedParserErrNoDelimiter panic if the delimiter has not been set.
IMPORT_C TInt | Dec | ( | ) | const |
Parses back to the previous segment.
There will be a KDelimitedParserErrNotParsed panic if the data has not been parsed, and a KDelimitedParserErrNoDelimiter panic if the delimiter has not been set.
IMPORT_C const TDesC16 & | Des | ( | ) | const |
Retrieves the descriptor reference with the data
IMPORT_C TBool | Eos | ( | ) | const |
Indicates whether the end of the data has been reached and there are no more segments to parse.
There will be a KDelimitedParserErrNotParsed panic if the data has not been parsed, and a KDelimitedParserErrNoDelimiter panic if the delimiter has not been set.
IMPORT_C TBool | FrontDelimiter | ( | ) | const |
Checks for a delimiter at the front (left) of the data.
There will be a KDelimitedParserErrNotParsed panic if the data has not been parsed, and a KDelimitedParserErrNoDelimiter panic if the delimiter has not been set.
Retrieves the current segment and then parses the data to the next one.
There will be a KDelimitedParserErrNotParsed panic if the data has not been parsed, and a KDelimitedParserErrNoDelimiter panic if the delimiter has not been set.
Parameters | |
---|---|
aSegment | This is an output argument that is set to the current segment. |
IMPORT_C TInt | Inc | ( | ) | const |
Parses to the next segment.
There will be a KDelimitedParserErrNotParsed panic if the data has not been parsed, and a KDelimitedParserErrNoDelimiter panic if the delimiter has not been set.
IMPORT_C void | Parse | ( | const TDesC16 & | aData | ) | [protected] |
This parses the data into segments from left to right.
There will be a KDelimitedParserErrNoDelimiter panic if the delimiter has not been set.
Parameters | |
---|---|
aData | A descriptor containing the data. |
IMPORT_C void | ParseReverse | ( | const TDesC16 & | aData | ) | [protected] |
This parses the data into segments from lright to left.
There will be a KDelimitedParserErrNoDelimiter panic if the delimiter has not been set.
Parameters | |
---|---|
aData | A descriptor containing the data. |
Retrieves the current segment.
There will be a KDelimitedParserErrNotParsed panic if the data has not been parsed, and a KDelimitedParserErrNoDelimiter panic if the delimiter has not been set.
Parameters | |
---|---|
aSegment | This is an output argument that is set to the current segment. |
Gives the remainder of the data from (and including) the current segment. Any other segments that have parsed through are not included.
There will be a KDelimitedParserErrNotParsed panic if the data has not been parsed, and a KDelimitedParserErrNoDelimiter panic if the delimiter has not been set.
Parameters | |
---|---|
aRemainder | This is an output argument that is set to the remaining data. |
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.
There will be a KUriUtilsErrBadDelimitedParserMode panic if the data mode has not been correctly set.
IMPORT_C void | SetDelimiter | ( | TChar | aDelimiter | ) | [protected] |
Sets the delimiting character.
Parameters | |
---|---|
aDelimiter | The delimiting character. |