MCPcopy Create free account
hub / github.com/MediaArea/MediaInfoLib / Parse

Method Parse

Source/ThirdParty/tinyxml2/tinyxml2.cpp:2277–2305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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