| 156 | |
| 157 | |
| 158 | void StrPair::TransferTo( StrPair* other ) |
| 159 | { |
| 160 | if ( this == other ) { |
| 161 | return; |
| 162 | } |
| 163 | // This in effect implements the assignment operator by "moving" |
| 164 | // ownership (as in auto_ptr). |
| 165 | |
| 166 | TIXMLASSERT( other != 0 ); |
| 167 | TIXMLASSERT( other->_flags == 0 ); |
| 168 | TIXMLASSERT( other->_start == 0 ); |
| 169 | TIXMLASSERT( other->_end == 0 ); |
| 170 | |
| 171 | other->Reset(); |
| 172 | |
| 173 | other->_flags = _flags; |
| 174 | other->_start = _start; |
| 175 | other->_end = _end; |
| 176 | |
| 177 | _flags = 0; |
| 178 | _start = 0; |
| 179 | _end = 0; |
| 180 | } |
| 181 | |
| 182 | |
| 183 | void StrPair::Reset() |