libupnpp
0.16.0
A C++ wrapper for the Portable UPnP reference library
|
UPnP Media Server directory entry, converted from XML data. More...
#include <cdircontent.hxx>
Classes | |
struct | PropertyValue |
A PropertyValue object describes one instance of a property (the name of which is the key in the parent map), with its attribute values). More... | |
Public Types | |
enum | ObjType { objtnone = -1, item, container } |
enum | ItemClass { ITC_audioItem = 0, ITC_playlist = 1, ITC_unknown = 2, ITC_videoItem = 3, ITC_audioItem_musicTrack = ITC_audioItem, ITC_audioItem_playlist = ITC_playlist } |
typedef std::map< std::string, std::vector< PropertyValue > > | PropertyMap |
Public Member Functions | |
bool | getprop (const std::string &name, std::string &value) const |
Get named property. More... | |
const std::string & | getprop (const std::string &name) const |
Get named property. More... | |
bool | getrprop (unsigned int ridx, const std::string &nm, std::string &val) const |
Get named resource attribute. More... | |
std::string | f2s (const std::string &nm, bool isresfield) |
Simplified interface to retrieving values: we don't distinguish between non-existing and empty, and we only use the first ressource. | |
int | getDurationSeconds (unsigned ridx=0) const |
Return resource duration in seconds. More... | |
std::string | getdidl () const |
Get a DIDL document suitable for sending to a mediaserver. More... | |
void | clear (bool detailed=false) |
std::string | dump () const |
Public Attributes | |
std::string | m_id |
Object Id. | |
std::string | m_pid |
Parent Object Id. | |
std::string | m_title |
Value of dc:title. | |
ObjType | m_type |
Item or container. | |
ItemClass | m_iclass |
Item type details. | |
std::map< std::string, std::string > | m_props |
Basic/compat storage for the properties, with multiple values concatenated. More... | |
std::shared_ptr< PropertyMap > | m_allprops {std::shared_ptr<PropertyMap>()} |
Extended storage for properties, with support for multiple values, and for storing the attributes. More... | |
std::vector< UPnPResource > | m_resources |
Resources: there may be several, for example for different audio formats of the same track, each with an URI and descriptor fields. More... | |
Friends | |
class | UPnPDirParser |
UPnP Media Server directory entry, converted from XML data.
This is a dumb data holder class, a struct with helpers.
string UPnPClient::UPnPDirObject::getdidl | ( | ) | const |
Get a DIDL document suitable for sending to a mediaserver.
Only works for items, not containers. We may have missed useful stuff while parsing the data from the content directory, so we send the original if we can.
|
inline |
Return resource duration in seconds.
ridx | resource index. |
|
inline |
Get named property.
name | (e.g. upnp:artist, upnp:album...). Use m_title instead for dc:title. | |
[out] | value | the parameter value if found |
|
inline |
Get named property.
name | (e.g. upnp:artist, upnp:album...). Use m_title instead for dc:title. |
|
inline |
Get named resource attribute.
Field names: "bitrate", "duration" (H:mm:ss.ms), "nrAudioChannels", "protocolInfo", "sampleFrequency" (Hz), "size" (bytes).
ridx | index in resources array. |
nm | attribute name. |
std::shared_ptr<PropertyMap> UPnPClient::UPnPDirObject::m_allprops {std::shared_ptr<PropertyMap>()} |
Extended storage for properties, with support for multiple values, and for storing the attributes.
The key is the property name (e.g. "artist"). See PropertyMap and
This is only created if the
detailed | parse param is true |
std::map<std::string, std::string> UPnPClient::UPnPDirObject::m_props |
Basic/compat storage for the properties, with multiple values concatenated.
See m_allprops for an extended version.
Properties as gathered from the XML document (album, artist, etc.), The map keys are the XML tag names except for title which has a proper field. Multiple values for a given key are concatenated with ", " as a separator, possibly qualified by 'role' which is the only attribute we look at.
std::vector<UPnPResource> UPnPClient::UPnPDirObject::m_resources |
Resources: there may be several, for example for different audio formats of the same track, each with an URI and descriptor fields.