ICU 4.8.1.1  4.8.1.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
numsys.h
Go to the documentation of this file.
1 /*
2 *******************************************************************************
3 * Copyright (C) 2010, International Business Machines Corporation and
4 * others. All Rights Reserved.
5 *******************************************************************************
6 *
7 *
8 * File NUMSYS.H
9 *
10 * Modification History:*
11 * Date Name Description
12 *
13 ********************************************************************************
14 */
15 
16 #ifndef NUMSYS
17 #define NUMSYS
18 
24 #define NUMSYS_NAME_CAPACITY 8
25 
26 #include "unicode/utypes.h"
27 
33 #if !UCONFIG_NO_FORMATTING
34 
35 
36 #include "unicode/format.h"
37 #include "unicode/uobject.h"
38 
40 
57 public:
58 
65 
70  NumberingSystem(const NumberingSystem& other);
71 
76  virtual ~NumberingSystem();
77 
84  static NumberingSystem* U_EXPORT2 createInstance(const Locale & inLocale, UErrorCode& status);
85 
90  static NumberingSystem* U_EXPORT2 createInstance(UErrorCode& status);
91 
101  static NumberingSystem* U_EXPORT2 createInstance(int32_t radix, UBool isAlgorithmic, const UnicodeString& description, UErrorCode& status );
102 
108  static StringEnumeration * U_EXPORT2 getAvailableNames(UErrorCode& status);
109 
116  static NumberingSystem* U_EXPORT2 createInstanceByName(const char* name, UErrorCode& status);
117 
118 
123  int32_t getRadix();
124 
130  const char * getName();
131 
138  virtual UnicodeString getDescription();
139 
140 
141 
149  UBool isAlgorithmic() const;
150 
157  static UClassID U_EXPORT2 getStaticClassID(void);
158 
164  virtual UClassID getDynamicClassID() const;
165 
166 
167 private:
168  UnicodeString desc;
169  int32_t radix;
170  UBool algorithmic;
171  char name[NUMSYS_NAME_CAPACITY+1];
172 
173  void setRadix(int32_t radix);
174 
175  void setAlgorithmic(UBool algorithmic);
176 
177  void setDesc(UnicodeString desc);
178 
179  void setName(const char* name);
180 
181  static UBool isValidDigitString(const UnicodeString &str);
182 
183  UBool hasContiguousDecimalDigits() const;
184 };
185 
187 
188 #endif /* #if !UCONFIG_NO_FORMATTING */
189 
190 #endif // _NUMSYS
191 //eof
C++ API: Base class for all formats.
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside...
Definition: utypes.h:521
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:131
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
Definition: unistr.h:188
#define U_EXPORT2
Definition: platform.h:314
Defines numbering systems.
Definition: numsys.h:56
C++ API: Common ICU base class UObject.
#define NUMSYS_NAME_CAPACITY
Size of a numbering system name.
Definition: numsys.h:24
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:132
UObject is the common ICU "boilerplate" class.
Definition: uobject.h:215
void * UClassID
UClassID is used to identify classes without using RTTI, since RTTI is not yet supported by all C++ c...
Definition: utypes.h:385
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:639
Base class for 'pure' C++ implementations of uenum api.
Definition: strenum.h:55
Basic definitions for ICU, for both C and C++ APIs.
A Locale object represents a specific geographical, political, or cultural region.
Definition: locid.h:181
virtual UClassID getDynamicClassID() const =0
ICU4C "poor man's RTTI", returns a UClassID for the actual ICU class.
int8_t UBool
The ICU boolean type.
Definition: umachine.h:228