MPD 0.20.6

- Main Page
- Namespaces
- Data Structures
- Files

- File List
- Globals

ContentDirectoryService.hxx
Go to the documentation of this file.
1 /*
2 * Copyright 2003-2017 The Music Player Daemon Project
3 * http://www.musicpd.org
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20 #ifndef _UPNPDIR_HXX_INCLUDED_
21 #define _UPNPDIR_HXX_INCLUDED_
22
23 #include "Compiler.h"
24
25 #include <upnp/upnp.h>
26
27 #include <string>
28 #include <list>
29
30 class UPnPDevice;
31 struct UPnPService;
32 class UPnPDirContent;
33
50 class ContentDirectoryService {
51 std::string m_actionURL;
52 std::string m_serviceType;
53 std::string m_deviceId;
54 std::string m_friendlyName;
55 std::string m_manufacturer;
56 std::string m_modelName;
57
58 int m_rdreqcnt; // Slice size to use when reading
59
60 public:
67 ContentDirectoryService(const UPnPDevice &device,
68 const UPnPService &service);
69
71 ContentDirectoryService() = default;
72
73 ~ContentDirectoryService();
74
79 UPnPDirContent readDir(UpnpClient_Handle handle,
80 const char *objectId) const;
81
82 void readDirSlice(UpnpClient_Handle handle,
83 const char *objectId, unsigned offset,
84 unsigned count, UPnPDirContent& dirbuf,
85 unsigned &didread, unsigned &total) const;
86
96 UPnPDirContent search(UpnpClient_Handle handle,
97 const char *objectId,
98 const char *searchstring) const;
99
104 UPnPDirContent getMetadata(UpnpClient_Handle handle,
105 const char *objectId) const;
106
114 std::list<std::string> getSearchCapabilities(UpnpClient_Handle handle) const;
115
116 gcc_pure
117 std::string GetURI() const {
118 return "upnp://" + m_deviceId + "/" + m_serviceType;
119 }
120
122 const char *getFriendlyName() const {
123 return m_friendlyName.c_str();
124 }
125 };
126
127 #endif /* _UPNPDIR_HXX_INCLUDED_ */
ContentDirectoryService::GetURI
gcc_pure std::string GetURI() const
Definition: ContentDirectoryService.hxx:117
ContentDirectoryService::getFriendlyName
const char * getFriendlyName() const
Retrieve the "friendly name" for this server, useful for display.
Definition: ContentDirectoryService.hxx:122
UPnPService
UPnP Description phase: interpreting the device description which we downloaded from the URL obtained...
Definition: Device.hxx:35
ContentDirectoryService::~ContentDirectoryService
~ContentDirectoryService()
ContentDirectoryService::getMetadata
UPnPDirContent getMetadata(UpnpClient_Handle handle, const char *objectId) const
Read metadata for a given node.
UPnPDevice
Data holder for a UPnP device, parsed from the XML description obtained during discovery.
Definition: Device.hxx:53
ContentDirectoryService::getSearchCapabilities
std::list< std::string > getSearchCapabilities(UpnpClient_Handle handle) const
Retrieve search capabilities.
ContentDirectoryService::search
UPnPDirContent search(UpnpClient_Handle handle, const char *objectId, const char *searchstring) const
Search the content directory service.
ContentDirectoryService::ContentDirectoryService
ContentDirectoryService()=default
An empty one.
Compiler.h
ContentDirectoryService
Content Directory Service class.
Definition: ContentDirectoryService.hxx:50
ContentDirectoryService::readDir
UPnPDirContent readDir(UpnpClient_Handle handle, const char *objectId) const
Read a container's children list into dirbuf.
gcc_pure
#define gcc_pure
Definition: Compiler.h:116
UPnPDirContent
Image of a MediaServer Directory Service container (directory), possibly containing items and subordi...
Definition: Directory.hxx:33
ContentDirectoryService::readDirSlice
void readDirSlice(UpnpClient_Handle handle, const char *objectId, unsigned offset, unsigned count, UPnPDirContent &dirbuf, unsigned &didread, unsigned &total) const