| 2115 | } |
| 2116 | |
| 2117 | void XMLDocument::Clear() |
| 2118 | { |
| 2119 | DeleteChildren(); |
| 2120 | while( _unlinked.Size()) { |
| 2121 | DeleteNode(_unlinked[0]); // Will remove from _unlinked as part of delete. |
| 2122 | } |
| 2123 | |
| 2124 | #ifdef TINYXML2_DEBUG |
| 2125 | const bool hadError = Error(); |
| 2126 | #endif |
| 2127 | ClearError(); |
| 2128 | |
| 2129 | delete [] _charBuffer; |
| 2130 | _charBuffer = 0; |
| 2131 | _parsingDepth = 0; |
| 2132 | |
| 2133 | #if 0 |
| 2134 | _textPool.Trace( "text" ); |
| 2135 | _elementPool.Trace( "element" ); |
| 2136 | _commentPool.Trace( "comment" ); |
| 2137 | _attributePool.Trace( "attribute" ); |
| 2138 | #endif |
| 2139 | |
| 2140 | #ifdef TINYXML2_DEBUG |
| 2141 | if ( !hadError ) { |
| 2142 | TIXMLASSERT( _elementPool.CurrentAllocs() == _elementPool.Untracked() ); |
| 2143 | TIXMLASSERT( _attributePool.CurrentAllocs() == _attributePool.Untracked() ); |
| 2144 | TIXMLASSERT( _textPool.CurrentAllocs() == _textPool.Untracked() ); |
| 2145 | TIXMLASSERT( _commentPool.CurrentAllocs() == _commentPool.Untracked() ); |
| 2146 | } |
| 2147 | #endif |
| 2148 | } |
| 2149 | |
| 2150 | |
| 2151 | void XMLDocument::DeepCopy(XMLDocument* target) const |
no test coverage detected