ICU 55.1 55.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- Data Structures
- Data Structure Index
- Class Hierarchy
- Data Fields

All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions
icu::MeasureUnit Class Reference

A unit such as length, mass, volume, currency, etc. More...

`#include <measunit.h>`

Inheritance diagram for icu::MeasureUnit:

## Public Member Functions
| MeasureUnit ()
| Default constructor.
| MeasureUnit (const MeasureUnit &other)
| Copy constructor.
MeasureUnit & | operator= (const MeasureUnit &other)
| Assignment operator.
virtual UObject * | clone () const
| Returns a polymorphic clone of this object.
virtual | ~MeasureUnit ()
| Destructor.
virtual UBool | operator== (const UObject &other) const
| Equality operator.
UBool | operator!= (const UObject &other) const
| Inequality operator.
const char * | getType () const
| Get the type.
const char * | getSubtype () const
| Get the sub type.
virtual UClassID | getDynamicClassID (void) const
| Returns a unique class ID POLYMORPHICALLY.
int32_t | getIndex () const
| ICU use only.
Public Member Functions inherited from icu::UObject
virtual | ~UObject ()
| Destructor.

## Static Public Member Functions
static int32_t | getAvailable (MeasureUnit *destArray, int32_t destCapacity, UErrorCode &errorCode)
| getAvailable gets all of the available units.
static int32_t | getAvailable (const char *type, MeasureUnit *destArray, int32_t destCapacity, UErrorCode &errorCode)
| getAvailable gets all of the available units for a specific type.
static StringEnumeration * | getAvailableTypes (UErrorCode &errorCode)
| getAvailableTypes gets all of the available types.
static UClassID | getStaticClassID (void)
| Return the class ID for this class.
static int32_t | getIndexCount ()
| ICU use only.
static MeasureUnit * | resolveUnitPerUnit (const MeasureUnit &unit, const MeasureUnit &perUnit)
| ICU use only.
static MeasureUnit * | createGForce (UErrorCode &status)
| Returns unit of acceleration: g-force.
static MeasureUnit * | createMeterPerSecondSquared (UErrorCode &status)
| Returns unit of acceleration: meter-per-second-squared.
static MeasureUnit * | createArcMinute (UErrorCode &status)
| Returns unit of angle: arc-minute.
static MeasureUnit * | createArcSecond (UErrorCode &status)
| Returns unit of angle: arc-second.
static MeasureUnit * | createDegree (UErrorCode &status)
| Returns unit of angle: degree.
static MeasureUnit * | createRadian (UErrorCode &status)
| Returns unit of angle: radian.
static MeasureUnit * | createAcre (UErrorCode &status)
| Returns unit of area: acre.
static MeasureUnit * | createHectare (UErrorCode &status)
| Returns unit of area: hectare.
static MeasureUnit * | createSquareCentimeter (UErrorCode &status)
| Returns unit of area: square-centimeter.
static MeasureUnit * | createSquareFoot (UErrorCode &status)
| Returns unit of area: square-foot.
static MeasureUnit * | createSquareInch (UErrorCode &status)
| Returns unit of area: square-inch.
static MeasureUnit * | createSquareKilometer (UErrorCode &status)
| Returns unit of area: square-kilometer.
static MeasureUnit * | createSquareMeter (UErrorCode &status)
| Returns unit of area: square-meter.
static MeasureUnit * | createSquareMile (UErrorCode &status)
| Returns unit of area: square-mile.
static MeasureUnit * | createSquareYard (UErrorCode &status)
| Returns unit of area: square-yard.
static MeasureUnit * | createLiterPerKilometer (UErrorCode &status)
| Returns unit of consumption: liter-per-kilometer.
static MeasureUnit * | createMilePerGallon (UErrorCode &status)
| Returns unit of consumption: mile-per-gallon.
static MeasureUnit * | createBit (UErrorCode &status)
| Returns unit of digital: bit.
static MeasureUnit * | createByte (UErrorCode &status)
| Returns unit of digital: byte.
static MeasureUnit * | createGigabit (UErrorCode &status)
| Returns unit of digital: gigabit.
static MeasureUnit * | createGigabyte (UErrorCode &status)
| Returns unit of digital: gigabyte.
static MeasureUnit * | createKilobit (UErrorCode &status)
| Returns unit of digital: kilobit.
static MeasureUnit * | createKilobyte (UErrorCode &status)
| Returns unit of digital: kilobyte.
static MeasureUnit * | createMegabit (UErrorCode &status)
| Returns unit of digital: megabit.
static MeasureUnit * | createMegabyte (UErrorCode &status)
| Returns unit of digital: megabyte.
static MeasureUnit * | createTerabit (UErrorCode &status)
| Returns unit of digital: terabit.
static MeasureUnit * | createTerabyte (UErrorCode &status)
| Returns unit of digital: terabyte.
static MeasureUnit * | createDay (UErrorCode &status)
| Returns unit of duration: day.
static MeasureUnit * | createHour (UErrorCode &status)
| Returns unit of duration: hour.
static MeasureUnit * | createMicrosecond (UErrorCode &status)
| Returns unit of duration: microsecond.
static MeasureUnit * | createMillisecond (UErrorCode &status)
| Returns unit of duration: millisecond.
static MeasureUnit * | createMinute (UErrorCode &status)
| Returns unit of duration: minute.
static MeasureUnit * | createMonth (UErrorCode &status)
| Returns unit of duration: month.
static MeasureUnit * | createNanosecond (UErrorCode &status)
| Returns unit of duration: nanosecond.
static MeasureUnit * | createSecond (UErrorCode &status)
| Returns unit of duration: second.
static MeasureUnit * | createWeek (UErrorCode &status)
| Returns unit of duration: week.
static MeasureUnit * | createYear (UErrorCode &status)
| Returns unit of duration: year.
static MeasureUnit * | createAmpere (UErrorCode &status)
| Returns unit of electric: ampere.
static MeasureUnit * | createMilliampere (UErrorCode &status)
| Returns unit of electric: milliampere.
static MeasureUnit * | createOhm (UErrorCode &status)
| Returns unit of electric: ohm.
static MeasureUnit * | createVolt (UErrorCode &status)
| Returns unit of electric: volt.
static MeasureUnit * | createCalorie (UErrorCode &status)
| Returns unit of energy: calorie.
static MeasureUnit * | createFoodcalorie (UErrorCode &status)
| Returns unit of energy: foodcalorie.
static MeasureUnit * | createJoule (UErrorCode &status)
| Returns unit of energy: joule.
static MeasureUnit * | createKilocalorie (UErrorCode &status)
| Returns unit of energy: kilocalorie.
static MeasureUnit * | createKilojoule (UErrorCode &status)
| Returns unit of energy: kilojoule.
static MeasureUnit * | createKilowattHour (UErrorCode &status)
| Returns unit of energy: kilowatt-hour.
static MeasureUnit * | createGigahertz (UErrorCode &status)
| Returns unit of frequency: gigahertz.
static MeasureUnit * | createHertz (UErrorCode &status)
| Returns unit of frequency: hertz.
static MeasureUnit * | createKilohertz (UErrorCode &status)
| Returns unit of frequency: kilohertz.
static MeasureUnit * | createMegahertz (UErrorCode &status)
| Returns unit of frequency: megahertz.
static MeasureUnit * | createAstronomicalUnit (UErrorCode &status)
| Returns unit of length: astronomical-unit.
static MeasureUnit * | createCentimeter (UErrorCode &status)
| Returns unit of length: centimeter.
static MeasureUnit * | createDecimeter (UErrorCode &status)
| Returns unit of length: decimeter.
static MeasureUnit * | createFathom (UErrorCode &status)
| Returns unit of length: fathom.
static MeasureUnit * | createFoot (UErrorCode &status)
| Returns unit of length: foot.
static MeasureUnit * | createFurlong (UErrorCode &status)
| Returns unit of length: furlong.
static MeasureUnit * | createInch (UErrorCode &status)
| Returns unit of length: inch.
static MeasureUnit * | createKilometer (UErrorCode &status)
| Returns unit of length: kilometer.
static MeasureUnit * | createLightYear (UErrorCode &status)
| Returns unit of length: light-year.
static MeasureUnit * | createMeter (UErrorCode &status)
| Returns unit of length: meter.
static MeasureUnit * | createMicrometer (UErrorCode &status)
| Returns unit of length: micrometer.
static MeasureUnit * | createMile (UErrorCode &status)
| Returns unit of length: mile.
static MeasureUnit * | createMillimeter (UErrorCode &status)
| Returns unit of length: millimeter.
static MeasureUnit * | createNanometer (UErrorCode &status)
| Returns unit of length: nanometer.
static MeasureUnit * | createNauticalMile (UErrorCode &status)
| Returns unit of length: nautical-mile.
static MeasureUnit * | createParsec (UErrorCode &status)
| Returns unit of length: parsec.
static MeasureUnit * | createPicometer (UErrorCode &status)
| Returns unit of length: picometer.
static MeasureUnit * | createYard (UErrorCode &status)
| Returns unit of length: yard.
static MeasureUnit * | createLux (UErrorCode &status)
| Returns unit of light: lux.
static MeasureUnit * | createCarat (UErrorCode &status)
| Returns unit of mass: carat.
static MeasureUnit * | createGram (UErrorCode &status)
| Returns unit of mass: gram.
static MeasureUnit * | createKilogram (UErrorCode &status)
| Returns unit of mass: kilogram.
static MeasureUnit * | createMetricTon (UErrorCode &status)
| Returns unit of mass: metric-ton.
static MeasureUnit * | createMicrogram (UErrorCode &status)
| Returns unit of mass: microgram.
static MeasureUnit * | createMilligram (UErrorCode &status)
| Returns unit of mass: milligram.
static MeasureUnit * | createOunce (UErrorCode &status)
| Returns unit of mass: ounce.
static MeasureUnit * | createOunceTroy (UErrorCode &status)
| Returns unit of mass: ounce-troy.
static MeasureUnit * | createPound (UErrorCode &status)
| Returns unit of mass: pound.
static MeasureUnit * | createStone (UErrorCode &status)
| Returns unit of mass: stone.
static MeasureUnit * | createTon (UErrorCode &status)
| Returns unit of mass: ton.
static MeasureUnit * | createGigawatt (UErrorCode &status)
| Returns unit of power: gigawatt.
static MeasureUnit * | createHorsepower (UErrorCode &status)
| Returns unit of power: horsepower.
static MeasureUnit * | createKilowatt (UErrorCode &status)
| Returns unit of power: kilowatt.
static MeasureUnit * | createMegawatt (UErrorCode &status)
| Returns unit of power: megawatt.
static MeasureUnit * | createMilliwatt (UErrorCode &status)
| Returns unit of power: milliwatt.
static MeasureUnit * | createWatt (UErrorCode &status)
| Returns unit of power: watt.
static MeasureUnit * | createHectopascal (UErrorCode &status)
| Returns unit of pressure: hectopascal.
static MeasureUnit * | createInchHg (UErrorCode &status)
| Returns unit of pressure: inch-hg.
static MeasureUnit * | createMillibar (UErrorCode &status)
| Returns unit of pressure: millibar.
static MeasureUnit * | createMillimeterOfMercury (UErrorCode &status)
| Returns unit of pressure: millimeter-of-mercury.
static MeasureUnit * | createPoundPerSquareInch (UErrorCode &status)
| Returns unit of pressure: pound-per-square-inch.
static MeasureUnit * | createKarat (UErrorCode &status)
| Returns unit of proportion: karat.
static MeasureUnit * | createKilometerPerHour (UErrorCode &status)
| Returns unit of speed: kilometer-per-hour.
static MeasureUnit * | createMeterPerSecond (UErrorCode &status)
| Returns unit of speed: meter-per-second.
static MeasureUnit * | createMilePerHour (UErrorCode &status)
| Returns unit of speed: mile-per-hour.
static MeasureUnit * | createCelsius (UErrorCode &status)
| Returns unit of temperature: celsius.
static MeasureUnit * | createFahrenheit (UErrorCode &status)
| Returns unit of temperature: fahrenheit.
static MeasureUnit * | createKelvin (UErrorCode &status)
| Returns unit of temperature: kelvin.
static MeasureUnit * | createAcreFoot (UErrorCode &status)
| Returns unit of volume: acre-foot.
static MeasureUnit * | createBushel (UErrorCode &status)
| Returns unit of volume: bushel.
static MeasureUnit * | createCentiliter (UErrorCode &status)
| Returns unit of volume: centiliter.
static MeasureUnit * | createCubicCentimeter (UErrorCode &status)
| Returns unit of volume: cubic-centimeter.
static MeasureUnit * | createCubicFoot (UErrorCode &status)
| Returns unit of volume: cubic-foot.
static MeasureUnit * | createCubicInch (UErrorCode &status)
| Returns unit of volume: cubic-inch.
static MeasureUnit * | createCubicKilometer (UErrorCode &status)
| Returns unit of volume: cubic-kilometer.
static MeasureUnit * | createCubicMeter (UErrorCode &status)
| Returns unit of volume: cubic-meter.
static MeasureUnit * | createCubicMile (UErrorCode &status)
| Returns unit of volume: cubic-mile.
static MeasureUnit * | createCubicYard (UErrorCode &status)
| Returns unit of volume: cubic-yard.
static MeasureUnit * | createCup (UErrorCode &status)
| Returns unit of volume: cup.
static MeasureUnit * | createDeciliter (UErrorCode &status)
| Returns unit of volume: deciliter.
static MeasureUnit * | createFluidOunce (UErrorCode &status)
| Returns unit of volume: fluid-ounce.
static MeasureUnit * | createGallon (UErrorCode &status)
| Returns unit of volume: gallon.
static MeasureUnit * | createHectoliter (UErrorCode &status)
| Returns unit of volume: hectoliter.
static MeasureUnit * | createLiter (UErrorCode &status)
| Returns unit of volume: liter.
static MeasureUnit * | createMegaliter (UErrorCode &status)
| Returns unit of volume: megaliter.
static MeasureUnit * | createMilliliter (UErrorCode &status)
| Returns unit of volume: milliliter.
static MeasureUnit * | createPint (UErrorCode &status)
| Returns unit of volume: pint.
static MeasureUnit * | createQuart (UErrorCode &status)
| Returns unit of volume: quart.
static MeasureUnit * | createTablespoon (UErrorCode &status)
| Returns unit of volume: tablespoon.
static MeasureUnit * | createTeaspoon (UErrorCode &status)
| Returns unit of volume: teaspoon.

