00001 /* 00002 ******************************************************************************* 00003 * Copyright (C) 2010-2011, 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 00024 #define NUMSYS_NAME_CAPACITY 8 00025 00026 #include "unicode/utypes.h" 00027 00033 #if !UCONFIG_NO_FORMATTING 00034 00035 00036 #include "unicode/format.h" 00037 #include "unicode/uobject.h" 00038 00039 U_NAMESPACE_BEGIN 00040 00056 class U_I18N_API NumberingSystem : public UObject { 00057 public: 00058 00064 NumberingSystem(); 00065 00070 NumberingSystem(const NumberingSystem& other); 00071 00076 virtual ~NumberingSystem(); 00077 00084 static NumberingSystem* U_EXPORT2 createInstance(const Locale & inLocale, UErrorCode& status); 00085 00090 static NumberingSystem* U_EXPORT2 createInstance(UErrorCode& status); 00091 00101 static NumberingSystem* U_EXPORT2 createInstance(int32_t radix, UBool isAlgorithmic, const UnicodeString& description, UErrorCode& status ); 00102 00108 static StringEnumeration * U_EXPORT2 getAvailableNames(UErrorCode& status); 00109 00116 static NumberingSystem* U_EXPORT2 createInstanceByName(const char* name, UErrorCode& status); 00117 00118 00123 int32_t getRadix(); 00124 00125 #ifndef U_HIDE_DRAFT_API 00126 00131 const char * getName(); 00132 #endif /* U_HIDE_DRAFT_API */ 00133 00140 virtual UnicodeString getDescription(); 00141 00142 00143 00151 UBool isAlgorithmic() const; 00152 00159 static UClassID U_EXPORT2 getStaticClassID(void); 00160 00166 virtual UClassID getDynamicClassID() const; 00167 00168 00169 private: 00170 UnicodeString desc; 00171 int32_t radix; 00172 UBool algorithmic; 00173 char name[NUMSYS_NAME_CAPACITY+1]; 00174 00175 void setRadix(int32_t radix); 00176 00177 void setAlgorithmic(UBool algorithmic); 00178 00179 void setDesc(UnicodeString desc); 00180 00181 void setName(const char* name); 00182 00183 static UBool isValidDigitString(const UnicodeString &str); 00184 00185 UBool hasContiguousDecimalDigits() const; 00186 }; 00187 00188 U_NAMESPACE_END 00189 00190 #endif /* #if !UCONFIG_NO_FORMATTING */ 00191 00192 #endif // _NUMSYS 00193 //eof