MCPcopy Create free account
hub / github.com/Overload-Technologies/Overload / Parse

Method Parse

Dependencies/tinyxml2/src/tinyxml2.cpp:2282–2310  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2280
2281
2282XMLError XMLDocument::Parse( const char* p, size_t len )
2283{
2284 Clear();
2285
2286 if ( len == 0 || !p || !*p ) {
2287 SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 );
2288 return _errorID;
2289 }
2290 if ( len == (size_t)(-1) ) {
2291 len = strlen( p );
2292 }
2293 TIXMLASSERT( _charBuffer == 0 );
2294 _charBuffer = new char[ len+1 ];
2295 memcpy( _charBuffer, p, len );
2296 _charBuffer[len] = 0;
2297
2298 Parse();
2299 if ( Error() ) {
2300 // clean up now essentially dangling memory.
2301 // and the parse fail can put objects in the
2302 // pools that are dead and inaccessible.
2303 DeleteChildren();
2304 _elementPool.Clear();
2305 _attributePool.Clear();
2306 _textPool.Clear();
2307 _commentPool.Clear();
2308 }
2309 return _errorID;
2310}
2311
2312
2313void XMLDocument::Print( XMLPrinter* streamer ) const

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected