numsys.h
Go to the documentation of this file.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
* Copyright (C) 2010-2014, International Business Machines Corporation and
* others. All Rights Reserved.
*******************************************************************************
*
*
* File NUMSYS.H
*
* Modification History:*
* Date Name Description
*
********************************************************************************
*/
#ifndef NUMSYS
#define NUMSYS
#include "unicode/utypes.h"
#if U_SHOW_CPLUSPLUS_API
#if !UCONFIG_NO_FORMATTING
#include "unicode/format.h"
#include "unicode/uobject.h"
U_NAMESPACE_BEGIN
// can't be #ifndef U_HIDE_INTERNAL_API; needed for char[] field size
constexpr const size_t kInternalNumSysNameCapacity = 8;
class U_I18N_API NumberingSystem : public UObject {
public:
NumberingSystem();
NumberingSystem(const NumberingSystem& other);
NumberingSystem& operator=(const NumberingSystem& other) = default;
virtual ~NumberingSystem();
static NumberingSystem* U_EXPORT2 createInstance(const Locale & inLocale, UErrorCode& status);
static NumberingSystem* U_EXPORT2 createInstance(UErrorCode& status);
static NumberingSystem* U_EXPORT2 createInstance(int32_t radix, UBool isAlgorithmic, const UnicodeString& description, UErrorCode& status );
static StringEnumeration * U_EXPORT2 getAvailableNames(UErrorCode& status);
static NumberingSystem* U_EXPORT2 createInstanceByName(const char* name, UErrorCode& status);
int32_t getRadix() const;
const char * getName() const;
virtual UnicodeString getDescription() const;
UBool isAlgorithmic() const;
static UClassID U_EXPORT2 getStaticClassID();
virtual UClassID getDynamicClassID() const override;
private:
UnicodeString desc;
int32_t radix;
UBool algorithmic;
char name[kInternalNumSysNameCapacity+1];
void setRadix(int32_t radix);
void setAlgorithmic(UBool algorithmic);
void setDesc(const UnicodeString &desc);
void setName(const char* name);
};
U_NAMESPACE_END
#endif /* #if !UCONFIG_NO_FORMATTING */
#endif /* U_SHOW_CPLUSPLUS_API */
#endif // _NUMSYS
//eof
icu::LocalPointerBase
"Smart pointer" base class; do not use directly: use LocalPointer etc.
Definition localpointer.h:68
icu::Locale
A Locale object represents a specific geographical, political, or cultural region.
Definition locid.h:195
icu::NumberingSystem
Defines numbering systems.
Definition numsys.h:60
icu::NumberingSystem::createInstance
static NumberingSystem * createInstance(int32_t radix, UBool isAlgorithmic, const UnicodeString &description, UErrorCode &status)
Create a numbering system using the specified radix, type, and description.
icu::NumberingSystem::getName
const char * getName() const
Returns the name of this numbering system if it was created using one of the predefined names known t...
icu::NumberingSystem::createInstanceByName
static NumberingSystem * createInstanceByName(const char *name, UErrorCode &status)
Create a numbering system from one of the predefined numbering systems specified by CLDR and known to...
icu::NumberingSystem::getDynamicClassID
virtual UClassID getDynamicClassID() const override
ICU "poor man's RTTI", returns a UClassID for the actual class.
icu::NumberingSystem::~NumberingSystem
virtual ~NumberingSystem()
Destructor.
icu::NumberingSystem::NumberingSystem
NumberingSystem()
Default Constructor.
icu::NumberingSystem::getStaticClassID
static UClassID getStaticClassID()
ICU "poor man's RTTI", returns a UClassID for this class.
icu::NumberingSystem::isAlgorithmic
UBool isAlgorithmic() const
Returns true if the given numbering system is algorithmic.
icu::NumberingSystem::getDescription
virtual UnicodeString getDescription() const
Returns the description string of this numbering system.
icu::NumberingSystem::NumberingSystem
NumberingSystem(const NumberingSystem &other)
Copy constructor.
icu::NumberingSystem::createInstance
static NumberingSystem * createInstance(const Locale &inLocale, UErrorCode &status)
Create the default numbering system associated with the specified locale.
icu::NumberingSystem::createInstance
static NumberingSystem * createInstance(UErrorCode &status)
Create the default numbering system associated with the default locale.
icu::NumberingSystem::getAvailableNames
static StringEnumeration * getAvailableNames(UErrorCode &status)
Return a StringEnumeration over all the names of numbering systems known to ICU.
icu::NumberingSystem::getRadix
int32_t getRadix() const
Returns the radix of this numbering system.
icu::NumberingSystem::operator=
NumberingSystem & operator=(const NumberingSystem &other)=default
Copy assignment.
icu::StringEnumeration
Base class for 'pure' C++ implementations of uenum api.
Definition strenum.h:61
icu::UObject
UObject is the common ICU "boilerplate" class.
Definition uobject.h:223
icu::UnicodeString
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
Definition unistr.h:296
format.h
C++ API: Base class for all formats.
icu::kInternalNumSysNameCapacity
constexpr const size_t kInternalNumSysNameCapacity
Size of a numbering system name.
Definition numsys.h:42
UBool
int8_t UBool
The ICU boolean type, a signed-byte integer.
Definition umachine.h:247
uobject.h
C++ API: Common ICU base class UObject.
UClassID
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Definition uobject.h:96
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition utypes.h:430
U_I18N_API
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside.
Definition utypes.h:316