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