ICU 4.2.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
numsys.h
Go to the documentation of this file.
1 /*
2 *******************************************************************************
3 * Copyright (C) 2009, 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 #if !UCONFIG_NO_FORMATTING
27 
28 
29 #include "unicode/format.h"
30 #include "unicode/uobject.h"
31 
33 
50 public:
51 
58 
63  NumberingSystem(const NumberingSystem& other);
64 
69  virtual ~NumberingSystem();
70 
77  static NumberingSystem* U_EXPORT2 createInstance(const Locale & inLocale, UErrorCode& status);
78 
83  static NumberingSystem* U_EXPORT2 createInstance(UErrorCode& status);
84 
94  static NumberingSystem* U_EXPORT2 createInstance(int32_t radix, UBool isAlgorithmic, const UnicodeString& description, UErrorCode& status );
95 
101  static StringEnumeration * U_EXPORT2 getAvailableNames(UErrorCode& status);
102 
109  static NumberingSystem* U_EXPORT2 createInstanceByName(const char* name, UErrorCode& status);
110 
111 
116  int32_t getRadix();
117 
124  virtual UnicodeString getDescription();
125 
126 
127 
135  UBool isAlgorithmic() const;
136 
143  static UClassID U_EXPORT2 getStaticClassID(void);
144 
150  virtual UClassID getDynamicClassID() const;
151 
152 
153 private:
154  UnicodeString desc;
155  int32_t radix;
156  UBool algorithmic;
157 
158  void setRadix(int32_t radix);
159 
160  void setAlgorithmic(UBool algorithmic);
161 
162  void setDesc(UnicodeString desc);
163 
164  static UBool isValidDigitString(const UnicodeString &str);
165 
166  UBool hasContiguousDecimalDigits() const;
167 };
168 
170 
171 #endif /* #if !UCONFIG_NO_FORMATTING */
172 
173 #endif // _NUMSYS
174 //eof
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:475
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:183
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
Definition: unistr.h:187
#define U_EXPORT2
Definition: platform.h:338
Defines numbering systems.
Definition: numsys.h:49
C++ API: Common ICU base class UObject.
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API If the compiler doesn't support namespaces...
Definition: uversion.h:184
UObject is the common ICU "boilerplate" class.
Definition: uobject.h:212
void * UClassID
UClassID is used to identify classes without using RTTI, since RTTI is not yet supported by all C++ c...
Definition: utypes.h:339
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:593
Base class for 'pure' C++ implementations of uenum api.
Definition: strenum.h:55
Basic definitions for ICU, for both C and C++ APIs.
A Locale object represents a specific geographical, political, or cultural region.
Definition: locid.h:181
virtual UClassID getDynamicClassID() const =0
ICU4C "poor man's RTTI", returns a UClassID for the actual ICU class.
signed int int32_t
Define 64 bit limits.
Definition: pwin32.h:143
int8_t UBool
The ICU boolean type.
Definition: umachine.h:208