ICU 50.1.2  50.1.2
numsys.h
Go to the documentation of this file.
1 /*
2 *******************************************************************************
3 * Copyright (C) 2010-2011, 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 
125 #ifndef U_HIDE_DRAFT_API
126 
131  const char * getName();
132 #endif /* U_HIDE_DRAFT_API */
133 
140  virtual UnicodeString getDescription();
141 
142 
143 
151  UBool isAlgorithmic() const;
152 
159  static UClassID U_EXPORT2 getStaticClassID(void);
160 
166  virtual UClassID getDynamicClassID() const;
167 
168 
169 private:
170  UnicodeString desc;
171  int32_t radix;
172  UBool algorithmic;
173  char name[NUMSYS_NAME_CAPACITY+1];
174 
175  void setRadix(int32_t radix);
176 
177  void setAlgorithmic(UBool algorithmic);
178 
179  void setDesc(UnicodeString desc);
180 
181  void setName(const char* name);
182 
183  static UBool isValidDigitString(const UnicodeString &str);
184 
185  UBool hasContiguousDecimalDigits() const;
186 };
187 
189 
190 #endif /* #if !UCONFIG_NO_FORMATTING */
191 
192 #endif // _NUMSYS
193 //eof