MCPcopy Create free account
hub / github.com/NanoMichael/MicroTeX / Parse

Method Parse

src/xml/tinyxml2.cpp:1740–1766  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1738
1739
1740XMLError XMLDocument::Parse( const char* p, size_t len ) {
1741 Clear();
1742
1743 if ( len == 0 || !p || !*p ) {
1744 SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 );
1745 return _errorID;
1746 }
1747 if ( len == (size_t)(-1) ) {
1748 len = strlen( p );
1749 }
1750 _charBuffer = new char[ len+1 ];
1751 memcpy( _charBuffer, p, len );
1752 _charBuffer[len] = 0;
1753
1754 Parse();
1755 if ( Error() ) {
1756 // clean up now essentially dangling memory.
1757 // and the parse fail can put objects in the
1758 // pools that are dead and inaccessible.
1759 DeleteChildren();
1760 _elementPool.Clear();
1761 _attributePool.Clear();
1762 _textPool.Clear();
1763 _commentPool.Clear();
1764 }
1765 return _errorID;
1766}
1767
1768
1769void XMLDocument::Print( XMLPrinter* streamer ) const {

Callers

nothing calls this directly

Calls 3

ErrorFunction · 0.85
NoChildrenFunction · 0.85
ClearMethod · 0.45

Tested by

no test coverage detected