00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef NUMSYS
00019 #define NUMSYS
00020
00021 #include "unicode/utypes.h"
00022
00023 #if U_SHOW_CPLUSPLUS_API
00024
00030 #if !UCONFIG_NO_FORMATTING
00031
00032 #include "unicode/format.h"
00033 #include "unicode/uobject.h"
00034
00035 U_NAMESPACE_BEGIN
00036
00037
00042 constexpr const size_t kInternalNumSysNameCapacity = 8;
00043
00060 class U_I18N_API NumberingSystem : public UObject {
00061 public:
00062
00068 NumberingSystem();
00069
00074 NumberingSystem(const NumberingSystem& other);
00075
00080 NumberingSystem& operator=(const NumberingSystem& other) = default;
00081
00086 virtual ~NumberingSystem();
00087
00094 static NumberingSystem* U_EXPORT2 createInstance(const Locale & inLocale, UErrorCode& status);
00095
00100 static NumberingSystem* U_EXPORT2 createInstance(UErrorCode& status);
00101
00111 static NumberingSystem* U_EXPORT2 createInstance(int32_t radix, UBool isAlgorithmic, const UnicodeString& description, UErrorCode& status );
00112
00122 static StringEnumeration * U_EXPORT2 getAvailableNames(UErrorCode& status);
00123
00138 static NumberingSystem* U_EXPORT2 createInstanceByName(const char* name, UErrorCode& status);
00139
00140
00147 int32_t getRadix() const;
00148
00157 const char * getName() const;
00158
00169 virtual UnicodeString getDescription() const;
00170
00171
00172
00180 UBool isAlgorithmic() const;
00181
00188 static UClassID U_EXPORT2 getStaticClassID(void);
00189
00195 virtual UClassID getDynamicClassID() const;
00196
00197
00198 private:
00199 UnicodeString desc;
00200 int32_t radix;
00201 UBool algorithmic;
00202 char name[kInternalNumSysNameCapacity+1];
00203
00204 void setRadix(int32_t radix);
00205
00206 void setAlgorithmic(UBool algorithmic);
00207
00208 void setDesc(const UnicodeString &desc);
00209
00210 void setName(const char* name);
00211
00212 static UBool isValidDigitString(const UnicodeString &str);
00213
00214 UBool hasContiguousDecimalDigits() const;
00215 };
00216
00217 U_NAMESPACE_END
00218
00219 #endif
00220
00221 #endif
00222
00223 #endif // _NUMSYS
00224