|
||||
File indexing completed on 2025-01-18 10:13:06
0001 // © 2017 and later: Unicode, Inc. and others. 0002 // License & terms of use: http://www.unicode.org/copyright.html 0003 /* 0004 ******************************************************************************* 0005 * Copyright (C) 2009-2017, International Business Machines Corporation, * 0006 * Google, and others. All Rights Reserved. * 0007 ******************************************************************************* 0008 */ 0009 0010 #ifndef __NOUNIT_H__ 0011 #define __NOUNIT_H__ 0012 0013 #include "unicode/utypes.h" 0014 0015 #if U_SHOW_CPLUSPLUS_API 0016 0017 #if !UCONFIG_NO_FORMATTING 0018 0019 #include "unicode/measunit.h" 0020 0021 /** 0022 * \file 0023 * \brief C++ API: units for percent and permille 0024 */ 0025 0026 U_NAMESPACE_BEGIN 0027 0028 /** 0029 * Dimensionless unit for percent and permille. 0030 * Prior to ICU 68, this namespace was a class with the same name. 0031 * @see NumberFormatter 0032 * @stable ICU 68 0033 */ 0034 namespace NoUnit { 0035 /** 0036 * Returns an instance for the base unit (dimensionless and no scaling). 0037 * 0038 * Prior to ICU 68, this function returned a NoUnit by value. 0039 * 0040 * Since ICU 68, this function returns the same value as the default MeasureUnit constructor. 0041 * 0042 * @return a MeasureUnit instance 0043 * @stable ICU 68 0044 */ 0045 static inline MeasureUnit U_EXPORT2 base() { 0046 return MeasureUnit(); 0047 } 0048 0049 /** 0050 * Returns an instance for percent, or 1/100 of a base unit. 0051 * 0052 * Prior to ICU 68, this function returned a NoUnit by value. 0053 * 0054 * Since ICU 68, this function returns the same value as MeasureUnit::getPercent(). 0055 * 0056 * @return a MeasureUnit instance 0057 * @stable ICU 68 0058 */ 0059 static inline MeasureUnit U_EXPORT2 percent() { 0060 return MeasureUnit::getPercent(); 0061 } 0062 0063 /** 0064 * Returns an instance for permille, or 1/1000 of a base unit. 0065 * 0066 * Prior to ICU 68, this function returned a NoUnit by value. 0067 * 0068 * Since ICU 68, this function returns the same value as MeasureUnit::getPermille(). 0069 * 0070 * @return a MeasureUnit instance 0071 * @stable ICU 68 0072 */ 0073 static inline MeasureUnit U_EXPORT2 permille() { 0074 return MeasureUnit::getPermille(); 0075 } 0076 } 0077 0078 U_NAMESPACE_END 0079 0080 #endif /* #if !UCONFIG_NO_FORMATTING */ 0081 0082 #endif /* U_SHOW_CPLUSPLUS_API */ 0083 0084 #endif // __NOUNIT_H__ 0085 //eof 0086 //
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |