CUpnpProtocolInfo Class Reference

class CUpnpProtocolInfo : public CBase

CUpnpProtocolInfo class. Class siplifies mainipulation of UPnP res property. Syntax: protocolInfo = <protocol> : <network> : <contentFormat> : <additionalInfo>

(See ConnectionManager:1 Service Template Version 1.01 for details)

Use case 1: Building protocol info:

_LIT8(KFirstParam, "http-get"); _LIT8(KSecondParam, "*"); _LIT8(KThirdParam, "image/jpeg"); _LIT8(KFourthParam, "*");

CUpnpProtocolInfo * protocolInfo = CUpnpProtocolInfo::NewL() ; protocolInfo->SetFirstFieldL(KFirstParam()); protocolInfo->SetSecondFieldL(KSecondParam()); protocolInfo->SetThirdFieldL(KThirdParam()); protocolInfo->SetFourthFieldL(KFourthParam());

Use case 2: Parsing existing protocol info:

_LIT8(KInfo, "http-get:*:audio/mpeg:*"); CUpnpProtocolInfo * protocolInfo = CUpnpProtocolInfo::NewL (KInfo()); TPtrC8 param = protocolInfo->SetFirstField(); param = protocolInfo->SecondParameterL(); param = protocolInfo->ThirdParameterL(); param = protocolInfo->FourthParameterL();

upnpavobjects.lib
Since
S60 3.1

Inherits from

Constructor & Destructor Documentation

CUpnpProtocolInfo()

CUpnpProtocolInfo ( ) [protected]

Constructor of the class

~CUpnpProtocolInfo()

~CUpnpProtocolInfo ( ) [virtual]

Destructor of the class.

Member Functions Documentation

BaseConstructL(const TDesC8 &)

void BaseConstructL ( const TDesC8 & aInputString ) [protected]

Method for creating instance of class. aInputString must contain protocolInfo string.

Parameters

const TDesC8 & aInputString

CheckBooleanValue(TChar)

TInt CheckBooleanValue ( TChar aCharacter ) [protected]

Check if character contains correct value for boolean type (1 or 0)

Parameters

TChar aCharacter

FirstField()

IMPORT_C TPtrC8 FirstField ( )

Getter for ProtocolInfo.

FourthField()

IMPORT_C TPtrC8 FourthField ( ) [virtual]

Getter for fourth parameter

GetFourthParameterInternalL(TDes8 &)

void GetFourthParameterInternalL ( TDes8 & aBuffer ) [protected, virtual]

This function produces a string containing all info taken from fourth ProtocolInfo field aBuffer - on this variable values are appended.

Parameters

TDes8 & aBuffer

GetFourthParameterLength()

TInt GetFourthParameterLength ( ) [protected, virtual]

This function returns length of the string containing all relevant information from fourth ProtocolInfo field. Returns - length of the string for 4th field.

GetProtocolInfoLength()

TInt GetProtocolInfoLength ( ) [protected]

Returns - integer value, which contains iformation about the length of the string currently stored in the class.

NewL()

IMPORT_C CUpnpProtocolInfo * NewL ( ) [static]

Factory method. Creates CProtocolInfo with empty parameters

NewL(const TDesC8 &)

IMPORT_C CUpnpProtocolInfo * NewL ( const TDesC8 & aProtocolInfo ) [static]

Factory method. Parses input descriptor. Example: _LIT8(KProtocolInfo,""http-get:*:audio/mpeg:*"); CProtocolInfo* protocolInfo = CProtocolInfo::NewL( KProtocolInfo() );

Parameters

const TDesC8 & aProtocolInfo protocolInfo string to be parsed

ParseAtomToDelimeter(TLex8 &, TChar)

void ParseAtomToDelimeter ( TLex8 & aLexeme,
TChar aDelimeter
) [protected]

It marks a string placed between start position and aDelimeter aLexeme - TLex8 object on which marking is occuring. aDelimeter - character on which marking will end.

Parameters

TLex8 & aLexeme
TChar aDelimeter

ParseL(const TDesC8 &)

TInt ParseL ( const TDesC8 & aInputString ) [protected, virtual]

Parses aInputString into protocolInfo object. aInputString- descriptor with protocolInfo Returns KErrNone when everything ok. KErrArgument when there was additionalInfo string empty.

Parameters

const TDesC8 & aInputString

ProtocolInfoL()

IMPORT_C TPtrC8 ProtocolInfoL ( )

Gets whole ProtocolInfo as a descriptor.

SecondField()

IMPORT_C TPtrC8 SecondField ( )

Getter for second parameter.

SetFirstFieldL(const TDesC8 &)

IMPORT_C void SetFirstFieldL ( const TDesC8 & aValue )

Setter for first parameter value.

Parameters

const TDesC8 & aValue parameter value

SetFourthFieldL(const TDesC8 &)

IMPORT_C void SetFourthFieldL ( const TDesC8 & aValue )

Setter for fourth parameter value.

Parameters

const TDesC8 & aValue parameter value

SetParameterL(TInt, const TDesC8 &)

void SetParameterL ( TInt aWhich,
const TDesC8 & aValue
) [protected]

Sets one of the four parameters of protcolInfo object: <protocol>':'<network>':'<contentType>':'<additionalInfo> protocol - iFirstField. network- iSecondField contentType - iThirdField additionalInfo iFourthField.

Parameters

TInt aWhich
const TDesC8 & aValue

SetSecondFieldL(const TDesC8 &)

IMPORT_C void SetSecondFieldL ( const TDesC8 & aValue )

Setter for second parameter value.

Parameters

const TDesC8 & aValue parameter value

SetThirdFieldL(const TDesC8 &)

IMPORT_C void SetThirdFieldL ( const TDesC8 & aValue )

Setter for third parameter value.

Parameters

const TDesC8 & aValue parameter value

Skip(TLex8 &, TInt)

void Skip ( TLex8 & aLexer,
TInt aValue
) [protected]

Skips aValue characters. Do not mark.

Parameters

TLex8 & aLexer
TInt aValue

SkipAndMark(TLex8 &, TInt)

void SkipAndMark ( TLex8 & aLexer,
TInt aValue
) [protected]

Skips aValue characters and marks after end of skipping.

Parameters

TLex8 & aLexer
TInt aValue

ThirdField()

IMPORT_C TPtrC8 ThirdField ( )

Getter for third parameter.

Member Data Documentation

HBufC8 * iFirstParameter

HBufC8 * iFirstParameter [private]

First field of protoclInfo.

HBufC8 * iFourthParameter

HBufC8 * iFourthParameter [protected]

Fourth field of protocolInfo. If this field equals NULL this means that information in rest DLNA parameters is valid. else, the field contains information from parsed string.

HBufC8 * iProtocolInfo

HBufC8 * iProtocolInfo [protected]

ProtoclInfo.

HBufC8 * iSecondParameter

HBufC8 * iSecondParameter [private]

Second field of protoclInfo.

HBufC8 * iThirdParameter

HBufC8 * iThirdParameter [protected]

Third field of protoclInfo.