ICU 51.2  51.2
numsys.h
Go to the documentation of this file.
1 /*
2 *******************************************************************************
3 * Copyright (C) 2010-2013, 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 
19 #include "unicode/utypes.h"
20 
21 #ifndef U_HIDE_INTERNAL_API
22 
27 #define NUMSYS_NAME_CAPACITY 8
28 #endif /* U_HIDE_INTERNAL_API */
29 
30 
36 #if !UCONFIG_NO_FORMATTING
37 
38 
39 #include "unicode/format.h"
40 #include "unicode/uobject.h"
41 
43 
60 public:
61 
68 
73  NumberingSystem(const NumberingSystem& other);
74 
79  virtual ~NumberingSystem();
80 
87  static NumberingSystem* U_EXPORT2 createInstance(const Locale & inLocale, UErrorCode& status);
88 
93  static NumberingSystem* U_EXPORT2 createInstance(UErrorCode& status);
94 
104  static NumberingSystem* U_EXPORT2 createInstance(int32_t radix, UBool isAlgorithmic, const UnicodeString& description, UErrorCode& status );
105 
111  static StringEnumeration * U_EXPORT2 getAvailableNames(UErrorCode& status);
112 
119  static NumberingSystem* U_EXPORT2 createInstanceByName(const char* name, UErrorCode& status);
120 
121 
126  int32_t getRadix();
127 
133  const char * getName();
134 
141  virtual UnicodeString getDescription();
142 
143 
144 
152  UBool isAlgorithmic() const;
153 
160  static UClassID U_EXPORT2 getStaticClassID(void);
161 
167  virtual UClassID getDynamicClassID() const;
168 
169 
170 private:
171  UnicodeString desc;
172  int32_t radix;
173  UBool algorithmic;
174  char name[NUMSYS_NAME_CAPACITY+1];
175 
176  void setRadix(int32_t radix);
177 
178  void setAlgorithmic(UBool algorithmic);
179 
180  void setDesc(UnicodeString desc);
181 
182  void setName(const char* name);
183 
184  static UBool isValidDigitString(const UnicodeString &str);
185 
186  UBool hasContiguousDecimalDigits() const;
187 };
188 
190 
191 #endif /* #if !UCONFIG_NO_FORMATTING */
192 
193 #endif // _NUMSYS
194 //eof