UPnPItemUtility Class Reference

class UPnPItemUtility

Utility for working with classes CUpnpObject and CUpnpItem . The class provides helpers to locating elements and attributes within the class, locating the resource and the URI, decoding some special elements like dc:date, res etc.

upnpavcontrollerhelper.lib
Since
S60 3.2

Member Functions Documentation

BelongsToClass(const CUpnpObject &, const TDesC8 &)

IMPORT_C TBool BelongsToClass ( const CUpnpObject & aObject,
const TDesC8 & aClass
) [static]

Tests if given object is of given class type. Note that in upnp the object classes are organised in open hierarchies, and this method will return true even if the class is unknown, if aObject's class is derived from aClass. see upnpconstantdefs.h for defined class definitions. example: TBool isPlaylist = BelongsToClass( item, KClassPlaylist );

Since
S60 3.2

Parameters

const CUpnpObject & aObject the object whose class is to be tested
const TDesC8 & aClass the class (in string form) against which to test

FindAttributeByName(const CUpnpElement &, const TDesC8 &)

IMPORT_C const CUpnpAttribute * FindAttributeByName ( const CUpnpElement & aElement,
const TDesC8 & aName
) [static]

Finds an attribute within an upnp element see upnpconstantdefs.h for element name definitions. example: CUpnpAttribute* s = FindAttributeByName( resElem, KAttributeSize );

Since
S60 3.2

Parameters

const CUpnpElement & aElement the element where to look for attributes
const TDesC8 & aName attribute name

FindAttributeByNameL(const CUpnpElement &, const TDesC8 &)

IMPORT_C const CUpnpAttribute & FindAttributeByNameL ( const CUpnpElement & aElement,
const TDesC8 & aName
) [static]

Finds an attribute within an upnp element. Leaves if not found see upnpconstantdefs.h for attribute name definitions. example: TDesC& s = FindAttributeByNameL( resElem, KAttributeSize ). Value() ;

Since
S60 3.2

Parameters

const CUpnpElement & aElement the element where to look for attributes
const TDesC8 & aName attribute name

FindElementByName(const CUpnpObject &, const TDesC8 &)

IMPORT_C const CUpnpElement * FindElementByName ( const CUpnpObject & aObject,
const TDesC8 & aName
) [static]

Finds an element within an object. see upnpconstantdefs.h for element name definitions. example: CUpnpElement* date = FindElementByName( item, KElementDate );

Since
S60 3.2

Parameters

const CUpnpObject & aObject the object where to look for elements
const TDesC8 & aName element name

FindElementByNameL(const CUpnpObject &, const TDesC8 &)

IMPORT_C const CUpnpElement & FindElementByNameL ( const CUpnpObject & aObject,
const TDesC8 & aName
) [static]

Finds an element within an object. Leaves if not found. see upnpconstantdefs.h for element name definitions. example: TDesC& genre = FindElementByNameL( item, KElementDate ). Value() ;

Since
S60 3.2

Parameters

const CUpnpObject & aObject the object where to look for elements
const TDesC8 & aName element name

GetResElements(const CUpnpObject &, RUPnPElementsArray &)

IMPORT_C void GetResElements ( const CUpnpObject & aObject,
RUPnPElementsArray & aResElementsArray
) [static]

Extracts all RES elements from an item. An item can include multiple resources, for instance an item may include the same image scaled to multiple resolutions, or a music track may include the track and its CR cover art as thumbnail. example: RUPnPElementsArray array; GetResElements( array );

Since
S60 3.2

Parameters

const CUpnpObject & aObject
RUPnPElementsArray & aResElementsArray

ResourceFromItemL(const CUpnpItem &)

IMPORT_C const CUpnpElement & ResourceFromItemL ( const CUpnpItem & aItem ) [static]

Finds the original resource of given item. Note that if item has multiple resource elements, this API will select the original and recommended one to use. Also note that if an item includes a thumbnail or another supporting resource, this can not be used to retrieve it. Example: const TDesC& uri = ResourceFromItemL( item ). Value() ;

Since
S60 3.2

Parameters

const CUpnpItem & aItem UPnP item where to extract the res element.

UPnPDateAsTTime(const TDesC8 &, TTime &)

IMPORT_C TInt UPnPDateAsTTime ( const TDesC8 & aUpnpDate,
TTime & aTime
) [static]

Converts given upnp date string into TTime . example: TTime time = UpnpDateAsTTime( FindElementByNameL( item, KElementDate ). Value() );

Since
S60 3.2

Parameters

const TDesC8 & aUpnpDate value from item's dc:date element
TTime & aTime out variable to receive corresponding TTime

UPnPDateAsTTimeL(const TDesC8 &, TTime &)

void UPnPDateAsTTimeL ( const TDesC8 & aUpnpDate,
TTime & aTime
) [private, static]

Parameters

const TDesC8 & aUpnpDate
TTime & aTime

UPnPDurationAsMilliseconds(const TDesC8 &, TInt &)

IMPORT_C TInt UPnPDurationAsMilliseconds ( const TDesC8 & aDuration,
TInt & aMilliseconds
) [static]

Converts given upnp duration or position string to a value in milliseconds. Duration was received in res element duration attribute, or in PositionInfo result from renderer. example: TInt duration = UpnpDurationAsMilliseconds( FindAttributeByNameL( ResourceFromItemL( item ), KAttributeDuration ). Value() );

Since
S60 3.2

Parameters

const TDesC8 & aDuration duration or position as string
TInt & aMilliseconds out variable to receive the result