diff options
Diffstat (limited to 'deps/icu-small/source/i18n/number_formatimpl.h')
-rw-r--r-- | deps/icu-small/source/i18n/number_formatimpl.h | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/deps/icu-small/source/i18n/number_formatimpl.h b/deps/icu-small/source/i18n/number_formatimpl.h index 084bc4a9d0..5cd549e54a 100644 --- a/deps/icu-small/source/i18n/number_formatimpl.h +++ b/deps/icu-small/source/i18n/number_formatimpl.h @@ -10,11 +10,13 @@ #include "number_types.h" #include "formatted_string_builder.h" #include "number_patternstring.h" +#include "number_usageprefs.h" #include "number_utils.h" #include "number_patternmodifier.h" #include "number_longnames.h" #include "number_compact.h" #include "number_microprops.h" +#include "number_utypes.h" U_NAMESPACE_BEGIN namespace number { namespace impl { @@ -34,9 +36,8 @@ class NumberFormatterImpl : public UMemory { /** * Builds and evaluates an "unsafe" MicroPropsGenerator, which is cheaper but can be used only once. */ - static int32_t - formatStatic(const MacroProps ¯os, DecimalQuantity &inValue, FormattedStringBuilder &outString, - UErrorCode &status); + static int32_t formatStatic(const MacroProps ¯os, UFormattedNumberData *results, + UErrorCode &status); /** * Prints only the prefix and suffix; used for DecimalFormat getters. @@ -51,7 +52,7 @@ class NumberFormatterImpl : public UMemory { /** * Evaluates the "safe" MicroPropsGenerator created by "fromMacros". */ - int32_t format(DecimalQuantity& inValue, FormattedStringBuilder& outString, UErrorCode& status) const; + int32_t format(UFormattedNumberData *results, UErrorCode &status) const; /** * Like format(), but saves the result into an output MicroProps without additional processing. @@ -82,7 +83,9 @@ class NumberFormatterImpl : public UMemory { int32_t end, UErrorCode& status); private: - // Head of the MicroPropsGenerator linked list: + // Head of the MicroPropsGenerator linked list. Subclasses' processQuantity + // methods process this list in a parent-first order, such that the last + // item added, which this points to, typically has its logic executed last. const MicroPropsGenerator *fMicroPropsGenerator = nullptr; // Tail of the list: @@ -90,13 +93,20 @@ class NumberFormatterImpl : public UMemory { // Other fields possibly used by the number formatting pipeline: // TODO: Convert more of these LocalPointers to value objects to reduce the number of news? + LocalPointer<const UsagePrefsHandler> fUsagePrefsHandler; + LocalPointer<const UnitConversionHandler> fUnitConversionHandler; LocalPointer<const DecimalFormatSymbols> fSymbols; LocalPointer<const PluralRules> fRules; LocalPointer<const ParsedPatternInfo> fPatternInfo; LocalPointer<const ScientificHandler> fScientificHandler; LocalPointer<MutablePatternModifier> fPatternModifier; LocalPointer<ImmutablePatternModifier> fImmutablePatternModifier; - LocalPointer<const LongNameHandler> fLongNameHandler; + LocalPointer<LongNameHandler> fLongNameHandler; + // TODO: use a common base class that enables fLongNameHandler, + // fLongNameMultiplexer, and fMixedUnitLongNameHandler to be merged into one + // member? + LocalPointer<MixedUnitLongNameHandler> fMixedUnitLongNameHandler; + LocalPointer<const LongNameMultiplexer> fLongNameMultiplexer; LocalPointer<const CompactHandler> fCompactHandler; // Value objects possibly used by the number formatting pipeline: |