Commit cdf615f7 authored by Max Kellermann's avatar Max Kellermann

lib/upnp/ContentDirectoryService: use SplitString() instead of csvToStrings()

parent 7d96883d
......@@ -22,10 +22,10 @@
#include "UniqueIxml.hxx"
#include "Device.hxx"
#include "ixmlwrap.hxx"
#include "Util.hxx"
#include "Action.hxx"
#include "util/UriUtil.hxx"
#include "util/RuntimeError.hxx"
#include "util/SplitString.hxx"
ContentDirectoryService::ContentDirectoryService(const UPnPDevice &device,
const UPnPService &service) noexcept
......@@ -49,7 +49,7 @@ ContentDirectoryService::~ContentDirectoryService() noexcept
/* this destructor exists here just so it won't get inlined */
}
std::list<std::string>
std::forward_list<std::string>
ContentDirectoryService::getSearchCapabilities(UpnpClient_Handle hdl) const
{
UniqueIxmlDocument request(UpnpMakeAction("GetSearchCapabilities", m_serviceType.c_str(),
......@@ -68,15 +68,10 @@ ContentDirectoryService::getSearchCapabilities(UpnpClient_Handle hdl) const
UniqueIxmlDocument response(_response);
std::list<std::string> result;
const char *s = ixmlwrap::getFirstElementValue(response.get(),
"SearchCaps");
if (s == nullptr || *s == 0)
return result;
if (!csvToStrings(s, result))
throw std::runtime_error("Bad response");
return {};
return result;
return SplitString(s, ',', false);
}
......@@ -25,7 +25,7 @@
#include <upnp.h>
#include <string>
#include <list>
#include <forward_list>
class UPnPDevice;
struct UPnPService;
......@@ -111,7 +111,7 @@ public:
* @param[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.
*/
std::list<std::string> getSearchCapabilities(UpnpClient_Handle handle) const;
std::forward_list<std::string> getSearchCapabilities(UpnpClient_Handle handle) const;
gcc_pure
std::string GetURI() const noexcept {
......
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