X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/b331163bffd790ced0e88b73f44f86d49ccc48a5..a01113dcd0f39d5da295ef82785beff9ed86fe38:/icuSources/i18n/measunit.cpp diff --git a/icuSources/i18n/measunit.cpp b/icuSources/i18n/measunit.cpp index f72ddb27..9ae7aebe 100644 --- a/icuSources/i18n/measunit.cpp +++ b/icuSources/i18n/measunit.cpp @@ -1,6 +1,8 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** -* Copyright (c) 2004-2015, International Business Machines +* Copyright (c) 2004-2016, International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************** * Author: Alan Liu @@ -31,50 +33,57 @@ UOBJECT_DEFINE_RTTI_IMPLEMENTATION(MeasureUnit) // // Start generated code + static const int32_t gOffsets[] = { 0, 2, - 6, - 15, + 7, 17, - 277, - 287, - 297, - 301, - 307, - 311, - 329, - 330, - 341, - 347, - 352, - 353, - 356, - 360, - 382 + 25, + 29, + 328, + 339, + 354, + 358, + 366, + 368, + 372, + 393, + 395, + 409, + 412, + 418, + 426, + 430, + 434, + 436, + 463 }; static const int32_t gIndexes[] = { 0, 2, - 6, - 15, - 17, + 7, 17, - 27, - 37, - 41, - 47, - 51, + 25, + 29, + 29, + 40, + 55, + 59, + 67, 69, - 70, - 81, - 87, - 92, - 93, + 73, + 94, 96, - 100, - 122 + 110, + 113, + 119, + 127, + 131, + 135, + 137, + 164 }; // Must be sorted alphabetically. @@ -82,21 +91,24 @@ static const char * const gTypes[] = { "acceleration", "angle", "area", + "concentr", "consumption", "currency", "digital", "duration", "electric", "energy", + "force", "frequency", "length", "light", "mass", + "none", "power", "pressure", - "proportion", "speed", "temperature", + "torque", "volume" }; @@ -108,7 +120,9 @@ static const char * const gSubTypes[] = { "arc-second", "degree", "radian", + "revolution", "acre", + "dunam", "hectare", "square-centimeter", "square-foot", @@ -117,21 +131,34 @@ static const char * const gSubTypes[] = { "square-meter", "square-mile", "square-yard", + "karat", + "milligram-per-deciliter", + "millimole-per-liter", + "mole", + "part-per-million", + "percent", + "permille", + "permyriad", + "liter-per-100kilometers", "liter-per-kilometer", "mile-per-gallon", + "mile-per-gallon-imperial", "ADP", "AED", "AFA", "AFN", + "ALK", "ALL", "AMD", "ANG", "AOA", + "AOK", "AON", "AOR", "ARA", "ARP", "ARS", + "ARY", "ATS", "AUD", "AWG", @@ -145,6 +172,8 @@ static const char * const gSubTypes[] = { "BEC", "BEF", "BEL", + "BGJ", + "BGK", "BGL", "BGN", "BHD", @@ -152,7 +181,9 @@ static const char * const gSubTypes[] = { "BMD", "BND", "BOB", + "BOP", "BOV", + "BRB", "BRC", "BRE", "BRL", @@ -160,8 +191,10 @@ static const char * const gSubTypes[] = { "BRR", "BSD", "BTN", + "BUK", "BWP", "BYB", + "BYN", "BYR", "BZD", "CAD", @@ -177,6 +210,7 @@ static const char * const gSubTypes[] = { "COU", "CRC", "CSD", + "CSJ", "CSK", "CUC", "CUP", @@ -211,10 +245,13 @@ static const char * const gSubTypes[] = { "GHS", "GIP", "GMD", + "GNE", "GNF", + "GNS", "GQE", "GRD", "GTQ", + "GWE", "GWP", "GYD", "HKD", @@ -225,10 +262,13 @@ static const char * const gSubTypes[] = { "HUF", "IDR", "IEP", + "ILP", + "ILR", "ILS", "INR", "IQD", "IRR", + "ISJ", "ISK", "ITL", "JMD", @@ -243,11 +283,13 @@ static const char * const gSubTypes[] = { "KWD", "KYD", "KZT", + "LAJ", "LAK", "LBP", "LKR", "LRD", "LSL", + "LSM", "LTL", "LTT", "LUC", @@ -266,17 +308,23 @@ static const char * const gSubTypes[] = { "MNT", "MOP", "MRO", + "MRU", "MTL", + "MTP", "MUR", + "MVQ", "MVR", "MWK", "MXN", + "MXP", "MXV", "MYR", + "MZE", "MZM", "MZN", "NAD", "NGN", + "NIC", "NIO", "NLG", "NOK", @@ -284,6 +332,7 @@ static const char * const gSubTypes[] = { "NZD", "OMR", "PAB", + "PEH", "PEI", "PEN", "PES", @@ -295,6 +344,8 @@ static const char * const gSubTypes[] = { "PTE", "PYG", "QAR", + "RHD", + "ROK", "ROL", "RON", "RSD", @@ -306,6 +357,7 @@ static const char * const gSubTypes[] = { "SCR", "SDD", "SDG", + "SDP", "SEK", "SGD", "SHP", @@ -317,6 +369,8 @@ static const char * const gSubTypes[] = { "SRG", "SSP", "STD", + "STN", + "SUR", "SVC", "SYP", "SZL", @@ -335,15 +389,22 @@ static const char * const gSubTypes[] = { "TZS", "UAH", "UAK", + "UGS", + "UGW", "UGX", "USD", "USN", "USS", "UYI", + "UYN", + "UYP", "UYU", + "UYW", "UZS", "VEB", "VEF", + "VES", + "VNC", "VND", "VUV", "WST", @@ -367,6 +428,7 @@ static const char * const gSubTypes[] = { "XXX", "YDD", "YER", + "YUD", "YUM", "YUN", "ZAL", @@ -375,6 +437,7 @@ static const char * const gSubTypes[] = { "ZMW", "ZRN", "ZRZ", + "ZWC", "ZWD", "ZWL", "ZWN", @@ -387,28 +450,38 @@ static const char * const gSubTypes[] = { "kilobyte", "megabit", "megabyte", + "petabyte", "terabit", "terabyte", + "century", "day", + "day-person", "hour", "microsecond", "millisecond", "minute", "month", + "month-person", "nanosecond", "second", "week", + "week-person", "year", + "year-person", "ampere", "milliampere", "ohm", "volt", + "british-thermal-unit", "calorie", + "electronvolt", "foodcalorie", "joule", "kilocalorie", "kilojoule", "kilowatt-hour", + "newton", + "pound-force", "gigahertz", "hertz", "kilohertz", @@ -425,14 +498,20 @@ static const char * const gSubTypes[] = { "meter", "micrometer", "mile", + "mile-scandinavian", "millimeter", "nanometer", "nautical-mile", "parsec", "picometer", + "point", + "solar-radius", "yard", "lux", + "solar-luminosity", "carat", + "dalton", + "earth-mass", "gram", "kilogram", "metric-ton", @@ -441,28 +520,38 @@ static const char * const gSubTypes[] = { "ounce", "ounce-troy", "pound", + "solar-mass", "stone", "ton", + "base", + "percent", + "permille", "gigawatt", "horsepower", "kilowatt", "megawatt", "milliwatt", "watt", + "atmosphere", "hectopascal", "inch-hg", + "kilopascal", + "megapascal", "millibar", "millimeter-of-mercury", "pound-per-square-inch", - "karat", "kilometer-per-hour", + "knot", "meter-per-second", "mile-per-hour", "celsius", "fahrenheit", - "kelvin", "generic", + "kelvin", + "newton-meter", + "pound-foot", "acre-foot", + "barrel", "bushel", "centiliter", "cubic-centimeter", @@ -473,14 +562,18 @@ static const char * const gSubTypes[] = { "cubic-mile", "cubic-yard", "cup", + "cup-metric", "deciliter", "fluid-ounce", + "fluid-ounce-imperial", "gallon", + "gallon-imperial", "hectoliter", "liter", "megaliter", "milliliter", "pint", + "pint-metric", "quart", "tablespoon", "teaspoon" @@ -488,501 +581,1306 @@ static const char * const gSubTypes[] = { // Must be sorted by first value and then second value. static int32_t unitPerUnitToSingleUnit[][4] = { - {318, 288, 16, 0}, - {320, 294, 16, 1}, - {322, 288, 16, 2}, - {322, 372, 3, 1}, - {338, 10, 14, 4}, - {375, 318, 3, 0} + {379, 342, 18, 0}, + {381, 349, 18, 2}, + {383, 342, 18, 3}, + {383, 452, 4, 2}, + {383, 453, 4, 3}, + {402, 449, 3, 1}, + {405, 12, 17, 7}, + {455, 379, 4, 1} }; +// Shortcuts to the base unit in order to make the default constructor fast +static const int32_t kBaseTypeIdx = 15; +static const int32_t kBaseSubTypeIdx = 0; + MeasureUnit *MeasureUnit::createGForce(UErrorCode &status) { return MeasureUnit::create(0, 0, status); } +MeasureUnit MeasureUnit::getGForce() { + return MeasureUnit(0, 0); +} + MeasureUnit *MeasureUnit::createMeterPerSecondSquared(UErrorCode &status) { return MeasureUnit::create(0, 1, status); } +MeasureUnit MeasureUnit::getMeterPerSecondSquared() { + return MeasureUnit(0, 1); +} + MeasureUnit *MeasureUnit::createArcMinute(UErrorCode &status) { return MeasureUnit::create(1, 0, status); } +MeasureUnit MeasureUnit::getArcMinute() { + return MeasureUnit(1, 0); +} + MeasureUnit *MeasureUnit::createArcSecond(UErrorCode &status) { return MeasureUnit::create(1, 1, status); } +MeasureUnit MeasureUnit::getArcSecond() { + return MeasureUnit(1, 1); +} + MeasureUnit *MeasureUnit::createDegree(UErrorCode &status) { return MeasureUnit::create(1, 2, status); } +MeasureUnit MeasureUnit::getDegree() { + return MeasureUnit(1, 2); +} + MeasureUnit *MeasureUnit::createRadian(UErrorCode &status) { return MeasureUnit::create(1, 3, status); } -MeasureUnit *MeasureUnit::createAcre(UErrorCode &status) { - return MeasureUnit::create(2, 0, status); +MeasureUnit MeasureUnit::getRadian() { + return MeasureUnit(1, 3); } -MeasureUnit *MeasureUnit::createHectare(UErrorCode &status) { - return MeasureUnit::create(2, 1, status); +MeasureUnit *MeasureUnit::createRevolutionAngle(UErrorCode &status) { + return MeasureUnit::create(1, 4, status); } -MeasureUnit *MeasureUnit::createSquareCentimeter(UErrorCode &status) { - return MeasureUnit::create(2, 2, status); +MeasureUnit MeasureUnit::getRevolutionAngle() { + return MeasureUnit(1, 4); } -MeasureUnit *MeasureUnit::createSquareFoot(UErrorCode &status) { - return MeasureUnit::create(2, 3, status); +MeasureUnit *MeasureUnit::createAcre(UErrorCode &status) { + return MeasureUnit::create(2, 0, status); } -MeasureUnit *MeasureUnit::createSquareInch(UErrorCode &status) { - return MeasureUnit::create(2, 4, status); +MeasureUnit MeasureUnit::getAcre() { + return MeasureUnit(2, 0); } -MeasureUnit *MeasureUnit::createSquareKilometer(UErrorCode &status) { - return MeasureUnit::create(2, 5, status); +MeasureUnit *MeasureUnit::createDunam(UErrorCode &status) { + return MeasureUnit::create(2, 1, status); } -MeasureUnit *MeasureUnit::createSquareMeter(UErrorCode &status) { - return MeasureUnit::create(2, 6, status); +MeasureUnit MeasureUnit::getDunam() { + return MeasureUnit(2, 1); } -MeasureUnit *MeasureUnit::createSquareMile(UErrorCode &status) { - return MeasureUnit::create(2, 7, status); +MeasureUnit *MeasureUnit::createHectare(UErrorCode &status) { + return MeasureUnit::create(2, 2, status); } -MeasureUnit *MeasureUnit::createSquareYard(UErrorCode &status) { - return MeasureUnit::create(2, 8, status); +MeasureUnit MeasureUnit::getHectare() { + return MeasureUnit(2, 2); } -MeasureUnit *MeasureUnit::createLiterPerKilometer(UErrorCode &status) { - return MeasureUnit::create(3, 0, status); +MeasureUnit *MeasureUnit::createSquareCentimeter(UErrorCode &status) { + return MeasureUnit::create(2, 3, status); } -MeasureUnit *MeasureUnit::createMilePerGallon(UErrorCode &status) { - return MeasureUnit::create(3, 1, status); +MeasureUnit MeasureUnit::getSquareCentimeter() { + return MeasureUnit(2, 3); } -MeasureUnit *MeasureUnit::createBit(UErrorCode &status) { - return MeasureUnit::create(5, 0, status); +MeasureUnit *MeasureUnit::createSquareFoot(UErrorCode &status) { + return MeasureUnit::create(2, 4, status); } -MeasureUnit *MeasureUnit::createByte(UErrorCode &status) { - return MeasureUnit::create(5, 1, status); +MeasureUnit MeasureUnit::getSquareFoot() { + return MeasureUnit(2, 4); } -MeasureUnit *MeasureUnit::createGigabit(UErrorCode &status) { - return MeasureUnit::create(5, 2, status); +MeasureUnit *MeasureUnit::createSquareInch(UErrorCode &status) { + return MeasureUnit::create(2, 5, status); } -MeasureUnit *MeasureUnit::createGigabyte(UErrorCode &status) { - return MeasureUnit::create(5, 3, status); +MeasureUnit MeasureUnit::getSquareInch() { + return MeasureUnit(2, 5); } -MeasureUnit *MeasureUnit::createKilobit(UErrorCode &status) { - return MeasureUnit::create(5, 4, status); +MeasureUnit *MeasureUnit::createSquareKilometer(UErrorCode &status) { + return MeasureUnit::create(2, 6, status); } -MeasureUnit *MeasureUnit::createKilobyte(UErrorCode &status) { - return MeasureUnit::create(5, 5, status); +MeasureUnit MeasureUnit::getSquareKilometer() { + return MeasureUnit(2, 6); } -MeasureUnit *MeasureUnit::createMegabit(UErrorCode &status) { - return MeasureUnit::create(5, 6, status); +MeasureUnit *MeasureUnit::createSquareMeter(UErrorCode &status) { + return MeasureUnit::create(2, 7, status); } -MeasureUnit *MeasureUnit::createMegabyte(UErrorCode &status) { - return MeasureUnit::create(5, 7, status); +MeasureUnit MeasureUnit::getSquareMeter() { + return MeasureUnit(2, 7); } -MeasureUnit *MeasureUnit::createTerabit(UErrorCode &status) { - return MeasureUnit::create(5, 8, status); +MeasureUnit *MeasureUnit::createSquareMile(UErrorCode &status) { + return MeasureUnit::create(2, 8, status); } -MeasureUnit *MeasureUnit::createTerabyte(UErrorCode &status) { - return MeasureUnit::create(5, 9, status); +MeasureUnit MeasureUnit::getSquareMile() { + return MeasureUnit(2, 8); } -MeasureUnit *MeasureUnit::createDay(UErrorCode &status) { - return MeasureUnit::create(6, 0, status); +MeasureUnit *MeasureUnit::createSquareYard(UErrorCode &status) { + return MeasureUnit::create(2, 9, status); } -MeasureUnit *MeasureUnit::createHour(UErrorCode &status) { - return MeasureUnit::create(6, 1, status); +MeasureUnit MeasureUnit::getSquareYard() { + return MeasureUnit(2, 9); } -MeasureUnit *MeasureUnit::createMicrosecond(UErrorCode &status) { - return MeasureUnit::create(6, 2, status); +MeasureUnit *MeasureUnit::createKarat(UErrorCode &status) { + return MeasureUnit::create(3, 0, status); } -MeasureUnit *MeasureUnit::createMillisecond(UErrorCode &status) { - return MeasureUnit::create(6, 3, status); +MeasureUnit MeasureUnit::getKarat() { + return MeasureUnit(3, 0); } -MeasureUnit *MeasureUnit::createMinute(UErrorCode &status) { - return MeasureUnit::create(6, 4, status); +MeasureUnit *MeasureUnit::createMilligramPerDeciliter(UErrorCode &status) { + return MeasureUnit::create(3, 1, status); } -MeasureUnit *MeasureUnit::createMonth(UErrorCode &status) { - return MeasureUnit::create(6, 5, status); +MeasureUnit MeasureUnit::getMilligramPerDeciliter() { + return MeasureUnit(3, 1); } -MeasureUnit *MeasureUnit::createNanosecond(UErrorCode &status) { - return MeasureUnit::create(6, 6, status); +MeasureUnit *MeasureUnit::createMillimolePerLiter(UErrorCode &status) { + return MeasureUnit::create(3, 2, status); } -MeasureUnit *MeasureUnit::createSecond(UErrorCode &status) { - return MeasureUnit::create(6, 7, status); +MeasureUnit MeasureUnit::getMillimolePerLiter() { + return MeasureUnit(3, 2); } -MeasureUnit *MeasureUnit::createWeek(UErrorCode &status) { - return MeasureUnit::create(6, 8, status); +MeasureUnit *MeasureUnit::createMole(UErrorCode &status) { + return MeasureUnit::create(3, 3, status); } -MeasureUnit *MeasureUnit::createYear(UErrorCode &status) { - return MeasureUnit::create(6, 9, status); +MeasureUnit MeasureUnit::getMole() { + return MeasureUnit(3, 3); } -MeasureUnit *MeasureUnit::createAmpere(UErrorCode &status) { - return MeasureUnit::create(7, 0, status); +MeasureUnit *MeasureUnit::createPartPerMillion(UErrorCode &status) { + return MeasureUnit::create(3, 4, status); } -MeasureUnit *MeasureUnit::createMilliampere(UErrorCode &status) { - return MeasureUnit::create(7, 1, status); +MeasureUnit MeasureUnit::getPartPerMillion() { + return MeasureUnit(3, 4); } -MeasureUnit *MeasureUnit::createOhm(UErrorCode &status) { - return MeasureUnit::create(7, 2, status); +MeasureUnit *MeasureUnit::createPercent(UErrorCode &status) { + return MeasureUnit::create(3, 5, status); } -MeasureUnit *MeasureUnit::createVolt(UErrorCode &status) { - return MeasureUnit::create(7, 3, status); +MeasureUnit MeasureUnit::getPercent() { + return MeasureUnit(3, 5); } -MeasureUnit *MeasureUnit::createCalorie(UErrorCode &status) { - return MeasureUnit::create(8, 0, status); +MeasureUnit *MeasureUnit::createPermille(UErrorCode &status) { + return MeasureUnit::create(3, 6, status); } -MeasureUnit *MeasureUnit::createFoodcalorie(UErrorCode &status) { - return MeasureUnit::create(8, 1, status); +MeasureUnit MeasureUnit::getPermille() { + return MeasureUnit(3, 6); } -MeasureUnit *MeasureUnit::createJoule(UErrorCode &status) { - return MeasureUnit::create(8, 2, status); +MeasureUnit *MeasureUnit::createPermyriad(UErrorCode &status) { + return MeasureUnit::create(3, 7, status); } -MeasureUnit *MeasureUnit::createKilocalorie(UErrorCode &status) { - return MeasureUnit::create(8, 3, status); +MeasureUnit MeasureUnit::getPermyriad() { + return MeasureUnit(3, 7); } -MeasureUnit *MeasureUnit::createKilojoule(UErrorCode &status) { - return MeasureUnit::create(8, 4, status); +MeasureUnit *MeasureUnit::createLiterPer100Kilometers(UErrorCode &status) { + return MeasureUnit::create(4, 0, status); } -MeasureUnit *MeasureUnit::createKilowattHour(UErrorCode &status) { - return MeasureUnit::create(8, 5, status); +MeasureUnit MeasureUnit::getLiterPer100Kilometers() { + return MeasureUnit(4, 0); } -MeasureUnit *MeasureUnit::createGigahertz(UErrorCode &status) { - return MeasureUnit::create(9, 0, status); +MeasureUnit *MeasureUnit::createLiterPerKilometer(UErrorCode &status) { + return MeasureUnit::create(4, 1, status); } -MeasureUnit *MeasureUnit::createHertz(UErrorCode &status) { - return MeasureUnit::create(9, 1, status); +MeasureUnit MeasureUnit::getLiterPerKilometer() { + return MeasureUnit(4, 1); } -MeasureUnit *MeasureUnit::createKilohertz(UErrorCode &status) { - return MeasureUnit::create(9, 2, status); +MeasureUnit *MeasureUnit::createMilePerGallon(UErrorCode &status) { + return MeasureUnit::create(4, 2, status); } -MeasureUnit *MeasureUnit::createMegahertz(UErrorCode &status) { - return MeasureUnit::create(9, 3, status); +MeasureUnit MeasureUnit::getMilePerGallon() { + return MeasureUnit(4, 2); } -MeasureUnit *MeasureUnit::createAstronomicalUnit(UErrorCode &status) { - return MeasureUnit::create(10, 0, status); +MeasureUnit *MeasureUnit::createMilePerGallonImperial(UErrorCode &status) { + return MeasureUnit::create(4, 3, status); } -MeasureUnit *MeasureUnit::createCentimeter(UErrorCode &status) { - return MeasureUnit::create(10, 1, status); +MeasureUnit MeasureUnit::getMilePerGallonImperial() { + return MeasureUnit(4, 3); } -MeasureUnit *MeasureUnit::createDecimeter(UErrorCode &status) { - return MeasureUnit::create(10, 2, status); +MeasureUnit *MeasureUnit::createBit(UErrorCode &status) { + return MeasureUnit::create(6, 0, status); } -MeasureUnit *MeasureUnit::createFathom(UErrorCode &status) { - return MeasureUnit::create(10, 3, status); +MeasureUnit MeasureUnit::getBit() { + return MeasureUnit(6, 0); } -MeasureUnit *MeasureUnit::createFoot(UErrorCode &status) { - return MeasureUnit::create(10, 4, status); +MeasureUnit *MeasureUnit::createByte(UErrorCode &status) { + return MeasureUnit::create(6, 1, status); } -MeasureUnit *MeasureUnit::createFurlong(UErrorCode &status) { - return MeasureUnit::create(10, 5, status); +MeasureUnit MeasureUnit::getByte() { + return MeasureUnit(6, 1); } -MeasureUnit *MeasureUnit::createInch(UErrorCode &status) { - return MeasureUnit::create(10, 6, status); +MeasureUnit *MeasureUnit::createGigabit(UErrorCode &status) { + return MeasureUnit::create(6, 2, status); } -MeasureUnit *MeasureUnit::createKilometer(UErrorCode &status) { - return MeasureUnit::create(10, 7, status); +MeasureUnit MeasureUnit::getGigabit() { + return MeasureUnit(6, 2); } -MeasureUnit *MeasureUnit::createLightYear(UErrorCode &status) { - return MeasureUnit::create(10, 8, status); +MeasureUnit *MeasureUnit::createGigabyte(UErrorCode &status) { + return MeasureUnit::create(6, 3, status); } -MeasureUnit *MeasureUnit::createMeter(UErrorCode &status) { - return MeasureUnit::create(10, 9, status); +MeasureUnit MeasureUnit::getGigabyte() { + return MeasureUnit(6, 3); } -MeasureUnit *MeasureUnit::createMicrometer(UErrorCode &status) { - return MeasureUnit::create(10, 10, status); +MeasureUnit *MeasureUnit::createKilobit(UErrorCode &status) { + return MeasureUnit::create(6, 4, status); } -MeasureUnit *MeasureUnit::createMile(UErrorCode &status) { - return MeasureUnit::create(10, 11, status); +MeasureUnit MeasureUnit::getKilobit() { + return MeasureUnit(6, 4); } -MeasureUnit *MeasureUnit::createMillimeter(UErrorCode &status) { - return MeasureUnit::create(10, 12, status); +MeasureUnit *MeasureUnit::createKilobyte(UErrorCode &status) { + return MeasureUnit::create(6, 5, status); } -MeasureUnit *MeasureUnit::createNanometer(UErrorCode &status) { - return MeasureUnit::create(10, 13, status); +MeasureUnit MeasureUnit::getKilobyte() { + return MeasureUnit(6, 5); } -MeasureUnit *MeasureUnit::createNauticalMile(UErrorCode &status) { - return MeasureUnit::create(10, 14, status); +MeasureUnit *MeasureUnit::createMegabit(UErrorCode &status) { + return MeasureUnit::create(6, 6, status); } -MeasureUnit *MeasureUnit::createParsec(UErrorCode &status) { - return MeasureUnit::create(10, 15, status); +MeasureUnit MeasureUnit::getMegabit() { + return MeasureUnit(6, 6); } -MeasureUnit *MeasureUnit::createPicometer(UErrorCode &status) { - return MeasureUnit::create(10, 16, status); +MeasureUnit *MeasureUnit::createMegabyte(UErrorCode &status) { + return MeasureUnit::create(6, 7, status); } -MeasureUnit *MeasureUnit::createYard(UErrorCode &status) { - return MeasureUnit::create(10, 17, status); +MeasureUnit MeasureUnit::getMegabyte() { + return MeasureUnit(6, 7); } -MeasureUnit *MeasureUnit::createLux(UErrorCode &status) { - return MeasureUnit::create(11, 0, status); +MeasureUnit *MeasureUnit::createPetabyte(UErrorCode &status) { + return MeasureUnit::create(6, 8, status); } -MeasureUnit *MeasureUnit::createCarat(UErrorCode &status) { - return MeasureUnit::create(12, 0, status); +MeasureUnit MeasureUnit::getPetabyte() { + return MeasureUnit(6, 8); } -MeasureUnit *MeasureUnit::createGram(UErrorCode &status) { - return MeasureUnit::create(12, 1, status); +MeasureUnit *MeasureUnit::createTerabit(UErrorCode &status) { + return MeasureUnit::create(6, 9, status); } -MeasureUnit *MeasureUnit::createKilogram(UErrorCode &status) { - return MeasureUnit::create(12, 2, status); +MeasureUnit MeasureUnit::getTerabit() { + return MeasureUnit(6, 9); } -MeasureUnit *MeasureUnit::createMetricTon(UErrorCode &status) { - return MeasureUnit::create(12, 3, status); +MeasureUnit *MeasureUnit::createTerabyte(UErrorCode &status) { + return MeasureUnit::create(6, 10, status); } -MeasureUnit *MeasureUnit::createMicrogram(UErrorCode &status) { - return MeasureUnit::create(12, 4, status); +MeasureUnit MeasureUnit::getTerabyte() { + return MeasureUnit(6, 10); } -MeasureUnit *MeasureUnit::createMilligram(UErrorCode &status) { - return MeasureUnit::create(12, 5, status); +MeasureUnit *MeasureUnit::createCentury(UErrorCode &status) { + return MeasureUnit::create(7, 0, status); } -MeasureUnit *MeasureUnit::createOunce(UErrorCode &status) { - return MeasureUnit::create(12, 6, status); +MeasureUnit MeasureUnit::getCentury() { + return MeasureUnit(7, 0); } -MeasureUnit *MeasureUnit::createOunceTroy(UErrorCode &status) { - return MeasureUnit::create(12, 7, status); +MeasureUnit *MeasureUnit::createDay(UErrorCode &status) { + return MeasureUnit::create(7, 1, status); } -MeasureUnit *MeasureUnit::createPound(UErrorCode &status) { - return MeasureUnit::create(12, 8, status); +MeasureUnit MeasureUnit::getDay() { + return MeasureUnit(7, 1); } -MeasureUnit *MeasureUnit::createStone(UErrorCode &status) { - return MeasureUnit::create(12, 9, status); +MeasureUnit *MeasureUnit::createDayPerson(UErrorCode &status) { + return MeasureUnit::create(7, 2, status); } -MeasureUnit *MeasureUnit::createTon(UErrorCode &status) { - return MeasureUnit::create(12, 10, status); +MeasureUnit MeasureUnit::getDayPerson() { + return MeasureUnit(7, 2); } -MeasureUnit *MeasureUnit::createGigawatt(UErrorCode &status) { - return MeasureUnit::create(13, 0, status); +MeasureUnit *MeasureUnit::createHour(UErrorCode &status) { + return MeasureUnit::create(7, 3, status); } -MeasureUnit *MeasureUnit::createHorsepower(UErrorCode &status) { - return MeasureUnit::create(13, 1, status); +MeasureUnit MeasureUnit::getHour() { + return MeasureUnit(7, 3); } -MeasureUnit *MeasureUnit::createKilowatt(UErrorCode &status) { - return MeasureUnit::create(13, 2, status); +MeasureUnit *MeasureUnit::createMicrosecond(UErrorCode &status) { + return MeasureUnit::create(7, 4, status); } -MeasureUnit *MeasureUnit::createMegawatt(UErrorCode &status) { - return MeasureUnit::create(13, 3, status); +MeasureUnit MeasureUnit::getMicrosecond() { + return MeasureUnit(7, 4); } -MeasureUnit *MeasureUnit::createMilliwatt(UErrorCode &status) { - return MeasureUnit::create(13, 4, status); +MeasureUnit *MeasureUnit::createMillisecond(UErrorCode &status) { + return MeasureUnit::create(7, 5, status); } -MeasureUnit *MeasureUnit::createWatt(UErrorCode &status) { - return MeasureUnit::create(13, 5, status); +MeasureUnit MeasureUnit::getMillisecond() { + return MeasureUnit(7, 5); } -MeasureUnit *MeasureUnit::createHectopascal(UErrorCode &status) { - return MeasureUnit::create(14, 0, status); +MeasureUnit *MeasureUnit::createMinute(UErrorCode &status) { + return MeasureUnit::create(7, 6, status); } -MeasureUnit *MeasureUnit::createInchHg(UErrorCode &status) { - return MeasureUnit::create(14, 1, status); +MeasureUnit MeasureUnit::getMinute() { + return MeasureUnit(7, 6); } -MeasureUnit *MeasureUnit::createMillibar(UErrorCode &status) { - return MeasureUnit::create(14, 2, status); +MeasureUnit *MeasureUnit::createMonth(UErrorCode &status) { + return MeasureUnit::create(7, 7, status); } -MeasureUnit *MeasureUnit::createMillimeterOfMercury(UErrorCode &status) { - return MeasureUnit::create(14, 3, status); +MeasureUnit MeasureUnit::getMonth() { + return MeasureUnit(7, 7); } -MeasureUnit *MeasureUnit::createPoundPerSquareInch(UErrorCode &status) { - return MeasureUnit::create(14, 4, status); +MeasureUnit *MeasureUnit::createMonthPerson(UErrorCode &status) { + return MeasureUnit::create(7, 8, status); } -MeasureUnit *MeasureUnit::createKarat(UErrorCode &status) { - return MeasureUnit::create(15, 0, status); +MeasureUnit MeasureUnit::getMonthPerson() { + return MeasureUnit(7, 8); } -MeasureUnit *MeasureUnit::createKilometerPerHour(UErrorCode &status) { - return MeasureUnit::create(16, 0, status); +MeasureUnit *MeasureUnit::createNanosecond(UErrorCode &status) { + return MeasureUnit::create(7, 9, status); } -MeasureUnit *MeasureUnit::createMeterPerSecond(UErrorCode &status) { - return MeasureUnit::create(16, 1, status); +MeasureUnit MeasureUnit::getNanosecond() { + return MeasureUnit(7, 9); } -MeasureUnit *MeasureUnit::createMilePerHour(UErrorCode &status) { - return MeasureUnit::create(16, 2, status); +MeasureUnit *MeasureUnit::createSecond(UErrorCode &status) { + return MeasureUnit::create(7, 10, status); } -MeasureUnit *MeasureUnit::createCelsius(UErrorCode &status) { - return MeasureUnit::create(17, 0, status); +MeasureUnit MeasureUnit::getSecond() { + return MeasureUnit(7, 10); } -MeasureUnit *MeasureUnit::createFahrenheit(UErrorCode &status) { - return MeasureUnit::create(17, 1, status); +MeasureUnit *MeasureUnit::createWeek(UErrorCode &status) { + return MeasureUnit::create(7, 11, status); } -MeasureUnit *MeasureUnit::createKelvin(UErrorCode &status) { - return MeasureUnit::create(17, 2, status); +MeasureUnit MeasureUnit::getWeek() { + return MeasureUnit(7, 11); } -// Apple-specific for now -MeasureUnit *MeasureUnit::createGenericTemperature(UErrorCode &status) { - return MeasureUnit::create(17, 3, status); +MeasureUnit *MeasureUnit::createWeekPerson(UErrorCode &status) { + return MeasureUnit::create(7, 12, status); } -MeasureUnit *MeasureUnit::createAcreFoot(UErrorCode &status) { - return MeasureUnit::create(18, 0, status); +MeasureUnit MeasureUnit::getWeekPerson() { + return MeasureUnit(7, 12); } -MeasureUnit *MeasureUnit::createBushel(UErrorCode &status) { - return MeasureUnit::create(18, 1, status); +MeasureUnit *MeasureUnit::createYear(UErrorCode &status) { + return MeasureUnit::create(7, 13, status); } -MeasureUnit *MeasureUnit::createCentiliter(UErrorCode &status) { - return MeasureUnit::create(18, 2, status); +MeasureUnit MeasureUnit::getYear() { + return MeasureUnit(7, 13); } -MeasureUnit *MeasureUnit::createCubicCentimeter(UErrorCode &status) { - return MeasureUnit::create(18, 3, status); +MeasureUnit *MeasureUnit::createYearPerson(UErrorCode &status) { + return MeasureUnit::create(7, 14, status); } -MeasureUnit *MeasureUnit::createCubicFoot(UErrorCode &status) { - return MeasureUnit::create(18, 4, status); +MeasureUnit MeasureUnit::getYearPerson() { + return MeasureUnit(7, 14); } -MeasureUnit *MeasureUnit::createCubicInch(UErrorCode &status) { - return MeasureUnit::create(18, 5, status); +MeasureUnit *MeasureUnit::createAmpere(UErrorCode &status) { + return MeasureUnit::create(8, 0, status); } -MeasureUnit *MeasureUnit::createCubicKilometer(UErrorCode &status) { - return MeasureUnit::create(18, 6, status); +MeasureUnit MeasureUnit::getAmpere() { + return MeasureUnit(8, 0); } -MeasureUnit *MeasureUnit::createCubicMeter(UErrorCode &status) { - return MeasureUnit::create(18, 7, status); +MeasureUnit *MeasureUnit::createMilliampere(UErrorCode &status) { + return MeasureUnit::create(8, 1, status); } -MeasureUnit *MeasureUnit::createCubicMile(UErrorCode &status) { - return MeasureUnit::create(18, 8, status); +MeasureUnit MeasureUnit::getMilliampere() { + return MeasureUnit(8, 1); } -MeasureUnit *MeasureUnit::createCubicYard(UErrorCode &status) { - return MeasureUnit::create(18, 9, status); +MeasureUnit *MeasureUnit::createOhm(UErrorCode &status) { + return MeasureUnit::create(8, 2, status); } -MeasureUnit *MeasureUnit::createCup(UErrorCode &status) { - return MeasureUnit::create(18, 10, status); +MeasureUnit MeasureUnit::getOhm() { + return MeasureUnit(8, 2); } -MeasureUnit *MeasureUnit::createDeciliter(UErrorCode &status) { - return MeasureUnit::create(18, 11, status); +MeasureUnit *MeasureUnit::createVolt(UErrorCode &status) { + return MeasureUnit::create(8, 3, status); } -MeasureUnit *MeasureUnit::createFluidOunce(UErrorCode &status) { - return MeasureUnit::create(18, 12, status); +MeasureUnit MeasureUnit::getVolt() { + return MeasureUnit(8, 3); } -MeasureUnit *MeasureUnit::createGallon(UErrorCode &status) { - return MeasureUnit::create(18, 13, status); +MeasureUnit *MeasureUnit::createBritishThermalUnit(UErrorCode &status) { + return MeasureUnit::create(9, 0, status); +} + +MeasureUnit MeasureUnit::getBritishThermalUnit() { + return MeasureUnit(9, 0); +} + +MeasureUnit *MeasureUnit::createCalorie(UErrorCode &status) { + return MeasureUnit::create(9, 1, status); +} + +MeasureUnit MeasureUnit::getCalorie() { + return MeasureUnit(9, 1); +} + +MeasureUnit *MeasureUnit::createElectronvolt(UErrorCode &status) { + return MeasureUnit::create(9, 2, status); +} + +MeasureUnit MeasureUnit::getElectronvolt() { + return MeasureUnit(9, 2); +} + +MeasureUnit *MeasureUnit::createFoodcalorie(UErrorCode &status) { + return MeasureUnit::create(9, 3, status); +} + +MeasureUnit MeasureUnit::getFoodcalorie() { + return MeasureUnit(9, 3); +} + +MeasureUnit *MeasureUnit::createJoule(UErrorCode &status) { + return MeasureUnit::create(9, 4, status); +} + +MeasureUnit MeasureUnit::getJoule() { + return MeasureUnit(9, 4); +} + +MeasureUnit *MeasureUnit::createKilocalorie(UErrorCode &status) { + return MeasureUnit::create(9, 5, status); +} + +MeasureUnit MeasureUnit::getKilocalorie() { + return MeasureUnit(9, 5); +} + +MeasureUnit *MeasureUnit::createKilojoule(UErrorCode &status) { + return MeasureUnit::create(9, 6, status); +} + +MeasureUnit MeasureUnit::getKilojoule() { + return MeasureUnit(9, 6); +} + +MeasureUnit *MeasureUnit::createKilowattHour(UErrorCode &status) { + return MeasureUnit::create(9, 7, status); +} + +MeasureUnit MeasureUnit::getKilowattHour() { + return MeasureUnit(9, 7); +} + +MeasureUnit *MeasureUnit::createNewton(UErrorCode &status) { + return MeasureUnit::create(10, 0, status); +} + +MeasureUnit MeasureUnit::getNewton() { + return MeasureUnit(10, 0); +} + +MeasureUnit *MeasureUnit::createPoundForce(UErrorCode &status) { + return MeasureUnit::create(10, 1, status); +} + +MeasureUnit MeasureUnit::getPoundForce() { + return MeasureUnit(10, 1); +} + +MeasureUnit *MeasureUnit::createGigahertz(UErrorCode &status) { + return MeasureUnit::create(11, 0, status); +} + +MeasureUnit MeasureUnit::getGigahertz() { + return MeasureUnit(11, 0); +} + +MeasureUnit *MeasureUnit::createHertz(UErrorCode &status) { + return MeasureUnit::create(11, 1, status); +} + +MeasureUnit MeasureUnit::getHertz() { + return MeasureUnit(11, 1); +} + +MeasureUnit *MeasureUnit::createKilohertz(UErrorCode &status) { + return MeasureUnit::create(11, 2, status); +} + +MeasureUnit MeasureUnit::getKilohertz() { + return MeasureUnit(11, 2); +} + +MeasureUnit *MeasureUnit::createMegahertz(UErrorCode &status) { + return MeasureUnit::create(11, 3, status); +} + +MeasureUnit MeasureUnit::getMegahertz() { + return MeasureUnit(11, 3); +} + +MeasureUnit *MeasureUnit::createAstronomicalUnit(UErrorCode &status) { + return MeasureUnit::create(12, 0, status); +} + +MeasureUnit MeasureUnit::getAstronomicalUnit() { + return MeasureUnit(12, 0); +} + +MeasureUnit *MeasureUnit::createCentimeter(UErrorCode &status) { + return MeasureUnit::create(12, 1, status); +} + +MeasureUnit MeasureUnit::getCentimeter() { + return MeasureUnit(12, 1); +} + +MeasureUnit *MeasureUnit::createDecimeter(UErrorCode &status) { + return MeasureUnit::create(12, 2, status); +} + +MeasureUnit MeasureUnit::getDecimeter() { + return MeasureUnit(12, 2); +} + +MeasureUnit *MeasureUnit::createFathom(UErrorCode &status) { + return MeasureUnit::create(12, 3, status); +} + +MeasureUnit MeasureUnit::getFathom() { + return MeasureUnit(12, 3); +} + +MeasureUnit *MeasureUnit::createFoot(UErrorCode &status) { + return MeasureUnit::create(12, 4, status); +} + +MeasureUnit MeasureUnit::getFoot() { + return MeasureUnit(12, 4); +} + +MeasureUnit *MeasureUnit::createFurlong(UErrorCode &status) { + return MeasureUnit::create(12, 5, status); +} + +MeasureUnit MeasureUnit::getFurlong() { + return MeasureUnit(12, 5); +} + +MeasureUnit *MeasureUnit::createInch(UErrorCode &status) { + return MeasureUnit::create(12, 6, status); +} + +MeasureUnit MeasureUnit::getInch() { + return MeasureUnit(12, 6); +} + +MeasureUnit *MeasureUnit::createKilometer(UErrorCode &status) { + return MeasureUnit::create(12, 7, status); +} + +MeasureUnit MeasureUnit::getKilometer() { + return MeasureUnit(12, 7); +} + +MeasureUnit *MeasureUnit::createLightYear(UErrorCode &status) { + return MeasureUnit::create(12, 8, status); +} + +MeasureUnit MeasureUnit::getLightYear() { + return MeasureUnit(12, 8); +} + +MeasureUnit *MeasureUnit::createMeter(UErrorCode &status) { + return MeasureUnit::create(12, 9, status); +} + +MeasureUnit MeasureUnit::getMeter() { + return MeasureUnit(12, 9); +} + +MeasureUnit *MeasureUnit::createMicrometer(UErrorCode &status) { + return MeasureUnit::create(12, 10, status); +} + +MeasureUnit MeasureUnit::getMicrometer() { + return MeasureUnit(12, 10); +} + +MeasureUnit *MeasureUnit::createMile(UErrorCode &status) { + return MeasureUnit::create(12, 11, status); +} + +MeasureUnit MeasureUnit::getMile() { + return MeasureUnit(12, 11); +} + +MeasureUnit *MeasureUnit::createMileScandinavian(UErrorCode &status) { + return MeasureUnit::create(12, 12, status); +} + +MeasureUnit MeasureUnit::getMileScandinavian() { + return MeasureUnit(12, 12); +} + +MeasureUnit *MeasureUnit::createMillimeter(UErrorCode &status) { + return MeasureUnit::create(12, 13, status); +} + +MeasureUnit MeasureUnit::getMillimeter() { + return MeasureUnit(12, 13); +} + +MeasureUnit *MeasureUnit::createNanometer(UErrorCode &status) { + return MeasureUnit::create(12, 14, status); +} + +MeasureUnit MeasureUnit::getNanometer() { + return MeasureUnit(12, 14); +} + +MeasureUnit *MeasureUnit::createNauticalMile(UErrorCode &status) { + return MeasureUnit::create(12, 15, status); +} + +MeasureUnit MeasureUnit::getNauticalMile() { + return MeasureUnit(12, 15); +} + +MeasureUnit *MeasureUnit::createParsec(UErrorCode &status) { + return MeasureUnit::create(12, 16, status); +} + +MeasureUnit MeasureUnit::getParsec() { + return MeasureUnit(12, 16); +} + +MeasureUnit *MeasureUnit::createPicometer(UErrorCode &status) { + return MeasureUnit::create(12, 17, status); +} + +MeasureUnit MeasureUnit::getPicometer() { + return MeasureUnit(12, 17); +} + +MeasureUnit *MeasureUnit::createPoint(UErrorCode &status) { + return MeasureUnit::create(12, 18, status); +} + +MeasureUnit MeasureUnit::getPoint() { + return MeasureUnit(12, 18); +} + +MeasureUnit *MeasureUnit::createSolarRadius(UErrorCode &status) { + return MeasureUnit::create(12, 19, status); +} + +MeasureUnit MeasureUnit::getSolarRadius() { + return MeasureUnit(12, 19); +} + +MeasureUnit *MeasureUnit::createYard(UErrorCode &status) { + return MeasureUnit::create(12, 20, status); +} + +MeasureUnit MeasureUnit::getYard() { + return MeasureUnit(12, 20); +} + +MeasureUnit *MeasureUnit::createLux(UErrorCode &status) { + return MeasureUnit::create(13, 0, status); +} + +MeasureUnit MeasureUnit::getLux() { + return MeasureUnit(13, 0); +} + +MeasureUnit *MeasureUnit::createSolarLuminosity(UErrorCode &status) { + return MeasureUnit::create(13, 1, status); +} + +MeasureUnit MeasureUnit::getSolarLuminosity() { + return MeasureUnit(13, 1); +} + +MeasureUnit *MeasureUnit::createCarat(UErrorCode &status) { + return MeasureUnit::create(14, 0, status); +} + +MeasureUnit MeasureUnit::getCarat() { + return MeasureUnit(14, 0); +} + +MeasureUnit *MeasureUnit::createDalton(UErrorCode &status) { + return MeasureUnit::create(14, 1, status); +} + +MeasureUnit MeasureUnit::getDalton() { + return MeasureUnit(14, 1); +} + +MeasureUnit *MeasureUnit::createEarthMass(UErrorCode &status) { + return MeasureUnit::create(14, 2, status); +} + +MeasureUnit MeasureUnit::getEarthMass() { + return MeasureUnit(14, 2); +} + +MeasureUnit *MeasureUnit::createGram(UErrorCode &status) { + return MeasureUnit::create(14, 3, status); +} + +MeasureUnit MeasureUnit::getGram() { + return MeasureUnit(14, 3); +} + +MeasureUnit *MeasureUnit::createKilogram(UErrorCode &status) { + return MeasureUnit::create(14, 4, status); +} + +MeasureUnit MeasureUnit::getKilogram() { + return MeasureUnit(14, 4); +} + +MeasureUnit *MeasureUnit::createMetricTon(UErrorCode &status) { + return MeasureUnit::create(14, 5, status); +} + +MeasureUnit MeasureUnit::getMetricTon() { + return MeasureUnit(14, 5); +} + +MeasureUnit *MeasureUnit::createMicrogram(UErrorCode &status) { + return MeasureUnit::create(14, 6, status); +} + +MeasureUnit MeasureUnit::getMicrogram() { + return MeasureUnit(14, 6); +} + +MeasureUnit *MeasureUnit::createMilligram(UErrorCode &status) { + return MeasureUnit::create(14, 7, status); +} + +MeasureUnit MeasureUnit::getMilligram() { + return MeasureUnit(14, 7); +} + +MeasureUnit *MeasureUnit::createOunce(UErrorCode &status) { + return MeasureUnit::create(14, 8, status); +} + +MeasureUnit MeasureUnit::getOunce() { + return MeasureUnit(14, 8); +} + +MeasureUnit *MeasureUnit::createOunceTroy(UErrorCode &status) { + return MeasureUnit::create(14, 9, status); +} + +MeasureUnit MeasureUnit::getOunceTroy() { + return MeasureUnit(14, 9); +} + +MeasureUnit *MeasureUnit::createPound(UErrorCode &status) { + return MeasureUnit::create(14, 10, status); +} + +MeasureUnit MeasureUnit::getPound() { + return MeasureUnit(14, 10); +} + +MeasureUnit *MeasureUnit::createSolarMass(UErrorCode &status) { + return MeasureUnit::create(14, 11, status); +} + +MeasureUnit MeasureUnit::getSolarMass() { + return MeasureUnit(14, 11); +} + +MeasureUnit *MeasureUnit::createStone(UErrorCode &status) { + return MeasureUnit::create(14, 12, status); +} + +MeasureUnit MeasureUnit::getStone() { + return MeasureUnit(14, 12); +} + +MeasureUnit *MeasureUnit::createTon(UErrorCode &status) { + return MeasureUnit::create(14, 13, status); +} + +MeasureUnit MeasureUnit::getTon() { + return MeasureUnit(14, 13); +} + +MeasureUnit *MeasureUnit::createGigawatt(UErrorCode &status) { + return MeasureUnit::create(16, 0, status); +} + +MeasureUnit MeasureUnit::getGigawatt() { + return MeasureUnit(16, 0); +} + +MeasureUnit *MeasureUnit::createHorsepower(UErrorCode &status) { + return MeasureUnit::create(16, 1, status); +} + +MeasureUnit MeasureUnit::getHorsepower() { + return MeasureUnit(16, 1); +} + +MeasureUnit *MeasureUnit::createKilowatt(UErrorCode &status) { + return MeasureUnit::create(16, 2, status); +} + +MeasureUnit MeasureUnit::getKilowatt() { + return MeasureUnit(16, 2); +} + +MeasureUnit *MeasureUnit::createMegawatt(UErrorCode &status) { + return MeasureUnit::create(16, 3, status); +} + +MeasureUnit MeasureUnit::getMegawatt() { + return MeasureUnit(16, 3); +} + +MeasureUnit *MeasureUnit::createMilliwatt(UErrorCode &status) { + return MeasureUnit::create(16, 4, status); +} + +MeasureUnit MeasureUnit::getMilliwatt() { + return MeasureUnit(16, 4); +} + +MeasureUnit *MeasureUnit::createWatt(UErrorCode &status) { + return MeasureUnit::create(16, 5, status); +} + +MeasureUnit MeasureUnit::getWatt() { + return MeasureUnit(16, 5); +} + +MeasureUnit *MeasureUnit::createAtmosphere(UErrorCode &status) { + return MeasureUnit::create(17, 0, status); +} + +MeasureUnit MeasureUnit::getAtmosphere() { + return MeasureUnit(17, 0); +} + +MeasureUnit *MeasureUnit::createHectopascal(UErrorCode &status) { + return MeasureUnit::create(17, 1, status); +} + +MeasureUnit MeasureUnit::getHectopascal() { + return MeasureUnit(17, 1); +} + +MeasureUnit *MeasureUnit::createInchHg(UErrorCode &status) { + return MeasureUnit::create(17, 2, status); +} + +MeasureUnit MeasureUnit::getInchHg() { + return MeasureUnit(17, 2); +} + +MeasureUnit *MeasureUnit::createKilopascal(UErrorCode &status) { + return MeasureUnit::create(17, 3, status); +} + +MeasureUnit MeasureUnit::getKilopascal() { + return MeasureUnit(17, 3); +} + +MeasureUnit *MeasureUnit::createMegapascal(UErrorCode &status) { + return MeasureUnit::create(17, 4, status); +} + +MeasureUnit MeasureUnit::getMegapascal() { + return MeasureUnit(17, 4); +} + +MeasureUnit *MeasureUnit::createMillibar(UErrorCode &status) { + return MeasureUnit::create(17, 5, status); +} + +MeasureUnit MeasureUnit::getMillibar() { + return MeasureUnit(17, 5); +} + +MeasureUnit *MeasureUnit::createMillimeterOfMercury(UErrorCode &status) { + return MeasureUnit::create(17, 6, status); +} + +MeasureUnit MeasureUnit::getMillimeterOfMercury() { + return MeasureUnit(17, 6); +} + +MeasureUnit *MeasureUnit::createPoundPerSquareInch(UErrorCode &status) { + return MeasureUnit::create(17, 7, status); +} + +MeasureUnit MeasureUnit::getPoundPerSquareInch() { + return MeasureUnit(17, 7); +} + +MeasureUnit *MeasureUnit::createKilometerPerHour(UErrorCode &status) { + return MeasureUnit::create(18, 0, status); +} + +MeasureUnit MeasureUnit::getKilometerPerHour() { + return MeasureUnit(18, 0); +} + +MeasureUnit *MeasureUnit::createKnot(UErrorCode &status) { + return MeasureUnit::create(18, 1, status); +} + +MeasureUnit MeasureUnit::getKnot() { + return MeasureUnit(18, 1); +} + +MeasureUnit *MeasureUnit::createMeterPerSecond(UErrorCode &status) { + return MeasureUnit::create(18, 2, status); +} + +MeasureUnit MeasureUnit::getMeterPerSecond() { + return MeasureUnit(18, 2); +} + +MeasureUnit *MeasureUnit::createMilePerHour(UErrorCode &status) { + return MeasureUnit::create(18, 3, status); +} + +MeasureUnit MeasureUnit::getMilePerHour() { + return MeasureUnit(18, 3); +} + +MeasureUnit *MeasureUnit::createCelsius(UErrorCode &status) { + return MeasureUnit::create(19, 0, status); +} + +MeasureUnit MeasureUnit::getCelsius() { + return MeasureUnit(19, 0); +} + +MeasureUnit *MeasureUnit::createFahrenheit(UErrorCode &status) { + return MeasureUnit::create(19, 1, status); +} + +MeasureUnit MeasureUnit::getFahrenheit() { + return MeasureUnit(19, 1); +} + +MeasureUnit *MeasureUnit::createGenericTemperature(UErrorCode &status) { + return MeasureUnit::create(19, 2, status); +} + +MeasureUnit MeasureUnit::getGenericTemperature() { + return MeasureUnit(19, 2); +} + +MeasureUnit *MeasureUnit::createKelvin(UErrorCode &status) { + return MeasureUnit::create(19, 3, status); +} + +MeasureUnit MeasureUnit::getKelvin() { + return MeasureUnit(19, 3); +} + +MeasureUnit *MeasureUnit::createNewtonMeter(UErrorCode &status) { + return MeasureUnit::create(20, 0, status); +} + +MeasureUnit MeasureUnit::getNewtonMeter() { + return MeasureUnit(20, 0); +} + +MeasureUnit *MeasureUnit::createPoundFoot(UErrorCode &status) { + return MeasureUnit::create(20, 1, status); +} + +MeasureUnit MeasureUnit::getPoundFoot() { + return MeasureUnit(20, 1); +} + +MeasureUnit *MeasureUnit::createAcreFoot(UErrorCode &status) { + return MeasureUnit::create(21, 0, status); +} + +MeasureUnit MeasureUnit::getAcreFoot() { + return MeasureUnit(21, 0); +} + +MeasureUnit *MeasureUnit::createBarrel(UErrorCode &status) { + return MeasureUnit::create(21, 1, status); +} + +MeasureUnit MeasureUnit::getBarrel() { + return MeasureUnit(21, 1); +} + +MeasureUnit *MeasureUnit::createBushel(UErrorCode &status) { + return MeasureUnit::create(21, 2, status); +} + +MeasureUnit MeasureUnit::getBushel() { + return MeasureUnit(21, 2); +} + +MeasureUnit *MeasureUnit::createCentiliter(UErrorCode &status) { + return MeasureUnit::create(21, 3, status); +} + +MeasureUnit MeasureUnit::getCentiliter() { + return MeasureUnit(21, 3); +} + +MeasureUnit *MeasureUnit::createCubicCentimeter(UErrorCode &status) { + return MeasureUnit::create(21, 4, status); +} + +MeasureUnit MeasureUnit::getCubicCentimeter() { + return MeasureUnit(21, 4); +} + +MeasureUnit *MeasureUnit::createCubicFoot(UErrorCode &status) { + return MeasureUnit::create(21, 5, status); +} + +MeasureUnit MeasureUnit::getCubicFoot() { + return MeasureUnit(21, 5); +} + +MeasureUnit *MeasureUnit::createCubicInch(UErrorCode &status) { + return MeasureUnit::create(21, 6, status); +} + +MeasureUnit MeasureUnit::getCubicInch() { + return MeasureUnit(21, 6); +} + +MeasureUnit *MeasureUnit::createCubicKilometer(UErrorCode &status) { + return MeasureUnit::create(21, 7, status); +} + +MeasureUnit MeasureUnit::getCubicKilometer() { + return MeasureUnit(21, 7); +} + +MeasureUnit *MeasureUnit::createCubicMeter(UErrorCode &status) { + return MeasureUnit::create(21, 8, status); +} + +MeasureUnit MeasureUnit::getCubicMeter() { + return MeasureUnit(21, 8); +} + +MeasureUnit *MeasureUnit::createCubicMile(UErrorCode &status) { + return MeasureUnit::create(21, 9, status); +} + +MeasureUnit MeasureUnit::getCubicMile() { + return MeasureUnit(21, 9); +} + +MeasureUnit *MeasureUnit::createCubicYard(UErrorCode &status) { + return MeasureUnit::create(21, 10, status); +} + +MeasureUnit MeasureUnit::getCubicYard() { + return MeasureUnit(21, 10); +} + +MeasureUnit *MeasureUnit::createCup(UErrorCode &status) { + return MeasureUnit::create(21, 11, status); +} + +MeasureUnit MeasureUnit::getCup() { + return MeasureUnit(21, 11); +} + +MeasureUnit *MeasureUnit::createCupMetric(UErrorCode &status) { + return MeasureUnit::create(21, 12, status); +} + +MeasureUnit MeasureUnit::getCupMetric() { + return MeasureUnit(21, 12); +} + +MeasureUnit *MeasureUnit::createDeciliter(UErrorCode &status) { + return MeasureUnit::create(21, 13, status); +} + +MeasureUnit MeasureUnit::getDeciliter() { + return MeasureUnit(21, 13); +} + +MeasureUnit *MeasureUnit::createFluidOunce(UErrorCode &status) { + return MeasureUnit::create(21, 14, status); +} + +MeasureUnit MeasureUnit::getFluidOunce() { + return MeasureUnit(21, 14); +} + +MeasureUnit *MeasureUnit::createFluidOunceImperial(UErrorCode &status) { + return MeasureUnit::create(21, 15, status); +} + +MeasureUnit MeasureUnit::getFluidOunceImperial() { + return MeasureUnit(21, 15); +} + +MeasureUnit *MeasureUnit::createGallon(UErrorCode &status) { + return MeasureUnit::create(21, 16, status); +} + +MeasureUnit MeasureUnit::getGallon() { + return MeasureUnit(21, 16); +} + +MeasureUnit *MeasureUnit::createGallonImperial(UErrorCode &status) { + return MeasureUnit::create(21, 17, status); +} + +MeasureUnit MeasureUnit::getGallonImperial() { + return MeasureUnit(21, 17); } MeasureUnit *MeasureUnit::createHectoliter(UErrorCode &status) { - return MeasureUnit::create(18, 14, status); + return MeasureUnit::create(21, 18, status); +} + +MeasureUnit MeasureUnit::getHectoliter() { + return MeasureUnit(21, 18); } MeasureUnit *MeasureUnit::createLiter(UErrorCode &status) { - return MeasureUnit::create(18, 15, status); + return MeasureUnit::create(21, 19, status); +} + +MeasureUnit MeasureUnit::getLiter() { + return MeasureUnit(21, 19); } MeasureUnit *MeasureUnit::createMegaliter(UErrorCode &status) { - return MeasureUnit::create(18, 16, status); + return MeasureUnit::create(21, 20, status); +} + +MeasureUnit MeasureUnit::getMegaliter() { + return MeasureUnit(21, 20); } MeasureUnit *MeasureUnit::createMilliliter(UErrorCode &status) { - return MeasureUnit::create(18, 17, status); + return MeasureUnit::create(21, 21, status); +} + +MeasureUnit MeasureUnit::getMilliliter() { + return MeasureUnit(21, 21); } MeasureUnit *MeasureUnit::createPint(UErrorCode &status) { - return MeasureUnit::create(18, 18, status); + return MeasureUnit::create(21, 22, status); +} + +MeasureUnit MeasureUnit::getPint() { + return MeasureUnit(21, 22); +} + +MeasureUnit *MeasureUnit::createPintMetric(UErrorCode &status) { + return MeasureUnit::create(21, 23, status); +} + +MeasureUnit MeasureUnit::getPintMetric() { + return MeasureUnit(21, 23); } MeasureUnit *MeasureUnit::createQuart(UErrorCode &status) { - return MeasureUnit::create(18, 19, status); + return MeasureUnit::create(21, 24, status); +} + +MeasureUnit MeasureUnit::getQuart() { + return MeasureUnit(21, 24); } MeasureUnit *MeasureUnit::createTablespoon(UErrorCode &status) { - return MeasureUnit::create(18, 20, status); + return MeasureUnit::create(21, 25, status); +} + +MeasureUnit MeasureUnit::getTablespoon() { + return MeasureUnit(21, 25); } MeasureUnit *MeasureUnit::createTeaspoon(UErrorCode &status) { - return MeasureUnit::create(18, 21, status); + return MeasureUnit::create(21, 26, status); +} + +MeasureUnit MeasureUnit::getTeaspoon() { + return MeasureUnit(21, 26); } // End generated code @@ -1003,7 +1901,13 @@ static int32_t binarySearch( } return -1; } - + +MeasureUnit::MeasureUnit() { + fCurrency[0] = 0; + fTypeId = kBaseTypeIdx; + fSubTypeId = kBaseSubTypeIdx; +} + MeasureUnit::MeasureUnit(const MeasureUnit &other) : fTypeId(other.fTypeId), fSubTypeId(other.fSubTypeId) { uprv_strcpy(fCurrency, other.fCurrency); @@ -1118,8 +2022,20 @@ int32_t MeasureUnit::getIndexCount() { return gIndexes[UPRV_LENGTHOF(gIndexes) - 1]; } -MeasureUnit *MeasureUnit::resolveUnitPerUnit( - const MeasureUnit &unit, const MeasureUnit &perUnit) { +int32_t MeasureUnit::internalGetIndexForTypeAndSubtype(const char *type, const char *subtype) { + int32_t t = binarySearch(gTypes, 0, UPRV_LENGTHOF(gTypes), type); + if (t < 0) { + return t; + } + int32_t st = binarySearch(gSubTypes, gOffsets[t], gOffsets[t + 1], subtype); + if (st < 0) { + return st; + } + return gIndexes[t] + st - gOffsets[t]; +} + +MeasureUnit MeasureUnit::resolveUnitPerUnit( + const MeasureUnit &unit, const MeasureUnit &perUnit, bool* isResolved) { int32_t unitOffset = unit.getOffset(); int32_t perUnitOffset = perUnit.getOffset(); @@ -1140,10 +2056,13 @@ MeasureUnit *MeasureUnit::resolveUnitPerUnit( } else { // We found a resolution for our unit / per-unit combo // return it. - return new MeasureUnit(midRow[2], midRow[3]); + *isResolved = true; + return MeasureUnit(midRow[2], midRow[3]); } } - return NULL; + + *isResolved = false; + return MeasureUnit(); } MeasureUnit *MeasureUnit::create(int typeId, int subTypeId, UErrorCode &status) { @@ -1176,9 +2095,19 @@ void MeasureUnit::initCurrency(const char *isoCurrency) { fSubTypeId = result - gOffsets[fTypeId]; } else { uprv_strncpy(fCurrency, isoCurrency, UPRV_LENGTHOF(fCurrency)); + fCurrency[3] = 0; } } +void MeasureUnit::initNoUnit(const char *subtype) { + int32_t result = binarySearch(gTypes, 0, UPRV_LENGTHOF(gTypes), "none"); + U_ASSERT(result != -1); + fTypeId = result; + result = binarySearch(gSubTypes, gOffsets[fTypeId], gOffsets[fTypeId + 1], subtype); + U_ASSERT(result != -1); + fSubTypeId = result - gOffsets[fTypeId]; +} + void MeasureUnit::setTo(int32_t typeId, int32_t subTypeId) { fTypeId = typeId; fSubTypeId = subTypeId;