## Protected Member Functions
void | initTime (const char *timeId)
| For ICU use only.
void | initCurrency (const char *isoCurrency)
| For ICU use only.

## Detailed Description

A unit such as length, mass, volume, currency, etc.

A unit is coupled with a numeric amount to produce a Measure.

Author
  Alan Liu

Stable:
  ICU 3.0

Definition at line 36 of file measunit.h.

## Constructor & Destructor Documentation

icu::MeasureUnit::MeasureUnit | ( |  | ) |
| inline

Default constructor.

Stable:
  ICU 3.0

Definition at line 43 of file measunit.h.

icu::MeasureUnit::MeasureUnit | ( | const MeasureUnit & | other | ) |

Copy constructor.

Stable:
  ICU 3.0

virtual icu::MeasureUnit::~MeasureUnit | ( |  | ) |
| virtual

Destructor.

Stable:
  ICU 3.0

## Member Function Documentation

virtual UObject* icu::MeasureUnit::clone | ( |  | ) | const
| virtual

Returns a polymorphic clone of this object.

The result will have the same class as returned by getDynamicClassID().

Stable:
  ICU 3.0

Reimplemented in icu::TimeUnit, and icu::CurrencyUnit.

static MeasureUnit* icu::MeasureUnit::createAcre | ( | UErrorCode & | status | ) |
| static

