diff options
author | romankoshelev <romankoshelev@yandex-team.com> | 2023-08-14 19:51:50 +0300 |
---|---|---|
committer | romankoshelev <romankoshelev@yandex-team.com> | 2023-08-15 01:24:11 +0300 |
commit | cfcd865e05c0d0525ea27d1e153a043b32a85138 (patch) | |
tree | 68d3b3b25271e8a4998505897a269ff7ce119b76 /contrib/libs/icu/i18n/measunit.cpp | |
parent | ccb790c507bd5e8ffe2ef9886ce5ee0a7ce22a15 (diff) | |
download | ydb-cfcd865e05c0d0525ea27d1e153a043b32a85138.tar.gz |
Update ICU to 73.2
Diffstat (limited to 'contrib/libs/icu/i18n/measunit.cpp')
-rw-r--r-- | contrib/libs/icu/i18n/measunit.cpp | 142 |
1 files changed, 85 insertions, 57 deletions
diff --git a/contrib/libs/icu/i18n/measunit.cpp b/contrib/libs/icu/i18n/measunit.cpp index 5ad3991974..47ae5bcf5d 100644 --- a/contrib/libs/icu/i18n/measunit.cpp +++ b/contrib/libs/icu/i18n/measunit.cpp @@ -43,24 +43,24 @@ static const int32_t gOffsets[] = { 17, 27, 31, - 330, - 341, - 357, - 361, - 370, + 332, + 343, + 360, + 364, 373, - 377, - 385, - 407, - 411, - 426, - 427, - 433, - 443, - 447, + 376, + 380, + 388, + 410, + 414, + 429, + 430, + 436, + 446, 451, - 453, - 487 + 455, + 457, + 491 }; static const int32_t kCurrencyOffset = 5; @@ -345,6 +345,7 @@ static const char * const gSubTypes[] = { "SHP", "SIT", "SKK", + "SLE", "SLL", "SOS", "SRD", @@ -384,6 +385,7 @@ static const char * const gSubTypes[] = { "UYW", "UZS", "VEB", + "VED", "VEF", "VES", "VNC", @@ -446,6 +448,7 @@ static const char * const gSubTypes[] = { "month", "month-person", "nanosecond", + "quarter", "second", "week", "week-person", @@ -511,7 +514,6 @@ static const char * const gSubTypes[] = { "grain", "gram", "kilogram", - "metric-ton", "microgram", "milligram", "ounce", @@ -520,6 +522,7 @@ static const char * const gSubTypes[] = { "solar-mass", "stone", "ton", + "tonne", "", "gigawatt", "horsepower", @@ -537,6 +540,7 @@ static const char * const gSubTypes[] = { "millimeter-ofhg", "pascal", "pound-force-per-square-inch", + "beaufort", "kilometer-per-hour", "knot", "meter-per-second", @@ -1011,46 +1015,54 @@ MeasureUnit MeasureUnit::getNanosecond() { return MeasureUnit(7, 10); } -MeasureUnit *MeasureUnit::createSecond(UErrorCode &status) { +MeasureUnit *MeasureUnit::createQuarter(UErrorCode &status) { return MeasureUnit::create(7, 11, status); } -MeasureUnit MeasureUnit::getSecond() { +MeasureUnit MeasureUnit::getQuarter() { return MeasureUnit(7, 11); } -MeasureUnit *MeasureUnit::createWeek(UErrorCode &status) { +MeasureUnit *MeasureUnit::createSecond(UErrorCode &status) { return MeasureUnit::create(7, 12, status); } -MeasureUnit MeasureUnit::getWeek() { +MeasureUnit MeasureUnit::getSecond() { return MeasureUnit(7, 12); } -MeasureUnit *MeasureUnit::createWeekPerson(UErrorCode &status) { +MeasureUnit *MeasureUnit::createWeek(UErrorCode &status) { return MeasureUnit::create(7, 13, status); } -MeasureUnit MeasureUnit::getWeekPerson() { +MeasureUnit MeasureUnit::getWeek() { return MeasureUnit(7, 13); } -MeasureUnit *MeasureUnit::createYear(UErrorCode &status) { +MeasureUnit *MeasureUnit::createWeekPerson(UErrorCode &status) { return MeasureUnit::create(7, 14, status); } -MeasureUnit MeasureUnit::getYear() { +MeasureUnit MeasureUnit::getWeekPerson() { return MeasureUnit(7, 14); } -MeasureUnit *MeasureUnit::createYearPerson(UErrorCode &status) { +MeasureUnit *MeasureUnit::createYear(UErrorCode &status) { return MeasureUnit::create(7, 15, status); } -MeasureUnit MeasureUnit::getYearPerson() { +MeasureUnit MeasureUnit::getYear() { return MeasureUnit(7, 15); } +MeasureUnit *MeasureUnit::createYearPerson(UErrorCode &status) { + return MeasureUnit::create(7, 16, status); +} + +MeasureUnit MeasureUnit::getYearPerson() { + return MeasureUnit(7, 16); +} + MeasureUnit *MeasureUnit::createAmpere(UErrorCode &status) { return MeasureUnit::create(8, 0, status); } @@ -1532,74 +1544,82 @@ MeasureUnit MeasureUnit::getKilogram() { } MeasureUnit *MeasureUnit::createMetricTon(UErrorCode &status) { - return MeasureUnit::create(15, 6, status); + return MeasureUnit::create(15, 14, status); } MeasureUnit MeasureUnit::getMetricTon() { - return MeasureUnit(15, 6); + return MeasureUnit(15, 14); } MeasureUnit *MeasureUnit::createMicrogram(UErrorCode &status) { - return MeasureUnit::create(15, 7, status); + return MeasureUnit::create(15, 6, status); } MeasureUnit MeasureUnit::getMicrogram() { - return MeasureUnit(15, 7); + return MeasureUnit(15, 6); } MeasureUnit *MeasureUnit::createMilligram(UErrorCode &status) { - return MeasureUnit::create(15, 8, status); + return MeasureUnit::create(15, 7, status); } MeasureUnit MeasureUnit::getMilligram() { - return MeasureUnit(15, 8); + return MeasureUnit(15, 7); } MeasureUnit *MeasureUnit::createOunce(UErrorCode &status) { - return MeasureUnit::create(15, 9, status); + return MeasureUnit::create(15, 8, status); } MeasureUnit MeasureUnit::getOunce() { - return MeasureUnit(15, 9); + return MeasureUnit(15, 8); } MeasureUnit *MeasureUnit::createOunceTroy(UErrorCode &status) { - return MeasureUnit::create(15, 10, status); + return MeasureUnit::create(15, 9, status); } MeasureUnit MeasureUnit::getOunceTroy() { - return MeasureUnit(15, 10); + return MeasureUnit(15, 9); } MeasureUnit *MeasureUnit::createPound(UErrorCode &status) { - return MeasureUnit::create(15, 11, status); + return MeasureUnit::create(15, 10, status); } MeasureUnit MeasureUnit::getPound() { - return MeasureUnit(15, 11); + return MeasureUnit(15, 10); } MeasureUnit *MeasureUnit::createSolarMass(UErrorCode &status) { - return MeasureUnit::create(15, 12, status); + return MeasureUnit::create(15, 11, status); } MeasureUnit MeasureUnit::getSolarMass() { - return MeasureUnit(15, 12); + return MeasureUnit(15, 11); } MeasureUnit *MeasureUnit::createStone(UErrorCode &status) { - return MeasureUnit::create(15, 13, status); + return MeasureUnit::create(15, 12, status); } MeasureUnit MeasureUnit::getStone() { - return MeasureUnit(15, 13); + return MeasureUnit(15, 12); } MeasureUnit *MeasureUnit::createTon(UErrorCode &status) { - return MeasureUnit::create(15, 14, status); + return MeasureUnit::create(15, 13, status); } MeasureUnit MeasureUnit::getTon() { + return MeasureUnit(15, 13); +} + +MeasureUnit *MeasureUnit::createTonne(UErrorCode &status) { + return MeasureUnit::create(15, 14, status); +} + +MeasureUnit MeasureUnit::getTonne() { return MeasureUnit(15, 14); } @@ -1731,38 +1751,46 @@ MeasureUnit MeasureUnit::getPoundPerSquareInch() { return MeasureUnit(18, 9); } -MeasureUnit *MeasureUnit::createKilometerPerHour(UErrorCode &status) { +MeasureUnit *MeasureUnit::createBeaufort(UErrorCode &status) { return MeasureUnit::create(19, 0, status); } -MeasureUnit MeasureUnit::getKilometerPerHour() { +MeasureUnit MeasureUnit::getBeaufort() { return MeasureUnit(19, 0); } -MeasureUnit *MeasureUnit::createKnot(UErrorCode &status) { +MeasureUnit *MeasureUnit::createKilometerPerHour(UErrorCode &status) { return MeasureUnit::create(19, 1, status); } -MeasureUnit MeasureUnit::getKnot() { +MeasureUnit MeasureUnit::getKilometerPerHour() { return MeasureUnit(19, 1); } -MeasureUnit *MeasureUnit::createMeterPerSecond(UErrorCode &status) { +MeasureUnit *MeasureUnit::createKnot(UErrorCode &status) { return MeasureUnit::create(19, 2, status); } -MeasureUnit MeasureUnit::getMeterPerSecond() { +MeasureUnit MeasureUnit::getKnot() { return MeasureUnit(19, 2); } -MeasureUnit *MeasureUnit::createMilePerHour(UErrorCode &status) { +MeasureUnit *MeasureUnit::createMeterPerSecond(UErrorCode &status) { return MeasureUnit::create(19, 3, status); } -MeasureUnit MeasureUnit::getMilePerHour() { +MeasureUnit MeasureUnit::getMeterPerSecond() { return MeasureUnit(19, 3); } +MeasureUnit *MeasureUnit::createMilePerHour(UErrorCode &status) { + return MeasureUnit::create(19, 4, status); +} + +MeasureUnit MeasureUnit::getMilePerHour() { + return MeasureUnit(19, 4); +} + MeasureUnit *MeasureUnit::createCelsius(UErrorCode &status) { return MeasureUnit::create(20, 0, status); } @@ -2258,13 +2286,13 @@ StringEnumeration* MeasureUnit::getAvailableTypes(UErrorCode &errorCode) { gTypes, UPRV_LENGTHOF(gTypes), &errorCode); if (U_FAILURE(errorCode)) { uenum_close(uenum); - return NULL; + return nullptr; } StringEnumeration *result = new UStringEnumeration(uenum); - if (result == NULL) { + if (result == nullptr) { errorCode = U_MEMORY_ALLOCATION_ERROR; uenum_close(uenum); - return NULL; + return nullptr; } return result; } @@ -2290,10 +2318,10 @@ bool MeasureUnit::findBySubType(StringPiece subType, MeasureUnit* output) { MeasureUnit *MeasureUnit::create(int typeId, int subTypeId, UErrorCode &status) { if (U_FAILURE(status)) { - return NULL; + return nullptr; } MeasureUnit *result = new MeasureUnit(typeId, subTypeId); - if (result == NULL) { + if (result == nullptr) { status = U_MEMORY_ALLOCATION_ERROR; } return result; |