ICU 51.2  51.2
Public Member Functions | Static Public Member Functions | Protected Member Functions
icu::MeasureFormat Class Reference

A formatter for measure objects. More...

#include <measfmt.h>

Inheritance diagram for icu::MeasureFormat:
icu::Format icu::UObject icu::UMemory icu::TimeUnitFormat

Public Member Functions

virtual ~MeasureFormat ()
 Destructor.
- Public Member Functions inherited from icu::Format
virtual ~Format ()
 Destructor.
virtual UBool operator== (const Format &other) const =0
 Return true if the given Format objects are semantically equal.
UBool operator!= (const Format &other) const
 Return true if the given Format objects are not semantically equal.
virtual Formatclone () const =0
 Clone this object polymorphically.
UnicodeStringformat (const Formattable &obj, UnicodeString &appendTo, UErrorCode &status) const
 Formats an object to produce a string.
virtual UnicodeStringformat (const Formattable &obj, UnicodeString &appendTo, FieldPosition &pos, UErrorCode &status) const =0
 Format an object to produce a string.
virtual UnicodeStringformat (const Formattable &obj, UnicodeString &appendTo, FieldPositionIterator *posIter, UErrorCode &status) const
 Format an object to produce a string.
virtual void parseObject (const UnicodeString &source, Formattable &result, ParsePosition &parse_pos) const =0
 Parse a string to produce an object.
void parseObject (const UnicodeString &source, Formattable &result, UErrorCode &status) const
 Parses a string to produce an object.
Locale getLocale (ULocDataLocaleType type, UErrorCode &status) const
 Get the locale for this format object.
const char * getLocaleID (ULocDataLocaleType type, UErrorCode &status) const
 Get the locale for this format object.
- Public Member Functions inherited from icu::UObject
virtual ~UObject ()
 Destructor.
virtual UClassID getDynamicClassID () const
 ICU4C "poor man's RTTI", returns a UClassID for the actual ICU class.

Static Public Member Functions

static MeasureFormatcreateCurrencyFormat (const Locale &locale, UErrorCode &ec)
 Return a formatter for CurrencyAmount objects in the given locale.
static MeasureFormatcreateCurrencyFormat (UErrorCode &ec)
 Return a formatter for CurrencyAmount objects in the default locale.

Protected Member Functions

 MeasureFormat ()
 Default constructor.
- Protected Member Functions inherited from icu::Format
void setLocaleIDs (const char *valid, const char *actual)
 Format ()
 Default constructor for subclass use only.
 Format (const Format &)
Formatoperator= (const Format &)

Additional Inherited Members

- Static Protected Member Functions inherited from icu::Format
static void syntaxError (const UnicodeString &pattern, int32_t pos, UParseError &parseError)
 Simple function for initializing a UParseError from a UnicodeString.

Detailed Description

A formatter for measure objects.

This is an abstract base class.

To format or parse a measure object, first create a formatter object using a MeasureFormat factory method. Then use that object's format and parse methods.

This is an abstract class.

See Also
Format
Author
Alan Liu
Stable:
ICU 3.0

Definition at line 41 of file measfmt.h.

Constructor & Destructor Documentation

virtual icu::MeasureFormat::~MeasureFormat ( )
virtual

Destructor.

Stable:
ICU 3.0
icu::MeasureFormat::MeasureFormat ( )
protected

Default constructor.

Stable:
ICU 3.0

Member Function Documentation

static MeasureFormat* icu::MeasureFormat::createCurrencyFormat ( const Locale locale,
UErrorCode ec 
)
static

Return a formatter for CurrencyAmount objects in the given locale.

Parameters
localedesired locale
ecinput-output error code
Returns
a formatter object, or NULL upon error
Stable:
ICU 3.0
static MeasureFormat* icu::MeasureFormat::createCurrencyFormat ( UErrorCode ec)
static

Return a formatter for CurrencyAmount objects in the default locale.

Parameters
ecinput-output error code
Returns
a formatter object, or NULL upon error
Stable:
ICU 3.0

The documentation for this class was generated from the following file: