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