| OLD | NEW |
| 1 /* | 1 /* |
| 2 ****************************************************************************** | 2 ****************************************************************************** |
| 3 * Copyright (C) 1998-2010, International Business Machines Corporation and | 3 * Copyright (C) 1998-2010, International Business Machines Corporation and |
| 4 * others. All Rights Reserved. | 4 * others. All Rights Reserved. |
| 5 ****************************************************************************** | 5 ****************************************************************************** |
| 6 * | 6 * |
| 7 * File schriter.cpp | 7 * File schriter.cpp |
| 8 * | 8 * |
| 9 * Modification History: | 9 * Modification History: |
| 10 * | 10 * |
| 11 * Date Name Description | 11 * Date Name Description |
| 12 * 05/05/99 stephen Cleaned up. | 12 * 05/05/99 stephen Cleaned up. |
| 13 ****************************************************************************** | 13 ****************************************************************************** |
| 14 */ | 14 */ |
| 15 | 15 |
| 16 #include <typeinfo> // for 'typeid' to work | |
| 17 | 16 |
| 18 #include "unicode/chariter.h" | 17 #include "unicode/chariter.h" |
| 19 #include "unicode/schriter.h" | 18 #include "unicode/schriter.h" |
| 20 | 19 |
| 21 U_NAMESPACE_BEGIN | 20 U_NAMESPACE_BEGIN |
| 22 | 21 |
| 23 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(StringCharacterIterator) | 22 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(StringCharacterIterator) |
| 24 | 23 |
| 25 StringCharacterIterator::StringCharacterIterator() | 24 StringCharacterIterator::StringCharacterIterator() |
| 26 : UCharCharacterIterator(), | 25 : UCharCharacterIterator(), |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 UBool | 79 UBool |
| 81 StringCharacterIterator::operator==(const ForwardCharacterIterator& that) const
{ | 80 StringCharacterIterator::operator==(const ForwardCharacterIterator& that) const
{ |
| 82 if (this == &that) { | 81 if (this == &that) { |
| 83 return TRUE; | 82 return TRUE; |
| 84 } | 83 } |
| 85 | 84 |
| 86 // do not call UCharCharacterIterator::operator==() | 85 // do not call UCharCharacterIterator::operator==() |
| 87 // because that checks for array pointer equality | 86 // because that checks for array pointer equality |
| 88 // while we compare UnicodeString objects | 87 // while we compare UnicodeString objects |
| 89 | 88 |
| 90 if (typeid(*this) != typeid(that)) { | 89 if (CR_TYPEID(*this) != CR_TYPEID(that)) { |
| 91 return FALSE; | 90 return FALSE; |
| 92 } | 91 } |
| 93 | 92 |
| 94 StringCharacterIterator& realThat = (StringCharacterIterator&)that; | 93 StringCharacterIterator& realThat = (StringCharacterIterator&)that; |
| 95 | 94 |
| 96 return text == realThat.text | 95 return text == realThat.text |
| 97 && pos == realThat.pos | 96 && pos == realThat.pos |
| 98 && begin == realThat.begin | 97 && begin == realThat.begin |
| 99 && end == realThat.end; | 98 && end == realThat.end; |
| 100 } | 99 } |
| 101 | 100 |
| 102 CharacterIterator* | 101 CharacterIterator* |
| 103 StringCharacterIterator::clone() const { | 102 StringCharacterIterator::clone() const { |
| 104 return new StringCharacterIterator(*this); | 103 return new StringCharacterIterator(*this); |
| 105 } | 104 } |
| 106 | 105 |
| 107 void | 106 void |
| 108 StringCharacterIterator::setText(const UnicodeString& newText) { | 107 StringCharacterIterator::setText(const UnicodeString& newText) { |
| 109 text = newText; | 108 text = newText; |
| 110 UCharCharacterIterator::setText(text.getBuffer(), text.length()); | 109 UCharCharacterIterator::setText(text.getBuffer(), text.length()); |
| 111 } | 110 } |
| 112 | 111 |
| 113 void | 112 void |
| 114 StringCharacterIterator::getText(UnicodeString& result) { | 113 StringCharacterIterator::getText(UnicodeString& result) { |
| 115 result = text; | 114 result = text; |
| 116 } | 115 } |
| 117 U_NAMESPACE_END | 116 U_NAMESPACE_END |
| OLD | NEW |