// Forward-declaration of implementation classes for friending class AffixPatternMatcherBuilder; class AffixPatternMatcher;
using ::icu::number::impl::AffixPatternProvider; using ::icu::number::impl::TokenConsumer; using ::icu::number::impl::CurrencySymbols;
class U_I18N_API CodePointMatcher : public NumberParseMatcher, public UMemory { public:
CodePointMatcher() = default; // WARNING: Leaves the object in an unusable state
// Export a explicit template instantiations of MaybeStackArray, MemoryPool and CompactUnicodeString. // When building DLLs for Windows this is required even though no direct access leaks out of the i18n library. // (See digitlst.h, pluralaffix.h, datefmt.h, and others for similar examples.) // Note: These need to be outside of the numparse::impl namespace, or Clang will generate a compile error. #if U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN templateclass U_I18N_API MaybeStackArray<numparse::impl::CodePointMatcher*, 8>; templateclass U_I18N_API MaybeStackArray<char16_t, 4>; templateclass U_I18N_API MemoryPool<numparse::impl::CodePointMatcher, 8>; templateclass U_I18N_API numparse::impl::CompactUnicodeString<4>; #endif
/** * Small helper class that generates matchers for individual tokens for AffixPatternMatcher. * * In Java, this is called AffixTokenMatcherFactory (a "factory"). However, in C++, it is called a * "warehouse", because in addition to generating the matchers, it also retains ownership of them. The * warehouse must stay in scope for the whole lifespan of the AffixPatternMatcher that uses matchers from * the warehouse. * * @author sffc
*/ // Exported as U_I18N_API for tests class U_I18N_API AffixTokenMatcherWarehouse : public UMemory { public:
AffixTokenMatcherWarehouse() = default; // WARNING: Leaves the object in an unusable state
private: // NOTE: The following field may be unsafe to access after construction is done! const AffixTokenMatcherSetupData* fSetupData;
// NOTE: These are default-constructed and should not be used until initialized.
MinusSignMatcher fMinusSign;
PlusSignMatcher fPlusSign;
PercentMatcher fPercent;
PermilleMatcher fPermille;
CombinedCurrencyMatcher fCurrency;
// Use a child class for code point matchers, since it requires non-default operators.
MemoryPool<CodePointMatcher> fCodePoints;
// Exported as U_I18N_API for tests class U_I18N_API AffixPatternMatcher : public ArraySeriesMatcher { public:
AffixPatternMatcher() = default; // WARNING: Leaves the object in an unusable state
/** * A C++-only class to retain ownership of the AffixMatchers needed for parsing.
*/ class AffixMatcherWarehouse { public:
AffixMatcherWarehouse() = default; // WARNING: Leaves the object in an unusable state
private: // 18 is the limit: positive, zero, and negative, each with prefix, suffix, and prefix+suffix, // and doubled since there may be an empty currency symbol
AffixMatcher fAffixMatchers[18]; // 6 is the limit: positive, zero, and negative, a prefix and a suffix for each, // and doubled since there may be an empty currency symbol
AffixPatternMatcher fAffixPatternMatchers[12]; // Reference to the warehouse for tokens used by the AffixPatternMatchers
AffixTokenMatcherWarehouse* fTokenWarehouse;
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.