00001 // © 2016 and later: Unicode, Inc. and others. 00002 // License & terms of use: http://www.unicode.org/copyright.html 00003 /* 00004 ******************************************************************************* 00005 * Copyright (C) 2010-2014, International Business Machines Corporation and 00006 * others. All Rights Reserved. 00007 ******************************************************************************* 00008 * 00009 * 00010 * File NUMSYS.H 00011 * 00012 * Modification History:* 00013 * Date Name Description 00014 * 00015 ******************************************************************************** 00016 */ 00017 00018 #ifndef NUMSYS 00019 #define NUMSYS 00020 00021 #include "unicode/utypes.h" 00022 00028 #define NUMSYS_NAME_CAPACITY 8 00029 00030 00036 #if !UCONFIG_NO_FORMATTING 00037 00038 00039 #include "unicode/format.h" 00040 #include "unicode/uobject.h" 00041 00042 U_NAMESPACE_BEGIN 00043 00060 class U_I18N_API NumberingSystem : public UObject { 00061 public: 00062 00068 NumberingSystem(); 00069 00074 NumberingSystem(const NumberingSystem& other); 00075 00080 virtual ~NumberingSystem(); 00081 00088 static NumberingSystem* U_EXPORT2 createInstance(const Locale & inLocale, UErrorCode& status); 00089 00094 static NumberingSystem* U_EXPORT2 createInstance(UErrorCode& status); 00095 00105 static NumberingSystem* U_EXPORT2 createInstance(int32_t radix, UBool isAlgorithmic, const UnicodeString& description, UErrorCode& status ); 00106 00112 static StringEnumeration * U_EXPORT2 getAvailableNames(UErrorCode& status); 00113 00126 static NumberingSystem* U_EXPORT2 createInstanceByName(const char* name, UErrorCode& status); 00127 00128 00135 int32_t getRadix() const; 00136 00145 const char * getName() const; 00146 00157 virtual UnicodeString getDescription() const; 00158 00159 00160 00168 UBool isAlgorithmic() const; 00169 00176 static UClassID U_EXPORT2 getStaticClassID(void); 00177 00183 virtual UClassID getDynamicClassID() const; 00184 00185 00186 private: 00187 UnicodeString desc; 00188 int32_t radix; 00189 UBool algorithmic; 00190 char name[NUMSYS_NAME_CAPACITY+1]; 00191 00192 void setRadix(int32_t radix); 00193 00194 void setAlgorithmic(UBool algorithmic); 00195 00196 void setDesc(const UnicodeString &desc); 00197 00198 void setName(const char* name); 00199 00200 static UBool isValidDigitString(const UnicodeString &str); 00201 00202 UBool hasContiguousDecimalDigits() const; 00203 }; 00204 00205 U_NAMESPACE_END 00206 00207 #endif /* #if !UCONFIG_NO_FORMATTING */ 00208 00209 #endif // _NUMSYS 00210 //eof
1.6.1