Returns unit of area: acre.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createAcreFoot | ( | UErrorCode & | status | ) |
| static

Returns unit of volume: acre-foot.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createAmpere | ( | UErrorCode & | status | ) |
| static

Returns unit of electric: ampere.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createArcMinute | ( | UErrorCode & | status | ) |
| static

Returns unit of angle: arc-minute.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createArcSecond | ( | UErrorCode & | status | ) |
| static

Returns unit of angle: arc-second.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createAstronomicalUnit | ( | UErrorCode & | status | ) |
| static

Returns unit of length: astronomical-unit.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createBit | ( | UErrorCode & | status | ) |
| static

Returns unit of digital: bit.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createBushel | ( | UErrorCode & | status | ) |
| static

Returns unit of volume: bushel.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createByte | ( | UErrorCode & | status | ) |
| static

Returns unit of digital: byte.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createCalorie | ( | UErrorCode & | status | ) |
| static

Returns unit of energy: calorie.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createCarat | ( | UErrorCode & | status | ) |
| static

Returns unit of mass: carat.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createCelsius | ( | UErrorCode & | status | ) |
| static

Returns unit of temperature: celsius.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createCentiliter | ( | UErrorCode & | status | ) |
| static

Returns unit of volume: centiliter.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createCentimeter | ( | UErrorCode & | status | ) |
| static

