Logo Search packages:      
Sourcecode: icu version File versions

U_STABLE UEnumeration* U_EXPORT2 ucurr_openISOCurrencies ( uint32_t  currType,
UErrorCode pErrorCode 
)

Provides a UEnumeration object for listing ISO-4217 codes.

Parameters:
currType You can use one of several UCurrCurrencyType values for this variable. You can also | (or) them together to get a specific list of currencies. Most people will want to use the (UCURR_CURRENCY|UCURR_NON_DEPRECATED) value to get a list of current currencies.
pErrorCode Error code ICU 3.2

Definition at line 1826 of file ucurr.cpp.

References NULL, and U_MEMORY_ALLOCATION_ERROR.

                                                                   {
    UEnumeration *myEnum = NULL;
    UCurrencyContext *myContext;

    myEnum = (UEnumeration*)uprv_malloc(sizeof(UEnumeration));
    if (myEnum == NULL) {
        *pErrorCode = U_MEMORY_ALLOCATION_ERROR;
        return NULL;
    }
    uprv_memcpy(myEnum, &gEnumCurrencyList, sizeof(UEnumeration));
    myContext = (UCurrencyContext*)uprv_malloc(sizeof(UCurrencyContext));
    if (myContext == NULL) {
        *pErrorCode = U_MEMORY_ALLOCATION_ERROR;
        uprv_free(myEnum);
        return NULL;
    }
    myContext->currType = currType;
    myContext->listIdx = 0;
    myEnum->context = myContext;
    return myEnum;
}


Generated by  Doxygen 1.6.0   Back to index