Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
cdf615f7
Commit
cdf615f7
authored
Jan 02, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib/upnp/ContentDirectoryService: use SplitString() instead of csvToStrings()
parent
7d96883d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
11 deletions
+6
-11
ContentDirectoryService.cxx
src/lib/upnp/ContentDirectoryService.cxx
+4
-9
ContentDirectoryService.hxx
src/lib/upnp/ContentDirectoryService.hxx
+2
-2
No files found.
src/lib/upnp/ContentDirectoryService.cxx
View file @
cdf615f7
...
...
@@ -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
)
;
}
src/lib/upnp/ContentDirectoryService.hxx
View file @
cdf615f7
...
...
@@ -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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment