ICU 73.2  73.2
numsys.h
Go to the documentation of this file.
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 
00023 #if U_SHOW_CPLUSPLUS_API
00024 
00030 #if !UCONFIG_NO_FORMATTING
00031 
00032 #include "unicode/format.h"
00033 #include "unicode/uobject.h"
00034 
00035 U_NAMESPACE_BEGIN
00036 
00037 // can't be #ifndef U_HIDE_INTERNAL_API; needed for char[] field size
00042 constexpr const size_t kInternalNumSysNameCapacity = 8;
00043 
00060 class U_I18N_API NumberingSystem : public UObject {
00061 public:
00062 
00068     NumberingSystem();
00069 
00074     NumberingSystem(const NumberingSystem& other);
00075 
00080     NumberingSystem& operator=(const NumberingSystem& other) = default;
00081 
00086     virtual ~NumberingSystem();
00087 
00094     static NumberingSystem* U_EXPORT2 createInstance(const Locale & inLocale, UErrorCode& status);
00095 
00100     static NumberingSystem* U_EXPORT2 createInstance(UErrorCode& status);
00101 
00111     static NumberingSystem* U_EXPORT2 createInstance(int32_t radix, UBool isAlgorithmic, const UnicodeString& description, UErrorCode& status );
00112 
00122      static StringEnumeration * U_EXPORT2 getAvailableNames(UErrorCode& status);
00123 
00138     static NumberingSystem* U_EXPORT2 createInstanceByName(const char* name, UErrorCode& status);
00139 
00140 
00147     int32_t getRadix() const;
00148 
00157     const char * getName() const;
00158 
00169     virtual UnicodeString getDescription() const;
00170 
00171 
00172 
00180     UBool isAlgorithmic() const;
00181 
00188     static UClassID U_EXPORT2 getStaticClassID(void);
00189 
00195     virtual UClassID getDynamicClassID() const override;
00196 
00197 
00198 private:
00199     UnicodeString   desc;
00200     int32_t         radix;
00201     UBool           algorithmic;
00202     char            name[kInternalNumSysNameCapacity+1];
00203 
00204     void setRadix(int32_t radix);
00205 
00206     void setAlgorithmic(UBool algorithmic);
00207 
00208     void setDesc(const UnicodeString &desc);
00209 
00210     void setName(const char* name);
00211 };
00212 
00213 U_NAMESPACE_END
00214 
00215 #endif /* #if !UCONFIG_NO_FORMATTING */
00216 
00217 #endif /* U_SHOW_CPLUSPLUS_API */
00218 
00219 #endif // _NUMSYS
00220 //eof