compactdecimalformat.h
Go to the documentation of this file.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
********************************************************************************
* Copyright (C) 2012-2016, International Business Machines
* Corporation and others. All Rights Reserved.
********************************************************************************
*
* File COMPACTDECIMALFORMAT.H
********************************************************************************
*/
#ifndef __COMPACT_DECIMAL_FORMAT_H__
#define __COMPACT_DECIMAL_FORMAT_H__
#include "unicode/utypes.h"
#if U_SHOW_CPLUSPLUS_API
#if !UCONFIG_NO_FORMATTING
#include "unicode/decimfmt.h"
struct UHashtable;
U_NAMESPACE_BEGIN
class PluralRules;
class U_I18N_API CompactDecimalFormat : public DecimalFormat {
public:
static CompactDecimalFormat* U_EXPORT2 createInstance(
const Locale& inLocale, UNumberCompactStyle style, UErrorCode& status);
CompactDecimalFormat(const CompactDecimalFormat& source);
~CompactDecimalFormat() override;
CompactDecimalFormat& operator=(const CompactDecimalFormat& rhs);
CompactDecimalFormat* clone() const override;
using DecimalFormat::format;
void parse(const UnicodeString& text, Formattable& result,
ParsePosition& parsePosition) const override;
void parse(const UnicodeString& text, Formattable& result, UErrorCode& status) const override;
#ifndef U_HIDE_INTERNAL_API
CurrencyAmount* parseCurrency(const UnicodeString& text, ParsePosition& pos) const override;
#endif /* U_HIDE_INTERNAL_API */
static UClassID U_EXPORT2 getStaticClassID();
UClassID getDynamicClassID() const override;
private:
CompactDecimalFormat(const Locale& inLocale, UNumberCompactStyle style, UErrorCode& status);
};
U_NAMESPACE_END
#endif /* #if !UCONFIG_NO_FORMATTING */
#endif /* U_SHOW_CPLUSPLUS_API */
#endif // __COMPACT_DECIMAL_FORMAT_H__
//eof
icu::CompactDecimalFormat
IMPORTANT: New users are strongly encouraged to see if numberformatter.h fits their use case.
Definition: compactdecimalformat.h:63
icu::CompactDecimalFormat::parseCurrency
CurrencyAmount * parseCurrency(const UnicodeString &text, ParsePosition &pos) const override
Parses text from the given string as a currency amount.
icu::CompactDecimalFormat::parse
void parse(const UnicodeString &text, Formattable &result, UErrorCode &status) const override
CompactDecimalFormat does not support parsing.
icu::CompactDecimalFormat::getDynamicClassID
UClassID getDynamicClassID() const override
Returns a unique class ID POLYMORPHICALLY.
icu::CompactDecimalFormat::parse
void parse(const UnicodeString &text, Formattable &result, ParsePosition &parsePosition) const override
CompactDecimalFormat does not support parsing.
icu::CompactDecimalFormat::~CompactDecimalFormat
~CompactDecimalFormat() override
Destructor.
icu::CompactDecimalFormat::CompactDecimalFormat
CompactDecimalFormat(const CompactDecimalFormat &source)
Copy constructor.
icu::CompactDecimalFormat::clone
CompactDecimalFormat * clone() const override
Clone this Format object polymorphically.
icu::CompactDecimalFormat::createInstance
static CompactDecimalFormat * createInstance(const Locale &inLocale, UNumberCompactStyle style, UErrorCode &status)
Returns a compact decimal instance for specified locale.
icu::CompactDecimalFormat::operator=
CompactDecimalFormat & operator=(const CompactDecimalFormat &rhs)
Assignment operator.
icu::CompactDecimalFormat::getStaticClassID
static UClassID getStaticClassID()
Return the class ID for this class.
icu::CurrencyAmount
A currency together with a numeric amount, such as 200 USD.
Definition: curramt.h:39
icu::DecimalFormat
IMPORTANT: New users are strongly encouraged to see if numberformatter.h fits their use case.
Definition: decimfmt.h:668
icu::DecimalFormat::format
virtual UnicodeString & format(const Formattable &obj, UnicodeString &appendTo, FieldPosition &pos, UErrorCode &status) const override
Format an object to produce a string.
icu::Formattable
Formattable objects can be passed to the Format class or its subclasses for formatting.
Definition: fmtable.h:64
icu::Locale
A Locale object represents a specific geographical, political, or cultural region.
Definition: locid.h:195
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::UnicodeString
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
Definition: unistr.h:296
decimfmt.h
C++ API: Compatibility APIs for decimal formatting.
UHashtable
struct UHashtable UHashtable
Definition: msgfmt.h:43
UNumberCompactStyle
UNumberCompactStyle
Constants for specifying short or long format.
Definition: unum.h:289
UClassID
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Definition: uobject.h:96
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition: utypes.h:415
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