CSdpOriginField Class Reference

class CSdpOriginField : public CBase

This class encapsulates the origin field of the Session Description Protocol.

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

Inherits from

Public Member Functions
~CSdpOriginField ()
IMPORT_C const TDesC8 & Address ()
IMPORT_C RStringF AddressType ()
IMPORT_C CSdpOriginField * CloneL ()
IMPORT_C CSdpOriginField * DecodeL (const TDesC8 &)
IMPORT_C CSdpOriginField * DecodeLC (const TDesC8 &)
IMPORT_C void EncodeL ( RWriteStream &)
void ExternalizeL ( RWriteStream &)
IMPORT_C const TInetAddr * InetAddress ()
CSdpOriginField * InternalizeL ( RReadStream &)
IMPORT_C RStringF NetType ()
IMPORT_C CSdpOriginField * NewL (const TDesC8 &, TInt64 , TInt64 , TInetAddr &)
IMPORT_C CSdpOriginField * NewL (const TDesC8 &, TInt64 , TInt64 , RStringF , RStringF , const TDesC8 &)
IMPORT_C CSdpOriginField * NewLC (const TDesC8 &, TInt64 , TInt64 , TInetAddr &)
IMPORT_C CSdpOriginField * NewLC (const TDesC8 &, TInt64 , TInt64 , RStringF , RStringF , const TDesC8 &)
IMPORT_C TInt64 SessionId ()
IMPORT_C void SetAddressL (const TDesC8 &, RStringF , RStringF )
IMPORT_C void SetInetAddress (const TInetAddr &)
IMPORT_C void SetSessionId ( TInt64 )
IMPORT_C void SetUserNameL (const TDesC8 &)
IMPORT_C void SetVersion ( TInt64 )
IMPORT_C const TDesC8 & UserName ()
IMPORT_C TInt64 Version ()
IMPORT_C TBool operator== (const CSdpOriginField &)
Private Member Functions
CSdpOriginField ()
CSdpOriginField (const CSdpOriginField &)
void ConstructL (const TDesC8 &)
void ConstructL (const TDesC8 &, TInt64 , TInt64 , TInetAddr &)
void ConstructL (const TDesC8 &, TInt64 , TInt64 , RStringF , RStringF , const TDesC8 &)
TInt64 Get63Msbs (const TDesC8 &)
TBool IsValidAddress (const TDesC8 &)
TBool IsValidAddress (const TInetAddr &)
TBool IsValidUserName (const TDesC8 &)
CSdpOriginFieldPtrs & OriginFieldPtrs ()
const CSdpOriginFieldPtrs & OriginFieldPtrs ()
void ParseAddressL ( RArray < TPtrC8 > &)
void ParseNetTypeAndAddressTypeL ( RArray < TPtrC8 > &)
void ParseSessionIDAndVersionL ( RArray < TPtrC8 > &)
void ParseUserNameL ( RArray < TPtrC8 > &)
void SetIPAddressType (const TInetAddr &)
TBool TypeMatchesWithFormat (const TDesC8 &, const TDesC8 &, RStringPool )
void __DbgTestInvariant ()
CSdpOriginField & operator= (const CSdpOriginField &)
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
TBuf8 < KMaxAddressLength > iAddress
TBuf < KMaxAddressLength > iAddress16
RStringF iAddressType
RStringF iNetType
RStringPool iPool
TInt64 iSessionId
TInt64 iSessionVersion
TInetAddr iUnicastAddress
HBufC8 * iUserName

Constructor & Destructor Documentation

CSdpOriginField()

CSdpOriginField ( ) [private]

Constructor

CSdpOriginField(const CSdpOriginField &)

CSdpOriginField ( const CSdpOriginField & ) [private]

Parameters

const CSdpOriginField &

~CSdpOriginField()

IMPORT_C ~CSdpOriginField ( )

Deletes the resources held by the instance.

Member Functions Documentation

Address()

IMPORT_C const TDesC8 & Address ( ) const

