Commit 77c461fe authored by Max Kellermann's avatar Max Kellermann

db/upnp: make several methods "const"

parent a89c21b0
......@@ -103,7 +103,7 @@ protected:
bool Configure(const config_param &param, Error &error);
private:
bool VisitServer(ContentDirectoryService &server,
bool VisitServer(const ContentDirectoryService &server,
const std::list<std::string> &vpath,
const DatabaseSelection &selection,
VisitDirectory visit_directory,
......@@ -115,19 +115,19 @@ private:
* Run an UPnP search according to MPD parameters, and
* visit_song the results.
*/
bool SearchSongs(ContentDirectoryService &server,
bool SearchSongs(const ContentDirectoryService &server,
const char *objid,
const DatabaseSelection &selection,
VisitSong visit_song,
Error &error) const;
bool SearchSongs(ContentDirectoryService &server,
bool SearchSongs(const ContentDirectoryService &server,
const char *objid,
const DatabaseSelection &selection,
UPnPDirContent& dirbuf,
Error &error) const;
bool Namei(ContentDirectoryService &server,
bool Namei(const ContentDirectoryService &server,
const std::list<std::string> &vpath,
UPnPDirObject &dirent,
Error &error) const;
......@@ -135,7 +135,7 @@ private:
/**
* Take server and objid, return metadata.
*/
bool ReadNode(ContentDirectoryService &server,
bool ReadNode(const ContentDirectoryService &server,
const char *objid, UPnPDirObject& dirent,
Error &error) const;
......@@ -144,7 +144,7 @@ private:
* except easier cause our inodes have a parent id. Not used
* any more actually (see comments in SearchSongs).
*/
bool BuildPath(ContentDirectoryService &server,
bool BuildPath(const ContentDirectoryService &server,
const UPnPDirObject& dirent, std::string &idpath,
Error &error) const;
};
......@@ -266,7 +266,7 @@ dquote(std::string &out, const char *in)
// Run an UPnP search, according to MPD parameters. Return results as
// UPnP items
bool
UpnpDatabase::SearchSongs(ContentDirectoryService &server,
UpnpDatabase::SearchSongs(const ContentDirectoryService &server,
const char *objid,
const DatabaseSelection &selection,
UPnPDirContent &dirbuf,
......@@ -381,7 +381,7 @@ songPath(const std::string &servername,
}
bool
UpnpDatabase::SearchSongs(ContentDirectoryService &server,
UpnpDatabase::SearchSongs(const ContentDirectoryService &server,
const char *objid,
const DatabaseSelection &selection,
VisitSong visit_song,
......@@ -426,7 +426,7 @@ UpnpDatabase::SearchSongs(ContentDirectoryService &server,
}
bool
UpnpDatabase::ReadNode(ContentDirectoryService &server,
UpnpDatabase::ReadNode(const ContentDirectoryService &server,
const char *objid, UPnPDirObject &dirent,
Error &error) const
{
......@@ -445,7 +445,7 @@ UpnpDatabase::ReadNode(ContentDirectoryService &server,
}
bool
UpnpDatabase::BuildPath(ContentDirectoryService &server,
UpnpDatabase::BuildPath(const ContentDirectoryService &server,
const UPnPDirObject& idirent,
std::string &path,
Error &error) const
......@@ -472,7 +472,7 @@ UpnpDatabase::BuildPath(ContentDirectoryService &server,
// Take server and internal title pathname and return objid and metadata.
bool
UpnpDatabase::Namei(ContentDirectoryService &server,
UpnpDatabase::Namei(const ContentDirectoryService &server,
const std::list<std::string> &vpath,
UPnPDirObject &odirent,
Error &error) const
......@@ -521,7 +521,7 @@ UpnpDatabase::Namei(ContentDirectoryService &server,
// vpath is a parsed and writeable version of selection.uri. There is
// really just one path parameter.
bool
UpnpDatabase::VisitServer(ContentDirectoryService &server,
UpnpDatabase::VisitServer(const ContentDirectoryService &server,
const std::list<std::string> &vpath,
const DatabaseSelection &selection,
VisitDirectory visit_directory,
......
......@@ -63,7 +63,7 @@ ContentDirectoryService::readDirSlice(UpnpClient_Handle hdl,
const char *objectId, unsigned offset,
unsigned count, UPnPDirContent &dirbuf,
unsigned &didreadp, unsigned &totalp,
Error &error)
Error &error) const
{
// Create request
char ofbuf[100], cntbuf[100];
......@@ -112,7 +112,7 @@ bool
ContentDirectoryService::readDir(UpnpClient_Handle handle,
const char *objectId,
UPnPDirContent &dirbuf,
Error &error)
Error &error) const
{
unsigned offset = 0, total = -1, count;
......@@ -132,7 +132,7 @@ ContentDirectoryService::search(UpnpClient_Handle hdl,
const char *objectId,
const char *ss,
UPnPDirContent &dirbuf,
Error &error)
Error &error) const
{
unsigned offset = 0, total = -1, count;
......@@ -189,7 +189,7 @@ ContentDirectoryService::search(UpnpClient_Handle hdl,
bool
ContentDirectoryService::getSearchCapabilities(UpnpClient_Handle hdl,
std::list<std::string> &result,
Error &error)
Error &error) const
{
assert(result.empty());
......@@ -234,7 +234,7 @@ bool
ContentDirectoryService::getMetadata(UpnpClient_Handle hdl,
const char *objectId,
UPnPDirContent &dirbuf,
Error &error)
Error &error) const
{
// Create request
IXML_Document *request =
......
......@@ -75,13 +75,13 @@ public:
*/
bool readDir(UpnpClient_Handle handle,
const char *objectId, UPnPDirContent &dirbuf,
Error &error);
Error &error) const;
bool readDirSlice(UpnpClient_Handle handle,
const char *objectId, unsigned offset,
unsigned count, UPnPDirContent& dirbuf,
unsigned &didread, unsigned &total,
Error &error);
Error &error) const;
/** Search the content directory service.
*
......@@ -96,7 +96,7 @@ public:
bool search(UpnpClient_Handle handle,
const char *objectId, const char *searchstring,
UPnPDirContent &dirbuf,
Error &error);
Error &error) const;
/** Read metadata for a given node.
*
......@@ -106,7 +106,7 @@ public:
*/
bool getMetadata(UpnpClient_Handle handle,
const char *objectId, UPnPDirContent &dirbuf,
Error &error);
Error &error) const;
/** Retrieve search capabilities
*
......@@ -115,7 +115,7 @@ public:
*/
bool getSearchCapabilities(UpnpClient_Handle handle,
std::list<std::string> &result,
Error &error);
Error &error) const;
/** Retrieve the "friendly name" for this server, useful for display. */
const char *getFriendlyName() const {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment