Skip to content

Commit

Permalink
ICU-22723 Integrate CLDR 46 release beta3, part 3, source files
Browse files Browse the repository at this point in the history
  • Loading branch information
DraganBesevic committed Sep 28, 2024
1 parent 17687bf commit de86b32
Show file tree
Hide file tree
Showing 4 changed files with 178 additions and 73 deletions.
103 changes: 61 additions & 42 deletions icu4c/source/i18n/measunit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,24 @@ static const int32_t gOffsets[] = {
17,
27,
31,
332,
343,
360,
364,
373,
376,
380,
388,
410,
414,
429,
430,
436,
447,
452,
456,
458,
492
333,
344,
362,
366,
375,
378,
382,
390,
412,
416,
431,
432,
438,
449,
455,
459,
461,
495
};

static const int32_t kCurrencyOffset = 5;
Expand Down Expand Up @@ -423,6 +423,7 @@ static const char * const gSubTypes[] = {
"ZRZ",
"ZWC",
"ZWD",
"ZWG",
"ZWL",
"ZWN",
"ZWR",
Expand All @@ -448,6 +449,7 @@ static const char * const gSubTypes[] = {
"month",
"month-person",
"nanosecond",
"night",
"quarter",
"second",
"week",
Expand Down Expand Up @@ -544,6 +546,7 @@ static const char * const gSubTypes[] = {
"beaufort",
"kilometer-per-hour",
"knot",
"light-speed",
"meter-per-second",
"mile-per-hour",
"celsius",
Expand Down Expand Up @@ -1016,54 +1019,62 @@ MeasureUnit MeasureUnit::getNanosecond() {
return MeasureUnit(7, 10);
}

MeasureUnit *MeasureUnit::createQuarter(UErrorCode &status) {
MeasureUnit *MeasureUnit::createNight(UErrorCode &status) {
return MeasureUnit::create(7, 11, status);
}

MeasureUnit MeasureUnit::getQuarter() {
MeasureUnit MeasureUnit::getNight() {
return MeasureUnit(7, 11);
}

MeasureUnit *MeasureUnit::createSecond(UErrorCode &status) {
MeasureUnit *MeasureUnit::createQuarter(UErrorCode &status) {
return MeasureUnit::create(7, 12, status);
}

MeasureUnit MeasureUnit::getSecond() {
MeasureUnit MeasureUnit::getQuarter() {
return MeasureUnit(7, 12);
}

MeasureUnit *MeasureUnit::createWeek(UErrorCode &status) {
MeasureUnit *MeasureUnit::createSecond(UErrorCode &status) {
return MeasureUnit::create(7, 13, status);
}

MeasureUnit MeasureUnit::getWeek() {
MeasureUnit MeasureUnit::getSecond() {
return MeasureUnit(7, 13);
}

MeasureUnit *MeasureUnit::createWeekPerson(UErrorCode &status) {
MeasureUnit *MeasureUnit::createWeek(UErrorCode &status) {
return MeasureUnit::create(7, 14, status);
}

MeasureUnit MeasureUnit::getWeekPerson() {
MeasureUnit MeasureUnit::getWeek() {
return MeasureUnit(7, 14);
}

MeasureUnit *MeasureUnit::createYear(UErrorCode &status) {
MeasureUnit *MeasureUnit::createWeekPerson(UErrorCode &status) {
return MeasureUnit::create(7, 15, status);
}

MeasureUnit MeasureUnit::getYear() {
MeasureUnit MeasureUnit::getWeekPerson() {
return MeasureUnit(7, 15);
}

MeasureUnit *MeasureUnit::createYearPerson(UErrorCode &status) {
MeasureUnit *MeasureUnit::createYear(UErrorCode &status) {
return MeasureUnit::create(7, 16, status);
}

MeasureUnit MeasureUnit::getYearPerson() {
MeasureUnit MeasureUnit::getYear() {
return MeasureUnit(7, 16);
}

MeasureUnit *MeasureUnit::createYearPerson(UErrorCode &status) {
return MeasureUnit::create(7, 17, status);
}

MeasureUnit MeasureUnit::getYearPerson() {
return MeasureUnit(7, 17);
}

MeasureUnit *MeasureUnit::createAmpere(UErrorCode &status) {
return MeasureUnit::create(8, 0, status);
}
Expand Down Expand Up @@ -1544,14 +1555,6 @@ MeasureUnit MeasureUnit::getKilogram() {
return MeasureUnit(15, 5);
}

MeasureUnit *MeasureUnit::createMetricTon(UErrorCode &status) {
return MeasureUnit::create(15, 14, status);
}

MeasureUnit MeasureUnit::getMetricTon() {
return MeasureUnit(15, 14);
}

MeasureUnit *MeasureUnit::createMicrogram(UErrorCode &status) {
return MeasureUnit::create(15, 6, status);
}
Expand Down Expand Up @@ -1624,6 +1627,14 @@ MeasureUnit MeasureUnit::getTonne() {
return MeasureUnit(15, 14);
}

MeasureUnit *MeasureUnit::createMetricTon(UErrorCode &status) {
return MeasureUnit::create(15, 14, status);
}

MeasureUnit MeasureUnit::getMetricTon() {
return MeasureUnit(15, 14);
}

MeasureUnit *MeasureUnit::createGigawatt(UErrorCode &status) {
return MeasureUnit::create(17, 0, status);
}
Expand Down Expand Up @@ -1784,22 +1795,30 @@ MeasureUnit MeasureUnit::getKnot() {
return MeasureUnit(19, 2);
}

MeasureUnit *MeasureUnit::createMeterPerSecond(UErrorCode &status) {
MeasureUnit *MeasureUnit::createLightSpeed(UErrorCode &status) {
return MeasureUnit::create(19, 3, status);
}

MeasureUnit MeasureUnit::getMeterPerSecond() {
MeasureUnit MeasureUnit::getLightSpeed() {
return MeasureUnit(19, 3);
}

MeasureUnit *MeasureUnit::createMilePerHour(UErrorCode &status) {
MeasureUnit *MeasureUnit::createMeterPerSecond(UErrorCode &status) {
return MeasureUnit::create(19, 4, status);
}

MeasureUnit MeasureUnit::getMilePerHour() {
MeasureUnit MeasureUnit::getMeterPerSecond() {
return MeasureUnit(19, 4);
}

MeasureUnit *MeasureUnit::createMilePerHour(UErrorCode &status) {
return MeasureUnit::create(19, 5, status);
}

MeasureUnit MeasureUnit::getMilePerHour() {
return MeasureUnit(19, 5);
}

MeasureUnit *MeasureUnit::createCelsius(UErrorCode &status) {
return MeasureUnit::create(20, 0, status);
}
Expand Down
84 changes: 60 additions & 24 deletions icu4c/source/i18n/unicode/measunit.h
Original file line number Diff line number Diff line change
Expand Up @@ -1568,6 +1568,24 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit getNanosecond();

#ifndef U_HIDE_DRAFT_API
/**
* Returns by pointer, unit of duration: night.
* Caller owns returned value and must free it.
* Also see {@link #getNight()}.
* @param status ICU error code.
* @draft ICU 76
*/
static MeasureUnit *createNight(UErrorCode &status);

/**
* Returns by value, unit of duration: night.
* Also see {@link #createNight()}.
* @draft ICU 76
*/
static MeasureUnit getNight();
#endif /* U_HIDE_DRAFT_API */

/**
* Returns by pointer, unit of duration: quarter.
* Caller owns returned value and must free it.
Expand Down Expand Up @@ -2624,30 +2642,6 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit getKilogram();

/**
* Returns by pointer, unit of mass: metric-ton
* (renamed to tonne in CLDR 42 / ICU 72).
* Caller owns returned value and must free it.
* Note: In ICU 74 this will be deprecated in favor of
* createTonne(), which is currently draft but will
* become stable in ICU 74, and which uses the preferred naming.
* Also see {@link #getMetricTon()} and {@link #createTonne()}.
* @param status ICU error code.
* @stable ICU 54
*/
static MeasureUnit *createMetricTon(UErrorCode &status);

/**
* Returns by value, unit of mass: metric-ton
* (renamed to tonne in CLDR 42 / ICU 72).
* Note: In ICU 74 this will be deprecated in favor of
* getTonne(), which is currently draft but will
* become stable in ICU 74, and which uses the preferred naming.
* Also see {@link #createMetricTon()} and {@link #getTonne()}.
* @stable ICU 64
*/
static MeasureUnit getMetricTon();

/**
* Returns by pointer, unit of mass: microgram.
* Caller owns returned value and must free it.
Expand Down Expand Up @@ -2792,6 +2786,30 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit getTonne();

/**
* Returns by pointer, unit of mass: metric-ton
* (renamed to tonne in CLDR 42 / ICU 72).
* Caller owns returned value and must free it.
* Note: In ICU 74 this will be deprecated in favor of
* createTonne(), which is currently draft but will
* become stable in ICU 74, and which uses the preferred naming.
* Also see {@link #getMetricTon()} and {@link #createTonne()}.
* @param status ICU error code.
* @stable ICU 54
*/
static MeasureUnit *createMetricTon(UErrorCode &status);

/**
* Returns by value, unit of mass: metric-ton
* (renamed to tonne in CLDR 42 / ICU 72).
* Note: In ICU 74 this will be deprecated in favor of
* getTonne(), which is currently draft but will
* become stable in ICU 74, and which uses the preferred naming.
* Also see {@link #createMetricTon()} and {@link #getTonne()}.
* @stable ICU 64
*/
static MeasureUnit getMetricTon();

/**
* Returns by pointer, unit of power: gigawatt.
* Caller owns returned value and must free it.
Expand Down Expand Up @@ -3112,6 +3130,24 @@ class U_I18N_API MeasureUnit: public UObject {
*/
static MeasureUnit getKnot();

#ifndef U_HIDE_DRAFT_API
/**
* Returns by pointer, unit of speed: light-speed.
* Caller owns returned value and must free it.
* Also see {@link #getLightSpeed()}.
* @param status ICU error code.
* @draft ICU 76
*/
static MeasureUnit *createLightSpeed(UErrorCode &status);

/**
* Returns by value, unit of speed: light-speed.
* Also see {@link #createLightSpeed()}.
* @draft ICU 76
*/
static MeasureUnit getLightSpeed();
#endif /* U_HIDE_DRAFT_API */

/**
* Returns by pointer, unit of speed: meter-per-second.
* Caller owns returned value and must free it.
Expand Down
Loading

0 comments on commit de86b32

Please sign in to comment.