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