| 142 | |
| 143 | |
| 144 | void StrPair::TransferTo(StrPair* other) |
| 145 | { |
| 146 | if (this == other) { |
| 147 | return; |
| 148 | } |
| 149 | // This in effect implements the assignment operator by "moving" |
| 150 | // ownership (as in auto_ptr). |
| 151 | |
| 152 | TIXMLASSERT(other != 0); |
| 153 | TIXMLASSERT(other->_flags == 0); |
| 154 | TIXMLASSERT(other->_start == 0); |
| 155 | TIXMLASSERT(other->_end == 0); |
| 156 | |
| 157 | other->Reset(); |
| 158 | |
| 159 | other->_flags = _flags; |
| 160 | other->_start = _start; |
| 161 | other->_end = _end; |
| 162 | |
| 163 | _flags = 0; |
| 164 | _start = 0; |
| 165 | _end = 0; |
| 166 | } |
| 167 | |
| 168 | void StrPair::Reset() |
| 169 | { |