diff --git a/icu4c/source/i18n/ucol.cpp b/icu4c/source/i18n/ucol.cpp index 937169daf01..a1e2a66b6cd 100644 --- a/icu4c/source/i18n/ucol.cpp +++ b/icu4c/source/i18n/ucol.cpp @@ -1,6 +1,6 @@ /* ******************************************************************************* -* Copyright (C) 1996-2003, International Business Machines +* Copyright (C) 1996-2004, International Business Machines * Corporation and others. All Rights Reserved. ******************************************************************************* * file name: ucol.cpp @@ -7533,6 +7533,21 @@ ucol_countAvailable() return uloc_countAvailable(); } +U_CAPI UEnumeration* U_EXPORT2 +ucol_openAvailableLocales(UErrorCode *status) { + return ures_openAvailableLocales(U_ICUDATA_COLL, status); +} + +U_CAPI UEnumeration* U_EXPORT2 +ucol_getKeywordValues(const char *keyword, UErrorCode *status) { + if (U_SUCCESS(*status) && + keyword==NULL || uprv_strcmp(keyword, "collation")!=0) { + *status = U_ILLEGAL_ARGUMENT_ERROR; + return NULL; + } + return ures_getKeywordValues(U_ICUDATA_COLL, keyword, status); +} + U_CAPI void U_EXPORT2 ucol_getVersion(const UCollator* coll, UVersionInfo versionInfo) diff --git a/icu4c/source/i18n/unicode/ucol.h b/icu4c/source/i18n/unicode/ucol.h index 7da397ea633..d7e1078225c 100644 --- a/icu4c/source/i18n/unicode/ucol.h +++ b/icu4c/source/i18n/unicode/ucol.h @@ -1,6 +1,6 @@ /* ******************************************************************************* -* Copyright (c) 1996-2003, International Business Machines Corporation and others. +* Copyright (c) 1996-2004, International Business Machines Corporation and others. * All Rights Reserved. ******************************************************************************* */ @@ -478,6 +478,31 @@ ucol_getAvailable(int32_t index); U_STABLE int32_t U_EXPORT2 ucol_countAvailable(void); +/** + * Create a string enumerator, owned by the caller, of all locales for + * which a collator may be opened. + * @param status input-output error code + * @return a string enumeration over locale strings + * @draft ICU 3.0 + */ +U_DRAFT UEnumeration* U_EXPORT2 +ucol_openAvailableLocales(UErrorCode *status); + +/** + * Given a keyword, return a string enumeration of all possible values + * for that keyword. + * @param keyword a particular keyword to consider. At this point, the + * only recognized keyword for this service is "collation". If any + * other keyword is passed in, *status is set to + * U_ILLEGAL_ARGUMENT_ERROR. + * @param status input-output error code + * @return a string enumeration over collation keyword values, or NULL + * upon error + * @draft ICU 3.0 + */ +U_DRAFT UEnumeration* U_EXPORT2 +ucol_getKeywordValues(const char *keyword, UErrorCode *status); + /** * Get the collation rules from a UCollator. * The rules will follow the rule syntax.