| 1562 | |
| 1563 | |
| 1564 | void XMLDocument::Clear() { |
| 1565 | DeleteChildren(); |
| 1566 | |
| 1567 | #ifdef DEBUG |
| 1568 | const bool hadError = Error(); |
| 1569 | #endif |
| 1570 | _errorID = XML_NO_ERROR; |
| 1571 | _errorStr1 = 0; |
| 1572 | _errorStr2 = 0; |
| 1573 | |
| 1574 | delete [] _charBuffer; |
| 1575 | _charBuffer = 0; |
| 1576 | |
| 1577 | #if 0 |
| 1578 | _textPool.Trace( "text" ); |
| 1579 | _elementPool.Trace( "element" ); |
| 1580 | _commentPool.Trace( "comment" ); |
| 1581 | _attributePool.Trace( "attribute" ); |
| 1582 | #endif |
| 1583 | |
| 1584 | #ifdef DEBUG |
| 1585 | if ( !hadError ) { |
| 1586 | TIXMLASSERT( _elementPool.CurrentAllocs() == _elementPool.Untracked() ); |
| 1587 | TIXMLASSERT( _attributePool.CurrentAllocs() == _attributePool.Untracked() ); |
| 1588 | TIXMLASSERT( _textPool.CurrentAllocs() == _textPool.Untracked() ); |
| 1589 | TIXMLASSERT( _commentPool.CurrentAllocs() == _commentPool.Untracked() ); |
| 1590 | } |
| 1591 | #endif |
| 1592 | } |
| 1593 | |
| 1594 | |
| 1595 | XMLElement* XMLDocument::NewElement( const char* name ) { |
no test coverage detected