| 2039 | } |
| 2040 | |
| 2041 | void XMLDocument::Clear() |
| 2042 | { |
| 2043 | DeleteChildren(); |
| 2044 | while( _unlinked.Size()) { |
| 2045 | DeleteNode(_unlinked[0]); // Will remove from _unlinked as part of delete. |
| 2046 | } |
| 2047 | |
| 2048 | #ifdef DEBUG |
| 2049 | const bool hadError = Error(); |
| 2050 | #endif |
| 2051 | ClearError(); |
| 2052 | |
| 2053 | delete [] _charBuffer; |
| 2054 | _charBuffer = 0; |
| 2055 | |
| 2056 | #if 0 |
| 2057 | _textPool.Trace( "text" ); |
| 2058 | _elementPool.Trace( "element" ); |
| 2059 | _commentPool.Trace( "comment" ); |
| 2060 | _attributePool.Trace( "attribute" ); |
| 2061 | #endif |
| 2062 | |
| 2063 | #ifdef DEBUG |
| 2064 | if ( !hadError ) { |
| 2065 | TIXMLASSERT( _elementPool.CurrentAllocs() == _elementPool.Untracked() ); |
| 2066 | TIXMLASSERT( _attributePool.CurrentAllocs() == _attributePool.Untracked() ); |
| 2067 | TIXMLASSERT( _textPool.CurrentAllocs() == _textPool.Untracked() ); |
| 2068 | TIXMLASSERT( _commentPool.CurrentAllocs() == _commentPool.Untracked() ); |
| 2069 | } |
| 2070 | #endif |
| 2071 | } |
| 2072 | |
| 2073 | |
| 2074 | void XMLDocument::DeepCopy(XMLDocument* target) const |
no test coverage detected