jpayne@69: // © 2017 and later: Unicode, Inc. and others. jpayne@69: // License & terms of use: http://www.unicode.org/copyright.html jpayne@69: /* jpayne@69: ******************************************************************************* jpayne@69: * Copyright (C) 2009-2017, International Business Machines Corporation, * jpayne@69: * Google, and others. All Rights Reserved. * jpayne@69: ******************************************************************************* jpayne@69: */ jpayne@69: jpayne@69: #ifndef __NOUNIT_H__ jpayne@69: #define __NOUNIT_H__ jpayne@69: jpayne@69: #include "unicode/utypes.h" jpayne@69: jpayne@69: #if U_SHOW_CPLUSPLUS_API jpayne@69: jpayne@69: #if !UCONFIG_NO_FORMATTING jpayne@69: jpayne@69: #include "unicode/measunit.h" jpayne@69: jpayne@69: #ifndef U_HIDE_DRAFT_API jpayne@69: jpayne@69: /** jpayne@69: * \file jpayne@69: * \brief C++ API: units for percent and permille jpayne@69: */ jpayne@69: jpayne@69: U_NAMESPACE_BEGIN jpayne@69: jpayne@69: /** jpayne@69: * Dimensionless unit for percent and permille. jpayne@69: * @see NumberFormatter jpayne@69: * @draft ICU 60 jpayne@69: */ jpayne@69: class U_I18N_API NoUnit: public MeasureUnit { jpayne@69: public: jpayne@69: /** jpayne@69: * Returns an instance for the base unit (dimensionless and no scaling). jpayne@69: * jpayne@69: * @return a NoUnit instance jpayne@69: * @draft ICU 60 jpayne@69: */ jpayne@69: static NoUnit U_EXPORT2 base(); jpayne@69: jpayne@69: /** jpayne@69: * Returns an instance for percent, or 1/100 of a base unit. jpayne@69: * jpayne@69: * @return a NoUnit instance jpayne@69: * @draft ICU 60 jpayne@69: */ jpayne@69: static NoUnit U_EXPORT2 percent(); jpayne@69: jpayne@69: /** jpayne@69: * Returns an instance for permille, or 1/1000 of a base unit. jpayne@69: * jpayne@69: * @return a NoUnit instance jpayne@69: * @draft ICU 60 jpayne@69: */ jpayne@69: static NoUnit U_EXPORT2 permille(); jpayne@69: jpayne@69: /** jpayne@69: * Copy operator. jpayne@69: * @draft ICU 60 jpayne@69: */ jpayne@69: NoUnit(const NoUnit& other); jpayne@69: jpayne@69: /** jpayne@69: * Destructor. jpayne@69: * @draft ICU 60 jpayne@69: */ jpayne@69: virtual ~NoUnit(); jpayne@69: jpayne@69: /** jpayne@69: * Return a polymorphic clone of this object. The result will jpayne@69: * have the same class as returned by getDynamicClassID(). jpayne@69: * @draft ICU 60 jpayne@69: */ jpayne@69: virtual NoUnit* clone() const; jpayne@69: jpayne@69: /** jpayne@69: * Returns a unique class ID for this object POLYMORPHICALLY. jpayne@69: * This method implements a simple form of RTTI used by ICU. jpayne@69: * @return The class ID for this object. All objects of a given jpayne@69: * class have the same class ID. Objects of other classes have jpayne@69: * different class IDs. jpayne@69: * @draft ICU 60 jpayne@69: */ jpayne@69: virtual UClassID getDynamicClassID() const; jpayne@69: jpayne@69: /** jpayne@69: * Returns the class ID for this class. This is used to compare to jpayne@69: * the return value of getDynamicClassID(). jpayne@69: * @return The class ID for all objects of this class. jpayne@69: * @draft ICU 60 jpayne@69: */ jpayne@69: static UClassID U_EXPORT2 getStaticClassID(); jpayne@69: jpayne@69: private: jpayne@69: /** jpayne@69: * Constructor jpayne@69: * @internal (private) jpayne@69: */ jpayne@69: NoUnit(const char* subtype); jpayne@69: jpayne@69: }; jpayne@69: jpayne@69: U_NAMESPACE_END jpayne@69: jpayne@69: #endif /* U_HIDE_DRAFT_API */ jpayne@69: #endif /* #if !UCONFIG_NO_FORMATTING */ jpayne@69: jpayne@69: #endif /* U_SHOW_CPLUSPLUS_API */ jpayne@69: jpayne@69: #endif // __NOUNIT_H__ jpayne@69: //eof jpayne@69: //