Returns unit of length: centimeter.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createCubicCentimeter | ( | UErrorCode & | status | ) |
| static

Returns unit of volume: cubic-centimeter.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createCubicFoot | ( | UErrorCode & | status | ) |
| static

Returns unit of volume: cubic-foot.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createCubicInch | ( | UErrorCode & | status | ) |
| static

Returns unit of volume: cubic-inch.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createCubicKilometer | ( | UErrorCode & | status | ) |
| static

Returns unit of volume: cubic-kilometer.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createCubicMeter | ( | UErrorCode & | status | ) |
| static

Returns unit of volume: cubic-meter.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createCubicMile | ( | UErrorCode & | status | ) |
| static

Returns unit of volume: cubic-mile.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createCubicYard | ( | UErrorCode & | status | ) |
| static

Returns unit of volume: cubic-yard.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createCup | ( | UErrorCode & | status | ) |
| static

Returns unit of volume: cup.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createDay | ( | UErrorCode & | status | ) |
| static

Returns unit of duration: day.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createDeciliter | ( | UErrorCode & | status | ) |
| static

Returns unit of volume: deciliter.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createDecimeter | ( | UErrorCode & | status | ) |
| static

Returns unit of length: decimeter.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createDegree | ( | UErrorCode & | status | ) |
| static

