MCPcopy Create free account
hub / github.com/cemu-project/Cemu / Parse

Method Parse

src/util/tinyxml2/tinyxml2.cpp:2265–2293  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2263
2264
2265 XMLError XMLDocument::Parse(const char* p, size_t len)
2266 {
2267 Clear();
2268
2269 if (len == 0 || !p || !*p) {
2270 SetError(XML_ERROR_EMPTY_DOCUMENT, 0, 0, 0);
2271 return _errorID;
2272 }
2273 if (len == (size_t)(-1)) {
2274 len = strlen(p);
2275 }
2276 TIXMLASSERT(_charBuffer == 0);
2277 _charBuffer = new char[len + 1];
2278 memcpy(_charBuffer, p, len);
2279 _charBuffer[len] = 0;
2280
2281 Parse();
2282 if (Error()) {
2283 // clean up now essentially dangling memory.
2284 // and the parse fail can put objects in the
2285 // pools that are dead and inaccessible.
2286 DeleteChildren();
2287 _elementPool.Clear();
2288 _attributePool.Clear();
2289 _textPool.Clear();
2290 _commentPool.Clear();
2291 }
2292 return _errorID;
2293 }
2294
2295
2296 void XMLDocument::Print(XMLPrinter* streamer) const

Callers 4

LoadOnlineDataMethod · 0.45
VerifyJsonEntryMethod · 0.45
UpdateThreadMethod · 0.45
LoadMethod · 0.45

Calls 4

NoChildrenFunction · 0.85
SkipWhiteSpaceFunction · 0.85
ErrorFunction · 0.70
ClearMethod · 0.45

Tested by

no test coverage detected