| 2148 | } |
| 2149 | |
| 2150 | void XMLDocument::Clear() |
| 2151 | { |
| 2152 | DeleteChildren(); |
| 2153 | while( _unlinked.Size()) { |
| 2154 | DeleteNode(_unlinked[0]); // Will remove from _unlinked as part of delete. |
| 2155 | } |
| 2156 | |
| 2157 | #ifdef TINYXML2_DEBUG |
| 2158 | const bool hadError = Error(); |
| 2159 | #endif |
| 2160 | ClearError(); |
| 2161 | |
| 2162 | delete [] _charBuffer; |
| 2163 | _charBuffer = 0; |
| 2164 | _parsingDepth = 0; |
| 2165 | |
| 2166 | #if 0 |
| 2167 | _textPool.Trace( "text" ); |
| 2168 | _elementPool.Trace( "element" ); |
| 2169 | _commentPool.Trace( "comment" ); |
| 2170 | _attributePool.Trace( "attribute" ); |
| 2171 | #endif |
| 2172 | |
| 2173 | #ifdef TINYXML2_DEBUG |
| 2174 | if ( !hadError ) { |
| 2175 | TIXMLASSERT( _elementPool.CurrentAllocs() == _elementPool.Untracked() ); |
| 2176 | TIXMLASSERT( _attributePool.CurrentAllocs() == _attributePool.Untracked() ); |
| 2177 | TIXMLASSERT( _textPool.CurrentAllocs() == _textPool.Untracked() ); |
| 2178 | TIXMLASSERT( _commentPool.CurrentAllocs() == _commentPool.Untracked() ); |
| 2179 | } |
| 2180 | #endif |
| 2181 | } |
| 2182 | |
| 2183 | |
| 2184 | void XMLDocument::DeepCopy(XMLDocument* target) const |
no test coverage detected