Returns unit of angle: degree.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createFahrenheit | ( | UErrorCode & | status | ) |
| static

Returns unit of temperature: fahrenheit.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createFathom | ( | UErrorCode & | status | ) |
| static

Returns unit of length: fathom.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createFluidOunce | ( | UErrorCode & | status | ) |
| static

Returns unit of volume: fluid-ounce.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createFoodcalorie | ( | UErrorCode & | status | ) |
| static

Returns unit of energy: foodcalorie.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createFoot | ( | UErrorCode & | status | ) |
| static

Returns unit of length: foot.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createFurlong | ( | UErrorCode & | status | ) |
| static

Returns unit of length: furlong.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createGallon | ( | UErrorCode & | status | ) |
| static

Returns unit of volume: gallon.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createGForce | ( | UErrorCode & | status | ) |
| static

Returns unit of acceleration: g-force.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createGigabit | ( | UErrorCode & | status | ) |
| static

Returns unit of digital: gigabit.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createGigabyte | ( | UErrorCode & | status | ) |
| static

Returns unit of digital: gigabyte.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createGigahertz | ( | UErrorCode & | status | ) |
| static

Returns unit of frequency: gigahertz.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createGigawatt | ( | UErrorCode & | status | ) |
| static

Returns unit of power: gigawatt.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createGram | ( | UErrorCode & | status | ) |
| static

Returns unit of mass: gram.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createHectare | ( | UErrorCode & | status | ) |
| static

Returns unit of area: hectare.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createHectoliter | ( | UErrorCode & | status | ) |
| static

Returns unit of volume: hectoliter.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createHectopascal | ( | UErrorCode & | status | ) |
| static

Returns unit of pressure: hectopascal.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createHertz | ( | UErrorCode & | status | ) |
| static

Returns unit of frequency: hertz.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createHorsepower | ( | UErrorCode & | status | ) |
| static

Returns unit of power: horsepower.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createHour | ( | UErrorCode & | status | ) |
| static

Returns unit of duration: hour.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createInch | ( | UErrorCode & | status | ) |
| static

Returns unit of length: inch.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createInchHg | ( | UErrorCode & | status | ) |
| static

