ICU 52.1  52.1
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 
26 #define NUMSYS_NAME_CAPACITY 8
27 
28 
34 #if !UCONFIG_NO_FORMATTING
35 
36 
37 #include "unicode/format.h"
38 #include "unicode/uobject.h"
39 
41 
59 public:
60 
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 
110  static StringEnumeration * U_EXPORT2 getAvailableNames(UErrorCode& status);
111 
124  static NumberingSystem* U_EXPORT2 createInstanceByName(const char* name, UErrorCode& status);
125 
126 
133  int32_t getRadix() const;
134 
140  const char * getName() const;
141 
152  virtual UnicodeString getDescription() const;
153 
154 
155 
163  UBool isAlgorithmic() const;
164 
171  static UClassID U_EXPORT2 getStaticClassID(void);
172 
178  virtual UClassID getDynamicClassID() const;
179 
180 
181 private:
182  UnicodeString desc;
183  int32_t radix;
184  UBool algorithmic;
185  char name[NUMSYS_NAME_CAPACITY+1];
186 
187  void setRadix(int32_t radix);
188 
189  void setAlgorithmic(UBool algorithmic);
190 
191  void setDesc(UnicodeString desc);
192 
193  void setName(const char* name);
194 
195  static UBool isValidDigitString(const UnicodeString &str);
196 
197  UBool hasContiguousDecimalDigits() const;
198 };
199 
201 
202 #endif /* #if !UCONFIG_NO_FORMATTING */
203 
204 #endif // _NUMSYS
205 //eof