#include <object.h>
Public Member Functions | |
virtual cStringList * | getPropertyList () |
virtual IXML_Node * | createDIDLFragment (IXML_Document *Document, cStringList *Filter) |
virtual bool | setProperty (const char *Property, const char *Value) |
virtual bool | getProperty (const char *Property, char **Value) const |
virtual cUPnPClassContainer * | getContainer () |
void | addObject (cUPnPClassObject *Object) |
void | removeObject (cUPnPClassObject *Object) |
cUPnPClassObject * | getObject (cUPnPObjectID ID) const |
cUPnPObjects * | getObjectList () const |
int | addSearchClass (cClass SearchClass) |
int | delSearchClass (cClass SearchClass) |
int | addCreateClass (cClass CreateClass) |
int | delCreateClass (cClass CreateClass) |
int | setContainerType (const char *Type) |
int | setSearchClasses (std::vector< cClass > SearchClasses) |
int | setCreateClasses (std::vector< cClass > CreateClasses) |
int | setSearchable (bool Searchable) |
const char * | getContainerType () const |
const std::vector< cClass > * | getSearchClasses () const |
const std::vector< cClass > * | getCreateClasses () const |
bool | isSearchable () const |
unsigned int | getChildCount () const |
unsigned int | getUpdateID () const |
bool | isUpdated () |
Protected Member Functions | |
void | update () |
int | setUpdateID (unsigned int UID) |
cUPnPClassContainer () | |
Protected Attributes | |
cString | mContainerType |
DLNA container type. | |
tClassVector | mSearchClasses |
Classes which are searchable. | |
tClassVector | mCreateClasses |
Classes which are creatable. | |
bool | mSearchable |
Is the Container searchable? | |
unsigned int | mUpdateID |
The containerUpdateID. | |
cUPnPObjects * | mChildren |
List of children. | |
cHash< cUPnPClassObject > * | mChildrenID |
List of children as hash map. | |
Friends | |
class | cMediaDatabase |
class | cUPnPObjectMediator |
class | cUPnPContainerMediator |
This is a UPnP class Container representation with all its properties.
cUPnPClassContainer::cUPnPClassContainer | ( | ) | [protected] |
Constructor of a container
This creates a new instance of a container
int cUPnPClassContainer::addCreateClass | ( | cClass | CreateClass | ) |
Add a create class
This adds a create class to the create classes vector
0
, if adding was successful<0
, otherwise CreateClass | the new class to be added |
void cUPnPClassContainer::addObject | ( | cUPnPClassObject * | Object | ) |
Add a child
This adds the specified child to this container. The parent container of the child will be set to this container.
Object | the child to be added |
int cUPnPClassContainer::addSearchClass | ( | cClass | SearchClass | ) |
Add a search class
This adds a search class to the search classes vector
0
, if adding was successful<0
, otherwise SearchClass | the new class to be added |
IXML_Node * cUPnPClassContainer::createDIDLFragment | ( | IXML_Document * | Document, | |
cStringList * | Filter | |||
) | [virtual] |
Create the DIDL fragment
This creates the DIDL-Lite fragment of the object. The DIDL is written to the specified IXML document. The details of the output can be controlled via the filter stringlist
Document | the IXML document where to write the contents | |
Filter | the string list with the filter criteria |
Implements cUPnPClassObject.
int cUPnPClassContainer::delCreateClass | ( | cClass | CreateClass | ) |
Remove a create class
This removes a create class from the create classes vector
0
, if deleting was successful<0
, otherwise CreateClass | the class to be deleted |
int cUPnPClassContainer::delSearchClass | ( | cClass | SearchClass | ) |
Remove a search class
This removes a search class from the search classes vector
0
, if deleting was successful<0
, otherwise SearchClass | the class to be deleted |
unsigned int cUPnPClassContainer::getChildCount | ( | ) | const [inline] |
Get the number of children
This returns the total number of children of this container
virtual cUPnPClassContainer* cUPnPClassContainer::getContainer | ( | ) | [inline, virtual] |
Converts to container
This will convert the object into a container if it is one. If not, it returns NULL
.
NULL
, if it is not a containerReimplemented from cUPnPClassObject.
const char* cUPnPClassContainer::getContainerType | ( | ) | const [inline] |
Get the DLNA container type
This returns the DLNA container type. Currently there are only these possible values beside NULL:
TUNER_1_0
const std::vector<cClass>* cUPnPClassContainer::getCreateClasses | ( | ) | const [inline] |
Get the create classes
This returns a vector containing all possible create classes. This are classes, which can be created in this container. For instance a TV container can only create items of the class VideoBroadcast. The vector is empty when creation of new items by the user is not allowed.
cUPnPClassObject * cUPnPClassContainer::getObject | ( | cUPnPObjectID | ID | ) | const |
Get a child by ID
Returns the child, which is specified by the ObjectID
.
ID | the ObjectID of the child |
cUPnPObjects* cUPnPClassContainer::getObjectList | ( | ) | const [inline] |
Get the list of children
This returns a list of the children of the container.
bool cUPnPClassContainer::getProperty | ( | const char * | Property, | |
char ** | Value | |||
) | const [virtual] |
Gets a property
Returns the value of a specified property. The value is converted into a string.
true
, if the property existsfalse
, otherwise Property | the property which should be returned | |
Value | the value of that property |
Reimplemented from cUPnPClassObject.
cStringList * cUPnPClassContainer::getPropertyList | ( | ) | [virtual] |
Get the properties of the object
This returns a property list with all the properties which can be obtained or set with getProperty
or setProperty
.
Reimplemented from cUPnPClassObject.
const std::vector<cClass>* cUPnPClassContainer::getSearchClasses | ( | ) | const [inline] |
Get the search classes
This returns a vector container all possible search classes. This are classes, which can be used for searching in this container.
unsigned int cUPnPClassContainer::getUpdateID | ( | ) | const [inline] |
Get the containerUpdateID
This returns the containerUpdateID
bool cUPnPClassContainer::isSearchable | ( | ) | const [inline] |
Is this container searchable
This returns true
, if the container can be search via Search or false
, otherwise.
true
, if the container is searchablefalse
, otherwise bool cUPnPClassContainer::isUpdated | ( | ) |
Has the container been updated?
This returns true
, if the container was recently updated or false
, otherwise
true
, if the container was updatedfalse
, otherwise void cUPnPClassContainer::removeObject | ( | cUPnPClassObject * | Object | ) |
Remove a child
This removes the specified child from the list of children. The child will also loose its parent container, so that there is no link between left.
Object | the child to be removed |
int cUPnPClassContainer::setContainerType | ( | const char * | Type | ) |
Set the DLNA container type
This sets the DLNA container type. It must be a valid container type value.
0
, if setting was successful<0
, otherwise Type | the DLNA container type |
int cUPnPClassContainer::setCreateClasses | ( | std::vector< cClass > | CreateClasses | ) |
Sets the create classes
This sets the create classes, which allows the user to create new objects in this container, if restricted is false
.
0
, if setting was successful<0
, otherwise CreateClasses | a vector containing the create classes |
bool cUPnPClassContainer::setProperty | ( | const char * | Property, | |
const char * | Value | |||
) | [virtual] |
Sets a property
Sets the value of a specified property. The value is converted from string into the propper data type
true
, if the property existsfalse
, otherwise Property | the property which should be set | |
Value | the value of that property |
Reimplemented from cUPnPClassObject.
int cUPnPClassContainer::setSearchable | ( | bool | Searchable | ) |
Sets the searchable flag
This sets the searchable flag, which allows or disallows search on this container.
0
, if setting was successful<0
, otherwise Searchable | true , to enable or false , to disable searching |
int cUPnPClassContainer::setSearchClasses | ( | std::vector< cClass > | SearchClasses | ) |
Sets the search classes
This sets the search classes, which allows the user to search only for these classes in the current container and its children. If the vector is empty the search can return any match. If the additional flag derived
is set, then also any derived classes are matched.
0
, if setting was successful<0
, otherwise SearchClasses | a vector container the allowed search classes |
int cUPnPClassContainer::setUpdateID | ( | unsigned int | UID | ) | [protected] |
Sets the containerUpdateID
This method should only be used when the containerUpdateID is loaded from the database.
0
, if setting was successful<0
, otherwise UID | the containerUpdateID |
void cUPnPClassContainer::update | ( | ) | [protected] |
Update the container
This performs an update, which acutally increases the containerUpdateID.