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

// © 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

// Allow implicit conversion from char16_t* to UnicodeString for this file:
// Helpful in toString methods and elsewhere.
#define UNISTR_FROM_STRING_EXPLICIT

#include <cmath>
#include <cstdlib>
#include <stdlib.h>
#include "unicode/errorcode.h"
#include "unicode/decimfmt.h"
#include "number_decimalquantity.h"
#include "number_types.h"
#include "numparse_impl.h"
#include "number_mapper.h"
#include "number_patternstring.h"
#include "putilimp.h"
#include "number_utils.h"
#include "number_utypes.h"

usingnamespaceicu;
usingnamespaceicu::number;
usingnamespaceicu::number::impl;
usingnamespaceicu::numparse;
usingnamespaceicu::numparse::impl;
ERoundingMode;
EPadPosition;

// MSVC VS2015 warns C4805 when comparing bool with UBool, VS2017 no longer emits this warning.
// TODO: Move this macro into a better place?
#if U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN
#define UBOOL_TO_BOOL
#else
#define UBOOL_TO_BOOL(b)
#endif


UOBJECT_DEFINE_RTTI_IMPLEMENTATION()


DecimalFormat::DecimalFormat(UErrorCode& status)
        :{}

DecimalFormat::DecimalFormat(const UnicodeString& pattern, UErrorCode& status)
        :{}

DecimalFormat::DecimalFormat(const UnicodeString& pattern, DecimalFormatSymbols* symbolsToAdopt,
                             UErrorCode& status)
        :{}

DecimalFormat::DecimalFormat(const UnicodeString& pattern, DecimalFormatSymbols* symbolsToAdopt,
                             UNumberFormatStyle style, UErrorCode& status)
        :{}

DecimalFormat::DecimalFormat(const DecimalFormatSymbols* symbolsToAdopt, UErrorCode& status) {}

#if UCONFIG_HAVE_PARSEALLINPUT

void DecimalFormat::setParseAllInput(UNumberFormatAttributeValue value) {}

#endif

DecimalFormat&
DecimalFormat::setAttribute(UNumberFormatAttribute attr, int32_t newValue, UErrorCode& status) {}

int32_t DecimalFormat::getAttribute(UNumberFormatAttribute attr, UErrorCode& status) const {}

void DecimalFormat::setGroupingUsed(UBool enabled) {}

void DecimalFormat::setParseIntegerOnly(UBool value) {}

void DecimalFormat::setLenient(UBool enable) {}

DecimalFormat::DecimalFormat(const UnicodeString& pattern, DecimalFormatSymbols* symbolsToAdopt,
                             UParseError&, UErrorCode& status)
        :{}

DecimalFormat::DecimalFormat(const UnicodeString& pattern, const DecimalFormatSymbols& symbols,
                             UErrorCode& status)
        :{}

DecimalFormat::DecimalFormat(const DecimalFormat& source) :{}

DecimalFormat& DecimalFormat::operator=(const DecimalFormat& rhs) {}

DecimalFormat::~DecimalFormat() {}

DecimalFormat* DecimalFormat::clone() const {}

bool DecimalFormat::operator==(const Format& other) const {}

UnicodeString& DecimalFormat::format(double number, UnicodeString& appendTo, FieldPosition& pos) const {}

UnicodeString& DecimalFormat::format(double number, UnicodeString& appendTo, FieldPosition& pos,
                                     UErrorCode& status) const {}

UnicodeString&
DecimalFormat::format(double number, UnicodeString& appendTo, FieldPositionIterator* posIter,
                      UErrorCode& status) const {}

UnicodeString& DecimalFormat::format(int32_t number, UnicodeString& appendTo, FieldPosition& pos) const {}

UnicodeString& DecimalFormat::format(int32_t number, UnicodeString& appendTo, FieldPosition& pos,
                                     UErrorCode& status) const {}

UnicodeString&
DecimalFormat::format(int32_t number, UnicodeString& appendTo, FieldPositionIterator* posIter,
                      UErrorCode& status) const {}

UnicodeString& DecimalFormat::format(int64_t number, UnicodeString& appendTo, FieldPosition& pos) const {}

UnicodeString& DecimalFormat::format(int64_t number, UnicodeString& appendTo, FieldPosition& pos,
                                     UErrorCode& status) const {}

