Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1113)

Side by Side Diff: source/common/ustrenum.cpp

Issue 1621843002: ICU 56 update step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@561
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « source/common/ustrenum.h ('k') | source/common/utext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 ********************************************************************** 2 **********************************************************************
3 * Copyright (c) 2002-2012, International Business Machines 3 * Copyright (c) 2002-2014, 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 "utypeinfo.h" // for 'typeid' to work 11 #include "utypeinfo.h" // for 'typeid' to work
12 12
13 #include "unicode/ustring.h" 13 #include "unicode/ustring.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 return typeid(*this) == typeid(that); 123 return typeid(*this) == typeid(that);
124 } 124 }
125 125
126 UBool 126 UBool
127 StringEnumeration::operator!=(const StringEnumeration& that)const { 127 StringEnumeration::operator!=(const StringEnumeration& that)const {
128 return !operator==(that); 128 return !operator==(that);
129 } 129 }
130 130
131 // UStringEnumeration implementation --------------------------------------- *** 131 // UStringEnumeration implementation --------------------------------------- ***
132 132
133 UStringEnumeration * U_EXPORT2
134 UStringEnumeration::fromUEnumeration(
135 UEnumeration *uenumToAdopt, UErrorCode &status) {
136 if (U_FAILURE(status)) {
137 uenum_close(uenumToAdopt);
138 return NULL;
139 }
140 UStringEnumeration *result = new UStringEnumeration(uenumToAdopt);
141 if (result == NULL) {
142 status = U_MEMORY_ALLOCATION_ERROR;
143 uenum_close(uenumToAdopt);
144 return NULL;
145 }
146 return result;
147 }
148
133 UStringEnumeration::UStringEnumeration(UEnumeration* _uenum) : 149 UStringEnumeration::UStringEnumeration(UEnumeration* _uenum) :
134 uenum(_uenum) { 150 uenum(_uenum) {
135 U_ASSERT(_uenum != 0); 151 U_ASSERT(_uenum != 0);
136 } 152 }
137 153
138 UStringEnumeration::~UStringEnumeration() { 154 UStringEnumeration::~UStringEnumeration() {
139 uenum_close(uenum); 155 uenum_close(uenum);
140 } 156 }
141 157
142 int32_t UStringEnumeration::count(UErrorCode& status) const { 158 int32_t UStringEnumeration::count(UErrorCode& status) const {
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 result->uenum.context = (void*)strings; 387 result->uenum.context = (void*)strings;
372 result->index = 0; 388 result->index = 0;
373 result->count = count; 389 result->count = count;
374 } 390 }
375 } 391 }
376 return (UEnumeration*) result; 392 return (UEnumeration*) result;
377 } 393 }
378 394
379 395
380 // end C Wrapper 396 // end C Wrapper
OLDNEW
« no previous file with comments | « source/common/ustrenum.h ('k') | source/common/utext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698