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 RStringFAddressType()
IMPORT_C CSdpOriginField *CloneL()
IMPORT_C CSdpOriginField *DecodeL(const TDesC8 &)
IMPORT_C CSdpOriginField *DecodeLC(const TDesC8 &)
IMPORT_C voidEncodeL(RWriteStream &)
voidExternalizeL(RWriteStream &)
IMPORT_C const TInetAddr *InetAddress()
CSdpOriginField *InternalizeL(RReadStream &)
IMPORT_C RStringFNetType()
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 TInt64SessionId()
IMPORT_C voidSetAddressL(const TDesC8 &, RStringF, RStringF)
IMPORT_C voidSetInetAddress(const TInetAddr &)
IMPORT_C voidSetSessionId(TInt64)
IMPORT_C voidSetUserNameL(const TDesC8 &)
IMPORT_C voidSetVersion(TInt64)
IMPORT_C const TDesC8 &UserName()
IMPORT_C TInt64Version()
IMPORT_C TBooloperator==(const CSdpOriginField &)
Private Member Functions
CSdpOriginField()
CSdpOriginField(const CSdpOriginField &)
voidConstructL(const TDesC8 &)
voidConstructL(const TDesC8 &, TInt64, TInt64, TInetAddr &)
voidConstructL(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()
voidParseAddressL(RArray< TPtrC8 > &)
voidParseNetTypeAndAddressTypeL(RArray< TPtrC8 > &)
voidParseSessionIDAndVersionL(RArray< TPtrC8 > &)
voidParseUserNameL(RArray< TPtrC8 > &)
voidSetIPAddressType(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 RStringFAddressType()const

Gets the address type.

CloneL()

IMPORT_C CSdpOriginField *CloneL()const

Creates a new instance that is equal to the target.

ConstructL(const TDesC8 &)

voidConstructL(const TDesC8 &aText)[private]

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

Parameters

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

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

voidConstructL(const TDesC8 &aUserName,
TInt64aSessionId,
TInt64aSessionVersion,
TInetAddr &aUnicastAddress
)[private]

Second phase constructor. Constructs the object.

Parameters

const TDesC8 & aUserNameA valid user name value.
TInt64 aSessionIdA valid session id value.
TInt64 aSessionVersionA valid announcement version value.
TInetAddr & aUnicastAddress

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

voidConstructL(const TDesC8 &aUserName,
TInt64aSessionId,
TInt64aSessionVersion,
RStringFaNetType,
RStringFaAddressType,
const TDesC8 &aAddress
)[private]

Second phase constructor. Constructs the object.

Parameters

const TDesC8 & aUserNameA valid user name value.
TInt64 aSessionIdA valid session id value.
TInt64 aSessionVersionA valid announcement version value.
RStringF aNetTypeA valid network type value (typically "IN").
RStringF aAddressTypeA valid address type value (typically "IP4" or "IP6").
const TDesC8 & aAddressA 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 & aTextA 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 & aTextA string containing a correctly formatted field value terminated by a CRLF.

EncodeL(RWriteStream &)

IMPORT_C voidEncodeL(RWriteStream &aStream)const

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

Parameters

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

ExternalizeL(RWriteStream &)

voidExternalizeL(RWriteStream &aStream)const

Externalizes the object to stream

Parameters

RWriteStream & aStreamStream 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 & aStreamStream 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 & aAddressAddress 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 & aUserNameUsername

NetType()

IMPORT_C RStringFNetType()const

Gets the network type.

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

IMPORT_C CSdpOriginField *NewL(const TDesC8 &aUserName,
TInt64aSessionId,
TInt64aSessionVersion,
TInetAddr &aAddress
)[static]

Constructs a new origin field.

Parameters

const TDesC8 & aUserNameA valid user name value.
TInt64 aSessionIdA valid session id value.
TInt64 aSessionVersionA valid announcement version value.
TInetAddr & aAddressA 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,
TInt64aSessionId,
TInt64aSessionVersion,
RStringFaNetType,
RStringFaAddressType,
const TDesC8 &aAddress
)[static]

Constructs a new origin field.

Parameters

const TDesC8 & aUserNameA valid user name value.
TInt64 aSessionIdA valid session id value.
TInt64 aSessionVersionA valid announcement version value.
RStringF aNetTypeA valid network type value (typically "IN").
RStringF aAddressTypeA valid address type value (typically "IP4" or "IP6").
const TDesC8 & aAddressA 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,
TInt64aSessionId,
TInt64aSessionVersion,
TInetAddr &aAddress
)[static]

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