Returns unit of pressure: inch-hg.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createJoule | ( | UErrorCode & | status | ) |
| static

Returns unit of energy: joule.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createKarat | ( | UErrorCode & | status | ) |
| static

Returns unit of proportion: karat.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createKelvin | ( | UErrorCode & | status | ) |
| static

Returns unit of temperature: kelvin.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createKilobit | ( | UErrorCode & | status | ) |
| static

Returns unit of digital: kilobit.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createKilobyte | ( | UErrorCode & | status | ) |
| static

Returns unit of digital: kilobyte.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createKilocalorie | ( | UErrorCode & | status | ) |
| static

Returns unit of energy: kilocalorie.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createKilogram | ( | UErrorCode & | status | ) |
| static

Returns unit of mass: kilogram.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createKilohertz | ( | UErrorCode & | status | ) |
| static

Returns unit of frequency: kilohertz.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createKilojoule | ( | UErrorCode & | status | ) |
| static

Returns unit of energy: kilojoule.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createKilometer | ( | UErrorCode & | status | ) |
| static

Returns unit of length: kilometer.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createKilometerPerHour | ( | UErrorCode & | status | ) |
| static

Returns unit of speed: kilometer-per-hour.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createKilowatt | ( | UErrorCode & | status | ) |
| static

Returns unit of power: kilowatt.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createKilowattHour | ( | UErrorCode & | status | ) |
| static

Returns unit of energy: kilowatt-hour.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createLightYear | ( | UErrorCode & | status | ) |
| static

Returns unit of length: light-year.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createLiter | ( | UErrorCode & | status | ) |
| static

Returns unit of volume: liter.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createLiterPerKilometer | ( | UErrorCode & | status | ) |
| static

Returns unit of consumption: liter-per-kilometer.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createLux | ( | UErrorCode & | status | ) |
| static

Returns unit of light: lux.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createMegabit | ( | UErrorCode & | status | ) |
| static

Returns unit of digital: megabit.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createMegabyte | ( | UErrorCode & | status | ) |
| static

Returns unit of digital: megabyte.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createMegahertz | ( | UErrorCode & | status | ) |
| static

Returns unit of frequency: megahertz.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createMegaliter | ( | UErrorCode & | status | ) |
| static

Returns unit of volume: megaliter.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createMegawatt | ( | UErrorCode & | status | ) |
| static

Returns unit of power: megawatt.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createMeter | ( | UErrorCode & | status | ) |
| static

Returns unit of length: meter.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createMeterPerSecond | ( | UErrorCode & | status | ) |
| static

Returns unit of speed: meter-per-second.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createMeterPerSecondSquared | ( | UErrorCode & | status | ) |
| static

Returns unit of acceleration: meter-per-second-squared.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createMetricTon | ( | UErrorCode & | status | ) |
| static

Returns unit of mass: metric-ton.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createMicrogram | ( | UErrorCode & | status | ) |
| static

Returns unit of mass: microgram.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createMicrometer | ( | UErrorCode & | status | ) |
| static

Returns unit of length: micrometer.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createMicrosecond | ( | UErrorCode & | status | ) |
| static

Returns unit of duration: microsecond.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createMile | ( | UErrorCode & | status | ) |
| static

Returns unit of length: mile.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createMilePerGallon | ( | UErrorCode & | status | ) |
| static

Returns unit of consumption: mile-per-gallon.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createMilePerHour | ( | UErrorCode & | status | ) |
| static

Returns unit of speed: mile-per-hour.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createMilliampere | ( | UErrorCode & | status | ) |
| static

Returns unit of electric: milliampere.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createMillibar | ( | UErrorCode & | status | ) |
| static

Returns unit of pressure: millibar.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createMilligram | ( | UErrorCode & | status | ) |
| static

Returns unit of mass: milligram.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createMilliliter | ( | UErrorCode & | status | ) |
| static

Returns unit of volume: milliliter.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createMillimeter | ( | UErrorCode & | status | ) |
| static

Returns unit of length: millimeter.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createMillimeterOfMercury | ( | UErrorCode & | status | ) |
| static

Returns unit of pressure: millimeter-of-mercury.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createMillisecond | ( | UErrorCode & | status | ) |
| static

