Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'deps/icu-small/source/i18n/number_scientific.cpp')
-rw-r--r--deps/icu-small/source/i18n/number_scientific.cpp34
1 files changed, 27 insertions, 7 deletions
diff --git a/deps/icu-small/source/i18n/number_scientific.cpp b/deps/icu-small/source/i18n/number_scientific.cpp
index 40952024e99..07c1ce9dac2 100644
--- a/deps/icu-small/source/i18n/number_scientific.cpp
+++ b/deps/icu-small/source/i18n/number_scientific.cpp
@@ -76,17 +76,16 @@ int32_t ScientificModifier::apply(NumberStringBuilder &output, int32_t /*leftInd
return i - rightIndex;
}
-int32_t ScientificModifier::getPrefixLength(UErrorCode &status) const {
- (void)status;
+int32_t ScientificModifier::getPrefixLength() const {
// TODO: Localized exponent separator location.
return 0;
}
-int32_t ScientificModifier::getCodePointCount(UErrorCode &status) const {
- (void)status;
- // This method is not used for strong modifiers.
- U_ASSERT(false);
- return 0;
+int32_t ScientificModifier::getCodePointCount() const {
+ // NOTE: This method is only called one place, NumberRangeFormatterImpl.
+ // The call site only cares about != 0 and != 1.
+ // Return a very large value so that if this method is used elsewhere, we should notice.
+ return 999;
}
bool ScientificModifier::isStrong() const {
@@ -94,6 +93,27 @@ bool ScientificModifier::isStrong() const {
return true;
}
+bool ScientificModifier::containsField(UNumberFormatFields field) const {
+ (void)field;
+ // This method is not used for inner modifiers.
+ U_ASSERT(false);
+ return false;
+}
+
+void ScientificModifier::getParameters(Parameters& output) const {
+ // Not part of any plural sets
+ output.obj = nullptr;
+}
+
+bool ScientificModifier::semanticallyEquivalent(const Modifier& other) const {
+ auto* _other = dynamic_cast<const ScientificModifier*>(&other);
+ if (_other == nullptr) {
+ return false;
+ }
+ // TODO: Check for locale symbols and settings as well? Could be less efficient.
+ return fExponent == _other->fExponent;
+}
+
// Note: Visual Studio does not compile this function without full name space. Why?
icu::number::impl::ScientificHandler::ScientificHandler(const Notation *notation, const DecimalFormatSymbols *symbols,
const MicroPropsGenerator *parent) :