+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
-* Copyright (c) 2002-2012, International Business Machines
+* Copyright (c) 2002-2014, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* Author: Alan Liu
// 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);