ICU 75.1 75.1

unumsys.h
Go to the documentation of this file.
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /*
4 *****************************************************************************************
5 * Copyright (C) 2013-2014, International Business Machines
6 * Corporation and others. All Rights Reserved.
7 *****************************************************************************************
8 */
9
10 #ifndef UNUMSYS_H
11 #define UNUMSYS_H
12
13 #include "unicode/utypes.h"
14
15 #if !UCONFIG_NO_FORMATTING
16
17 #include "unicode/uenum.h"
18
19 #if U_SHOW_CPLUSPLUS_API
20 #include "unicode/localpointer.h"
21 #endif // U_SHOW_CPLUSPLUS_API
22
46 struct UNumberingSystem;
47 typedef struct UNumberingSystem UNumberingSystem;
60 U_CAPI UNumberingSystem * U_EXPORT2
61 unumsys_open(const char *locale, UErrorCode *status);
62
81 U_CAPI UNumberingSystem * U_EXPORT2
82 unumsys_openByName(const char *name, UErrorCode *status);
83
89 U_CAPI void U_EXPORT2
90 unumsys_close(UNumberingSystem *unumsys);
91
92 #if U_SHOW_CPLUSPLUS_API
93 U_NAMESPACE_BEGIN
94
103 U_DEFINE_LOCAL_OPEN_POINTER(LocalUNumberingSystemPointer, UNumberingSystem, unumsys_close);
104
105 U_NAMESPACE_END
106 #endif
107
117 U_CAPI UEnumeration * U_EXPORT2
118 unumsys_openAvailableNames(UErrorCode *status);
119
129 U_CAPI const char * U_EXPORT2
130 unumsys_getName(const UNumberingSystem *unumsys);
131
140 U_CAPI UBool U_EXPORT2
141 unumsys_isAlgorithmic(const UNumberingSystem *unumsys);
142
151 U_CAPI int32_t U_EXPORT2
152 unumsys_getRadix(const UNumberingSystem *unumsys);
153
170 U_CAPI int32_t U_EXPORT2
171 unumsys_getDescription(const UNumberingSystem *unumsys, UChar *result,
172 int32_t resultLength, UErrorCode *status);
173
174 #endif /* #if !UCONFIG_NO_FORMATTING */
175
176 #endif
LocalUNumberingSystemPointer
"Smart pointer" class, closes a UNumberingSystem via unumsys_close().
localpointer.h
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
U_DEFINE_LOCAL_OPEN_POINTER
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction)
"Smart pointer" definition macro, deletes objects via the closeFunction.
Definition: localpointer.h:550
uenum.h
C API: String Enumeration.
UEnumeration
struct UEnumeration UEnumeration
structure representing an enumeration object instance
Definition: uenum.h:44
UBool
int8_t UBool
The ICU boolean type, a signed-byte integer.
Definition: umachine.h:247
U_CAPI
#define U_CAPI
This is used to declare a function as a public ICU C API.
Definition: umachine.h:110
UChar
char16_t UChar
The base type for UTF-16 code units and pointers.
Definition: umachine.h:378
unumsys_close
U_CAPI void unumsys_close(UNumberingSystem *unumsys)
Close a UNumberingSystem object.
unumsys_isAlgorithmic
U_CAPI UBool unumsys_isAlgorithmic(const UNumberingSystem *unumsys)
Returns whether the given UNumberingSystem object is for an algorithmic (not purely positional) syste...
unumsys_openByName
U_CAPI UNumberingSystem * unumsys_openByName(const char *name, UErrorCode *status)
Opens a UNumberingSystem object using the name of one of the predefined numbering systems specified b...
unumsys_open
U_CAPI UNumberingSystem * unumsys_open(const char *locale, UErrorCode *status)
Opens a UNumberingSystem object using the default numbering system for the specified locale.
unumsys_openAvailableNames
U_CAPI UEnumeration * unumsys_openAvailableNames(UErrorCode *status)
Returns an enumeration over the names of all of the predefined numbering systems known to ICU.
unumsys_getRadix
U_CAPI int32_t unumsys_getRadix(const UNumberingSystem *unumsys)
Returns the radix of the specified UNumberingSystem object.
unumsys_getDescription
U_CAPI int32_t unumsys_getDescription(const UNumberingSystem *unumsys, UChar *result, int32_t resultLength, UErrorCode *status)
Get the description string of the specified UNumberingSystem object.
UNumberingSystem
struct UNumberingSystem UNumberingSystem
C typedef for struct UNumberingSystem.
Definition: unumsys.h:47
unumsys_getName
U_CAPI const char * unumsys_getName(const UNumberingSystem *unumsys)
Returns the name of the specified UNumberingSystem object (if it is one of the predefined names known...
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition: utypes.h:415