MCPcopy Create free account
hub / github.com/crossuo/crossuo / Parse

Method Parse

external/tinyxml2.cpp:2402–2430  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2400
2401
2402XMLError XMLDocument::Parse( const char* p, size_t len )
2403{
2404 Clear();
2405
2406 if ( len == 0 || !p || !*p ) {
2407 SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 );
2408 return _errorID;
2409 }
2410 if ( len == static_cast<size_t>(-1) ) {
2411 len = strlen( p );
2412 }
2413 TIXMLASSERT( _charBuffer == 0 );
2414 _charBuffer = new char[ len+1 ];
2415 memcpy( _charBuffer, p, len );
2416 _charBuffer[len] = 0;
2417
2418 Parse();
2419 if ( Error() ) {
2420 // clean up now essentially dangling memory.
2421 // and the parse fail can put objects in the
2422 // pools that are dead and inaccessible.
2423 DeleteChildren();
2424 _elementPool.Clear();
2425 _attributePool.Clear();
2426 _textPool.Clear();
2427 _commentPool.Clear();
2428 }
2429 return _errorID;
2430}
2431
2432
2433void XMLDocument::Print( XMLPrinter* streamer ) const

Callers 2

xuo_manifest_loadFunction · 0.45
mft_loadFunction · 0.45

Calls 6

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

Tested by

no test coverage detected