Parameters

const TDesC8 & aUserNameA valid user name value.
TInt64 aSessionIdA valid session id value.
TInt64 aSessionVersionA valid announcement version value.
TInetAddr & aAddressA 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,
TInt64aSessionId,
TInt64aSessionVersion,
RStringFaNetType,
RStringFaAddressType,
const TDesC8 &aAddress
)[static]

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

Parameters

const TDesC8 & aUserNameA valid user name value.
TInt64 aSessionIdA valid session id value.
TInt64 aSessionVersionA valid announcement version value.
RStringF aNetTypeA valid network type value (typically "IN").
RStringF aAddressTypeA valid address type value (typically "IP4" or "IP6").
const TDesC8 & aAddressA 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 > &)

voidParseAddressL(RArray< TPtrC8 > &aArray)[private]

Parses address, checks address against address type, initializes iAddress

Parameters

RArray< TPtrC8 > & aArrayArray containing all the elements

ParseNetTypeAndAddressTypeL(RArray< TPtrC8 > &)

voidParseNetTypeAndAddressTypeL(RArray< TPtrC8 > &aArray)[private]

Parses network type and address type, initializes iNetType and iAddressType

Parameters

RArray< TPtrC8 > & aArrayArray containing all the elements

ParseSessionIDAndVersionL(RArray< TPtrC8 > &)

voidParseSessionIDAndVersionL(RArray< TPtrC8 > &aArray)[private]

Parses session ID and version, initializes iSessionId and iSessionVersion

Parameters

RArray< TPtrC8 > & aArrayArray containing all the elements

ParseUserNameL(RArray< TPtrC8 > &)

voidParseUserNameL(RArray< TPtrC8 > &aArray)[private]

Parses username, initializes iUserName

Parameters

RArray< TPtrC8 > & aArrayArray containing all the elements

SessionId()

IMPORT_C TInt64SessionId()const

Gets the session id of the origin field.

SetAddressL(const TDesC8 &, RStringF, RStringF)

IMPORT_C voidSetAddressL(const TDesC8 &aAddress,
RStringFaNetType,
RStringFaAddressType
)

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 & aAddressA unicast IP Address, Fully Qualified Domain Name (FQDN), or an other type of address allowed for the address type.
RStringF aNetTypeA valid network type value (typically "IN").
RStringF aAddressTypeA valid address type value (typically "IP4" or "IP6").

SetIPAddressType(const TInetAddr &)

voidSetIPAddressType(const TInetAddr &aAddr)[private]

Parameters

const TInetAddr & aAddr

SetInetAddress(const TInetAddr &)

IMPORT_C voidSetInetAddress(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 & aValueA unicast IP address from either KAfInet or KAfInet6 family.

SetSessionId(TInt64)

IMPORT_C voidSetSessionId(TInt64aValue)

Sets the session id.

Parameters

TInt64 aValueA valid session id value.

SetUserNameL(const TDesC8 &)

IMPORT_C voidSetUserNameL(const TDesC8 &aValue)

Sets the user name.

leave
KErrSdpCodecOriginField if aValue is not a valid user name.

Parameters

const TDesC8 & aValueA valid user name value.

SetVersion(TInt64)

IMPORT_C voidSetVersion(TInt64aValue)

Sets the announcement version..

Parameters

TInt64 aValueA valid version value.

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

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

Checks that address type matches with address format

Parameters

const TDesC8 & aAddressAddress
const TDesC8 & aTypeAddress type
RStringPool aPoolString pool

UserName()

IMPORT_C const TDesC8 &UserName()const

Gets the user name.

Version()

IMPORT_C TInt64Version()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 TBooloperator==(const CSdpOriginField &aObj)const

Compares this instance to another for equality.

Parameters

const CSdpOriginField & aObjThe 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]