Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: btsdp.h
Link against: bluetooth.lib

Class CElementParser

CElementParser

Support

Supported from 6.1

Description

Parser for SDP attribute values.

The class parses an input buffer containing an attribute value into its constituent data elements. It calls an MSdpElementBuilder object each time a data element is decoded.

This parser can parse incrementally, and be fed new data as it arrives.

Derivation

CBaseBase class for all classes to be instantiated on the heap
CElementParserParser for SDP attribute values

Defined in CElementParser:
BufferedParseL(), NewL(), ParseElementsL(), Reset(), ~CElementParser()

Inherited from CBase:
operator new()

See also:


Construction and destruction


NewL()

static CElementParser* NewL(MSdpElementBuilder* aBuilder);

Description

Allocates and constructs a new CElementParser object.

Parameters

MSdpElementBuilder* aBuilder

Object into which to build data element

Return value

CElementParser*

New CElementParser object


~CElementParser()

~CElementParser();

Description

Destructor.

[Top]


ParseElementsL()

TInt ParseElementsL(const TDesC8& aData);

Description

Parses a data buffer into the currently set MSdpElementBuilder interface.

If a whole number of data elements can not be parsed out of aData, the number of bytes left unparsed is returned. Those bytes should be prepended to the buffer when the function is next called.

Parameters

const TDesC8& aData

Buffer to parse

Return value

TInt

Number of bytes not consumed

[Top]


BufferedParseL()

TBool BufferedParseL(const TDesC8& aData);

Description

Parse out some encoded data, with transparent buffering of unparsed data between calls.

The function stores any incompletely parsed data from a previous call, and automatically prepends to the data buffer when it is next called.

If the function leaves, the unparsed data will be deleted. This means it will not be possible to continue with this data stream; Reset() should be called before the next call to this function.

Parameters

const TDesC8& aData

Buffer to parse

Return value

TBool

True if a whole number of data elements have not been parsed, so more data is expected. False if a whole number has been parsed.

[Top]


Reset()

void Reset();

Description

Resets the parser's buffers to be empty.

[Top]


Reset()

void Reset(MSdpElementBuilder* aBuilder);

Description

Resets the parser's buffers to be empty, and resets the element builder object used.

Parameters

MSdpElementBuilder* aBuilder

Element builder object to use