webkit
2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
|
C API: UNumberingSystem, information about numbering systems. More...
#include "unicode/utypes.h"
#include "unicode/uenum.h"
#include "unicode/localpointer.h"
Go to the source code of this file.
Typedefs | |
typedef struct UNumberingSystem | UNumberingSystem |
Functions | |
U_DRAFT UNumberingSystem *U_EXPORT2 | unumsys_open (const char *locale, UErrorCode *status) |
U_DRAFT UNumberingSystem *U_EXPORT2 | unumsys_openByName (const char *name, UErrorCode *status) |
U_DRAFT void U_EXPORT2 | unumsys_close (UNumberingSystem *unumsys) |
U_DRAFT UEnumeration *U_EXPORT2 | unumsys_openAvailableNames (UErrorCode *status) |
U_DRAFT const char *U_EXPORT2 | unumsys_getName (const UNumberingSystem *unumsys) |
U_DRAFT UBool U_EXPORT2 | unumsys_isAlgorithmic (const UNumberingSystem *unumsys) |
U_DRAFT int32_t U_EXPORT2 | unumsys_getRadix (const UNumberingSystem *unumsys) |
U_DRAFT int32_t U_EXPORT2 | unumsys_getDescription (const UNumberingSystem *unumsys, UChar *result, int32_t resultLength, UErrorCode *status) |
C API: UNumberingSystem, information about numbering systems.
Defines numbering systems. A numbering system describes the scheme by which numbers are to be presented to the end user. In its simplest form, a numbering system describes the set of digit characters that are to be used to display numbers, such as Western digits, Thai digits, Arabic-Indic digits, etc., in a positional numbering system with a specified radix (typically 10). More complicated numbering systems are algorithmic in nature, and require use of an RBNF formatter (rule based number formatter), in order to calculate the characters to be displayed for a given number. Examples of algorithmic numbering systems include Roman numerals, Chinese numerals, and Hebrew numerals. Formatting rules for many commonly used numbering systems are included in the ICU package, based on the numbering system rules defined in CLDR. Alternate numbering systems can be specified to a locale by using the numbers locale keyword.
C typedef for struct UNumberingSystem. ICU 52
U_DRAFT void U_EXPORT2 unumsys_close | ( | UNumberingSystem * | unumsys | ) |
Close a UNumberingSystem object. Once closed it may no longer be used.
unumsys | The UNumberingSystem object to close. ICU 52 |
U_DRAFT int32_t U_EXPORT2 unumsys_getDescription | ( | const UNumberingSystem * | unumsys, |
UChar * | result, | ||
int32_t | resultLength, | ||
UErrorCode * | status | ||
) |
Get the description string of the specified UNumberingSystem object. For simple positional systems this is the ordered string of digits (with length matching the radix), e.g. "\u3007\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D" for "hanidec"; it would be "0123456789ABCDEF" for hexadecimal. For algorithmic systems this is the name of the RBNF ruleset used for formatting, e.g. "zh/SpelloutRules/%spellout-cardinal" for "hans" or "%greek-upper" for "grek".
unumsys | The UNumberingSystem whose description string is desired. |
result | A pointer to a buffer to receive the description string. |
resultLength | The maximum size of result. |
status | A pointer to a UErrorCode to receive any errors. |
U_DRAFT const char* U_EXPORT2 unumsys_getName | ( | const UNumberingSystem * | unumsys | ) |
Returns the name of the specified UNumberingSystem object (if it is one of the predefined names known to ICU).
unumsys | The UNumberingSystem whose name is desired. |
U_DRAFT int32_t U_EXPORT2 unumsys_getRadix | ( | const UNumberingSystem * | unumsys | ) |
Returns the radix of the specified UNumberingSystem object. Simple positional numbering systems typically have radix 10, but might have a radix of e.g. 16 for hexadecimal. The radix is less well-defined for non-positional algorithmic systems.
unumsys | The UNumberingSystem whose radix is desired. |
U_DRAFT UBool U_EXPORT2 unumsys_isAlgorithmic | ( | const UNumberingSystem * | unumsys | ) |
Returns whether the given UNumberingSystem object is for an algorithmic (not purely positional) system.
unumsys | The UNumberingSystem whose algorithmic status is desired. |
U_DRAFT UNumberingSystem* U_EXPORT2 unumsys_open | ( | const char * | locale, |
UErrorCode * | status | ||
) |
Opens a UNumberingSystem object using the default numbering system for the specified locale.
locale | The locale for which the default numbering system should be opened. |
status | A pointer to a UErrorCode to receive any errors. For example, this may be U_UNSUPPORTED_ERROR for a locale such as "en@numbers=xyz" that specifies a numbering system unknown to ICU. |
U_DRAFT UEnumeration* U_EXPORT2 unumsys_openAvailableNames | ( | UErrorCode * | status | ) |
Returns an enumeration over the names of all of the predefined numbering systems known to ICU.
status | A pointer to a UErrorCode to receive any errors. |
U_DRAFT UNumberingSystem* U_EXPORT2 unumsys_openByName | ( | const char * | name, |
UErrorCode * | status | ||
) |
Opens a UNumberingSystem object using the name of one of the predefined numbering systems specified by CLDR and known to ICU, such as "latn", "arabext", or "hanidec"; the full list is returned by unumsys_openAvailableNames. Note that some of the names listed at http://unicode.org/repos/cldr/tags/latest/common/bcp47/number.xml - e.g. default, native, traditional, finance - do not identify specific numbering systems, but rather key values that may only be used as part of a locale, which in turn defines how they are mapped to a specific numbering system such as "latn" or "hant".
name | The name of the numbering system for which a UNumberingSystem object should be opened. |
status | A pointer to a UErrorCode to receive any errors. For example, this may be U_UNSUPPORTED_ERROR for a numbering system such as "xyz" that is unknown to ICU. |