MCPcopy Create free account
hub / github.com/JayXon/Leanify / Parse

Method Parse

lib/tinyxml2/tinyxml2.cpp:1887–1914  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1885
1886
1887XMLError XMLDocument::Parse( const char* p, size_t len )
1888{
1889 Clear();
1890
1891 if ( len == 0 || !p || !*p ) {
1892 SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 );
1893 return _errorID;
1894 }
1895 if ( len == (size_t)(-1) ) {
1896 len = strlen( p );
1897 }
1898 _charBuffer = new char[ len+1 ];
1899 memcpy( _charBuffer, p, len );
1900 _charBuffer[len] = 0;
1901
1902 Parse();
1903 if ( Error() ) {
1904 // clean up now essentially dangling memory.
1905 // and the parse fail can put objects in the
1906 // pools that are dead and inaccessible.
1907 DeleteChildren();
1908 _elementPool.Clear();
1909 _attributePool.Clear();
1910 _textPool.Clear();
1911 _commentPool.Clear();
1912 }
1913 return _errorID;
1914}
1915
1916
1917void XMLDocument::Print( XMLPrinter* streamer ) const

Callers 1

XmlMethod · 0.80

Calls 3

ErrorFunction · 0.85
NoChildrenFunction · 0.85
ClearMethod · 0.45

Tested by

no test coverage detected