mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-07 22:44:49 +00:00
ICU-415 add API facade for name->code point and enum names
X-SVN-Rev: 1703
This commit is contained in:
parent
784b5f52ad
commit
4660da6313
2 changed files with 63 additions and 0 deletions
|
@ -144,6 +144,30 @@ u_charName(uint32_t code, UCharNameChoice nameChoice,
|
|||
return getName(uCharNames, code, nameChoice, buffer, (uint16_t)bufferLength);
|
||||
}
|
||||
|
||||
/* ### TBD */
|
||||
U_CAPI UChar32 U_EXPORT2
|
||||
u_charFromName(UCharNameChoice nameChoice,
|
||||
const char *name,
|
||||
UErrorCode *pErrorCode) {
|
||||
if(pErrorCode==NULL || U_FAILURE(*pErrorCode)) {
|
||||
return 0;
|
||||
}
|
||||
*pErrorCode=U_UNSUPPORTED_ERROR;
|
||||
return 0xffff;
|
||||
}
|
||||
|
||||
U_CAPI void U_EXPORT2
|
||||
u_enumCharNames(UChar32 start, UChar32 limit,
|
||||
UEnumCharNamesFn *fn,
|
||||
void *context,
|
||||
UCharNameChoice nameChoice,
|
||||
UErrorCode *pErrorCode) {
|
||||
if(pErrorCode==NULL || U_FAILURE(*pErrorCode)) {
|
||||
return;
|
||||
}
|
||||
*pErrorCode=U_UNSUPPORTED_ERROR;
|
||||
}
|
||||
|
||||
/* implementation ----------------------------------------------------------- */
|
||||
|
||||
static UBool
|
||||
|
|
|
@ -736,6 +736,45 @@ u_charName(uint32_t code, UCharNameChoice nameChoice,
|
|||
char *buffer, UTextOffset bufferLength,
|
||||
UErrorCode *pErrorCode);
|
||||
|
||||
/**
|
||||
* Find a Unicode character by its name and return its code point value.
|
||||
* ### TBD
|
||||
*/
|
||||
U_CAPI UChar32 U_EXPORT2
|
||||
u_charFromName(UCharNameChoice nameChoice,
|
||||
const char *name,
|
||||
UErrorCode *pErrorCode);
|
||||
|
||||
U_CDECL_BEGIN
|
||||
|
||||
/**
|
||||
* Type of a callback function for u_enumCharNames() that gets called
|
||||
* for each Unicode character with the code point value and
|
||||
* the character name.
|
||||
* If such a function returns FALSE, then the enumeration is stopped.
|
||||
* ### TBD
|
||||
*/
|
||||
typedef UBool UEnumCharNamesFn(void *context,
|
||||
UChar32 code,
|
||||
UCharNameChoice nameChoice,
|
||||
char *name,
|
||||
UTextOffset length);
|
||||
|
||||
U_CDECL_END
|
||||
|
||||
/**
|
||||
* Enumerate all assigned Unicode characters between the start and limit
|
||||
* code points (start inclusive, limit exclusive) and call a function
|
||||
* for each, passing the code point value and the character name.
|
||||
* ### TBD
|
||||
*/
|
||||
U_CAPI void U_EXPORT2
|
||||
u_enumCharNames(UChar32 start, UChar32 limit,
|
||||
UEnumCharNamesFn *fn,
|
||||
void *context,
|
||||
UCharNameChoice nameChoice,
|
||||
UErrorCode *pErrorCode);
|
||||
|
||||
/**
|
||||
* The following functions are java specific.
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue