ICU-3549 add new collation tree API

X-SVN-Rev: 15000
This commit is contained in:
Alan Liu 2004-04-16 21:06:52 +00:00
parent 90f70b1cee
commit 6a3d881c1f
2 changed files with 42 additions and 2 deletions

View file

@ -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)

View file

@ -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.