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
860aa9d6
Commit
860aa9d6
authored
Jan 07, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib/expat/ExpatParser: move InputStream overload to separate source file
Eliminate one unnecessary dependency for debug programs which don't need the InputStream API.
parent
64dc5212
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
18 deletions
+40
-18
Makefile.am
Makefile.am
+1
-0
ExpatParser.cxx
src/lib/expat/ExpatParser.cxx
+0
-18
StreamExpatParser.cxx
src/lib/expat/StreamExpatParser.cxx
+39
-0
No files found.
Makefile.am
View file @
860aa9d6
...
...
@@ -1577,6 +1577,7 @@ endif
if
ENABLE_EXPAT
libplaylist_plugins_a_SOURCES
+=
\
src/lib/expat/StreamExpatParser.cxx
\
src/lib/expat/ExpatParser.cxx src/lib/expat/ExpatParser.hxx
\
src/playlist/plugins/XspfPlaylistPlugin.cxx
\
src/playlist/plugins/XspfPlaylistPlugin.hxx
\
...
...
src/lib/expat/ExpatParser.cxx
View file @
860aa9d6
...
...
@@ -19,7 +19,6 @@
#include "config.h"
#include "ExpatParser.hxx"
#include "input/InputStream.hxx"
#include "util/ASCII.hxx"
#include <string.h>
...
...
@@ -31,23 +30,6 @@ ExpatParser::Parse(const char *data, size_t length, bool is_final)
throw
ExpatError
(
parser
);
}
void
ExpatParser
::
Parse
(
InputStream
&
is
)
{
assert
(
is
.
IsReady
());
while
(
true
)
{
char
buffer
[
4096
];
size_t
nbytes
=
is
.
LockRead
(
buffer
,
sizeof
(
buffer
));
if
(
nbytes
==
0
)
break
;
Parse
(
buffer
,
nbytes
,
false
);
}
Parse
(
""
,
0
,
true
);
}
const
char
*
ExpatParser
::
GetAttribute
(
const
XML_Char
**
atts
,
const
char
*
name
)
...
...
src/lib/expat/StreamExpatParser.cxx
0 → 100644
View file @
860aa9d6
/*
* Copyright 2003-2017 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "config.h"
#include "ExpatParser.hxx"
#include "input/InputStream.hxx"
void
ExpatParser
::
Parse
(
InputStream
&
is
)
{
assert
(
is
.
IsReady
());
while
(
true
)
{
char
buffer
[
4096
];
size_t
nbytes
=
is
.
LockRead
(
buffer
,
sizeof
(
buffer
));
if
(
nbytes
==
0
)
break
;
Parse
(
buffer
,
nbytes
,
false
);
}
Parse
(
""
,
0
,
true
);
}
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