lib/expat/Parser: add method CompleteParse()
This commit is contained in:
@@ -74,6 +74,10 @@ public:
|
|||||||
|
|
||||||
void Parse(const char *data, size_t length, bool is_final);
|
void Parse(const char *data, size_t length, bool is_final);
|
||||||
|
|
||||||
|
void CompleteParse() {
|
||||||
|
Parse("", 0, true);
|
||||||
|
}
|
||||||
|
|
||||||
void Parse(InputStream &is);
|
void Parse(InputStream &is);
|
||||||
|
|
||||||
gcc_pure
|
gcc_pure
|
||||||
@@ -109,6 +113,10 @@ public:
|
|||||||
parser.Parse(std::forward<Args>(args)...);
|
parser.Parse(std::forward<Args>(args)...);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CompleteParse() {
|
||||||
|
parser.CompleteParse();
|
||||||
|
}
|
||||||
|
|
||||||
gcc_pure
|
gcc_pure
|
||||||
static const char *GetAttribute(const XML_Char **atts,
|
static const char *GetAttribute(const XML_Char **atts,
|
||||||
const char *name) noexcept {
|
const char *name) noexcept {
|
||||||
|
@@ -35,5 +35,5 @@ ExpatParser::Parse(InputStream &is)
|
|||||||
Parse(buffer, nbytes, false);
|
Parse(buffer, nbytes, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
Parse("", 0, true);
|
CompleteParse();
|
||||||
}
|
}
|
||||||
|
@@ -304,7 +304,7 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void OnEnd() final {
|
void OnEnd() final {
|
||||||
Parse("", 0, true);
|
CompleteParse();
|
||||||
LockSetDone();
|
LockSetDone();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user