Gets the address.

AddressType()

IMPORT_C RStringF AddressType ( ) const

Gets the address type.

CloneL()

IMPORT_C CSdpOriginField * CloneL ( ) const

Creates a new instance that is equal to the target.

ConstructL(const TDesC8 &)

void ConstructL ( const TDesC8 & aText ) [private]

Second phase constructor. Parses the text string and initializes the member variables

Parameters

const TDesC8 & aText Line of text that will be parsed (ends on the newline)

ConstructL(const TDesC8 &, TInt64, TInt64, TInetAddr &)

void ConstructL ( const TDesC8 & aUserName,
TInt64 aSessionId,
TInt64 aSessionVersion,
TInetAddr & aUnicastAddress
) [private]

Second phase constructor. Constructs the object.

Parameters

const TDesC8 & aUserName A valid user name value.
TInt64 aSessionId A valid session id value.
TInt64 aSessionVersion A valid announcement version value.
TInetAddr & aUnicastAddress

ConstructL(const TDesC8 &, TInt64, TInt64, RStringF, RStringF, const TDesC8 &)

void ConstructL ( const TDesC8 & aUserName,
TInt64 aSessionId,
TInt64 aSessionVersion,
RStringF aNetType,
RStringF aAddressType,
const TDesC8 & aAddress
) [private]

Second phase constructor. Constructs the object.

Parameters

const TDesC8 & aUserName A valid user name value.
TInt64 aSessionId A valid session id value.
TInt64 aSessionVersion A valid announcement version value.
RStringF aNetType A valid network type value (typically "IN").
RStringF aAddressType A valid address type value (typically "IP4" or "IP6").
const TDesC8 & aAddress A unicast IP Address, Fully Qualified Domain Name (FQDN), or an other type of address allowed for the address type.

DecodeL(const TDesC8 &)

IMPORT_C CSdpOriginField * DecodeL ( const TDesC8 & aText ) [static]

Constructs a new origin field.

Parameters

const TDesC8 & aText A string containing a correctly formatted field value terminated by a CRLF.

DecodeLC(const TDesC8 &)

IMPORT_C CSdpOriginField * DecodeLC ( const TDesC8 & aText ) [static]

Constructs a new origin field and adds the pointer to the cleanup stack.

Parameters

const TDesC8 & aText A string containing a correctly formatted field value terminated by a CRLF.

EncodeL(RWriteStream &)

IMPORT_C void EncodeL ( RWriteStream & aStream ) const

Outputs the field formatted according to SDP syntax and including the terminating CRLF.

Parameters

RWriteStream & aStream Stream used for output. On return the stream includes correctly formatted origin field.

ExternalizeL(RWriteStream &)

void ExternalizeL ( RWriteStream & aStream ) const

Externalizes the object to stream

Parameters

RWriteStream & aStream Stream where the object's state will be stored

Get63Msbs(const TDesC8 &)

TInt64 Get63Msbs ( const TDesC8 & aDecimalValue ) const [private]

Parameters

const TDesC8 & aDecimalValue

InetAddress()

IMPORT_C const TInetAddr * InetAddress ( ) const

Gets the address.

InternalizeL(RReadStream &)

CSdpOriginField * InternalizeL ( RReadStream & aStream ) [static]

Creates object from the stream data

Parameters

RReadStream & aStream Stream where the object's state will be read

IsValidAddress(const TDesC8 &)

TBool IsValidAddress ( const TDesC8 & aAddress ) const [private]

Checks if the given address is valid

Parameters

const TDesC8 & aAddress Address to be checked

IsValidAddress(const TInetAddr &)

TBool IsValidAddress ( const TInetAddr & addr ) const [private]

Checks if the given address is valid

Parameters

const TInetAddr & addr

IsValidUserName(const TDesC8 &)

TBool IsValidUserName ( const TDesC8 & aUserName ) const [private]

Checks if the given username is valid

Parameters

const TDesC8 & aUserName Username

NetType()

