MCPcopy Create free account
hub / github.com/ajkhoury/ReClassEx / Parse

Method Parse

ReClass/tinyxml2.cpp:2266–2294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected