Index: source/common/ustrenum.cpp |
diff --git a/source/common/ustrenum.cpp b/source/common/ustrenum.cpp |
index dd7fe78a3a21460187ea74e24503c915c1ea0edf..762bf99d517105bea149f0ffb7032c11355de9d6 100644 |
--- a/source/common/ustrenum.cpp |
+++ b/source/common/ustrenum.cpp |
@@ -1,6 +1,6 @@ |
/* |
********************************************************************** |
-* Copyright (c) 2002-2012, International Business Machines |
+* Copyright (c) 2002-2014, International Business Machines |
* Corporation and others. All Rights Reserved. |
********************************************************************** |
* Author: Alan Liu |
@@ -130,6 +130,22 @@ StringEnumeration::operator!=(const StringEnumeration& that)const { |
// UStringEnumeration implementation --------------------------------------- *** |
+UStringEnumeration * U_EXPORT2 |
+UStringEnumeration::fromUEnumeration( |
+ UEnumeration *uenumToAdopt, UErrorCode &status) { |
+ if (U_FAILURE(status)) { |
+ uenum_close(uenumToAdopt); |
+ return NULL; |
+ } |
+ UStringEnumeration *result = new UStringEnumeration(uenumToAdopt); |
+ if (result == NULL) { |
+ status = U_MEMORY_ALLOCATION_ERROR; |
+ uenum_close(uenumToAdopt); |
+ return NULL; |
+ } |
+ return result; |
+} |
+ |
UStringEnumeration::UStringEnumeration(UEnumeration* _uenum) : |
uenum(_uenum) { |
U_ASSERT(_uenum != 0); |