UnicodeString&
DecimalFormat::format(int64_t number, UnicodeString& appendTo, FieldPositionIterator* posIter,
                      UErrorCode& status) const {}

UnicodeString&
DecimalFormat::format(StringPiece number, UnicodeString& appendTo, FieldPositionIterator* posIter,
                      UErrorCode& status) const {}

UnicodeString& DecimalFormat::format(const DecimalQuantity& number, UnicodeString& appendTo,
                                     FieldPositionIterator* posIter, UErrorCode& status) const {}

UnicodeString&
DecimalFormat::format(const DecimalQuantity& number, UnicodeString& appendTo, FieldPosition& pos,
                      UErrorCode& status) const {}

void DecimalFormat::parse(const UnicodeString& text, Formattable& output,
                          ParsePosition& parsePosition) const {}

CurrencyAmount* DecimalFormat::parseCurrency(const UnicodeString& text, ParsePosition& parsePosition) const {}

const DecimalFormatSymbols* DecimalFormat::getDecimalFormatSymbols() const {}

void DecimalFormat::adoptDecimalFormatSymbols(DecimalFormatSymbols* symbolsToAdopt) {}

void DecimalFormat::setDecimalFormatSymbols(const DecimalFormatSymbols& symbols) {}

const CurrencyPluralInfo* DecimalFormat::getCurrencyPluralInfo() const {}

void DecimalFormat::adoptCurrencyPluralInfo(CurrencyPluralInfo* toAdopt) {}

void DecimalFormat::setCurrencyPluralInfo(const CurrencyPluralInfo& info) {}

UnicodeString& DecimalFormat::getPositivePrefix(UnicodeString& result) const {}

void DecimalFormat::setPositivePrefix(const UnicodeString& newValue) {}

UnicodeString& DecimalFormat::getNegativePrefix(UnicodeString& result) const {}

void DecimalFormat::setNegativePrefix(const UnicodeString& newValue) {}

UnicodeString& DecimalFormat::getPositiveSuffix(UnicodeString& result) const {}

void DecimalFormat::setPositiveSuffix(const UnicodeString& newValue) {}

UnicodeString& DecimalFormat::getNegativeSuffix(UnicodeString& result) const {}

void DecimalFormat::setNegativeSuffix(const UnicodeString& newValue) {}

UBool DecimalFormat::isSignAlwaysShown() const {}

void DecimalFormat::setSignAlwaysShown(UBool value) {}

int32_t DecimalFormat::getMultiplier() const {}

void DecimalFormat::setMultiplier(int32_t multiplier) {}

int32_t DecimalFormat::getMultiplierScale() const {}

void DecimalFormat::setMultiplierScale(int32_t newValue) {}

double DecimalFormat::getRoundingIncrement() const {}

void DecimalFormat::setRoundingIncrement(double newValue) {}

ERoundingMode DecimalFormat::getRoundingMode() const {}

void DecimalFormat::setRoundingMode(ERoundingMode roundingMode) UPRV_NO_SANITIZE_UNDEFINED {}

int32_t DecimalFormat::getFormatWidth() const {}

void DecimalFormat::setFormatWidth(int32_t width) {}

UnicodeString DecimalFormat::getPadCharacterString() const {}

void DecimalFormat::setPadCharacter(const UnicodeString& padChar) {}

EPadPosition DecimalFormat::getPadPosition() const {}

void DecimalFormat::setPadPosition(EPadPosition padPos) {}

UBool DecimalFormat::isScientificNotation() const {}

void DecimalFormat::setScientificNotation(UBool useScientific) {}

int8_t DecimalFormat::getMinimumExponentDigits() const {}

void DecimalFormat::setMinimumExponentDigits(int8_t minExpDig) {}

UBool DecimalFormat::isExponentSignAlwaysShown() const {}

void DecimalFormat::setExponentSignAlwaysShown(UBool expSignAlways) {}

int32_t DecimalFormat::getGroupingSize() const {}

void DecimalFormat::setGroupingSize(int32_t newValue) {}

int32_t DecimalFormat::getSecondaryGroupingSize() const {}

void DecimalFormat::setSecondaryGroupingSize(int32_t newValue) {}

int32_t DecimalFormat::getMinimumGroupingDigits() const {}

void DecimalFormat::setMinimumGroupingDigits(int32_t newValue) {}

UBool DecimalFormat::isDecimalSeparatorAlwaysShown() const {}

