Go to the documentation of this file.
4 #ifndef __FORMATTEDNUMBER_H__
5 #define __FORMATTEDNUMBER_H__
9 #if U_SHOW_CPLUSPLUS_API
11 #if !UCONFIG_NO_FORMATTING
27 class FieldPositionIteratorHandler;
32 class DecimalQuantity;
33 class UFormattedNumberData;
34 struct UFormattedNumberImpl;
127 template<
typename StringClass>
128 inline StringClass toDecimalNumber(
UErrorCode& status)
const;
143 #ifndef U_HIDE_DRAFT_API
154 #endif // U_HIDE_DRAFT_API
156 #ifndef U_HIDE_INTERNAL_API
162 void getDecimalQuantity(impl::DecimalQuantity& output,
UErrorCode& status)
const;
168 void getAllFieldPositionsImpl(FieldPositionIteratorHandler& fpih,
UErrorCode& status)
const;
174 impl::UFormattedNumberData *fData;
186 explicit FormattedNumber(
UErrorCode errorCode)
187 : fData(nullptr), fErrorCode(errorCode) {}
189 void toDecimalNumber(ByteSink& sink,
UErrorCode& status)
const;
192 friend class LocalizedNumberFormatter;
193 friend class SimpleNumberFormatter;
196 friend struct impl::UFormattedNumberImpl;
199 template<
typename StringClass>
200 StringClass FormattedNumber::toDecimalNumber(
UErrorCode& status)
const {
203 toDecimalNumber(sink, status);
214 #endif // __FORMATTEDNUMBER_H__
A unit such as length, mass, volume, currency, etc.
Basic definitions for ICU, for both C and C++ APIs.
int8_t UBool
The ICU boolean type, a signed-byte integer.
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
UMemory is the common ICU base class.
C API: Display options (enum types, values, helper functions)
@ U_ZERO_ERROR
No error, no warning.
Base class for objects to which Unicode characters and strings can be appended.
Implementation of ByteSink that writes to a "string".
C++ API: Common ICU base class UObject.
@ U_INVALID_STATE_ERROR
Requested operation can not be completed with ICU in its current state.
C++ API: A unit for measuring a quantity.
Represents a span of a string containing a given field.
UDisplayOptionsNounClass
Represents all the grammatical noun classes that are supported by CLDR.