lib/expat/Parser: add method CompleteParse()

This commit is contained in:
Max Kellermann 2018-01-21 14:34:19 +01:00
parent b14fc907f9
commit dedede3caa
3 changed files with 10 additions and 2 deletions

View File

@ -74,6 +74,10 @@ public:
void Parse(const char *data, size_t length, bool is_final);
void CompleteParse() {
Parse("", 0, true);
}
void Parse(InputStream &is);
gcc_pure
@ -109,6 +113,10 @@ public:
parser.Parse(std::forward<Args>(args)...);
}
void CompleteParse() {
parser.CompleteParse();
}
gcc_pure
static const char *GetAttribute(const XML_Char **atts,
const char *name) noexcept {

View File

@ -35,5 +35,5 @@ ExpatParser::Parse(InputStream &is)
Parse(buffer, nbytes, false);
}
Parse("", 0, true);
CompleteParse();
}

View File

@ -304,7 +304,7 @@ private:
}
void OnEnd() final {
Parse("", 0, true);
CompleteParse();
LockSetDone();
}