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();
Public Member Functions | |
---|---|
~CUpnpProtocolInfo () | |
IMPORT_C TPtrC8 | FirstField () |
IMPORT_C TPtrC8 | FourthField () |
IMPORT_C CUpnpProtocolInfo * | NewL () |
IMPORT_C CUpnpProtocolInfo * | NewL (const TDesC8 &) |
IMPORT_C TPtrC8 | ProtocolInfoL () |
IMPORT_C TPtrC8 | SecondField () |
IMPORT_C void | SetFirstFieldL (const TDesC8 &) |
IMPORT_C void | SetFourthFieldL (const TDesC8 &) |
IMPORT_C void | SetSecondFieldL (const TDesC8 &) |
IMPORT_C void | SetThirdFieldL (const TDesC8 &) |
IMPORT_C TPtrC8 | ThirdField () |
Protected Member Functions | |
---|---|
CUpnpProtocolInfo () | |
void | BaseConstructL (const TDesC8 &) |
TInt | CheckBooleanValue ( TChar ) |
void | GetFourthParameterInternalL ( TDes8 &) |
TInt | GetFourthParameterLength () |
TInt | GetProtocolInfoLength () |
void | ParseAtomToDelimeter ( TLex8 &, TChar ) |
TInt | ParseL (const TDesC8 &) |
void | SetParameterL ( TInt , const TDesC8 &) |
void | Skip ( TLex8 &, TInt ) |
void | SkipAndMark ( TLex8 &, TInt ) |
Protected Attributes | |
---|---|
HBufC8 * | iFourthParameter |
HBufC8 * | iProtocolInfo |
HBufC8 * | iThirdParameter |
Private Attributes | |
---|---|
HBufC8 * | iFirstParameter |
HBufC8 * | iSecondParameter |
void | BaseConstructL | ( | const TDesC8 & | aInputString | ) | [protected] |
Method for creating instance of class. aInputString must contain protocolInfo string.
const TDesC8 & aInputString |
TInt | CheckBooleanValue | ( | TChar | aCharacter | ) | [protected] |
Check if character contains correct value for boolean type (1 or 0)
TChar aCharacter |
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.
TDes8 & aBuffer |
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.
TInt | GetProtocolInfoLength | ( | ) | [protected] |
Returns - integer value, which contains iformation about the length of the string currently stored in the class.
IMPORT_C CUpnpProtocolInfo * | NewL | ( | ) | [static] |
Factory method. Creates CProtocolInfo with empty parameters
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() );
const TDesC8 & aProtocolInfo | protocolInfo string to be parsed |
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.
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.
const TDesC8 & aInputString |
IMPORT_C void | SetFirstFieldL | ( | const TDesC8 & | aValue | ) |
Setter for first parameter value.
const TDesC8 & aValue | parameter value |
IMPORT_C void | SetFourthFieldL | ( | const TDesC8 & | aValue | ) |
Setter for fourth parameter value.
const TDesC8 & aValue | parameter value |
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.
IMPORT_C void | SetSecondFieldL | ( | const TDesC8 & | aValue | ) |
Setter for second parameter value.
const TDesC8 & aValue | parameter value |
IMPORT_C void | SetThirdFieldL | ( | const TDesC8 & | aValue | ) |
Setter for third parameter value.
const TDesC8 & aValue | parameter value |
void | Skip | ( | TLex8 & | aLexer, |
TInt | aValue | |||
) | [protected] |
Skips aValue characters. Do not mark.
void | SkipAndMark | ( | TLex8 & | aLexer, |
TInt | aValue | |||
) | [protected] |
Skips aValue characters and marks after end of skipping.
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.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.