| 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 |
| 17 |
namespace number::impl { |
| 18 |
|
| 19 |
/** Helper function used in upluralrules.cpp */ |
| 20 |
const DecimalQuantity* validateUFormattedNumberToDecimalQuantity( |
| 21 |
const UFormattedNumber* uresult, UErrorCode& status); |
| 22 |
|
| 23 |
|
| 24 |
/** |
| 25 |
* Struct for data used by FormattedNumber. |
| 26 |
* |
| 27 |
* This struct is held internally by the C++ version FormattedNumber since the member types are not |
| 28 |
* declared in the public header file. |
| 29 |
* |
| 30 |
* Exported as U_I18N_API for tests |
| 31 |
*/ |
| 32 |
class U_I18N_API UFormattedNumberData : public FormattedValueStringBuilderImpl { |
| 33 |
public: |
| 34 |
UFormattedNumberData() : FormattedValueStringBuilderImpl(kUndefinedField) {} |
| 35 |
virtual ~UFormattedNumberData(); |
| 36 |
|
| 37 |
UFormattedNumberData(UFormattedNumberData&&) = default; |
| 38 |
UFormattedNumberData& operator=(UFormattedNumberData&&) = default; |
| 39 |
|
| 40 |
// The formatted quantity. |
| 41 |
DecimalQuantity quantity; |
| 42 |
|
| 43 |
// The output unit for the formatted quantity. |
| 44 |
// TODO(units,hugovdm): populate this correctly for the general case - it's |
| 45 |
// currently only implemented for the .usage() use case. |
| 46 |
MeasureUnit outputUnit; |
| 47 |
|
| 48 |
// The gender of the formatted output. |
| 49 |
const char *gender = ""; |
| 50 |
}; |
| 51 |
|
| 52 |
} // namespace number::impl |
| 53 |
U_NAMESPACE_END |
| 54 |
|
| 55 |
#endif //__SOURCE_NUMBER_UTYPES_H__ |
| 56 |
#endif /* #if !UCONFIG_NO_FORMATTING */ |