S60 3rd Edition API Reference: CSdpDocument Class Reference

CSdpDocument Class Reference

API published in: S60 2nd Ed

Link against: sdpcodec.lib

Capability Information

Required Capabilities

None

Exceptions


#include <sdpdocument.h>

Detailed Description

PublishedAll
Released
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.


Public Member Functions

IMPORT_C ~CSdpDocument ()
 Deletes the resources held by the instance.
IMPORT_C void ExternalizeL (RWriteStream &aStream) const
 Externalizes the object state in an internal, memory optimized format.
IMPORT_C void EncodeL (RWriteStream &aStream) const
 Outputs the SDP document formatted according to SDP syntax.
IMPORT_C CSdpDocumentCloneL () const
 Creates a new instance that is equal to the target.
IMPORT_C TBool IsValid () const
 Checks if the instance represents a valid SDP document.
IMPORT_C TUint SdpVersion () const
 Gets the SDP version used in the version field.
IMPORT_C CSdpOriginFieldOriginField ()
 Gets a reference to the session origin field.
IMPORT_C const CSdpOriginFieldOriginField () const
 Gets a reference to the session origin field.
IMPORT_C void SetOriginField (CSdpOriginField *aObj)
 Sets or removes the session origin field.
IMPORT_C const TDesC8 & SessionName () const
 Gets the session name field value.
IMPORT_C void SetSessionNameL (const TDesC8 &aValue)
 Sets the session name field value.
IMPORT_C const TDesC8 & Info () const
 Gets the session information field value.
IMPORT_C void SetInfoL (const TDesC8 &aValue)
 Sets or removes the session information field value.
IMPORT_C CUri8 * Uri ()
 Gets the session URI field value.
IMPORT_C const CUri8 * Uri () const
 Gets the session URI field value.
IMPORT_C void SetUri (CUri8 *aValue)
 Sets or removes the session level URI field.
IMPORT_C CDesC8Array & EmailFields ()
 Gets the set of session level email field values.
IMPORT_C CDesC8Array & PhoneFields ()
 Gets the set of session level phone field values.
IMPORT_C CSdpConnectionFieldConnectionField ()
 Gets the session level connection field.
IMPORT_C const CSdpConnectionFieldConnectionField () const
 Gets the session level connection field.
IMPORT_C void SetConnectionField (CSdpConnectionField *aObj)
 Sets or removes the session level connection field.
IMPORT_C RPointerArray< CSdpBandwidthField > & BandwidthFields ()
 Gets the possibly empty set of session level bandwidth fields.
IMPORT_C RPointerArray< CSdpTimeField > & TimeFields ()
 Gets the set of session level time description fields.
IMPORT_C const TDesC8 & ZoneAdjustments () const
 Gets the zone adjustments field value.
IMPORT_C void SetZoneAdjustmentsL (const TDesC8 &aValue)
 Sets the zone adjustments field value.
IMPORT_C CSdpKeyFieldKey ()
 Gets the session level encryption key field.
IMPORT_C const CSdpKeyFieldKey () const
 Gets the session level encryption key field.
IMPORT_C void SetKey (CSdpKeyField *aObj)
 Sets or removes the encryption key field.
IMPORT_C RPointerArray< CSdpAttributeField > & AttributeFields ()
 Gets the possibly empty set of session level attribute fields.
IMPORT_C RPointerArray< CSdpMediaField > & MediaFields ()
 Gets the possibly empty set of media description fields.

Static Public Member Functions

static IMPORT_C CSdpDocumentDecodeL (const TDesC8 &aText)
 Constructs a new SDP document.
static IMPORT_C CSdpDocumentDecodeLC (const TDesC8 &aText)
 Constructs a new SDP document and adds the pointer to the cleanup stack.
static IMPORT_C CSdpDocumentNewL ()
 Constructs a new, empty SDP document.
static IMPORT_C CSdpDocumentNewLC ()
 Constructs a new, empty SDP document document and adds the pointer to the cleanup stack.
static IMPORT_C CSdpDocumentInternalizeL (RReadStream &aStream)
 Internalizes the object state from an internal, memory optimized format.

Constructor & Destructor Documentation

IMPORT_C CSdpDocument::~CSdpDocument  ) 
 

Deletes the resources held by the instance.


Member Function Documentation

IMPORT_C RPointerArray<CSdpAttributeField>& CSdpDocument::AttributeFields  ) 
 

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.

Returns:
Set of session level attributes.
IMPORT_C RPointerArray<CSdpBandwidthField>& CSdpDocument::BandwidthFields  ) 
 

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.

Returns:
Set of bandwidth fields.
IMPORT_C CSdpDocument* CSdpDocument::CloneL  )  const
 

Creates a new instance that is equal to the target.

Returns:
a new instance.
IMPORT_C const CSdpConnectionField* CSdpDocument::ConnectionField  )  const
 

Gets the session level connection field.

Returns:
Connection field or zero if not present.
IMPORT_C CSdpConnectionField* CSdpDocument::ConnectionField  ) 
 

Gets the session level connection field.

Note, that the ownership is not transferred and the instance must not be deleted by the caller.

Returns:
Connection field or zero if not present.
static IMPORT_C CSdpDocument* CSdpDocument::DecodeL const TDesC8 &  aText  )  [static]
 

Constructs a new SDP document.

Parameters:
aText A string containing a correctly formatted SDP document.
Returns:
a new instance.
static IMPORT_C CSdpDocument* CSdpDocument::DecodeLC const TDesC8 &  aText  )  [static]
 

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

