00001 /* 00002 ******************************************************************************* 00003 * Copyright (C) 2009, International Business Machines Corporation and 00004 * others. All Rights Reserved. 00005 ******************************************************************************* 00006 * 00007 * 00008 * File NUMSYS.H 00009 * 00010 * Modification History:* 00011 * Date Name Description 00012 * 00013 ******************************************************************************** 00014 */ 00015 00016 #ifndef NUMSYS 00017 #define NUMSYS 00018 00019 #include "unicode/utypes.h" 00020 00026 #if !UCONFIG_NO_FORMATTING 00027 00028 00029 #include "unicode/format.h" 00030 #include "unicode/uobject.h" 00031 00032 U_NAMESPACE_BEGIN 00033 00038 class U_I18N_API NumberingSystem : public UObject { 00039 public: 00040 00046 NumberingSystem(); 00047 00052 NumberingSystem(const NumberingSystem& other); 00053 00058 virtual ~NumberingSystem(); 00059 00066 static NumberingSystem* U_EXPORT2 createInstance(const Locale & inLocale, UErrorCode& status); 00067 00072 static NumberingSystem* U_EXPORT2 createInstance(UErrorCode& status); 00073 00083 static NumberingSystem* U_EXPORT2 createInstance(int32_t radix, UBool isAlgorithmic, const UnicodeString& description, UErrorCode& status ); 00084 00090 static StringEnumeration * U_EXPORT2 getAvailableNames(UErrorCode& status); 00091 00098 static NumberingSystem* U_EXPORT2 createInstanceByName(const char* name, UErrorCode& status); 00099 00100 00105 int32_t getRadix(); 00106 00113 virtual UnicodeString getDescription(); 00114 00115 00116 00124 UBool isAlgorithmic() const; 00125 00132 static UClassID U_EXPORT2 getStaticClassID(void); 00133 00139 virtual UClassID getDynamicClassID() const; 00140 00141 00142 private: 00143 UnicodeString desc; 00144 int32_t radix; 00145 UBool algorithmic; 00146 00147 void setRadix(int32_t radix); 00148 00149 void setAlgorithmic(UBool algorithmic); 00150 00151 void setDesc(UnicodeString desc); 00152 00153 static UBool isValidDigitString(const UnicodeString &str); 00154 00155 UBool hasContiguousDecimalDigits() const; 00156 }; 00157 00158 U_NAMESPACE_END 00159 00160 #endif /* #if !UCONFIG_NO_FORMATTING */ 00161 00162 #endif // _NUMSYS 00163 //eof