Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: SdpDocument.h
Link against: sdpcodec.lib

Class CSdpDocument

class CSdpDocument : public CBase;

Description

This class encapsulates the Session Description Protocol (SDP) document. The SDP document is a collection of SDP fields and related values describing a session.

The normative reference for correct formatting and values is draft-ietf-mmusic-sdp-new-14 unless specified otherwise in member documentation. The implementation supports this normative reference, but does not enforce it fully.

sdpcodec.lib

Derivation

Members

Defined in CSdpDocument:
AttributeFields(), BandwidthFields(), CloneL(), ConnectionField(), ConnectionField(), DecodeL(), DecodeLC(), EmailFields(), EncodeL(), ExternalizeL(), Info(), InternalizeL(), IsValid(), Key(), Key(), MediaFields(), NewL(), NewLC(), OriginField(), OriginField(), PhoneFields(), SdpVersion(), SessionName(), SetConnectionField(), SetInfoL(), SetKey(), SetOriginField(), SetSessionNameL(), SetUri(), SetZoneAdjustmentsL(), TimeFields(), Uri(), Uri(), ZoneAdjustments(), ~CSdpDocument()

Inherited from CBase:
Delete(), Extension_(), operator new()


Construction and destruction


NewL()

static IMPORT_C CSdpDocument *NewL();

Description

Constructs a new, empty SDP document. The instance will have the following initial values: v=0 s=- t=0 0

Return value

CSdpDocument *

a new instance.


NewLC()

static IMPORT_C CSdpDocument *NewLC();

Description

Constructs a new, empty SDP document document and adds the pointer to the cleanup stack. The instance will have the following initial values: v=0 s=- t=0 0

Return value

CSdpDocument *

a new instance.


~CSdpDocument()

IMPORT_C ~CSdpDocument();

Description

Deletes the resources held by the instance.

[Top]


Member functions


DecodeL()

static IMPORT_C CSdpDocument *DecodeL(const TDesC8 &aText);

Description

Constructs a new SDP document.

Parameters

const TDesC8 &aText

A string containing a correctly formatted SDP document.

Return value

CSdpDocument *

a new instance.


DecodeLC()

static IMPORT_C CSdpDocument *DecodeLC(const TDesC8 &aText);

Description

Constructs a new SDP document and adds the pointer to the cleanup stack.

Parameters

const TDesC8 &aText

A string containing a correctly formatted SDP document.

Return value

CSdpDocument *

a new instance.


ExternalizeL()

IMPORT_C void ExternalizeL(RWriteStream &aStream) const;

Description

Externalizes the object state in an internal, memory optimized format.

Parameters

RWriteStream &aStream

The output stream.


InternalizeL()

static IMPORT_C CSdpDocument *InternalizeL(RReadStream &aStream);

Description

Internalizes the object state from an internal, memory optimized format.

Parameters

RReadStream &aStream

The input stream.

Return value

CSdpDocument *

A new SDP document internalized from the input stream.


EncodeL()

IMPORT_C void EncodeL(RWriteStream &aStream) const;

Description

Outputs the SDP document formatted according to SDP syntax. It is possible to output the document even though it is incomplete in the sense that all mandatory SDP fields are not present.When creating an SDP document to be used e.g. as part of SIP signalling, caller should first ensure the validity of the document using the IsValid() function.

Parameters

RWriteStream &aStream

Stream used for output. On return the stream includes correctly formatted SDP description.


CloneL()

IMPORT_C CSdpDocument *CloneL() const;

Description

Creates a new instance that is equal to the target.

Return value

CSdpDocument *

a new instance.


IsValid()

IMPORT_C TBool IsValid() const;

Description

Checks if the instance represents a valid SDP document.

Return value

TBool

ETrue if SDP document is valid and EFalse if not.


SdpVersion()

IMPORT_C TUint SdpVersion() const;

Description

Gets the SDP version used in the version field. Note, that the current implementation supports only version number 0.

Return value

TUint

The SDP version number.


OriginField()

IMPORT_C CSdpOriginField *OriginField();

Description

Gets a reference to the session origin field. Note, that the ownership is not transferred and the instance must not be deleted by the caller.

Return value

CSdpOriginField *

The origin field or zero if not present.


OriginField()

IMPORT_C const CSdpOriginField *OriginField() const;

Description

Gets a reference to the session origin field.

Return value

const CSdpOriginField *

The origin field or zero if not present.


SetOriginField()

IMPORT_C void SetOriginField(CSdpOriginField *aObj);

Description

Sets or removes the session origin field. Note, that the ownership of the argument is transferred to the SDP document object.

Parameters

CSdpOriginField *aObj

New origin field or null to remove the field.


SessionName()

IMPORT_C const TDesC8 &SessionName() const;

Description

Gets the session name field value.

Return value

const TDesC8 &

The session name or empty descriptor if not present.


SetSessionNameL()

IMPORT_C void SetSessionNameL(const TDesC8 &aValue);

Description

Sets the session name field value.

Parameters

const TDesC8 &aValue

Valid session name value. Note that an empty value is not accepted.

Leave codes

KErrSdpCodecSessionField

if aValue is not empty or aValue includes invalid byte strings (´´, ´ ´, ´´).


Info()

IMPORT_C const TDesC8 &Info() const;

Description

Gets the session information field value.

Return value

const TDesC8 &

Info field value or an empty descriptor if not present.


SetInfoL()

IMPORT_C void SetInfoL(const TDesC8 &aValue);