IMPORT_C RStringF NetType ( ) const

Gets the network type.

NewL(const TDesC8 &, TInt64, TInt64, TInetAddr &)

IMPORT_C CSdpOriginField * NewL ( const TDesC8 & aUserName,
TInt64 aSessionId,
TInt64 aSessionVersion,
TInetAddr & aAddress
) [static]

Constructs a new origin field.

Parameters

const TDesC8 & aUserName A valid user name value.
TInt64 aSessionId A valid session id value.
TInt64 aSessionVersion A valid announcement version value.
TInetAddr & aAddress A unicast IP address from either KAfInet or KAfInet6 family.

NewL(const TDesC8 &, TInt64, TInt64, RStringF, RStringF, const TDesC8 &)

IMPORT_C CSdpOriginField * NewL ( const TDesC8 & aUserName,
TInt64 aSessionId,
TInt64 aSessionVersion,
RStringF aNetType,
RStringF aAddressType,
const TDesC8 & aAddress
) [static]

Constructs a new origin field.

Parameters

const TDesC8 & aUserName A valid user name value.
TInt64 aSessionId A valid session id value.
TInt64 aSessionVersion A valid announcement version value.
RStringF aNetType A valid network type value (typically "IN").
RStringF aAddressType A valid address type value (typically "IP4" or "IP6").
const TDesC8 & aAddress A unicast IP Address, Fully Qualified Domain Name (FQDN), or an other type of address allowed for the address type.

NewLC(const TDesC8 &, TInt64, TInt64, TInetAddr &)

IMPORT_C CSdpOriginField * NewLC ( const TDesC8 & aUserName,
TInt64 aSessionId,
TInt64 aSessionVersion,
TInetAddr & aAddress
) [static]

Constructs a new origin field and adds the pointer to the cleanup stack.

Parameters

const TDesC8 & aUserName A valid user name value.
TInt64 aSessionId A valid session id value.
TInt64 aSessionVersion A valid announcement version value.
TInetAddr & aAddress A unicast IP address from either KAfInet or KAfInet6 family.

NewLC(const TDesC8 &, TInt64, TInt64, RStringF, RStringF, const TDesC8 &)

IMPORT_C CSdpOriginField * NewLC ( const TDesC8 & aUserName,
TInt64 aSessionId,
TInt64 aSessionVersion,
RStringF aNetType,
RStringF aAddressType,
const TDesC8 & aAddress
) [static]

Constructs a new origin field and adds the pointer to the cleanup stack.

Parameters

const TDesC8 & aUserName A valid user name value.
TInt64 aSessionId A valid session id value.
TInt64 aSessionVersion A valid announcement version value.
RStringF aNetType A valid network type value (typically "IN").
RStringF aAddressType A valid address type value (typically "IP4" or "IP6").
const TDesC8 & aAddress A unicast IP Address, Fully Qualified Domain Name (FQDN), or an other type of address allowed for the address type.

OriginFieldPtrs()

CSdpOriginFieldPtrs & OriginFieldPtrs ( ) [private, inline]

OriginFieldPtrs()

const CSdpOriginFieldPtrs & OriginFieldPtrs ( ) const [private, inline]

ParseAddressL(RArray< TPtrC8 > &)

void ParseAddressL ( RArray < TPtrC8 > & aArray ) [private]

Parses address, checks address against address type, initializes iAddress

Parameters

RArray < TPtrC8 > & aArray Array containing all the elements

ParseNetTypeAndAddressTypeL(RArray< TPtrC8 > &)

void ParseNetTypeAndAddressTypeL ( RArray < TPtrC8 > & aArray ) [private]

Parses network type and address type, initializes iNetType and iAddressType

Parameters

RArray < TPtrC8 > & aArray Array containing all the elements

ParseSessionIDAndVersionL(RArray< TPtrC8 > &)

void ParseSessionIDAndVersionL ( RArray < TPtrC8 > & aArray ) [private]

Parses session ID and version, initializes iSessionId and iSessionVersion

