summaryrefslogtreecommitdiff
path: root/src/lib/expat
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2016-09-09 18:47:42 +0200
committerMax Kellermann <max@musicpd.org>2016-09-16 17:43:36 +0200
commit8c744efd5693f2a39b1441d747ebdf0d23faa308 (patch)
treeee7e99a9b1a235bc1ef554930a3c75dbfabec8d5 /src/lib/expat
parent597e59f10da774c7169ee4328c874b21f71f3e60 (diff)
input/InputStream: migrate from class Error to C++ exceptions
Diffstat (limited to 'src/lib/expat')
-rw-r--r--src/lib/expat/ExpatParser.cxx10
-rw-r--r--src/lib/expat/ExpatParser.hxx6
2 files changed, 6 insertions, 10 deletions
diff --git a/src/lib/expat/ExpatParser.cxx b/src/lib/expat/ExpatParser.cxx
index 13d16707d..99050f886 100644
--- a/src/lib/expat/ExpatParser.cxx
+++ b/src/lib/expat/ExpatParser.cxx
@@ -43,25 +43,21 @@ ExpatParser::Parse(const char *data, size_t length, bool is_final)
throw ExpatError(parser);
}
-bool
-ExpatParser::Parse(InputStream &is, Error &error)
+void
+ExpatParser::Parse(InputStream &is)
{
assert(is.IsReady());
while (true) {
char buffer[4096];
- size_t nbytes = is.LockRead(buffer, sizeof(buffer), error);
+ size_t nbytes = is.LockRead(buffer, sizeof(buffer));
if (nbytes == 0)
break;
Parse(buffer, nbytes, false);
}
- if (error.IsDefined())
- return false;
-
Parse("", 0, true);
- return true;
}
const char *
diff --git a/src/lib/expat/ExpatParser.hxx b/src/lib/expat/ExpatParser.hxx
index 15983801c..c13017fb3 100644
--- a/src/lib/expat/ExpatParser.hxx
+++ b/src/lib/expat/ExpatParser.hxx
@@ -66,7 +66,7 @@ public:
void Parse(const char *data, size_t length, bool is_final);
- bool Parse(InputStream &is, Error &error);
+ void Parse(InputStream &is);
gcc_pure
static const char *GetAttribute(const XML_Char **atts,
@@ -97,8 +97,8 @@ public:
parser.Parse(data, length, is_final);
}
- bool Parse(InputStream &is, Error &error) {
- return parser.Parse(is, error);
+ void Parse(InputStream &is) {
+ parser.Parse(is);
}
gcc_pure