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
virtual UClassID getDynamicClassID() const
ICU4C "poor man's RTTI", returns a UClassID for the actual ICU class.
Defines numbering systems.
Definition: numsys.h:58
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Definition: uobject.h:91
Base class for 'pure' C++ implementations of uenum api.
Definition: strenum.h:55
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:358
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:129
C++ API: Common ICU base class UObject.
#define NUMSYS_NAME_CAPACITY
Size of a numbering system name.
Definition: numsys.h:26
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:130
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:476
Basic definitions for ICU, for both C and C++ APIs.
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
Definition: unistr.h:245
UObject is the common ICU "boilerplate" class.
Definition: uobject.h:221
int8_t UBool
The ICU boolean type.
Definition: umachine.h:200
A Locale object represents a specific geographical, political, or cultural region.
Definition: locid.h:185