2017-09-27 00:25:20 +00:00
|
|
|
// © 2017 and later: Unicode, Inc. and others.
|
|
|
|
// License & terms of use: http://www.unicode.org/copyright.html
|
|
|
|
|
2017-10-04 22:51:06 +00:00
|
|
|
#include "unicode/utypes.h"
|
|
|
|
|
2017-10-05 00:47:38 +00:00
|
|
|
#if !UCONFIG_NO_FORMATTING && !UPRV_INCOMPLETE_CPP11_SUPPORT
|
2017-09-27 05:31:57 +00:00
|
|
|
#ifndef __NUMBER_DECIMFMTPROPS_H__
|
|
|
|
#define __NUMBER_DECIMFMTPROPS_H__
|
2017-09-27 00:25:20 +00:00
|
|
|
|
|
|
|
#include "unicode/unistr.h"
|
|
|
|
#include <cstdint>
|
2017-09-27 05:31:57 +00:00
|
|
|
#include "unicode/plurrule.h"
|
|
|
|
#include "unicode/currpinf.h"
|
2017-09-27 00:25:20 +00:00
|
|
|
#include "unicode/unum.h"
|
2017-09-28 22:53:31 +00:00
|
|
|
#include "unicode/localpointer.h"
|
2017-09-27 00:25:20 +00:00
|
|
|
#include "number_types.h"
|
|
|
|
|
|
|
|
U_NAMESPACE_BEGIN
|
|
|
|
|
2017-10-02 22:55:16 +00:00
|
|
|
// Export an explicit template instantiation of the LocalPointer that is used as a
|
|
|
|
// data member of CurrencyPluralInfoWrapper.
|
2017-10-26 06:49:15 +00:00
|
|
|
// (When building DLLs for Windows this is required.)
|
|
|
|
#if U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN
|
2017-10-04 03:13:36 +00:00
|
|
|
// Ignore warning 4661 as LocalPointerBase does not use operator== or operator!=
|
|
|
|
#pragma warning(suppress: 4661)
|
2017-10-25 17:27:45 +00:00
|
|
|
template class U_I18N_API LocalPointerBase<CurrencyPluralInfo>;
|
|
|
|
template class U_I18N_API LocalPointer<CurrencyPluralInfo>;
|
2017-10-02 22:55:16 +00:00
|
|
|
#endif
|
|
|
|
|
2017-10-25 17:11:37 +00:00
|
|
|
namespace number {
|
|
|
|
namespace impl {
|
|
|
|
|
2017-09-27 05:31:57 +00:00
|
|
|
// TODO: Figure out a nicer way to deal with CurrencyPluralInfo.
|
2017-09-28 22:53:31 +00:00
|
|
|
// Exported as U_I18N_API because it is a public member field of exported DecimalFormatProperties
|
|
|
|
struct U_I18N_API CurrencyPluralInfoWrapper {
|
2017-09-27 05:31:57 +00:00
|
|
|
LocalPointer<CurrencyPluralInfo> fPtr;
|
|
|
|
|
|
|
|
CurrencyPluralInfoWrapper() {}
|
|
|
|
CurrencyPluralInfoWrapper(const CurrencyPluralInfoWrapper& other) {
|
|
|
|
if (!other.fPtr.isNull()) {
|
|
|
|
fPtr.adoptInstead(new CurrencyPluralInfo(*other.fPtr));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2017-09-28 22:53:31 +00:00
|
|
|
// Exported as U_I18N_API because it is needed for the unit test PatternStringTest
|
2017-09-27 18:50:44 +00:00
|
|
|
struct U_I18N_API DecimalFormatProperties {
|
2017-09-27 00:25:20 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
NullableValue<UNumberCompactStyle> compactStyle;
|
|
|
|
NullableValue<CurrencyUnit> currency;
|
2017-09-27 05:31:57 +00:00
|
|
|
CurrencyPluralInfoWrapper currencyPluralInfo;
|
2017-09-27 00:25:20 +00:00
|
|
|
NullableValue<UCurrencyUsage> currencyUsage;
|
|
|
|
bool decimalPatternMatchRequired;
|
|
|
|
bool decimalSeparatorAlwaysShown;
|
|
|
|
bool exponentSignAlwaysShown;
|
|
|
|
int32_t formatWidth;
|
|
|
|
int32_t groupingSize;
|
|
|
|
int32_t magnitudeMultiplier;
|
|
|
|
int32_t maximumFractionDigits;
|
|
|
|
int32_t maximumIntegerDigits;
|
|
|
|
int32_t maximumSignificantDigits;
|
|
|
|
int32_t minimumExponentDigits;
|
|
|
|
int32_t minimumFractionDigits;
|
|
|
|
int32_t minimumGroupingDigits;
|
|
|
|
int32_t minimumIntegerDigits;
|
|
|
|
int32_t minimumSignificantDigits;
|
|
|
|
int32_t multiplier;
|
|
|
|
UnicodeString negativePrefix;
|
|
|
|
UnicodeString negativePrefixPattern;
|
|
|
|
UnicodeString negativeSuffix;
|
|
|
|
UnicodeString negativeSuffixPattern;
|
|
|
|
NullableValue<PadPosition> padPosition;
|
|
|
|
UnicodeString padString;
|
|
|
|
bool parseCaseSensitive;
|
|
|
|
bool parseIntegerOnly;
|
|
|
|
bool parseLenient;
|
|
|
|
bool parseNoExponent;
|
|
|
|
bool parseToBigDecimal;
|
|
|
|
//PluralRules pluralRules;
|
|
|
|
UnicodeString positivePrefix;
|
|
|
|
UnicodeString positivePrefixPattern;
|
|
|
|
UnicodeString positiveSuffix;
|
|
|
|
UnicodeString positiveSuffixPattern;
|
|
|
|
double roundingIncrement;
|
|
|
|
NullableValue<RoundingMode> roundingMode;
|
|
|
|
int32_t secondaryGroupingSize;
|
|
|
|
bool signAlwaysShown;
|
|
|
|
|
|
|
|
DecimalFormatProperties();
|
|
|
|
|
|
|
|
//DecimalFormatProperties(const DecimalFormatProperties &other) = default;
|
|
|
|
|
|
|
|
DecimalFormatProperties &operator=(const DecimalFormatProperties &other) = default;
|
|
|
|
|
|
|
|
bool operator==(const DecimalFormatProperties &other) const;
|
|
|
|
|
|
|
|
void clear();
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace impl
|
|
|
|
} // namespace number
|
|
|
|
U_NAMESPACE_END
|
|
|
|
|
|
|
|
|
2017-09-27 05:31:57 +00:00
|
|
|
#endif //__NUMBER_DECIMFMTPROPS_H__
|
|
|
|
|
|
|
|
#endif /* #if !UCONFIG_NO_FORMATTING */
|