Returns unit of duration: millisecond.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createMilliwatt | ( | UErrorCode & | status | ) |
| static

Returns unit of power: milliwatt.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createMinute | ( | UErrorCode & | status | ) |
| static

Returns unit of duration: minute.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createMonth | ( | UErrorCode & | status | ) |
| static

Returns unit of duration: month.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createNanometer | ( | UErrorCode & | status | ) |
| static

Returns unit of length: nanometer.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createNanosecond | ( | UErrorCode & | status | ) |
| static

Returns unit of duration: nanosecond.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createNauticalMile | ( | UErrorCode & | status | ) |
| static

Returns unit of length: nautical-mile.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createOhm | ( | UErrorCode & | status | ) |
| static

Returns unit of electric: ohm.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createOunce | ( | UErrorCode & | status | ) |
| static

Returns unit of mass: ounce.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createOunceTroy | ( | UErrorCode & | status | ) |
| static

Returns unit of mass: ounce-troy.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createParsec | ( | UErrorCode & | status | ) |
| static

Returns unit of length: parsec.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createPicometer | ( | UErrorCode & | status | ) |
| static

Returns unit of length: picometer.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createPint | ( | UErrorCode & | status | ) |
| static

Returns unit of volume: pint.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createPound | ( | UErrorCode & | status | ) |
| static

Returns unit of mass: pound.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createPoundPerSquareInch | ( | UErrorCode & | status | ) |
| static

Returns unit of pressure: pound-per-square-inch.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createQuart | ( | UErrorCode & | status | ) |
| static

Returns unit of volume: quart.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createRadian | ( | UErrorCode & | status | ) |
| static

Returns unit of angle: radian.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createSecond | ( | UErrorCode & | status | ) |
| static

Returns unit of duration: second.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createSquareCentimeter | ( | UErrorCode & | status | ) |
| static

Returns unit of area: square-centimeter.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createSquareFoot | ( | UErrorCode & | status | ) |
| static

Returns unit of area: square-foot.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createSquareInch | ( | UErrorCode & | status | ) |
| static

Returns unit of area: square-inch.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createSquareKilometer | ( | UErrorCode & | status | ) |
| static

Returns unit of area: square-kilometer.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createSquareMeter | ( | UErrorCode & | status | ) |
| static

Returns unit of area: square-meter.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createSquareMile | ( | UErrorCode & | status | ) |
| static

Returns unit of area: square-mile.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createSquareYard | ( | UErrorCode & | status | ) |
| static

Returns unit of area: square-yard.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createStone | ( | UErrorCode & | status | ) |
| static

Returns unit of mass: stone.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createTablespoon | ( | UErrorCode & | status | ) |
| static

Returns unit of volume: tablespoon.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createTeaspoon | ( | UErrorCode & | status | ) |
| static

Returns unit of volume: teaspoon.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createTerabit | ( | UErrorCode & | status | ) |
| static

Returns unit of digital: terabit.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createTerabyte | ( | UErrorCode & | status | ) |
| static

Returns unit of digital: terabyte.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createTon | ( | UErrorCode & | status | ) |
| static

Returns unit of mass: ton.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createVolt | ( | UErrorCode & | status | ) |
| static

Returns unit of electric: volt.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Draft:
  This API may be changed in the future versions and was introduced in ICU 54

static MeasureUnit* icu::MeasureUnit::createWatt | ( | UErrorCode & | status | ) |
| static

Returns unit of power: watt.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createWeek | ( | UErrorCode & | status | ) |
| static

Returns unit of duration: week.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createYard | ( | UErrorCode & | status | ) |
| static

Returns unit of length: yard.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static MeasureUnit* icu::MeasureUnit::createYear | ( | UErrorCode & | status | ) |
| static

Returns unit of duration: year.

Caller owns returned value and must free it.

Parameters

  status | ICU error code.

Stable:
  ICU 53

static int32_t icu::MeasureUnit::getAvailable | ( | MeasureUnit * | destArray,
|  | int32_t | destCapacity,
|  | UErrorCode & | errorCode
| ) |  |
| static

getAvailable gets all of the available units.