Parameters:
aText A string containing a correctly formatted SDP document.
Returns:
a new instance.
IMPORT_C CDesC8Array& CSdpDocument::EmailFields  ) 
 

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.

Returns:
Email fields in array or empty array if no email fields.
IMPORT_C void CSdpDocument::EncodeL RWriteStream &  aStream  )  const
 

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:
aStream Stream used for output. On return the stream includes correctly formatted SDP description.
IMPORT_C void CSdpDocument::ExternalizeL RWriteStream &  aStream  )  const
 

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

Parameters:
aStream The output stream.
IMPORT_C const TDesC8& CSdpDocument::Info  )  const
 

Gets the session information field value.

Returns:
Info field value or an empty descriptor if not present.
static IMPORT_C CSdpDocument* CSdpDocument::InternalizeL RReadStream &  aStream  )  [static]
 

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

Parameters:
aStream The input stream.
Returns:
A new SDP document internalized from the input stream.
IMPORT_C TBool CSdpDocument::IsValid  )  const
 

Checks if the instance represents a valid SDP document.

Returns:
ETrue if SDP document is valid and EFalse if not.
IMPORT_C const CSdpKeyField* CSdpDocument::Key  )  const
 

Gets the session level encryption key field.

Returns:
The encryption key or zero if not present.
IMPORT_C CSdpKeyField* CSdpDocument::Key  ) 
 

Gets the session level encryption key field.

Note, that the ownership is not transferred and the instance must not be deleted by the caller.

Returns:
The encryption key or zero if not present.
IMPORT_C RPointerArray<CSdpMediaField>& CSdpDocument::MediaFields  ) 
 

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.

Returns:
Set of media description fields.
static IMPORT_C CSdpDocument* CSdpDocument::NewL  )  [static]
 

Constructs a new, empty SDP document.

The instance will have the following initial values: v=0 s=- t=0 0

Returns:
a new instance.
static IMPORT_C CSdpDocument* CSdpDocument::NewLC  )  [static]
 

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

Returns:
a new instance.
IMPORT_C const CSdpOriginField* CSdpDocument::OriginField  )  const
 

Gets a reference to the session origin field.

Returns:
The origin field or zero if not present.
IMPORT_C CSdpOriginField* CSdpDocument::OriginField  ) 
 

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.

Returns:
The origin field or zero if not present.
IMPORT_C CDesC8Array& CSdpDocument::PhoneFields  ) 
 

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.

Returns:
Phone fields in array or empty array if no phone fields.
IMPORT_C TUint CSdpDocument::SdpVersion  )  const
 

Gets the SDP version used in the version field.

Note, that the current implementation supports only version number 0.

Returns:
The SDP version number.
IMPORT_C const TDesC8& CSdpDocument::SessionName  )  const
 

Gets the session name field value.

Returns:
The session name or empty descriptor if not present.
IMPORT_C void CSdpDocument::SetConnectionField CSdpConnectionField aObj  ) 
 

Sets or removes the session level connection field.

Note, that the ownership of the argument is transferred to the SDP document object.

Parameters:
New connection field or zero to remove the field.
IMPORT_C void CSdpDocument::SetInfoL const TDesC8 &  aValue  ) 
 

Sets or removes the session information field value.

Parameters:
New field value or an empty descriptor to remove the field.
Leave:
KErrSdpCodecInfoField if aValue is not empty or aValue includes invalid byte strings (´´, ´
´, ´´).
IMPORT_C void CSdpDocument::SetKey CSdpKeyField aObj  ) 
 

Sets or removes the encryption key field.

Note, that the ownership of the argument is transferred to the SDP document object.

Parameters:
aObj New value of the field or zero to remove the field.
IMPORT_C void CSdpDocument::SetOriginField CSdpOriginField aObj  ) 
 

Sets or removes the session origin field.

Note, that the ownership of the argument is transferred to the SDP document object.

Parameters:
aObj New origin field or null to remove the field.
IMPORT_C void CSdpDocument::SetSessionNameL const TDesC8 &  aValue  ) 
 

Sets the session name field value.

Parameters:
aValue Valid session name value. Note that an empty value is not accepted.
Leave:
KErrSdpCodecSessionField if aValue is not empty or aValue includes invalid byte strings (´´, ´
´, ´´).
IMPORT_C void CSdpDocument::SetUri CUri8 *  aValue  ) 
 

Sets or removes the session level URI field.

Note, that the ownership of the argument is transferred to the SDP document object.

Parameters:
New value of the field or zero to remove the field.
IMPORT_C void CSdpDocument::SetZoneAdjustmentsL const TDesC8 &  aValue  ) 
 

Sets the zone adjustments field value.

Parameters:
aValue A valid field value or an empty descriptor if field is not present.
IMPORT_C RPointerArray<CSdpTimeField>& CSdpDocument::TimeFields  ) 
 

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.

Returns:
Set of time fields.
IMPORT_C const CUri8* CSdpDocument::Uri  )  const
 

Gets the session URI field value.

Returns:
Session URI or zero if the field is not present.
IMPORT_C CUri8* CSdpDocument::Uri  ) 
 

Gets the session URI field value.

Note, that the ownership is not transferred and the instance must not be deleted by the caller.

Returns:
CUri8*: Session URI or zero if the field is not present.
IMPORT_C const TDesC8& CSdpDocument::ZoneAdjustments  )  const
 

Gets the zone adjustments field value.

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

The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2007
Back to top