ICU 56.1  56.1
 All Data Structures Namespaces 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-2014, 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 
143  const char * getName() const;
144 
155  virtual UnicodeString getDescription() const;
156 
157 
158 
166  UBool isAlgorithmic() const;
167 
174  static UClassID U_EXPORT2 getStaticClassID(void);
175 
181  virtual UClassID getDynamicClassID() const;
182 
183 
184 private:
185  UnicodeString desc;
186  int32_t radix;
187  UBool algorithmic;
188  char name[NUMSYS_NAME_CAPACITY+1];
189 
190  void setRadix(int32_t radix);
191 
192  void setAlgorithmic(UBool algorithmic);
193 
194  void setDesc(UnicodeString desc);
195 
196  void setName(const char* name);
197 
198  static UBool isValidDigitString(const UnicodeString &str);
199 
200  UBool hasContiguousDecimalDigits() const;
201 };
202 
204 
205 #endif /* #if !UCONFIG_NO_FORMATTING */
206 
207 #endif // _NUMSYS
208 //eof