Description

Sets or removes the session information field value.

Parameters

const TDesC8 &aValue

Leave codes

KErrSdpCodecInfoField

if aValue is not empty or aValue includes invalid byte strings (´´, ´ ´, ´´).


Uri()

IMPORT_C CUri8 *Uri();

Description

Gets the session URI field value. Note, that the ownership is not transferred and the instance must not be deleted by the caller.

Return value

CUri8 *

CUri8*: Session URI or zero if the field is not present.


Uri()

IMPORT_C const CUri8 *Uri() const;

Description

Gets the session URI field value.

Return value

const CUri8 *

Session URI or zero if the field is not present.


SetUri()

IMPORT_C void SetUri(CUri8 *aValue);

Description

Sets or removes the session level URI field. Note, that the ownership of the argument is transferred to the SDP document object.

Parameters

CUri8 *aValue


EmailFields()

IMPORT_C CDesC8Array &EmailFields();

Description

Gets the set of session level email field values. This array is used to add and remove fields into the document. Note, that only correctly formatted email field values should be placed into the array. Empty values in the array will be ignored.

Return value

CDesC8Array &

Email fields in array or empty array if no email fields.


PhoneFields()

IMPORT_C CDesC8Array &PhoneFields();

Description

Gets the set of session level phone field values. This array is used to add and remove fields into the document. Note, that only correctly formatted phone field values should be placed into the array. Empty values in the array will be ignored.

Return value

CDesC8Array &

Phone fields in array or empty array if no phone fields.


ConnectionField()

IMPORT_C CSdpConnectionField *ConnectionField();

Description

Gets the session level connection field. Note, that the ownership is not transferred and the instance must not be deleted by the caller.

Return value

CSdpConnectionField *

Connection field or zero if not present.


ConnectionField()

IMPORT_C const CSdpConnectionField *ConnectionField() const;

Description

Gets the session level connection field.

Return value

const CSdpConnectionField *

Connection field or zero if not present.


SetConnectionField()

IMPORT_C void SetConnectionField(CSdpConnectionField *aObj);

Description

Sets or removes the session level connection field. Note, that the ownership of the argument is transferred to the SDP document object.

Parameters

CSdpConnectionField *aObj


BandwidthFields()

IMPORT_C RPointerArray< CSdpBandwidthField > &BandwidthFields();

Description

Gets the possibly empty set of session level bandwidth fields. This array is used directly for element insertion and removal. The array may contain zero references and these are ignored.

The objects referenced from the array are owned by the document instance and must not be deleted. An object can be removed from the document by setting the corresponding element to zero. By doing so, the calling party receives ownership of the removed object.

Return value

RPointerArray< CSdpBandwidthField > &

Set of bandwidth fields.


TimeFields()

IMPORT_C RPointerArray< CSdpTimeField > &TimeFields();

Description

Gets the set of session level time description fields. This array is used directly for element insertion and removal. There must be at least one time description field in a valid SDP document.The array may contain zero references and these are ignored.

The objects referenced from the array are owned by the document instance and must not be deleted. An object can be removed from the document by setting the corresponding element to zero. By doing so, the calling party receives ownership of the removed object.

Return value

RPointerArray< CSdpTimeField > &

Set of time fields.


ZoneAdjustments()

IMPORT_C const TDesC8 &ZoneAdjustments() const;

Description

Gets the zone adjustments field value.

Return value

const TDesC8 &

The field value or an empty descriptor if the field is not present.


SetZoneAdjustmentsL()

IMPORT_C void SetZoneAdjustmentsL(const TDesC8 &aValue);

Description

Sets the zone adjustments field value.

Parameters

const TDesC8 &aValue

A valid field value or an empty descriptor if field is not present.


Key()

IMPORT_C CSdpKeyField *Key();

Description

Gets the session level encryption key field. Note, that the ownership is not transferred and the instance must not be deleted by the caller.

Return value

CSdpKeyField *

The encryption key or zero if not present.


Key()

IMPORT_C const CSdpKeyField *Key() const;

Description

Gets the session level encryption key field.

Return value

const CSdpKeyField *

The encryption key or zero if not present.


SetKey()

IMPORT_C void SetKey(CSdpKeyField *aObj);

Description

Sets or removes the encryption key field. Note, that the ownership of the argument is transferred to the SDP document object.

Parameters

CSdpKeyField *aObj

New value of the field or zero to remove the field.


AttributeFields()

IMPORT_C RPointerArray< CSdpAttributeField > &AttributeFields();

Description

Gets the possibly empty set of session level attribute fields. This array is used directly for element insertion and removal. The array may contain zero references and these are ignored.

The objects referenced from the array are owned by the document instance and must not be deleted. An object can be removed from the document by setting the corresponding element to zero. By doing so, the calling party receives ownership of the removed object.

Return value

RPointerArray< CSdpAttributeField > &

Set of session level attributes.


MediaFields()

IMPORT_C RPointerArray< CSdpMediaField > &MediaFields();

Description

Gets the possibly empty set of media description fields. This array is used directly for element insertion and removal. Note, that media level attributes and fields are managed through the corresponding media field instance and not through the document instance. The array may contain zero references and these are ignored.

The objects referenced from the array are owned by the document instance and must not be deleted. An object can be removed from the document by setting the corresponding element to zero. By doing so, the calling party receives ownership of the removed object.

Return value

RPointerArray< CSdpMediaField > &

Set of media description fields.