Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/intl/icu/source/i18n/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 3 kB image not shown  

Quellcode-Bibliothek numparse_impl.h

  Sprache: C
 

// © 2018 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html

#include "unicode/utypes.h"

#if !UCONFIG_NO_FORMATTING
#ifndef __NUMPARSE_IMPL_H__
#define __NUMPARSE_IMPL_H__

#include "numparse_types.h"
#include "numparse_decimal.h"
#include "numparse_symbols.h"
#include "numparse_scientific.h"
#include "unicode/uniset.h"
#include "numparse_currency.h"
#include "numparse_affixes.h"
#include "number_decimfmtprops.h"
#include "unicode/localpointer.h"
#include "numparse_validators.h"
#include "number_multiplier.h"
#include "string_segment.h"

U_NAMESPACE_BEGIN

namespace numparse::impl {

// Exported as U_I18N_API_CLASS for tests
class U_I18N_API_CLASS NumberParserImpl : public MutableMatcherCollection, public UMemory {
  public:
    virtual ~NumberParserImpl();

    U_I18N_API static NumberParserImpl *createSimpleParser(const Locale& locale,
                                                           const UnicodeString& patternString,
                                                           parse_flags_t parseFlags,
                                                           UErrorCode& status);

    static NumberParserImpl* createParserFromProperties(
            const number::impl::DecimalFormatProperties& properties, const DecimalFormatSymbols& symbols,
            bool parseCurrency, UErrorCode& status);

    /**
     * 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;

    void freeze();

    parse_flags_t getParseFlags() const;

    U_I18N_API void parse(const UnicodeString& input, bool greedy, ParsedNumber& result,
                          UErrorCode& status) const;

    void parse(const UnicodeString& input, int32_t start, bool greedy, ParsedNumber& result,
               UErrorCode& status) const;

    U_I18N_API UnicodeString toString() const;

  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;
        ApproximatelySignMatcher approximatelySign;
        DecimalMatcher decimal;
        ScientificMatcher scientific;
        CombinedCurrencyMatcher currency;
        AffixMatcherWarehouse affixMatcherWarehouse;
        AffixTokenMatcherWarehouse affixTokenMatcherWarehouse;
    } fLocalMatchers;
    struct {
        RequireAffixValidator affix;
        RequireCurrencyValidator currency;
        RequireDecimalSeparatorValidator decimalSeparator;
        RequireNumberValidator number;
        MultiplierParseHandler multiplier;
    } fLocalValidators;

    explicit NumberParserImpl(parse_flags_t parseFlags);

    void parseGreedy(StringSegment& segment, ParsedNumber& result, UErrorCode& ;status) const;

    void parseLongestRecursive(
        StringSegment& segment, ParsedNumber& result, int32_t recursionLevels, UErrorCode& status) const;
};

// namespace numparse::impl

U_NAMESPACE_END

#endif //__NUMPARSE_IMPL_H__
#endif /* #if !UCONFIG_NO_FORMATTING */

Messung V0.5 in Prozent
C=89 H=94 G=91

¤ 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.0.67Bemerkung:  (vorverarbeitet am  2026-08-26) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

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.