ICU 50.2 50.2
MeasureFormat Class Reference

A formatter for measure objects. More...

#include <measfmt.h>

Inheritance diagram for MeasureFormat:
Format UObject UMemory TimeUnitFormat

Public Member Functions

virtual ~MeasureFormat ()
 Destructor.
 
- Public Member Functions inherited from 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 UObject
virtual ~UObject ()
 Destructor.
 
virtual UClassID getDynamicClassID () const =0
 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 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 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

◆ ~MeasureFormat()

virtual MeasureFormat::~MeasureFormat ( )
virtual

Destructor.

Stable
ICU 3.0

◆ MeasureFormat()

MeasureFormat::MeasureFormat ( )
protected

Default constructor.

Stable
ICU 3.0

Referenced by createCurrencyFormat(), and createCurrencyFormat().

Member Function Documentation

◆ createCurrencyFormat() [1/2]

static MeasureFormat * 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

References MeasureFormat().

◆ createCurrencyFormat() [2/2]

static MeasureFormat * 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

References MeasureFormat().


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