| 71 | |
| 72 | |
| 73 | void StrPair::TransferTo( StrPair* other ) |
| 74 | { |
| 75 | if ( this == other ) { |
| 76 | return; |
| 77 | } |
| 78 | // This in effect implements the assignment operator by "moving" |
| 79 | // ownership (as in auto_ptr). |
| 80 | |
| 81 | TIXMLASSERT( other->_flags == 0 ); |
| 82 | TIXMLASSERT( other->_start == 0 ); |
| 83 | TIXMLASSERT( other->_end == 0 ); |
| 84 | |
| 85 | other->Reset(); |
| 86 | |
| 87 | other->_flags = _flags; |
| 88 | other->_start = _start; |
| 89 | other->_end = _end; |
| 90 | |
| 91 | _flags = 0; |
| 92 | _start = 0; |
| 93 | _end = 0; |
| 94 | } |
| 95 | |
| 96 | void StrPair::Reset() |
| 97 | { |