| OLD | NEW |
| 1 /* | 1 /* |
| 2 ********************************************************************** | 2 ********************************************************************** |
| 3 * Copyright (c) 2002-2010, International Business Machines | 3 * Copyright (c) 2002-2010, International Business Machines |
| 4 * Corporation and others. All Rights Reserved. | 4 * Corporation and others. All Rights Reserved. |
| 5 ********************************************************************** | 5 ********************************************************************** |
| 6 * Author: Alan Liu | 6 * Author: Alan Liu |
| 7 * Created: November 11 2002 | 7 * Created: November 11 2002 |
| 8 * Since: ICU 2.4 | 8 * Since: ICU 2.4 |
| 9 ********************************************************************** | 9 ********************************************************************** |
| 10 */ | 10 */ |
| 11 #include <typeinfo> // for 'typeid' to work | |
| 12 | 11 |
| 13 #include "unicode/ustring.h" | 12 #include "unicode/ustring.h" |
| 14 #include "unicode/strenum.h" | 13 #include "unicode/strenum.h" |
| 15 #include "unicode/putil.h" | 14 #include "unicode/putil.h" |
| 16 #include "uenumimp.h" | 15 #include "uenumimp.h" |
| 17 #include "ustrenum.h" | 16 #include "ustrenum.h" |
| 18 #include "cstring.h" | 17 #include "cstring.h" |
| 19 #include "cmemory.h" | 18 #include "cmemory.h" |
| 20 #include "uassert.h" | 19 #include "uassert.h" |
| 21 | 20 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 return &unistr; | 107 return &unistr; |
| 109 } else { | 108 } else { |
| 110 status=U_MEMORY_ALLOCATION_ERROR; | 109 status=U_MEMORY_ALLOCATION_ERROR; |
| 111 } | 110 } |
| 112 } | 111 } |
| 113 | 112 |
| 114 return NULL; | 113 return NULL; |
| 115 } | 114 } |
| 116 UBool | 115 UBool |
| 117 StringEnumeration::operator==(const StringEnumeration& that)const { | 116 StringEnumeration::operator==(const StringEnumeration& that)const { |
| 118 return typeid(*this) == typeid(that); | 117 return CR_TYPEID(*this) == CR_TYPEID(that); |
| 119 } | 118 } |
| 120 | 119 |
| 121 UBool | 120 UBool |
| 122 StringEnumeration::operator!=(const StringEnumeration& that)const { | 121 StringEnumeration::operator!=(const StringEnumeration& that)const { |
| 123 return !operator==(that); | 122 return !operator==(that); |
| 124 } | 123 } |
| 125 | 124 |
| 126 // UStringEnumeration implementation --------------------------------------- *** | 125 // UStringEnumeration implementation --------------------------------------- *** |
| 127 | 126 |
| 128 UStringEnumeration::UStringEnumeration(UEnumeration* _uenum) : | 127 UStringEnumeration::UStringEnumeration(UEnumeration* _uenum) : |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 uprv_memcpy(result, &UCHARSTRENUM_VT, sizeof(UCHARSTRENUM_VT)); | 315 uprv_memcpy(result, &UCHARSTRENUM_VT, sizeof(UCHARSTRENUM_VT)); |
| 317 result->uenum.context = (void*)strings; | 316 result->uenum.context = (void*)strings; |
| 318 result->index = 0; | 317 result->index = 0; |
| 319 result->count = count; | 318 result->count = count; |
| 320 } | 319 } |
| 321 } | 320 } |
| 322 return (UEnumeration*) result; | 321 return (UEnumeration*) result; |
| 323 } | 322 } |
| 324 | 323 |
| 325 | 324 |
| OLD | NEW |