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

db/upnp: make several methods "const"

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