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