ICU-42 Added API for aliases

X-SVN-Rev: 587
This commit is contained in:
Vladimir Weinstein 2000-01-14 23:29:01 +00:00
parent 7845ffb9be
commit 1d48c065af
2 changed files with 53 additions and 0 deletions

View File

@ -290,6 +290,30 @@ int32_t ucnv_countAvailable ()
return ucnv_io_countAvailableConverters(&err);
}
U_CAPI uint16_t
ucnv_countAliases(const char *alias, UErrorCode *pErrorCode) {
const char *p;
return ucnv_io_getAliases(alias, &p, pErrorCode);
}
U_CAPI const char *
ucnv_getAlias(const char *alias, uint16_t index, UErrorCode *pErrorCode) {
return ucnv_io_getAlias(alias, index, pErrorCode);
}
U_CAPI void
ucnv_getAliases(const char *alias, const char **aliases, UErrorCode *pErrorCode) {
char *p;
uint16_t count=ucnv_io_getAliases(alias, &p, pErrorCode);
while(count>0) {
*aliases++=*p;
/* skip a name, first the canonical converter name */
*p+=uprv_strlen(p)+1;
--count;
}
}
void ucnv_getSubstChars (const UConverter * converter,
char *mySubChar,
int8_t * len,

View File

@ -581,6 +581,35 @@ U_CAPI
*/
U_CAPI int32_t U_EXPORT2 ucnv_countAvailable (void);
/**
* Gives the number of aliases for given converter or alias name
* @param alias alias name
* @param pErrorCode result of operation
* @return number of names on alias list
*/
U_CAPI uint16_t
ucnv_countAliases(const char *alias, UErrorCode *pErrorCode);
/**
* Gives the name of the alias at given index of alias list
* @param alias alias name
* @param index indes in alias list
* @param pErrorCode result of operation
* @return returns the name of the alias at given index
*/
U_CAPI const char *
ucnv_getAlias(const char *alias, uint16_t index, UErrorCode *pErrorCode);
/**
* Fill-up the list of alias names for the given alias
* @param alias alias name
* @param aliases fill-in list
* @param pErrorCode result of operation
*/
U_CAPI void
ucnv_getAliases(const char *alias, const char **aliases, UErrorCode *pErrorCode);
/**
* returns the current default converter name.
*