mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-23 00:47:31 +09:00
Issue #1971 - Part 2: Update ICU source to 63.2.
This commit is contained in:
parent
8df84683be
commit
1e69214382
3160 changed files with 275815 additions and 234203 deletions
95
intl/icu/source/i18n/numparse_validators.h
Normal file
95
intl/icu/source/i18n/numparse_validators.h
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
// © 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 __SOURCE_NUMPARSE_VALIDATORS_H__
|
||||
#define __SOURCE_NUMPARSE_VALIDATORS_H__
|
||||
|
||||
#include "numparse_types.h"
|
||||
#include "static_unicode_sets.h"
|
||||
|
||||
U_NAMESPACE_BEGIN namespace numparse {
|
||||
namespace impl {
|
||||
|
||||
|
||||
class ValidationMatcher : public NumberParseMatcher {
|
||||
public:
|
||||
bool match(StringSegment&, ParsedNumber&, UErrorCode&) const U_OVERRIDE {
|
||||
// No-op
|
||||
return false;
|
||||
}
|
||||
|
||||
bool smokeTest(const StringSegment&) const U_OVERRIDE {
|
||||
// No-op
|
||||
return false;
|
||||
}
|
||||
|
||||
void postProcess(ParsedNumber& result) const U_OVERRIDE = 0;
|
||||
};
|
||||
|
||||
|
||||
class RequireAffixValidator : public ValidationMatcher, public UMemory {
|
||||
public:
|
||||
void postProcess(ParsedNumber& result) const U_OVERRIDE;
|
||||
|
||||
UnicodeString toString() const U_OVERRIDE;
|
||||
};
|
||||
|
||||
|
||||
class RequireCurrencyValidator : public ValidationMatcher, public UMemory {
|
||||
public:
|
||||
void postProcess(ParsedNumber& result) const U_OVERRIDE;
|
||||
|
||||
UnicodeString toString() const U_OVERRIDE;
|
||||
};
|
||||
|
||||
|
||||
class RequireDecimalSeparatorValidator : public ValidationMatcher, public UMemory {
|
||||
public:
|
||||
RequireDecimalSeparatorValidator() = default; // leaves instance in valid but undefined state
|
||||
|
||||
RequireDecimalSeparatorValidator(bool patternHasDecimalSeparator);
|
||||
|
||||
void postProcess(ParsedNumber& result) const U_OVERRIDE;
|
||||
|
||||
UnicodeString toString() const U_OVERRIDE;
|
||||
|
||||
private:
|
||||
bool fPatternHasDecimalSeparator;
|
||||
};
|
||||
|
||||
|
||||
class RequireNumberValidator : public ValidationMatcher, public UMemory {
|
||||
public:
|
||||
void postProcess(ParsedNumber& result) const U_OVERRIDE;
|
||||
|
||||
UnicodeString toString() const U_OVERRIDE;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Wraps a {@link Multiplier} for use in the number parsing pipeline.
|
||||
*/
|
||||
class MultiplierParseHandler : public ValidationMatcher, public UMemory {
|
||||
public:
|
||||
MultiplierParseHandler() = default; // leaves instance in valid but undefined state
|
||||
|
||||
MultiplierParseHandler(::icu::number::Scale multiplier);
|
||||
|
||||
void postProcess(ParsedNumber& result) const U_OVERRIDE;
|
||||
|
||||
UnicodeString toString() const U_OVERRIDE;
|
||||
|
||||
private:
|
||||
::icu::number::Scale fMultiplier;
|
||||
};
|
||||
|
||||
|
||||
} // namespace impl
|
||||
} // namespace numparse
|
||||
U_NAMESPACE_END
|
||||
|
||||
#endif //__SOURCE_NUMPARSE_VALIDATORS_H__
|
||||
#endif /* #if !UCONFIG_NO_FORMATTING */
|
||||
Loading…
Add table
Add a link
Reference in a new issue