Victor Chang | 7322950 | 2020-09-17 13:39:19 +0100 | [diff] [blame] | 1 | // © 2018 and later: Unicode, Inc. and others. |
| 2 | // License & terms of use: http://www.unicode.org/copyright.html |
| 3 | |
| 4 | #include "unicode/utypes.h" |
| 5 | |
| 6 | #if !UCONFIG_NO_FORMATTING |
| 7 | #ifndef __SOURCE_NUMBER_UTYPES_H__ |
| 8 | #define __SOURCE_NUMBER_UTYPES_H__ |
| 9 | |
| 10 | #include "unicode/numberformatter.h" |
| 11 | #include "number_types.h" |
| 12 | #include "number_decimalquantity.h" |
| 13 | #include "formatted_string_builder.h" |
| 14 | #include "formattedval_impl.h" |
| 15 | |
| 16 | U_NAMESPACE_BEGIN namespace number { |
| 17 | namespace impl { |
| 18 | |
| 19 | |
| 20 | /** Helper function used in upluralrules.cpp */ |
| 21 | const DecimalQuantity* validateUFormattedNumberToDecimalQuantity( |
| 22 | const UFormattedNumber* uresult, UErrorCode& status); |
| 23 | |
| 24 | |
| 25 | /** |
| 26 | * Struct for data used by FormattedNumber. |
| 27 | * |
| 28 | * This struct is held internally by the C++ version FormattedNumber since the member types are not |
| 29 | * declared in the public header file. |
| 30 | * |
Victor Chang | d8aa9d5 | 2021-01-05 23:49:57 +0000 | [diff] [blame] | 31 | * Exported as U_I18N_API for tests |
Victor Chang | 7322950 | 2020-09-17 13:39:19 +0100 | [diff] [blame] | 32 | */ |
Victor Chang | d8aa9d5 | 2021-01-05 23:49:57 +0000 | [diff] [blame] | 33 | class U_I18N_API UFormattedNumberData : public FormattedValueStringBuilderImpl { |
Victor Chang | 7322950 | 2020-09-17 13:39:19 +0100 | [diff] [blame] | 34 | public: |
Victor Chang | d8aa9d5 | 2021-01-05 23:49:57 +0000 | [diff] [blame] | 35 | UFormattedNumberData() : FormattedValueStringBuilderImpl(kUndefinedField) {} |
Victor Chang | 7322950 | 2020-09-17 13:39:19 +0100 | [diff] [blame] | 36 | virtual ~UFormattedNumberData(); |
| 37 | |
Victor Chang | ce4bf3c | 2021-01-19 16:34:24 +0000 | [diff] [blame] | 38 | // The formatted quantity. |
Victor Chang | 7322950 | 2020-09-17 13:39:19 +0100 | [diff] [blame] | 39 | DecimalQuantity quantity; |
Victor Chang | ce4bf3c | 2021-01-19 16:34:24 +0000 | [diff] [blame] | 40 | |
| 41 | // The output unit for the formatted quantity. |
| 42 | // TODO(units,hugovdm): populate this correctly for the general case - it's |
| 43 | // currently only implemented for the .usage() use case. |
| 44 | MeasureUnit outputUnit; |
Victor Chang | 7322950 | 2020-09-17 13:39:19 +0100 | [diff] [blame] | 45 | }; |
| 46 | |
| 47 | |
| 48 | } // namespace impl |
| 49 | } // namespace number |
| 50 | U_NAMESPACE_END |
| 51 | |
| 52 | #endif //__SOURCE_NUMBER_UTYPES_H__ |
| 53 | #endif /* #if !UCONFIG_NO_FORMATTING */ |