1 // © 2017 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
4 #include "unicode/utypes.h"
6 #if !UCONFIG_NO_FORMATTING
7 #ifndef __NUMBER_SCIENTIFIC_H__
8 #define __NUMBER_SCIENTIFIC_H__
10 #include "number_types.h"
12 U_NAMESPACE_BEGIN
namespace number
{
16 class ScientificHandler
;
18 class U_I18N_API ScientificModifier
: public UMemory
, public Modifier
{
22 void set(int32_t exponent
, const ScientificHandler
*handler
);
24 int32_t apply(NumberStringBuilder
&output
, int32_t leftIndex
, int32_t rightIndex
,
25 UErrorCode
&status
) const U_OVERRIDE
;
27 int32_t getPrefixLength() const U_OVERRIDE
;
29 int32_t getCodePointCount() const U_OVERRIDE
;
31 bool isStrong() const U_OVERRIDE
;
33 bool containsField(UNumberFormatFields field
) const U_OVERRIDE
;
35 void getParameters(Parameters
& output
) const U_OVERRIDE
;
37 bool semanticallyEquivalent(const Modifier
& other
) const U_OVERRIDE
;
41 const ScientificHandler
*fHandler
;
44 class ScientificHandler
: public UMemory
, public MicroPropsGenerator
, public MultiplierProducer
{
46 ScientificHandler(const Notation
*notation
, const DecimalFormatSymbols
*symbols
,
47 const MicroPropsGenerator
*parent
);
50 processQuantity(DecimalQuantity
&quantity
, MicroProps
µs
, UErrorCode
&status
) const U_OVERRIDE
;
52 int32_t getMultiplier(int32_t magnitude
) const U_OVERRIDE
;
55 const Notation::ScientificSettings
& fSettings
;
56 const DecimalFormatSymbols
*fSymbols
;
57 const MicroPropsGenerator
*fParent
;
59 friend class ScientificModifier
;
66 #endif //__NUMBER_SCIENTIFIC_H__
68 #endif /* #if !UCONFIG_NO_FORMATTING */