ICU 4.8.1.1  4.8.1.1
numsys.h
Go to the documentation of this file.
00001 /*
00002 *******************************************************************************
00003 * Copyright (C) 2010, 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 
00130     const char * getName();
00131 
00138     virtual UnicodeString getDescription();
00139 
00140 
00141 
00149     UBool isAlgorithmic() const;
00150 
00157     static UClassID U_EXPORT2 getStaticClassID(void);
00158 
00164     virtual UClassID getDynamicClassID() const;
00165 
00166 
00167 private:
00168     UnicodeString   desc;
00169     int32_t         radix;
00170     UBool           algorithmic;
00171     char            name[NUMSYS_NAME_CAPACITY+1];
00172 
00173     void setRadix(int32_t radix);
00174 
00175     void setAlgorithmic(UBool algorithmic);
00176 
00177     void setDesc(UnicodeString desc);
00178 
00179     void setName(const char* name);
00180 
00181     static UBool isValidDigitString(const UnicodeString &str);
00182 
00183     UBool hasContiguousDecimalDigits() const;
00184 };
00185 
00186 U_NAMESPACE_END
00187 
00188 #endif /* #if !UCONFIG_NO_FORMATTING */
00189 
00190 #endif // _NUMSYS
00191 //eof
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines