#include <object.h>


Public Member Functions | |
| time_t | modified () const |
| virtual int | Compare (const cListObject &ListObject) const |
| virtual cStringList * | getPropertyList () |
| virtual bool | getProperty (const char *Property, char **Value) const |
| virtual bool | setProperty (const char *Property, const char *Value) |
| virtual cUPnPClassContainer * | getContainer () |
| virtual IXML_Node * | createDIDLFragment (IXML_Document *Document, cStringList *Filter)=0 |
| bool | isContainer () |
| void | setSortCriteria (const char *Property, bool Descending=false) |
| void | clearSortCriteria () |
| int | setTitle (const char *Title) |
| int | setCreator (const char *Creator) |
| int | setRestricted (bool Restricted) |
| int | setWriteStatus (int Status) |
| int | setResources (cList< cUPnPResource > *Resources) |
| int | addResource (cUPnPResource *Resource) |
| int | removeResource (cUPnPResource *Resource) |
| cUPnPObjectID | getID () const |
| cUPnPObjectID | getParentID () const |
| cUPnPClassContainer * | getParent () const |
| const char * | getTitle () const |
| const char * | getClass () const |
| const char * | getCreator () const |
| bool | isRestricted () const |
| int | getWriteStatus () const |
| cUPnPResource * | getResource (unsigned int ResourceID) const |
| cList< cUPnPResource > * | getResources () const |
Protected Member Functions | |
| int | setID (cUPnPObjectID ID) |
| int | setParent (cUPnPClassContainer *Parent) |
| int | setClass (const char *Class) |
| void | setModified (void) |
Protected Attributes | |
| time_t | mLastModified |
| The last modification of this property. | |
| cUPnPObjectID | mID |
| The object ID. | |
| cUPnPClassObject * | mParent |
| The parent object. | |
| cString | mClass |
| Class (Who am I?). | |
| cString | mTitle |
| Object title. | |
| cString | mCreator |
| Creator of this object. | |
| bool | mRestricted |
| Ability of changing metadata? | |
| int | mWriteStatus |
| Ability of writing resources? | |
| cList< cUPnPResource > * | mResources |
| The resources of this object. | |
| cHash< cUPnPResource > * | mResourcesID |
| The resources of this object as hashmap. | |
| IXML_Document * | mDIDLFragment |
| The DIDL fragment of the object. | |
| cString | mSortCriteria |
| The sort criteria to sort with. | |
| bool | mSortDescending |
| The direction of the sort. | |
Friends | |
| class | cMediaDatabase |
| class | cUPnPObjectMediator |
| class | cUPnPClassContainer |
This is a UPnP class Object representation with all its properties.
| int cUPnPClassObject::addResource | ( | cUPnPResource * | Resource | ) |
Add resource to list
This adds the specified resource to the resource list of the object
0, if setting was successful<0, otherwise | Resource | the resource to be added |
| void cUPnPClassObject::clearSortCriteria | ( | ) |
Clears the sort criteria
Clears the property of the sort criteria and sets the descending flag to false.
| int cUPnPClassObject::Compare | ( | const cListObject & | ListObject | ) | const [virtual] |
Compares a object
This compares a given object with this object It uses the SortCriteria to compare them.
>0, if the object comes after this one0, if the objects have the same property<0, if the object comes before this one | ListObject | the object to compare with |
| virtual IXML_Node* cUPnPClassObject::createDIDLFragment | ( | IXML_Document * | Document, | |
| cStringList * | Filter | |||
| ) | [pure 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 |
Implemented in cUPnPClassItem, and cUPnPClassContainer.
| const char* cUPnPClassObject::getClass | ( | ) | const [inline] |
Get the object class
This returns the object class of the object. The classes are defined by the UPnP Working Committee. However, custom classes which are derived from a standardized class are also possible.
| virtual cUPnPClassContainer* cUPnPClassObject::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 in cUPnPClassContainer.
| const char* cUPnPClassObject::getCreator | ( | ) | const [inline] |
Get the creator
This returns the creator of the object. Usually, this is the primary content creator or the owner of the object
| cUPnPObjectID cUPnPClassObject::getID | ( | ) | const [inline] |
Get the object ID
This returns the object ID of the object.
| cUPnPClassContainer* cUPnPClassObject::getParent | ( | ) | const [inline] |
Get the parent object
This returns the parent container object, associated with this object. It is NULL, if the object is the root object.
| cUPnPObjectID cUPnPClassObject::getParentID | ( | ) | const [inline] |
Get the parent ID
This returns the ID of the parent container object, associated with this object. It is -1, if the object is the root object.
| bool cUPnPClassObject::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 in cUPnPClassItem, cUPnPClassContainer, cUPnPClassVideoItem, cUPnPClassMovie, and cUPnPClassVideoBroadcast.
| cStringList * cUPnPClassObject::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 in cUPnPClassItem, cUPnPClassContainer, cUPnPClassVideoItem, cUPnPClassMovie, and cUPnPClassVideoBroadcast.
| cUPnPResource* cUPnPClassObject::getResource | ( | unsigned int | ResourceID | ) | const [inline] |
Get a resource by its ID
Returns the resource with the specified resource ID.
| ResourceID | the resource ID of the demanded resource |
| cList<cUPnPResource>* cUPnPClassObject::getResources | ( | ) | const [inline] |
Get the resources
This returns a list with resources associated with this object.
| const char* cUPnPClassObject::getTitle | ( | ) | const [inline] |
Get the title
This returns the title of the object. This may be the title of an item or the folder name in case of a container.
| int cUPnPClassObject::getWriteStatus | ( | ) | const [inline] |
Get write status
This returns the write status of the object. It gives information, if the resource is modifiable.
| bool cUPnPClassObject::isContainer | ( | ) | [inline] |
Is this a container?
Returns if this object is a container or not
true, if it is a containerfalse, otherwise | bool cUPnPClassObject::isRestricted | ( | ) | const [inline] |
Is the resource restricted?
Returns true, if the object is restricted or false, otherwise. When the object is restricted, then modifications to the metadata of the object are disallowed.
true, if the object is restrictedfalse, otherwise | time_t cUPnPClassObject::modified | ( | ) | const [inline] |
Last modified
Returns when the object was modified the last time.
| int cUPnPClassObject::removeResource | ( | cUPnPResource * | Resource | ) |
Remove resource from list
This removes the specified resource from the resource list of the object
0, if setting was successful<0, otherwise | Resource | the resource to be removed |
| int cUPnPClassObject::setClass | ( | const char * | Class | ) | [protected] |
Set the object class
This is only allowed by mediators and the media database. Manually editing the object class may result in unpredictable behavior.
| Class | the class of this object |
0, if setting was successful<0, otherwise | int cUPnPClassObject::setCreator | ( | const char * | Creator | ) |
Set the creator
The creator of an object is primarily the creator or owner of the object
0, if setting was successful<0, otherwise | Creator | the creator of the object |
| int cUPnPClassObject::setID | ( | cUPnPObjectID | ID | ) | [protected] |
Set the Object ID
This is only allowed by mediators and the media database. Manually editing the object ID may result in unpredictable behavior.
| ID | the ObjectID of this object |
0, if setting was successful<0, otherwise | void cUPnPClassObject::setModified | ( | void | ) | [inline, protected] |
Set the modification time
This sets the last modification time to the current timestamp. This is used to indicate when the object was updated the last time.
| int cUPnPClassObject::setParent | ( | cUPnPClassContainer * | Parent | ) | [protected] |
Set the Parent Object
This is only allowed by mediators and the media database. Manually editing the parent may result in unpredictable behavior.
| Parent | the parent of this object |
0, if setting was successful<0, otherwise | bool cUPnPClassObject::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 in cUPnPClassItem, cUPnPClassContainer, cUPnPClassVideoItem, cUPnPClassMovie, and cUPnPClassVideoBroadcast.
| int cUPnPClassObject::setResources | ( | cList< cUPnPResource > * | Resources | ) |
Set the resources
This sets the list of resources of an object. The list usally contain a single resource. However, multiple resources a also very common.
0, if setting was successful<0, otherwise | Resources | the resource list of this object |
| int cUPnPClassObject::setRestricted | ( | bool | Restricted | ) |
Set the restriction
This sets the restriction flag. If the object is restricted, no modifications to its metadata by the user are allowed.
0, if setting was successful<0, otherwise | Restricted | true, to disallow modification, false to allow it |
| void cUPnPClassObject::setSortCriteria | ( | const char * | Property, | |
| bool | Descending = false | |||
| ) |
Set the sort criteria
This sets a certain criteria which the object can be compared with.
| Property | the property to sort after | |
| Descending | sort the objects in descending order |
| int cUPnPClassObject::setTitle | ( | const char * | Title | ) |
Set the title
This sets the title of the object. It is a required metadata information. It must not be NULL or an empty string.
0, if setting was successful<0, otherwise | Title | the title of the object |
| int cUPnPClassObject::setWriteStatus | ( | int | Status | ) |
Set the write status
This sets the write status of a resource. With this indicator, you can set the modifiabilty of resources by a control point.
0, if setting was successful<0, otherwise | Status | the write status |
1.5.8