| 1 |
. |
| 2 |
|
| 3 |
|
| 4 |
#include "unicode/utypes.h" |
| 5 |
|
| 6 |
#if !UCONFIG_NO_FORMATTING |
| 7 |
#ifndef __NUMBER_ASFORMAT_H__ |
| 8 |
#define __NUMBER_ASFORMAT_H__ |
| 9 |
|
| 10 |
#include "unicode/numberformatter.h" |
| 11 |
#include "number_types.h" |
| 12 |
#include "number_decimalquantity.h" |
| 13 |
#include "number_scientific.h" |
| 14 |
#include "number_patternstring.h" |
| 15 |
#include "number_modifiers.h" |
| 16 |
#include "number_multiplier.h" |
| 17 |
#include "number_roundingutils.h" |
| 18 |
#include "decNumber.h" |
| 19 |
#include "charstr.h" |
| 20 |
|
| 21 |
U_NAMESPACE_BEGIN |
| 22 |
namespace number::impl { |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
class U_I18N_API LocalizedNumberFormatterAsFormat : public Format { |
| 31 |
public: |
| 32 |
LocalizedNumberFormatterAsFormat(const LocalizedNumberFormatter& formatter, const Locale& locale); |
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
~LocalizedNumberFormatterAsFormat() override; |
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
bool operator==(const Format& other) const override; |
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
LocalizedNumberFormatterAsFormat* clone() const override; |
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
UnicodeString& format(const Formattable& obj, UnicodeString& appendTo, FieldPosition& pos, |
| 54 |
UErrorCode& status) const override; |
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
UnicodeString& format(const Formattable& obj, UnicodeString& appendTo, FieldPositionIterator* posIter, |
| 61 |
UErrorCode& status) const override; |
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
void parseObject(const UnicodeString& source, Formattable& result, |
| 67 |
ParsePosition& parse_pos) const override; |
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
const LocalizedNumberFormatter& getNumberFormatter() const; |
| 88 |
|
| 89 |
UClassID getDynamicClassID() const override; |
| 90 |
static UClassID U_EXPORT2 getStaticClassID(); |
| 91 |
|
| 92 |
private: |
| 93 |
LocalizedNumberFormatter fFormatter; |
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
Locale fLocale; |
| 98 |
}; |
| 99 |
|
| 100 |
} |
| 101 |
U_NAMESPACE_END |
| 102 |
|
| 103 |
#endif |
| 104 |
|
| 105 |
#endif |