00001 /* 00002 ******************************************************************************* 00003 * Copyright (C) 2010-2014, 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 #define NUMSYS_NAME_CAPACITY 8 00027 00028 00034 #if !UCONFIG_NO_FORMATTING 00035 00036 00037 #include "unicode/format.h" 00038 #include "unicode/uobject.h" 00039 00040 U_NAMESPACE_BEGIN 00041 00058 class U_I18N_API NumberingSystem : public UObject { 00059 public: 00060 00066 NumberingSystem(); 00067 00072 NumberingSystem(const NumberingSystem& other); 00073 00078 virtual ~NumberingSystem(); 00079 00086 static NumberingSystem* U_EXPORT2 createInstance(const Locale & inLocale, UErrorCode& status); 00087 00092 static NumberingSystem* U_EXPORT2 createInstance(UErrorCode& status); 00093 00103 static NumberingSystem* U_EXPORT2 createInstance(int32_t radix, UBool isAlgorithmic, const UnicodeString& description, UErrorCode& status ); 00104 00110 static StringEnumeration * U_EXPORT2 getAvailableNames(UErrorCode& status); 00111 00124 static NumberingSystem* U_EXPORT2 createInstanceByName(const char* name, UErrorCode& status); 00125 00126 00133 int32_t getRadix() const; 00134 00143 const char * getName() const; 00144 00155 virtual UnicodeString getDescription() const; 00156 00157 00158 00166 UBool isAlgorithmic() const; 00167 00174 static UClassID U_EXPORT2 getStaticClassID(void); 00175 00181 virtual UClassID getDynamicClassID() const; 00182 00183 00184 private: 00185 UnicodeString desc; 00186 int32_t radix; 00187 UBool algorithmic; 00188 char name[NUMSYS_NAME_CAPACITY+1]; 00189 00190 void setRadix(int32_t radix); 00191 00192 void setAlgorithmic(UBool algorithmic); 00193 00194 void setDesc(UnicodeString desc); 00195 00196 void setName(const char* name); 00197 00198 static UBool isValidDigitString(const UnicodeString &str); 00199 00200 UBool hasContiguousDecimalDigits() const; 00201 }; 00202 00203 U_NAMESPACE_END 00204 00205 #endif /* #if !UCONFIG_NO_FORMATTING */ 00206 00207 #endif // _NUMSYS 00208 //eof
1.6.1