ICU 55.1 55.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
compactdecimalformat.h
Go to the documentation of this file.
1 /*
2 ********************************************************************************
3 * Copyright (C) 2012-2014, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 ********************************************************************************
6 *
7 * File COMPACTDECIMALFORMAT.H
8 ********************************************************************************
9 */
10
11 #ifndef __COMPACT_DECIMAL_FORMAT_H__
12 #define __COMPACT_DECIMAL_FORMAT_H__
13
14 #include "unicode/utypes.h"
20 #if !UCONFIG_NO_FORMATTING
21
22 #include "unicode/decimfmt.h"
23
24 struct UHashtable;
25
26 U_NAMESPACE_BEGIN
27
28 class PluralRules;
29
52 class U_I18N_API CompactDecimalFormat : public DecimalFormat {
53 public:
54
62 static CompactDecimalFormat* U_EXPORT2 createInstance(
63 const Locale& inLocale, UNumberCompactStyle style, UErrorCode& status);
64
71 CompactDecimalFormat(const CompactDecimalFormat& source);
72
77 virtual ~CompactDecimalFormat();
78
85 CompactDecimalFormat& operator=(const CompactDecimalFormat& rhs);
86
94 virtual Format* clone() const;
95
104 virtual UBool operator==(const Format& other) const;
105
106
107 using DecimalFormat::format;
108
120 virtual UnicodeString& format(double number,
121 UnicodeString& appendTo,
122 FieldPosition& pos) const;
123
138 virtual UnicodeString& format(double number,
139 UnicodeString& appendTo,
140 FieldPositionIterator* posIter,
141 UErrorCode& status) const;
142
154 virtual UnicodeString& format(int64_t number,
155 UnicodeString& appendTo,
156 FieldPosition& pos) const;
157
172 virtual UnicodeString& format(int64_t number,
173 UnicodeString& appendTo,
174 FieldPositionIterator* posIter,
175 UErrorCode& status) const;
176
193 virtual UnicodeString& format(const StringPiece &number,
194 UnicodeString& appendTo,
195 FieldPositionIterator* posIter,
196 UErrorCode& status) const;
197
213 virtual UnicodeString& format(const DigitList &number,
214 UnicodeString& appendTo,
215 FieldPositionIterator* posIter,
216 UErrorCode& status) const;
217
233 virtual UnicodeString& format(const DigitList &number,
234 UnicodeString& appendTo,
235 FieldPosition& pos,
236 UErrorCode& status) const;
237
247 virtual void parse(const UnicodeString& text,
248 Formattable& result,
249 ParsePosition& parsePosition) const;
250
260 virtual void parse(const UnicodeString& text,
261 Formattable& result,
262 UErrorCode& status) const;
263
284 virtual CurrencyAmount* parseCurrency(const UnicodeString& text,
285 ParsePosition& pos) const;
286
298 static UClassID U_EXPORT2 getStaticClassID();
299
311 virtual UClassID getDynamicClassID() const;
312
313 private:
314
315 const UHashtable* _unitsByVariant;
316 const double* _divisors;
317 PluralRules* _pluralRules;
318
319 // Default constructor not implemented.
320 CompactDecimalFormat(const DecimalFormat &, const UHashtable* unitsByVariant, const double* divisors, PluralRules* pluralRules);
321
322 UBool eqHelper(const CompactDecimalFormat& that) const;
323 };
324
325 U_NAMESPACE_END
326
327 #endif /* #if !UCONFIG_NO_FORMATTING */
328
329 #endif // __COMPACT_DECIMAL_FORMAT_H__
330 //eof