ICU 71.1 71.1

compactdecimalformat.h
Go to the documentation of this file.
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /*
4 ********************************************************************************
5 * Copyright (C) 2012-2016, International Business Machines
6 * Corporation and others. All Rights Reserved.
7 ********************************************************************************
8 *
9 * File COMPACTDECIMALFORMAT.H
10 ********************************************************************************
11 */
12
13 #ifndef __COMPACT_DECIMAL_FORMAT_H__
14 #define __COMPACT_DECIMAL_FORMAT_H__
15
16 #include "unicode/utypes.h"
17
18 #if U_SHOW_CPLUSPLUS_API
19
25 #if !UCONFIG_NO_FORMATTING
26
27 #include "unicode/decimfmt.h"
28
29 struct UHashtable;
30
31 U_NAMESPACE_BEGIN
32
33 class PluralRules;
34
63 class U_I18N_API CompactDecimalFormat : public DecimalFormat {
64 public:
65
76 static CompactDecimalFormat* U_EXPORT2 createInstance(
77 const Locale& inLocale, UNumberCompactStyle style, UErrorCode& status);
78
85 CompactDecimalFormat(const CompactDecimalFormat& source);
86
91 ~CompactDecimalFormat() U_OVERRIDE;
92
99 CompactDecimalFormat& operator=(const CompactDecimalFormat& rhs);
100
108 CompactDecimalFormat* clone() const U_OVERRIDE;
109
110 using DecimalFormat::format;
111
121 void parse(const UnicodeString& text, Formattable& result,
122 ParsePosition& parsePosition) const U_OVERRIDE;
123
133 void parse(const UnicodeString& text, Formattable& result, UErrorCode& status) const U_OVERRIDE;
134
135 #ifndef U_HIDE_INTERNAL_API
136
156 CurrencyAmount* parseCurrency(const UnicodeString& text, ParsePosition& pos) const U_OVERRIDE;
157 #endif /* U_HIDE_INTERNAL_API */
158
170 static UClassID U_EXPORT2 getStaticClassID();
171
183 UClassID getDynamicClassID() const U_OVERRIDE;
184
185 private:
186 CompactDecimalFormat(const Locale& inLocale, UNumberCompactStyle style, UErrorCode& status);
187 };
188
189 U_NAMESPACE_END
190
191 #endif /* #if !UCONFIG_NO_FORMATTING */
192
193 #endif /* U_SHOW_CPLUSPLUS_API */
194
195 #endif // __COMPACT_DECIMAL_FORMAT_H__
196 //eof
UHashtable
struct UHashtable UHashtable
Definition: msgfmt.h:43
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
U_I18N_API
#define U_I18N_API
Definition: utypes.h:301
icu::Formattable
Formattable objects can be passed to the Format class or its subclasses for formatting.
Definition: fmtable.h:64
icu::DecimalFormat::getDynamicClassID
UClassID getDynamicClassID(void) const U_OVERRIDE
Returns a unique class ID POLYMORPHICALLY.
U_OVERRIDE
#define U_OVERRIDE
Definition: umachine.h:130
icu::CompactDecimalFormat
IMPORTANT: New users are strongly encouraged to see if numberformatter.h fits their use case.
Definition: compactdecimalformat.h:63
decimfmt.h
C++ API: Compatibility APIs for decimal formatting.
icu::UnicodeString
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
Definition: unistr.h:295
UClassID
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Definition: uobject.h:96
UErrorCode
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition: utypes.h:415
icu::DecimalFormat::clone
DecimalFormat * clone() const U_OVERRIDE
Clone this Format object polymorphically.
icu::DecimalFormat::operator=
DecimalFormat & operator=(const DecimalFormat &rhs)
Assignment operator.
icu::DecimalFormat::format
UnicodeString & format(double number, UnicodeString &appendTo, FieldPosition &pos) const U_OVERRIDE
Format a double or long number using base-10 representation.
icu::DecimalFormat::getStaticClassID
static UClassID getStaticClassID(void)
Return the class ID for this class.
icu::DecimalFormat
IMPORTANT: New users are strongly encouraged to see if numberformatter.h fits their use case.
Definition: decimfmt.h:668
icu::NumberFormat::createInstance
static NumberFormat * createInstance(UErrorCode &)
Create a default style NumberFormat for the current default locale.
icu::DecimalFormat::parse
void parse(const UnicodeString &text, Formattable &result, ParsePosition &parsePosition) const U_OVERRIDE
Parse the given string using this object's choices.
icu::CurrencyAmount
A currency together with a numeric amount, such as 200 USD.
Definition: curramt.h:39
icu::ParsePosition
ParsePosition is a simple class used by Format and its subclasses to keep track of the current positi...
Definition: parsepos.h:52
icu::Locale
A Locale object represents a specific geographical, political, or cultural region.
Definition: locid.h:195
icu::DecimalFormat::parseCurrency
CurrencyAmount * parseCurrency(const UnicodeString &text, ParsePosition &pos) const U_OVERRIDE
Parses text from the given string as a currency amount.
UNumberCompactStyle
UNumberCompactStyle
Constants for specifying short or long format.
Definition: unum.h:337