ICU 60.2 60.2

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

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 #define NUMSYS_NAME_CAPACITY 8
29
30
36 #if !UCONFIG_NO_FORMATTING
37
38
39 #include "unicode/format.h"
40 #include "unicode/uobject.h"
41
42 U_NAMESPACE_BEGIN
43
60 class U_I18N_API NumberingSystem : public UObject {
61 public:
62
68 NumberingSystem();
69
74 NumberingSystem(const NumberingSystem& other);
75
80 virtual ~NumberingSystem();
81
88 static NumberingSystem* U_EXPORT2 createInstance(const Locale & inLocale, UErrorCode& status);
89
94 static NumberingSystem* U_EXPORT2 createInstance(UErrorCode& status);
95
105 static NumberingSystem* U_EXPORT2 createInstance(int32_t radix, UBool isAlgorithmic, const UnicodeString& description, UErrorCode& status );
106
112 static StringEnumeration * U_EXPORT2 getAvailableNames(UErrorCode& status);
113
126 static NumberingSystem* U_EXPORT2 createInstanceByName(const char* name, UErrorCode& status);
127
128
135 int32_t getRadix() const;
136
145 const char * getName() const;
146
157 virtual UnicodeString getDescription() const;
158
159
160
168 UBool isAlgorithmic() const;
169
176 static UClassID U_EXPORT2 getStaticClassID(void);
177
183 virtual UClassID getDynamicClassID() const;
184
185
186 private:
187 UnicodeString desc;
188 int32_t radix;
189 UBool algorithmic;
190 char name[NUMSYS_NAME_CAPACITY+1];
191
192 void setRadix(int32_t radix);
193
194 void setAlgorithmic(UBool algorithmic);
195
196 void setDesc(const UnicodeString &desc);
197
198 void setName(const char* name);
199
200 static UBool isValidDigitString(const UnicodeString &str);
201
202 UBool hasContiguousDecimalDigits() const;
203 };
204
205 U_NAMESPACE_END
206
207 #endif /* #if !UCONFIG_NO_FORMATTING */
208
209 #endif // _NUMSYS
210 //eof
icu::UObject::getDynamicClassID
virtual UClassID getDynamicClassID() const
ICU4C "poor man&#39;s RTTI", returns a UClassID for the actual ICU class.
icu::NumberingSystem
Defines numbering systems.
Definition: numsys.h:60
UClassID
void * UClassID
UClassID is used to identify classes without using the compiler&#39;s RTTI.
Definition: uobject.h:93
icu::StringEnumeration
Base class for &#39;pure&#39; 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:360
U_NAMESPACE_BEGIN
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:131
uobject.h
C++ API: Common ICU base class UObject.
NUMSYS_NAME_CAPACITY
#define NUMSYS_NAME_CAPACITY
Size of a numbering system name.
Definition: numsys.h:28
U_NAMESPACE_END
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:132
UErrorCode
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:396
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:286
icu::UObject
UObject is the common ICU "boilerplate" class.
Definition: uobject.h:223
UBool
int8_t UBool
The ICU boolean type.
Definition: umachine.h:236
icu::Locale
A Locale object represents a specific geographical, political, or cultural region.
Definition: locid.h:188