MCPcopy Create free account
hub / github.com/bytedance/Fastbot_Android / Parse

Method Parse

native/thirdpart/tinyxml2/tinyxml2.cpp:2415–2443  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2413
2414
2415XMLError XMLDocument::Parse( const char* p, size_t len )
2416{
2417 Clear();
2418
2419 if ( len == 0 || !p || !*p ) {
2420 SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 );
2421 return _errorID;
2422 }
2423 if ( len == static_cast<size_t>(-1) ) {
2424 len = strlen( p );
2425 }
2426 TIXMLASSERT( _charBuffer == 0 );
2427 _charBuffer = new char[ len+1 ];
2428 memcpy( _charBuffer, p, len );
2429 _charBuffer[len] = 0;
2430
2431 Parse();
2432 if ( Error() ) {
2433 // clean up now essentially dangling memory.
2434 // and the parse fail can put objects in the
2435 // pools that are dead and inaccessible.
2436 DeleteChildren();
2437 _elementPool.Clear();
2438 _attributePool.Clear();
2439 _textPool.Clear();
2440 _commentPool.Clear();
2441 }
2442 return _errorID;
2443}
2444
2445
2446void XMLDocument::Print( XMLPrinter* streamer ) const

Callers 2

createFromXmlMethod · 0.45
load_documentFunction · 0.45

Calls 5

ErrorFunction · 0.85
NoChildrenFunction · 0.85
SkipWhiteSpaceFunction · 0.85
ClearFunction · 0.50
ClearMethod · 0.45

Tested by

no test coverage detected