]>
git.saurik.com Git - apple/icu.git/blob - icuSources/i18n/unicode/nounit.h
1 // © 2017 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
4 *******************************************************************************
5 * Copyright (C) 2009-2017, International Business Machines Corporation, *
6 * Google, and others. All Rights Reserved. *
7 *******************************************************************************
13 #include "unicode/utypes.h"
15 #if U_SHOW_CPLUSPLUS_API
17 #if !UCONFIG_NO_FORMATTING
19 #include "unicode/measunit.h"
21 #ifndef U_HIDE_DRAFT_API
25 * \brief C++ API: units for percent and permille
31 * Dimensionless unit for percent and permille.
32 * @see NumberFormatter
35 class U_I18N_API NoUnit
: public MeasureUnit
{
38 * Returns an instance for the base unit (dimensionless and no scaling).
40 * @return a NoUnit instance
43 static NoUnit U_EXPORT2
base();
46 * Returns an instance for percent, or 1/100 of a base unit.
48 * @return a NoUnit instance
51 static NoUnit U_EXPORT2
percent();
54 * Returns an instance for permille, or 1/1000 of a base unit.
56 * @return a NoUnit instance
59 static NoUnit U_EXPORT2
permille();
65 NoUnit(const NoUnit
& other
);
74 * Return a polymorphic clone of this object. The result will
75 * have the same class as returned by getDynamicClassID().
78 virtual NoUnit
* clone() const;
81 * Returns a unique class ID for this object POLYMORPHICALLY.
82 * This method implements a simple form of RTTI used by ICU.
83 * @return The class ID for this object. All objects of a given
84 * class have the same class ID. Objects of other classes have
85 * different class IDs.
88 virtual UClassID
getDynamicClassID() const;
91 * Returns the class ID for this class. This is used to compare to
92 * the return value of getDynamicClassID().
93 * @return The class ID for all objects of this class.
96 static UClassID U_EXPORT2
getStaticClassID();
101 * @internal (private)
103 NoUnit(const char* subtype
);
109 #endif /* U_HIDE_DRAFT_API */
110 #endif /* #if !UCONFIG_NO_FORMATTING */
112 #endif /* U_SHOW_CPLUSPLUS_API */
114 #endif // __NOUNIT_H__