chromium/third_party/icu/source/i18n/number_scientific.cpp

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

#include "unicode/utypes.h"

#if !UCONFIG_NO_FORMATTING

#include <cstdlib>
#include "number_scientific.h"
#include "number_utils.h"
#include "formatted_string_builder.h"
#include "unicode/unum.h"
#include "number_microprops.h"

usingnamespaceicu;
usingnamespaceicu::number;
usingnamespaceicu::number::impl;

// NOTE: The object lifecycle of ScientificModifier and ScientificHandler differ greatly in Java and C++.
//
// During formatting, we need to provide an object with state (the exponent) as the inner modifier.
//
// In Java, where the priority is put on reducing object creations, the unsafe code path re-uses the
// ScientificHandler as a ScientificModifier, and the safe code path pre-computes 25 ScientificModifier
// instances.  This scheme reduces the number of object creations by 1 in both safe and unsafe.
//
// In C++, MicroProps provides a pre-allocated ScientificModifier, and ScientificHandler simply populates
// the state (the exponent) into that ScientificModifier. There is no difference between safe and unsafe.

ScientificModifier::ScientificModifier() :{}

void ScientificModifier::set(int32_t exponent, const ScientificHandler *handler) {}

int32_t ScientificModifier::apply(FormattedStringBuilder &output, int32_t /*leftIndex*/, int32_t rightIndex,
                                  UErrorCode &status) const {}

int32_t ScientificModifier::getPrefixLength() const {}

int32_t ScientificModifier::getCodePointCount() const {}

bool ScientificModifier::isStrong() const {}

bool ScientificModifier::containsField(Field field) const {}

void ScientificModifier::getParameters(Parameters& output) const {}

bool ScientificModifier::semanticallyEquivalent(const Modifier& other) const {}

// 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) :{}

void ScientificHandler::processQuantity(DecimalQuantity &quantity, MicroProps &micros,
                                        UErrorCode &status) const {}

int32_t ScientificHandler::getMultiplier(int32_t magnitude) const {}

#endif /* #if !UCONFIG_NO_FORMATTING */