UPnPItemUtility Class Reference
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 &)
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 );
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 &)
Finds an attribute within an upnp element see upnpconstantdefs.h for element name definitions. example: CUpnpAttribute* s = FindAttributeByName( resElem, KAttributeSize );
Parameters
const
CUpnpElement
& aElement
|
the element where to look for attributes
|
const
TDesC8
& aName
|
attribute name
|
FindAttributeByNameL(const CUpnpElement &, const TDesC8 &)
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()
;
Parameters
const
CUpnpElement
& aElement
|
the element where to look for attributes
|
const
TDesC8
& aName
|
attribute name
|
FindElementByName(const CUpnpObject &, const TDesC8 &)
Finds an element within an object. see upnpconstantdefs.h for element name definitions. example: CUpnpElement* date = FindElementByName( item, KElementDate );
Parameters
const
CUpnpObject
& aObject
|
the object where to look for elements
|
const
TDesC8
& aName
|
element name
|
FindElementByNameL(const CUpnpObject &, const TDesC8 &)
Finds an element within an object. Leaves if not found. see upnpconstantdefs.h for element name definitions. example: TDesC& genre = FindElementByNameL( item, KElementDate ).
Value()
;
Parameters
const
CUpnpObject
& aObject
|
the object where to look for elements
|
const
TDesC8
& aName
|
element name
|
GetResElements(const CUpnpObject &, RUPnPElementsArray &)
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 );
ResourceFromItemL(const CUpnpItem &)
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()
;
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()
);
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]
|
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()
);
Parameters
const
TDesC8
& aDuration
|
duration or position as string
|
TInt
& aMilliseconds
|
out variable to receive the result
|
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.