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 #if !UCONFIG_NO_FORMATTING 00029 00030 #include "unicode/format.h" 00031 #include "unicode/uobject.h" 00032 00033 U_NAMESPACE_BEGIN 00034 00035 // can't be #ifndef U_HIDE_INTERNAL_API; needed for char[] field size 00040 constexpr const size_t kInternalNumSysNameCapacity = 8; 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 00114 static StringEnumeration * U_EXPORT2 getAvailableNames(UErrorCode& status); 00115 00130 static NumberingSystem* U_EXPORT2 createInstanceByName(const char* name, UErrorCode& status); 00131 00132 00139 int32_t getRadix() const; 00140 00149 const char * getName() const; 00150 00161 virtual UnicodeString getDescription() const; 00162 00163 00164 00172 UBool isAlgorithmic() const; 00173 00180 static UClassID U_EXPORT2 getStaticClassID(void); 00181 00187 virtual UClassID getDynamicClassID() const; 00188 00189 00190 private: 00191 UnicodeString desc; 00192 int32_t radix; 00193 UBool algorithmic; 00194 char name[kInternalNumSysNameCapacity+1]; 00195 00196 void setRadix(int32_t radix); 00197 00198 void setAlgorithmic(UBool algorithmic); 00199 00200 void setDesc(const UnicodeString &desc); 00201 00202 void setName(const char* name); 00203 00204 static UBool isValidDigitString(const UnicodeString &str); 00205 00206 UBool hasContiguousDecimalDigits() const; 00207 }; 00208 00209 U_NAMESPACE_END 00210 00211 #endif /* #if !UCONFIG_NO_FORMATTING */ 00212 00213 #endif // _NUMSYS 00214 //eof
1.6.1