CDelimitedDataBase16 Class Reference

class CDelimitedDataBase16 : public CBase

Dependencies : CBase, TDelimitedParserBase16 Comments : Provides functionality for creating and editing a delimited data object. Uses 16-bit descriptors

The object contains a descriptor buffer with the data. Functionality is provided to allow segments to be added or removed from the data. There is access to the internal delimited data parser to provide parsing functionality to be excercised on the created data.

This a base class that cannot be instantiated. It should be derived. The derived class must set the delimited data parser, which is an object derived from TDelimitedParserBase. This helper class must set the delimiting object

If the delimiting character has not been set, then calling any of the functionality will cause a panic KDelimitedParserErrNoDelimiter.
Since
6.0

Inherits from

  • CDelimitedDataBase16
Public Member Functions
~CDelimitedDataBase16()
IMPORT_C voidAddBackDelimiterL()
IMPORT_C voidAddFrontDelimiterL()
IMPORT_C voidInsertCurrentL(const TDesC16 &)
IMPORT_C voidParse()
IMPORT_C voidParseReverse()
IMPORT_C const TDelimitedParserBase16 &Parser()
IMPORT_C voidPopBackL()
IMPORT_C voidPopFrontL()
IMPORT_C voidPushBackL(const TDesC16 &)
IMPORT_C voidPushFrontL(const TDesC16 &)
IMPORT_C voidRemoveCurrentL()
IMPORT_C voidTrimBackDelimiterL()
IMPORT_C voidTrimFrontDelimiterL()
Protected Member Functions
CDelimitedDataBase16()
IMPORT_C voidConstructL(const TDesC16 &)
IMPORT_C voidSetDelimiter(TChar)
Private Member Functions
voidDoInsertL(const TDesC16 &)
voidDoRemoveL()
voidSetData(HBufC16 *)
voidSetDataL(const TDesC16 &)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Private Attributes
HBufC16 *iDataBuf
TDelimitedParserBase16 iParser

Constructor & Destructor Documentation

CDelimitedDataBase16()

IMPORT_CCDelimitedDataBase16()[protected]

Constructor. First phase of two-phase construction method. Does non-allocating construction.

Since
6.0

~CDelimitedDataBase16()

IMPORT_C~CDelimitedDataBase16()

Destructor.

Since
6.0

Member Functions Documentation

AddBackDelimiterL()

IMPORT_C voidAddBackDelimiterL()

