Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <btsdp.h>
Link against: sdpdatabase.lib

Class CSdpAttrValue

class CSdpAttrValue : public CBase;

Description

Base class for classes that encapsulate SDP attributes values.

Sub-classes of this wrap specific types of SDP service record attributes. For example, CSdpBoolean derives from CSdpAttrValue to encapsulate boolean attributes. The base class defines getters for all types: for example, it declares a function CSdpAttrValue::Bool()const that returns the attribute value as a TBool. Note though that the function would panic unless called on actual CSdpBoolean.

A common base class allows attributes of all types to be used polymorphically. You can use CSdpAttrValue's CSdpAttrValue::Type()const function to find the actual type being used, and upcast the pointer appropriately.

Derivation

Members

Defined in CSdpAttrValue:

Inherited from CBase:


Construction and destruction


~CSdpAttrValue()

virtual ~CSdpAttrValue();

Description

Destructor.

[Top]


Member functions


Type()const

virtual TSdpElementType Type() const=0;

Description

Gets the attribute type.

Return value

TSdpElementType

Attribute type


DataSize()const

virtual TUint DataSize() const=0;

Description

Gets the size of the attribute.

Return value

TUint

Size of the attribute in bytes


Uint()const

virtual TUint Uint() const;

Description

Gets an unsigned integer attribute value.

The base class implementation panics.

The size of the unsigned integer should be checked with CSdpAttrValue::DataSize()const before calling.

Return value

TUint

Attribute value


Int()const

virtual TInt Int() const;

Description

Gets a signed integer attribute value.

The base class implementation panics.

Return value

TInt

Attribute value


DoesIntFit()const

virtual TBool DoesIntFit() const;

Description

Tests if the attribute can be stored in an integer value.

The base class implementation returns EFalse.

Return value

TBool

True if the attribute can be stored in an integer value


Bool()const

virtual TInt Bool() const;

Description

Gets a Boolean attribute value.

The base class implementation panics.

Return value

TInt

Attribute value


UUID()const

virtual const TUUID& UUID() const;

Description

Gets a UUID attribute value.

The base class implementation panics.

Return value

const TUUID &

Attribute value


Des()const

virtual const TPtrC8 Des() const;

Description

Gets a data buffer attribute value.

The base class implementation panics.

Return value

const TPtrC8

Attribute value


AcceptVisitorL(MSdpAttributeValueVisitor &)

virtual void AcceptVisitorL(MSdpAttributeValueVisitor &aVisitor);

Description

Request a call back to pass the attribute value.

When called on attributes that are not lists (not DEA or DES), then this calls MSdpAttributeValueVisitor::VisitAttributeValueL(CSdpAttrValue &,TSdpElementType), passing the attribute value object itself (i.e. *this), and the value attribute type.

It is more useful when called on a DES or DEA object, as it then provides a simple method of enumerating each attribute in a list.

Parameters

MSdpAttributeValueVisitor &aVisitor

Abstract interface that can be implemented to receive an enumeration of the values in an attribute list.

See also:


Uint64(TUint64 &)const

IMPORT_C void Uint64(TUint64 &aValue) const;

Description

Gets the value as an unsigned 64 bit integer

The size of the unsigned integer should be checked with CSdpAttrValue::DataSize()const before calling.

Parameters

TUint64 &aValue

A 64 bit unsigned integer


Uint128(TUint64 &,TUint64 &)const

IMPORT_C void Uint128(TUint64 &aLo, TUint64 &aHi) const;

Description

Gets two TUint64s, one being the high 64 bits and one being the low 64 bits of a 128 bit integer

The size of the unsigned integer should be checked with CSdpAttrValue::DataSize()const before calling.

Parameters

TUint64 &aLo

The unsigned 64 bit integer contains the lower bits of the 128 bit integer contained in the descriptor

TUint64 &aHi

The unsigned 64 bit integer contains the higher bits of the 128 bit integer contained in the descriptor