MPD 0.20.6

- Main Page
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

Public Member Functions
ContentDirectoryService Class Reference

Content Directory Service class. More...

`#include <ContentDirectoryService.hxx>`

## Public Member Functions
| ContentDirectoryService (const UPnPDevice &device, const UPnPService &service)
| Construct by copying data from device and service objects. More...
| ContentDirectoryService ()=default
| An empty one. More...
| ~ContentDirectoryService ()
UPnPDirContent | readDir (UpnpClient_Handle handle, const char *objectId) const
| Read a container's children list into dirbuf. More...
void | readDirSlice (UpnpClient_Handle handle, const char *objectId, unsigned offset, unsigned count, UPnPDirContent &dirbuf, unsigned &didread, unsigned &total) const
UPnPDirContent | search (UpnpClient_Handle handle, const char *objectId, const char *searchstring) const
| Search the content directory service. More...
UPnPDirContent | getMetadata (UpnpClient_Handle handle, const char *objectId) const
| Read metadata for a given node. More...
std::list< std::string > | getSearchCapabilities (UpnpClient_Handle handle) const
| Retrieve search capabilities. More...
gcc_pure std::string | GetURI () const
const char * | getFriendlyName () const
| Retrieve the "friendly name" for this server, useful for display. More...

## Detailed Description

Content Directory Service class.

This stores identity data from a directory service and the device it belongs to, and has methods to query the directory, using libupnp for handling the UPnP protocols.

Note: m_rdreqcnt: number of entries requested per directory read. 0 means all entries. The device can still return less entries than requested, depending on its own limits. In general it's not optimal becauses it triggers issues, and is sometimes actually slower, e.g. on a D-Link NAS 327

The value chosen may affect by the UpnpSetMaxContentLength (2000*1024) done during initialization, but this should be ample

Definition at line 50 of file ContentDirectoryService.hxx.

## Constructor & Destructor Documentation

ContentDirectoryService::ContentDirectoryService | ( | const UPnPDevice & | device,
|  | const UPnPService & | service
| ) |  |

Construct by copying data from device and service objects.

The discovery service does this: use UPnPDeviceDirectory::GetDirectories()

ContentDirectoryService::ContentDirectoryService | ( |  | ) |
| default

An empty one.

ContentDirectoryService::~ContentDirectoryService | ( |  | ) |

## Member Function Documentation

const char* ContentDirectoryService::getFriendlyName | ( |  | ) | const
| inline

Retrieve the "friendly name" for this server, useful for display.

Definition at line 122 of file ContentDirectoryService.hxx.

UPnPDirContent ContentDirectoryService::getMetadata | ( | UpnpClient_Handle | handle,
|  | const char * | objectId
| ) |  | const

Read metadata for a given node.

Parameters

  objectId | the UPnP object Id. Root has Id "0"

std::list<std::string> ContentDirectoryService::getSearchCapabilities | ( | UpnpClient_Handle | handle | ) | const

Retrieve search capabilities.

Throws std::runtime_error on error.

Parameters

  [out] | result | an empty vector: no search, or a single '*' element: any tag can be used in a search, or a list of usable tag names.

gcc_pure std::string ContentDirectoryService::GetURI | ( |  | ) | const
| inline

Definition at line 117 of file ContentDirectoryService.hxx.

UPnPDirContent ContentDirectoryService::readDir | ( | UpnpClient_Handle | handle,
|  | const char * | objectId
| ) |  | const

Read a container's children list into dirbuf.

Parameters

  objectId | the UPnP object Id for the container. Root has Id "0"

void ContentDirectoryService::readDirSlice | ( | UpnpClient_Handle | handle,
|  | const char * | objectId,
|  | unsigned | offset,
|  | unsigned | count,
|  | UPnPDirContent & | dirbuf,
|  | unsigned & | didread,
|  | unsigned & | total
| ) |  | const

UPnPDirContent ContentDirectoryService::search | ( | UpnpClient_Handle | handle,
|  | const char * | objectId,
|  | const char * | searchstring
| ) |  | const

Search the content directory service.

Parameters

  objectId | the UPnP object Id under which the search should be done. Not all servers actually support this below root. Root has Id "0"
  searchstring | an UPnP searchcriteria string. Check the UPnP document: UPnP-av-ContentDirectory-v1-Service-20020625.pdf section 2.5.5. Maybe we'll provide an easier way some day...

The documentation for this class was generated from the following file:

- lib/upnp/ContentDirectoryService.hxx