Adds a delimiter to the back of the data (if it doesn't exist).

CAUTION:

There will be a KDelimitedParserErrNotParsed panic if the data has not been parsed, and a KDelimitedParserErrNoDelimiter panic if the delimiter has not been set. A re-parse is required to ensure that the parser is valid.

Since
6.0
Pre-condition
The delimiter must have been set.
Post-condition
The data might have been extended to include a front delimiter.

AddFrontDelimiterL()

IMPORT_C voidAddFrontDelimiterL()

Adds a delimiter to the front of the data (if it doesn't exist).

CAUTION:

There will be a KDelimitedParserErrNotParsed panic if the data has not been parsed, and a KDelimitedParserErrNoDelimiter panic if the delimiter has not been set. A re-parse is required to ensure that the parser is valid.

Since
6.0
Pre-condition
The delimiter must have been set.
Post-condition
The data might have been extended to include a front delimiter.

ConstructL(const TDesC16 &)

IMPORT_C voidConstructL(const TDesC16 &aData)[protected]

Second phase of two-phase construction method. Does any allocations required to fully construct the object.

Since
6.0
Pre-condition
First phase of construction is complete.
Post-condition
The object is fully constructed.

Parameters

const TDesC16 & aDataA descriptor with the initial string.

DoInsertL(const TDesC16 &)

voidDoInsertL(const TDesC16 &aSegment)[private]

Inserts the new segment in a position before the current segment. The new segment can be made up of several segments and have delimiters at either extreme. The insert functionality will ensure that there is always a delimiter at the front of the new segment. The parser will be left in a state where its current segment is the same one as before the insertion.

Since
6.0
Pre-condition
The string must have been parsed.
Post-condition
The string will have been extended to include the new segment. The current segment will remain as the one before the insertion.

Parameters

const TDesC16 & aSegmentThe descriptor with the segment to be inserted.

DoRemoveL()

voidDoRemoveL()[private]

Removes the current segment. After removing the segment, the parser's new current segment will be the next segment. If the last segment is the one that is removed then the parser will be set to the end of the data.

Since
6.0
Pre-condition
The data must have been parsed.
Post-condition
The data will have been reduced to exclude the removed data. The current segment is set to what was the next segment. If the removed segment was the last segment, the parser is at the end of the data.

InsertCurrentL(const TDesC16 &)

IMPORT_C voidInsertCurrentL(const TDesC16 &aSegment)

Inserts the new segment in a position before the current parsed segment. The new segment can be made up of several segments and have delimiters at either extreme. The insert functionality will ensure that there is always a delimiter at the front of the new segment. The parser is left in a state where its current segment is the same one as before the insertion.

CAUTION:

There will be a KDelimitedParserErrNotParsed panic if the data has not been parsed, and a KDelimitedParserErrNoDelimiter panic if the delimiter has not been set.

Since
6.0
Pre-condition
The data must have been initially parsed by Parse() or ParseReverse().
Post-condition
The data will have been extended to include the new segment. The current segment will remain as the one before the insertion.

Parameters

const TDesC16 & aSegmentA descriptor with the new segment to be inserted.

Parse()

IMPORT_C voidParse()

This parses the data into segments from left to right.

CAUTION:

There will be a KDelimitedParserErrNoDelimiter panic if the delimiter has not been set.

Since
6.0
Pre-condition
The delimiter must have been set.
Post-condition
The current segment is the leftmost segment and the direction of parsing is set from left to right (EDelimitedDataFroward).

ParseReverse()

IMPORT_C voidParseReverse()

This parses the string into segments from right to left.

Since
6.0
Pre-condition
The delimiter must have been set. Will get a KDelimitedParserErrNoDelimiter panic if the delimiter has not been initialized.
Post-condition
The current segment is the leftmost segment and the direction of parsing is right to left.

Parser()

IMPORT_C const TDelimitedParserBase16 &Parser()const

Retrieves a const reference to the delimited data parser.

Since
6.0

PopBackL()

IMPORT_C voidPopBackL()

Removes the last segment from the data. The data must be re-parsed to ensure that the parser is valid.

CAUTION:

There will be a KDelimitedParserErrNotParsed panic if the data has not been parsed, and a KDelimitedParserErrNoDelimiter panic if the delimiter has not been set. A re-parse is required to ensure that the parser is valid.

Since
6.0
Pre-condition
The delimiter must have been set.
Post-condition
The data will have been reduced to exclude the last segment.

PopFrontL()

IMPORT_C voidPopFrontL()

Removes the first segment from the data. The data must be re-parsed to ensure that the parser is valid.

CAUTION:

There will be a KDelimitedParserErrNotParsed panic if the data has not been parsed, and a KDelimitedParserErrNoDelimiter panic if the delimiter has not been set. A re-parse is required to ensure that the parser is valid.

Since
6.0
Pre-condition
The delimiter must have been set.
Post-condition
The data will have been reduced to exclude the last segment.

PushBackL(const TDesC16 &)

IMPORT_C voidPushBackL(const TDesC16 &aSegment)

Adds a new segment to the end of the data. The new segment can be made up of several segments and have delimiters at either extreme. The insert functionality will ensure that there is always a delimiter at the front of the new segment. The data must re-parsed to ensure that the parser is valid.

CAUTION:

There will be a KDelimitedParserErrNotParsed panic if the data has not been parsed, and a KDelimitedParserErrNoDelimiter panic if the delimiter has not been set. A re-parse is required to ensure that the parser is valid.

Since
6.0
Pre-condition
The delimiter must have been set.
Post-condition
The data will have been extended to include the new segment.

Parameters

const TDesC16 & aSegmentA descriptor with the new segment to be inserted.

PushFrontL(const TDesC16 &)

IMPORT_C voidPushFrontL(const TDesC16 &aSegment)

Adds a new segment to the front of the data. The new segment can be made up of several segments and have delimiters at either extreme. The insert functionality will ensure that there is always a delimiter at the front of the new segment. The data must re-parsed to ensure that the parser is valid.

CAUTION:

There will be a KDelimitedParserErrNotParsed panic if the data has not been parsed, and a KDelimitedParserErrNoDelimiter panic if the delimiter has not been set. A re-parse is required to ensure that the parser is valid.

Since
6.0
Pre-condition
The delimiter must have been set.
Post-condition
The data will have been extended to include the new segment.

Parameters

const TDesC16 & aSegmentA descriptor with the new segment to be inserted.

RemoveCurrentL()

IMPORT_C voidRemoveCurrentL()

Removes the current segment. After removing the segment, the parser's new current segment will be the next segment. If the last segment is the one that is removed then the parser will be set to the end of the data.

CAUTION:

There will be a KDelimitedParserErrNotParsed panic if the data has not been parsed, and a KDelimitedParserErrNoDelimiter panic if the delimiter has not been set.

Since
6.0
Pre-condition
The data must have been initially parsed by Parse() or ParseReverse().
Post-condition
The data will have been reduced to exclude the removed segment. The current segment will be set to what was the next segment. If the removed segment was the last segment, the parser is at the end of the data.

SetData(HBufC16 *)

voidSetData(HBufC16 *aDataBuf)[private]

Sets internal data buffer and parser. Cleans up the old data and uses the data buffer. The parser is set to the new data.

Since
6.0
Post-condition
The internal data buffer now points to the new buffer and the parser is set to the data in the new buffer..

Parameters

HBufC16 * aDataBufA pointer to a decriptor buffer with the new data.

SetDataL(const TDesC16 &)

voidSetDataL(const TDesC16 &aData)[private]

Updates internal data buffer with the new data. Creates a copy of the new data.

Since
6.0
Post-condition
The internal data buffer now contains a copy of the new data and the parser is set to the new data.

Parameters

const TDesC16 & aDataA descriptor with the new string.

SetDelimiter(TChar)

IMPORT_C voidSetDelimiter(TCharaDelimiter)[protected]

Sets the delimiting character.

Since
6.0
Post-condition
The delimiting character is updated.

Parameters

TChar aDelimiterThe delimiting character.

TrimBackDelimiterL()

IMPORT_C voidTrimBackDelimiterL()

Removes the back delimiter (if exists) from the data.

CAUTION:

There will be a KDelimitedParserErrNotParsed panic if the data has not been parsed, and a KDelimitedParserErrNoDelimiter panic if the delimiter has not been set. A re-parse is required to ensure that the parser is valid.

Since
6.0
Pre-condition
The delimiter must have been set.
Post-condition
The data might have been reduced to exclude the front delimiter.

TrimFrontDelimiterL()

IMPORT_C voidTrimFrontDelimiterL()

Removes the front delimiter (if exists) from the data.

CAUTION:

There will be a KDelimitedParserErrNotParsed panic if the data has not been parsed, and a KDelimitedParserErrNoDelimiter panic if the delimiter has not been set. A re-parse is required to ensure that the parser is valid.

Since
6.0
Pre-condition
The delimiter must have been set.
Post-condition
The data might have been reduced to exclude the front delimiter.

Member Data Documentation

HBufC16 * iDataBuf

HBufC16 *iDataBuf[private]

Descriptor buffer.

TDelimitedParserBase16 iParser

TDelimitedParserBase16 iParser[private]

Parser object