/** * A struct for ownership of a few objects needed for formatting.
*/ struct DecimalFormatWarehouse : public UMemory {
AutoAffixPatternProvider affixProvider;
LocalPointer<PluralRules> rules;
};
/** * Internal fields for DecimalFormat. * TODO: Make some of these fields by value instead of by LocalPointer?
*/ struct DecimalFormatFields : public UMemory {
/** The property bag corresponding to user-specified settings and settings from the pattern string. */
DecimalFormatProperties properties;
/** The symbols for the current locale. */
LocalPointer<const DecimalFormatSymbols> symbols;
/** * The pre-computed formatter object. Setters cause this to be re-computed atomically. The {@link * #format} method uses the formatter directly without needing to synchronize.
*/
LocalizedNumberFormatter formatter;
/** The lazy-computed parser for .parse() */ #ifndef __wasi__
std::atomic<::icu::numparse::impl::NumberParserImpl*> atomicParser = {}; #else
::icu::numparse::impl::NumberParserImpl* atomicParser = nullptr; #endif
/** The lazy-computed parser for .parseCurrency() */ #ifndef __wasi__
std::atomic<::icu::numparse::impl::NumberParserImpl*> atomicCurrencyParser = {}; #else
::icu::numparse::impl::NumberParserImpl* atomicCurrencyParser = {}; #endif
/** Small object ownership warehouse for the formatter and parser */
DecimalFormatWarehouse warehouse;
/** The effective properties as exported from the formatter object. Used by some getters. */
DecimalFormatProperties exportedProperties;
/** * Utilities for converting between a DecimalFormatProperties and a MacroProps.
*/ class NumberPropertyMapper { public: /** Convenience method to create a NumberFormatter directly from Properties. */ static UnlocalizedNumberFormatter create(const DecimalFormatProperties& properties, const DecimalFormatSymbols& symbols,
DecimalFormatWarehouse& warehouse, UErrorCode& status);
/** Convenience method to create a NumberFormatter directly from Properties. */ static UnlocalizedNumberFormatter create(const DecimalFormatProperties& properties, const DecimalFormatSymbols& symbols,
DecimalFormatWarehouse& warehouse,
DecimalFormatProperties& exportedProperties,
UErrorCode& status);
/** * Creates a new {@link MacroProps} object based on the content of a {@link DecimalFormatProperties} * object. In other words, maps Properties to MacroProps. This function is used by the * JDK-compatibility API to call into the ICU 60 fluent number formatting pipeline. * * @param properties * The property bag to be mapped. * @param symbols * The symbols associated with the property bag. * @param exportedProperties * A property bag in which to store validated properties. Used by some DecimalFormat * getters. * @return A new MacroProps containing all of the information in the Properties.
*/ static MacroProps oldToNew(const DecimalFormatProperties& properties, const DecimalFormatSymbols& symbols, DecimalFormatWarehouse& warehouse,
DecimalFormatProperties* exportedProperties, UErrorCode& status);
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.