// Export an explicit template instantiation of the MaybeStackArray that is used as a data member of NumberParserImpl. // When building DLLs for Windows this is required even though no direct access to the MaybeStackArray leaks out of the i18n library. // (See numparse_compositions.h, numparse_affixes.h, datefmt.h, and others for similar examples.) #if U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN templateclass U_I18N_API MaybeStackArray<const numparse::impl::NumberParseMatcher*, 10>; #endif
namespace numparse::impl {
// Exported as U_I18N_API for tests class U_I18N_API NumberParserImpl : public MutableMatcherCollection, public UMemory { public: virtual ~NumberParserImpl();
/** * Does NOT take ownership of the matcher. The matcher MUST remain valid for the lifespan of the * NumberParserImpl. * @param matcher The matcher to reference.
*/ void addMatcher(NumberParseMatcher& matcher) override;
private:
parse_flags_t fParseFlags;
int32_t fNumMatchers = 0; // NOTE: The stack capacity for fMatchers and fLeads should be the same
MaybeStackArray<const NumberParseMatcher*, 10> fMatchers; bool fFrozen = false;
// WARNING: All of these matchers start in an undefined state (default-constructed). // You must use an assignment operator on them before using. struct {
IgnorablesMatcher ignorables;
InfinityMatcher infinity;
MinusSignMatcher minusSign;
NanMatcher nan;
PaddingMatcher padding;
PercentMatcher percent;
PermilleMatcher permille;
PlusSignMatcher plusSign;
DecimalMatcher decimal;
ScientificMatcher scientific;
CombinedCurrencyMatcher currency;
AffixMatcherWarehouse affixMatcherWarehouse;
AffixTokenMatcherWarehouse affixTokenMatcherWarehouse;
} fLocalMatchers; struct {
RequireAffixValidator affix;
RequireCurrencyValidator currency;
RequireDecimalSeparatorValidator decimalSeparator;
RequireNumberValidator number;
MultiplierParseHandler multiplier;
} fLocalValidators;
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.