]>
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 !UCONFIG_NO_FORMATTING
17 #include "unicode/measunit.h"
21 * \brief C++ API: units for percent and permille
26 #ifndef U_HIDE_DRAFT_API
28 * Dimensionless unit for percent and permille.
29 * @see NumberFormatter
32 class U_I18N_API NoUnit
: public MeasureUnit
{
35 * Returns an instance for the base unit (dimensionless and no scaling).
37 * @return a NoUnit instance
40 static NoUnit U_EXPORT2
base();
43 * Returns an instance for percent, or 1/100 of a base unit.
45 * @return a NoUnit instance
48 static NoUnit U_EXPORT2
percent();
51 * Returns an instance for permille, or 1/1000 of a base unit.
53 * @return a NoUnit instance
56 static NoUnit U_EXPORT2
permille();
62 NoUnit(const NoUnit
& other
);
71 * Return a polymorphic clone of this object. The result will
72 * have the same class as returned by getDynamicClassID().
75 virtual UObject
* clone() const;
78 * Returns a unique class ID for this object POLYMORPHICALLY.
79 * This method implements a simple form of RTTI used by ICU.
80 * @return The class ID for this object. All objects of a given
81 * class have the same class ID. Objects of other classes have
82 * different class IDs.
85 virtual UClassID
getDynamicClassID() const;
88 * Returns the class ID for this class. This is used to compare to
89 * the return value of getDynamicClassID().
90 * @return The class ID for all objects of this class.
93 static UClassID U_EXPORT2
getStaticClassID();
100 NoUnit(const char* subtype
);
103 #endif /* U_HIDE_DRAFT_API */
107 #endif /* #if !UCONFIG_NO_FORMATTING */
109 #endif // __NOUNIT_H__