#include <metadata.h>
Public Member Functions | |
unsigned int | getSystemUpdateID () |
const char * | getContainerUpdateIDs () |
cMediaDatabase () | |
int | addFastFind (cUPnPClassObject *Object, const char *FastFind) |
cUPnPClassObject * | getObjectByFastFind (const char *FastFind) |
cUPnPClassObject * | getObjectByID (cUPnPObjectID ID) |
int | browse (OUT cUPnPResultSet **Results, IN const char *ID, IN bool BrowseMetadata, IN const char *Filter="*", IN unsigned int Offset=0, IN unsigned int Count=0, IN const char *SortCriteria="") |
int | search (OUT cUPnPResultSet **Results, IN const char *ID, IN const char *Search, IN const char *Filter="*", IN unsigned int Offset=0, IN unsigned int Count=0, IN const char *SortCriteria="") |
Friends | |
class | cUPnPServer |
class | cUPnPObjectMediator |
This class is the global object manager. It holds every object in a local cache. Only this class is allowed to create new objects.
cMediaDatabase::cMediaDatabase | ( | ) |
Constructor
This creates an instance of the media database.
int cMediaDatabase::addFastFind | ( | cUPnPClassObject * | Object, | |
const char * | FastFind | |||
) |
Add a Fastfind
This creates a Fastfind entry. It is a string which can be used to relocate a objectID. Usually this is a file name or another ID with which the related object can be found.
-1
, if the creation was successful0
, otherwise Object | the object, which should be registered | |
FastFind | the string with which the object shall be relocated |
int cMediaDatabase::browse | ( | OUT cUPnPResultSet ** | Results, | |
IN const char * | ID, | |||
IN bool | BrowseMetadata, | |||
IN const char * | Filter = "*" , |
|||
IN unsigned int | Offset = 0 , |
|||
IN unsigned int | Count = 0 , |
|||
IN const char * | SortCriteria = "" | |||
) |
Performs a browse on the database
This performs a browse request on the database and returns a structure containing the matching count and DIDL-Lite fragement which is sent to the control point.
UPNP_CDS_E_INVALID_SORT_CRITERIA
, when the sort criteria is malformedUPNP_CDS_E_CANT_PROCESS_REQUEST
, when there is an internal error while processing the requestUPNP_CDS_E_NO_SUCH_OBJECT
, when the requested ObjectID does not existUPNP_SOAP_E_ACTION_FAILED
, when the action failed due any reasonsUPNP_E_SUCCESS
, if the request was successful Results | the result of the request | |
ID | the objectID of the request | |
BrowseMetadata | true to browse metadata, false otherwise | |
Filter | the filter applied to the returned metadata | |
Offset | the starting offset | |
Count | maximum count returned | |
SortCriteria | sorts the results before returning them |
const char * cMediaDatabase::getContainerUpdateIDs | ( | ) |
Returns a CSV list with ContainerUpdateIDs
This list contains an unordered list of ordered pairs of ContainerID and its ContainerUpdateID. It contains only recent changes which are not yet beeing evented. This means that evented updates will be removed from list.
cUPnPClassObject * cMediaDatabase::getObjectByFastFind | ( | const char * | FastFind | ) |
Finds a object by Fastfind
This returns the object via the Fastfind string. The object must be previosly registered via cMediaDatabase::addFastFind()
.
It tries to find the object in the internal object cache. If this fails, the object will be loaded from the database.
FastFind | the string with which the object shall be relocated |
cUPnPClassObject * cMediaDatabase::getObjectByID | ( | cUPnPObjectID | ID | ) |
Finds a object by its ObjectID
This returns the object via its ObjectID.
It tries to find the object in the internal object cache. If this fails, the object will be loaded from the database.
ID | The ObjectID of the requested object |
unsigned int cMediaDatabase::getSystemUpdateID | ( | ) |
Returns the SystemUpdateID
This returns the SystemUpdateID. This changes whenever anything changed within the content directory. This value will be sent through the UPnP network every 2 seconds.
int cMediaDatabase::search | ( | OUT cUPnPResultSet ** | Results, | |
IN const char * | ID, | |||
IN const char * | Search, | |||
IN const char * | Filter = "*" , |
|||
IN unsigned int | Offset = 0 , |
|||
IN unsigned int | Count = 0 , |
|||
IN const char * | SortCriteria = "" | |||
) |
Performs a search on the database
This performs a search request on the database and returns a structure containing the matching count and DIDL-Lite fragement which is sent to the control point.
UPNP_CDS_E_INVALID_SORT_CRITERIA
, when the sort criteria is malformedUPNP_CDS_E_CANT_PROCESS_REQUEST
, when there is an internal error while processing the requestUPNP_CDS_E_NO_SUCH_OBJECT
, when the requested ObjectID does not existUPNP_SOAP_E_ACTION_FAILED
, when the action failed due any reasonsUPNP_E_SUCCESS
, if the request was successful Results | the result of the request | |
ID | the ContainerID | |
Search | the search string | |
Filter | the filter applied to the returned metadata | |
Offset | the starting offset | |
Count | maximum count returned | |
SortCriteria | sorts the results before returning them |