ICU 50.2 50.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
32
33#if !UCONFIG_NO_FORMATTING
34
35
36#include "unicode/format.h"
37#include "unicode/uobject.h"
38
40
55
57public:
58
65
71
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
107
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
131 const char * getName();
132#endif /* U_HIDE_DRAFT_API */
133
141
142
143
152
159 static UClassID U_EXPORT2 getStaticClassID(void);
160
167
168
169private:
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
A Locale object represents a specific geographical, political, or cultural region.
Definition locid.h:182
const char * getName()
Returns the name of this numbering system if it was created using one of the predefined names known t...
NumberingSystem()
Default Constructor.
virtual UClassID getDynamicClassID() const
ICU "poor man's RTTI", returns a UClassID for the actual class.
int32_t getRadix()
Returns the radix of this numbering system.
static NumberingSystem * createInstance(UErrorCode &status)
Create the default numbering system associated with the default locale.
virtual UnicodeString getDescription()
Returns the description string of this numbering system, which is either the string of digits in the ...
NumberingSystem(const NumberingSystem &other)
Copy constructor.
static NumberingSystem * createInstance(int32_t radix, UBool isAlgorithmic, const UnicodeString &description, UErrorCode &status)
Create a numbering system using the specified radix, type, and description.
virtual ~NumberingSystem()
Destructor.
static NumberingSystem * createInstance(const Locale &inLocale, UErrorCode &status)
Create the default numbering system associated with the specified locale.
static UClassID getStaticClassID(void)
ICU "poor man's RTTI", returns a UClassID for this class.
static StringEnumeration * getAvailableNames(UErrorCode &status)
Return a StringEnumeration over all the names of numbering systems known to ICU.
static NumberingSystem * createInstanceByName(const char *name, UErrorCode &status)
Create a numbering system from one of the predefined numbering systems known to ICU.
UBool isAlgorithmic() const
Returns TRUE if the given numbering system is algorithmic.
Base class for 'pure' C++ implementations of uenum api.
Definition strenum.h:55
UObject is the common ICU "boilerplate" class.
Definition uobject.h:229
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
Definition unistr.h:247
C++ API: Base class for all formats.
#define NUMSYS_NAME_CAPACITY
Size of a numbering system name.
Definition numsys.h:24
int8_t UBool
The ICU boolean type.
Definition umachine.h:200
C++ API: Common ICU base class UObject.
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Definition uobject.h:96
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers,...
Definition utypes.h:476
#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_END
This is used to end a declaration of a public ICU C++ API.
Definition uversion.h:130
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition uversion.h:129