ICU 63.1 63.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"
22 #if !UCONFIG_NO_FORMATTING
23
24 #include "unicode/decimfmt.h"
25
26 struct UHashtable;
27
28 U_NAMESPACE_BEGIN
29
30 class PluralRules;
31
60 class U_I18N_API CompactDecimalFormat : public DecimalFormat {
61 public:
62
73 static CompactDecimalFormat* U_EXPORT2 createInstance(
74 const Locale& inLocale, UNumberCompactStyle style, UErrorCode& status);
75
82 CompactDecimalFormat(const CompactDecimalFormat& source);
83
88 ~CompactDecimalFormat() U_OVERRIDE;
89
96 CompactDecimalFormat& operator=(const CompactDecimalFormat& rhs);
97
105 Format* clone() const U_OVERRIDE;
106
107 using DecimalFormat::format;
108
118 void parse(const UnicodeString& text, Formattable& result,
119 ParsePosition& parsePosition) const U_OVERRIDE;
120
130 void parse(const UnicodeString& text, Formattable& result, UErrorCode& status) const U_OVERRIDE;
131
132 #ifndef U_HIDE_INTERNAL_API
133
153 CurrencyAmount* parseCurrency(const UnicodeString& text, ParsePosition& pos) const U_OVERRIDE;
154 #endif /* U_HIDE_INTERNAL_API */
155
167 static UClassID U_EXPORT2 getStaticClassID();
168
180 UClassID getDynamicClassID() const U_OVERRIDE;
181
182 private:
183 CompactDecimalFormat(const Locale& inLocale, UNumberCompactStyle style, UErrorCode& status);
184 };
185
186 U_NAMESPACE_END
187
188 #endif /* #if !UCONFIG_NO_FORMATTING */
189
190 #endif // __COMPACT_DECIMAL_FORMAT_H__
191 //eof
icu::Format
Base class for all formats.
Definition: format.h:96
UHashtable
struct UHashtable UHashtable
Definition: msgfmt.h:41
icu::DecimalFormat::operator=
DecimalFormat & operator=(const DecimalFormat &rhs)
Assignment operator.
U_OVERRIDE
#define U_OVERRIDE
Defined to the C++11 "override" keyword if available.
Definition: umachine.h:129
icu::DecimalFormat
IMPORTANT: New users are strongly encouraged to see if numberformatter.h fits their use case...
Definition: decimfmt.h:677
UClassID
void * UClassID
UClassID is used to identify classes without using the compiler&#39;s RTTI.
Definition: uobject.h:90
icu::NumberFormat::createInstance
static NumberFormat * createInstance(UErrorCode &)
Create a default style NumberFormat for the current default locale.
icu::CompactDecimalFormat
IMPORTANT: New users are strongly encouraged to see if numberformatter.h fits their use case...
Definition: compactdecimalformat.h:60
U_I18N_API
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside...
Definition: utypes.h:301
U_NAMESPACE_BEGIN
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:137
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::clone
Format * clone(void) const U_OVERRIDE
Clone this Format object polymorphically.
U_NAMESPACE_END
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:138
UNumberCompactStyle
UNumberCompactStyle
Constants for specifying short or long format.
Definition: unum.h:319
UErrorCode
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:401
icu::ParsePosition
ParsePosition is a simple class used by Format and its subclasses to keep track of the current positi...
Definition: parsepos.h:49
decimfmt.h
C++ API: Compatibility APIs for decimal formatting.
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
icu::UnicodeString
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
Definition: unistr.h:289
icu::Formattable
Formattable objects can be passed to the Format class or its subclasses for formatting.
Definition: fmtable.h:62
icu::DecimalFormat::parse
void parse(const UnicodeString &text, Formattable &result, ParsePosition &parsePosition) const U_OVERRIDE
Parse the given string using this object&#39;s choices.
icu::DecimalFormat::parseCurrency
CurrencyAmount * parseCurrency(const UnicodeString &text, ParsePosition &pos) const U_OVERRIDE
Parses text from the given string as a currency amount.
icu::CurrencyAmount
A currency together with a numeric amount, such as 200 USD.
Definition: curramt.h:37
icu::DecimalFormat::getDynamicClassID
UClassID getDynamicClassID(void) const U_OVERRIDE
Returns a unique class ID POLYMORPHICALLY.
icu::Locale
A Locale object represents a specific geographical, political, or cultural region.
Definition: locid.h:192