Parameters

RArray < TPtrC8 > & aArray Array containing all the elements

ParseUserNameL(RArray< TPtrC8 > &)

void ParseUserNameL ( RArray < TPtrC8 > & aArray ) [private]

Parses username, initializes iUserName

Parameters

RArray < TPtrC8 > & aArray Array containing all the elements

SessionId()

IMPORT_C TInt64 SessionId ( ) const

Gets the session id of the origin field.

SetAddressL(const TDesC8 &, RStringF, RStringF)

IMPORT_C void SetAddressL ( const TDesC8 & aAddress,
RStringF aNetType,
RStringF aAddressType
)

Sets the address, network and address type.

leave
KErrSdpCodecOriginField if aNetType or aAddressType are not valid tokens, or aAddress is invalid, or aAddress type is not aligned with the address format

Parameters

const TDesC8 & aAddress A unicast IP Address, Fully Qualified Domain Name (FQDN), or an other type of address allowed for the address type.
RStringF aNetType A valid network type value (typically "IN").
RStringF aAddressType A valid address type value (typically "IP4" or "IP6").

SetIPAddressType(const TInetAddr &)

void SetIPAddressType ( const TInetAddr & aAddr ) [private]

Parameters

const TInetAddr & aAddr

SetInetAddress(const TInetAddr &)

IMPORT_C void SetInetAddress ( const TInetAddr & aValue )

Sets the address, network and address type. Also sets the network type to "IN" and address type to "IP4" or "IP6" depending on the address family of aValue.

Parameters

const TInetAddr & aValue A unicast IP address from either KAfInet or KAfInet6 family.

SetSessionId(TInt64)

IMPORT_C void SetSessionId ( TInt64 aValue )

Sets the session id.

Parameters

TInt64 aValue A valid session id value.

SetUserNameL(const TDesC8 &)

IMPORT_C void SetUserNameL ( const TDesC8 & aValue )

Sets the user name.

leave
KErrSdpCodecOriginField if aValue is not a valid user name.

Parameters

const TDesC8 & aValue A valid user name value.

SetVersion(TInt64)

IMPORT_C void SetVersion ( TInt64 aValue )

Sets the announcement version..

Parameters

TInt64 aValue A valid version value.

TypeMatchesWithFormat(const TDesC8 &, const TDesC8 &, RStringPool)

TBool TypeMatchesWithFormat ( const TDesC8 & aAddress,
const TDesC8 & aType,
RStringPool aPool
) const [private]

Checks that address type matches with address format

Parameters

const TDesC8 & aAddress Address
const TDesC8 & aType Address type
RStringPool aPool String pool

UserName()

IMPORT_C const TDesC8 & UserName ( ) const

Gets the user name.

Version()

IMPORT_C TInt64 Version ( ) const

Gets the announcement version.

__DbgTestInvariant()

void __DbgTestInvariant ( ) const [private]

operator=(const CSdpOriginField &)

CSdpOriginField & operator= ( const CSdpOriginField & ) [private]

Parameters

const CSdpOriginField &

operator==(const CSdpOriginField &)

IMPORT_C TBool operator== ( const CSdpOriginField & aObj ) const

Compares this instance to another for equality.

Parameters

const CSdpOriginField & aObj The instance to compare to.

Member Data Documentation

TBuf8< KMaxAddressLength > iAddress

TBuf8 < KMaxAddressLength > iAddress [private]

TBuf< KMaxAddressLength > iAddress16

TBuf < KMaxAddressLength > iAddress16 [private]

RStringF iAddressType

RStringF iAddressType [private]

RStringF iNetType

RStringF iNetType [private]

RStringPool iPool

RStringPool iPool [private]

TInt64 iSessionId

TInt64 iSessionId [private]

TInt64 iSessionVersion

TInt64 iSessionVersion [private]

TInetAddr iUnicastAddress

TInetAddr iUnicastAddress [private]

HBufC8 * iUserName

HBufC8 * iUserName [private]