void DecimalFormat::setDecimalSeparatorAlwaysShown(UBool newValue) {}

UBool DecimalFormat::isDecimalPatternMatchRequired() const {}

void DecimalFormat::setDecimalPatternMatchRequired(UBool newValue) {}

UBool DecimalFormat::isParseNoExponent() const {}

void DecimalFormat::setParseNoExponent(UBool value) {}

UBool DecimalFormat::isParseCaseSensitive() const {}

void DecimalFormat::setParseCaseSensitive(UBool value) {}

UBool DecimalFormat::isFormatFailIfMoreThanMaxDigits() const {}

void DecimalFormat::setFormatFailIfMoreThanMaxDigits(UBool value) {}

UnicodeString& DecimalFormat::toPattern(UnicodeString& result) const {}

UnicodeString& DecimalFormat::toLocalizedPattern(UnicodeString& result) const {}

void DecimalFormat::applyPattern(const UnicodeString& pattern, UParseError&, UErrorCode& status) {}

void DecimalFormat::applyPattern(const UnicodeString& pattern, UErrorCode& status) {}

void DecimalFormat::applyLocalizedPattern(const UnicodeString& localizedPattern, UParseError&,
                                          UErrorCode& status) {}

void DecimalFormat::applyLocalizedPattern(const UnicodeString& localizedPattern, UErrorCode& status) {}

void DecimalFormat::setMaximumIntegerDigits(int32_t newValue) {}

void DecimalFormat::setMinimumIntegerDigits(int32_t newValue) {}

void DecimalFormat::setMaximumFractionDigits(int32_t newValue) {}

void DecimalFormat::setMinimumFractionDigits(int32_t newValue) {}

int32_t DecimalFormat::getMinimumSignificantDigits() const {}

int32_t DecimalFormat::getMaximumSignificantDigits() const {}

void DecimalFormat::setMinimumSignificantDigits(int32_t value) {}

void DecimalFormat::setMaximumSignificantDigits(int32_t value) {}

UBool DecimalFormat::areSignificantDigitsUsed() const {}

void DecimalFormat::setSignificantDigitsUsed(UBool useSignificantDigits) {}

void DecimalFormat::setCurrency(const char16_t* theCurrency, UErrorCode& ec) {}

void DecimalFormat::setCurrency(const char16_t* theCurrency) {}

void DecimalFormat::setCurrencyUsage(UCurrencyUsage newUsage, UErrorCode* ec) {}

UCurrencyUsage DecimalFormat::getCurrencyUsage() const {}

void
DecimalFormat::formatToDecimalQuantity(double number, DecimalQuantity& output, UErrorCode& status) const {}

void DecimalFormat::formatToDecimalQuantity(const Formattable& number, DecimalQuantity& output,
                                            UErrorCode& status) const {}

const number::LocalizedNumberFormatter* DecimalFormat::toNumberFormatter(UErrorCode& status) const {}

/** Rebuilds the formatter object from the property bag. */
void DecimalFormat::touch(UErrorCode& status) {}

void DecimalFormat::touchNoError() {}

void DecimalFormat::setPropertiesFromPattern(const UnicodeString& pattern, int32_t ignoreRounding,
                                             UErrorCode& status) {}

const numparse::impl::NumberParserImpl* DecimalFormat::getParser(UErrorCode& status) const {}

const numparse::impl::NumberParserImpl* DecimalFormat::getCurrencyParser(UErrorCode& status) const {}

void
DecimalFormat::fieldPositionHelper(
        const UFormattedNumberData& formatted,
        FieldPosition& fieldPosition,
        int32_t offset,
        UErrorCode& status) {}

void
DecimalFormat::fieldPositionIteratorHelper(
        const UFormattedNumberData& formatted,
        FieldPositionIterator* fpi,
        int32_t offset,
        UErrorCode& status) {}

// To debug fast-format, change void(x) to printf(x)
#define trace(x)

void DecimalFormat::setupFastFormat() {}

bool DecimalFormat::fastFormatDouble(double input, UnicodeString& output) const {}

bool DecimalFormat::fastFormatInt64(int64_t input, UnicodeString& output) const {}

void DecimalFormat::doFastFormatInt32(int32_t input, bool isNegative, UnicodeString& output) const {}


#endif /* #if !UCONFIG_NO_FORMATTING */