If there are too many units to fit into destCapacity then the error code is set to U_BUFFER_OVERFLOW_ERROR.

Parameters

  destArray | destination buffer.
  destCapacity | number of MeasureUnit instances available at dest.
  errorCode | ICU error code.

Returns
  number of available units.

Stable:
  ICU 53

static int32_t icu::MeasureUnit::getAvailable | ( | const char * | type,
|  | MeasureUnit * | destArray,
|  | int32_t | destCapacity,
|  | UErrorCode & | errorCode
| ) |  |
| static

getAvailable gets all of the available units for a specific type.

If there are too many units to fit into destCapacity then the error code is set to U_BUFFER_OVERFLOW_ERROR.

Parameters

  type | the type
  destArray | destination buffer.
  destCapacity | number of MeasureUnit instances available at dest.
  errorCode | ICU error code.

Returns
  number of available units for type.

Stable:
  ICU 53

static StringEnumeration* icu::MeasureUnit::getAvailableTypes | ( | UErrorCode & | errorCode | ) |
| static

getAvailableTypes gets all of the available types.

Caller owns the returned StringEnumeration and must delete it when finished using it.

Parameters

  errorCode | ICU error code.

Returns
  the types.

Stable:
  ICU 53

virtual UClassID icu::MeasureUnit::getDynamicClassID | ( | void |  | ) | const
| virtual

Returns a unique class ID POLYMORPHICALLY.

Pure virtual override. This method is to implement a simple version of RTTI, since not all C++ compilers support genuine RTTI. Polymorphic operator==() and clone() methods call this method.

Returns
  The class ID for this object. All objects of a given class have the same class ID. Objects of other classes have different class IDs.

Stable:
  ICU 53

Reimplemented from icu::UObject.

Reimplemented in icu::TimeUnit, and icu::CurrencyUnit.

int32_t icu::MeasureUnit::getIndex | ( |  | ) | const

ICU use only.

Returns associated array index for this measure unit. Only valid for non-currency measure units.

Internal:
  Do not use. This API is for internal use only.

static int32_t icu::MeasureUnit::getIndexCount | ( |  | ) |
| static

ICU use only.

Returns maximum value from getIndex plus 1.

Internal:
  Do not use. This API is for internal use only.

static UClassID icu::MeasureUnit::getStaticClassID | ( | void |  | ) |
| static

Return the class ID for this class.

This is useful only for comparing to a return value from getDynamicClassID(). For example:

    .   Base* polymorphic_pointer = createPolymorphicObject();
    .   if (polymorphic_pointer->getDynamicClassID() ==
    .       erived::getStaticClassID()) ...

Returns
  The class ID for all objects of this class.

Stable:
  ICU 53

Reimplemented in icu::TimeUnit, and icu::CurrencyUnit.

const char* icu::MeasureUnit::getSubtype | ( |  | ) | const

Get the sub type.

Stable:
  ICU 53

const char* icu::MeasureUnit::getType | ( |  | ) | const

Get the type.

Stable:
  ICU 53

void icu::MeasureUnit::initCurrency | ( | const char * | isoCurrency | ) |
| protected

For ICU use only.

Internal:
  Do not use. This API is for internal use only.

void icu::MeasureUnit::initTime | ( | const char * | timeId | ) |
| protected

For ICU use only.

Internal:
  Do not use. This API is for internal use only.

UBool icu::MeasureUnit::operator!= | ( | const UObject & | other | ) | const
| inline

Inequality operator.

Return true if this object is not equal to the given object.

Stable:
  ICU 53

Definition at line 84 of file measunit.h.

MeasureUnit& icu::MeasureUnit::operator= | ( | const MeasureUnit & | other | ) |

Assignment operator.

Stable:
  ICU 3.0

virtual UBool icu::MeasureUnit::operator== | ( | const UObject & | other | ) | const
| virtual

Equality operator.

Return true if this object is equal to the given object.

Stable:
  ICU 3.0

static MeasureUnit* icu::MeasureUnit::resolveUnitPerUnit | ( | const MeasureUnit & | unit,
|  | const MeasureUnit & | perUnit
| ) |  |
| static

ICU use only.

Internal:
  Do not use. This API is for internal use only.

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

- measunit.h