ICU 64.2 64.2

numsys.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) 2010-2014, International Business Machines Corporation and
6 * others. All Rights Reserved.
7 *******************************************************************************
8 *
9 *
10 * File NUMSYS.H
11 *
12 * Modification History:*
13 * Date Name Description
14 *
15 ********************************************************************************
16 */
17
18 #ifndef NUMSYS
19 #define NUMSYS
20
21 #include "unicode/utypes.h"
22
28 #if !UCONFIG_NO_FORMATTING
29
30 #include "unicode/format.h"
31 #include "unicode/uobject.h"
32
33 U_NAMESPACE_BEGIN
34
35 // can't be #ifndef U_HIDE_INTERNAL_API; needed for char[] field size
40 constexpr const size_t kInternalNumSysNameCapacity = 8;
41
58 class U_I18N_API NumberingSystem : public UObject {
59 public:
60
66 NumberingSystem();
67
72 NumberingSystem(const NumberingSystem& other);
73
78 virtual ~NumberingSystem();
79
86 static NumberingSystem* U_EXPORT2 createInstance(const Locale & inLocale, UErrorCode& status);
87
92 static NumberingSystem* U_EXPORT2 createInstance(UErrorCode& status);
93
103 static NumberingSystem* U_EXPORT2 createInstance(int32_t radix, UBool isAlgorithmic, const UnicodeString& description, UErrorCode& status );
104
114 static StringEnumeration * U_EXPORT2 getAvailableNames(UErrorCode& status);
115
130 static NumberingSystem* U_EXPORT2 createInstanceByName(const char* name, UErrorCode& status);
131
132
139 int32_t getRadix() const;
140
149 const char * getName() const;
150
161 virtual UnicodeString getDescription() const;
162
163
164
172 UBool isAlgorithmic() const;
173
180 static UClassID U_EXPORT2 getStaticClassID(void);
181
187 virtual UClassID getDynamicClassID() const;
188
189
190 private:
191 UnicodeString desc;
192 int32_t radix;
193 UBool algorithmic;
194 char name[kInternalNumSysNameCapacity+1];
195
196 void setRadix(int32_t radix);
197
198 void setAlgorithmic(UBool algorithmic);
199
200 void setDesc(const UnicodeString &desc);
201
202 void setName(const char* name);
203
204 static UBool isValidDigitString(const UnicodeString &str);
205
206 UBool hasContiguousDecimalDigits() const;
207 };
208
209 U_NAMESPACE_END
210
211 #endif /* #if !UCONFIG_NO_FORMATTING */
212
213 #endif // _NUMSYS
214 //eof
icu::NumberingSystem
Defines numbering systems.
Definition: numsys.h:58
UClassID
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Definition: uobject.h:93
icu::StringEnumeration
Base class for 'pure' C++ implementations of uenum api.
Definition: strenum.h:57
format.h
C++ API: Base class for all formats.
U_I18N_API
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside.
Definition: utypes.h:301
U_NAMESPACE_BEGIN
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:137
icu::UObject::getDynamicClassID
virtual UClassID getDynamicClassID() const
ICU4C "poor man's RTTI", returns a UClassID for the actual ICU class.
icu::kInternalNumSysNameCapacity
constexpr const size_t kInternalNumSysNameCapacity
Size of a numbering system name.
Definition: numsys.h:40
uobject.h
C++ API: Common ICU base class UObject.
U_NAMESPACE_END
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:138
UErrorCode
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers,...
Definition: utypes.h:401
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
icu::UnicodeString
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
Definition: unistr.h:289
icu::UObject
UObject is the common ICU "boilerplate" class.
Definition: uobject.h:223
UBool
int8_t UBool
The ICU boolean type.
Definition: umachine.h:225
icu::Locale
A Locale object represents a specific geographical, political, or cultural region.
Definition: locid.h:192