ICU 66.0.1  66.0.1
measunit.h
Go to the documentation of this file.
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /*
4 **********************************************************************
5 * Copyright (c) 2004-2016, International Business Machines
6 * Corporation and others. All Rights Reserved.
7 **********************************************************************
8 * Author: Alan Liu
9 * Created: April 26, 2004
10 * Since: ICU 3.0
11 **********************************************************************
12 */
13 #ifndef __MEASUREUNIT_H__
14 #define __MEASUREUNIT_H__
15 
16 #include "unicode/utypes.h"
17 
18 #if U_SHOW_CPLUSPLUS_API
19 
20 #if !UCONFIG_NO_FORMATTING
21 
22 #include "unicode/unistr.h"
23 
29 U_NAMESPACE_BEGIN
30 
31 class StringEnumeration;
32 
41  public:
42 
48  MeasureUnit();
49 
54  MeasureUnit(const MeasureUnit &other);
55 
60  MeasureUnit &operator=(const MeasureUnit &other);
61 
67  virtual MeasureUnit* clone() const;
68 
73  virtual ~MeasureUnit();
74 
80  virtual UBool operator==(const UObject& other) const;
81 
87  UBool operator!=(const UObject& other) const {
88  return !(*this == other);
89  }
90 
95  const char *getType() const;
96 
101  const char *getSubtype() const;
102 
114  static int32_t getAvailable(
115  MeasureUnit *destArray,
116  int32_t destCapacity,
117  UErrorCode &errorCode);
118 
131  static int32_t getAvailable(
132  const char *type,
133  MeasureUnit *destArray,
134  int32_t destCapacity,
135  UErrorCode &errorCode);
136 
145  static StringEnumeration* getAvailableTypes(UErrorCode &errorCode);
146 
158  static UClassID U_EXPORT2 getStaticClassID(void);
159 
171  virtual UClassID getDynamicClassID(void) const;
172 
173 #ifndef U_HIDE_INTERNAL_API
174 
180  int32_t getIndex() const;
181 
187  static int32_t getIndexCount();
188 
195  static int32_t internalGetIndexForTypeAndSubtype(const char *type, const char *subtype);
196 
201  static MeasureUnit resolveUnitPerUnit(
202  const MeasureUnit &unit, const MeasureUnit &perUnit, bool* isResolved);
203 #endif /* U_HIDE_INTERNAL_API */
204 
205 // All code between the "Start generated createXXX methods" comment and
206 // the "End generated createXXX methods" comment is auto generated code
207 // and must not be edited manually. For instructions on how to correctly
208 // update this code, refer to:
209 // http://site.icu-project.org/design/formatting/measureformat/updating-measure-unit
210 //
211 // Start generated createXXX methods
212 
220  static MeasureUnit *createGForce(UErrorCode &status);
221 
222 #ifndef U_HIDE_DRAFT_API
223 
228  static MeasureUnit getGForce();
229 #endif /* U_HIDE_DRAFT_API */
230 
238  static MeasureUnit *createMeterPerSecondSquared(UErrorCode &status);
239 
240 #ifndef U_HIDE_DRAFT_API
241 
246  static MeasureUnit getMeterPerSecondSquared();
247 #endif /* U_HIDE_DRAFT_API */
248 
256  static MeasureUnit *createArcMinute(UErrorCode &status);
257 
258 #ifndef U_HIDE_DRAFT_API
259 
264  static MeasureUnit getArcMinute();
265 #endif /* U_HIDE_DRAFT_API */
266 
274  static MeasureUnit *createArcSecond(UErrorCode &status);
275 
276 #ifndef U_HIDE_DRAFT_API
277 
282  static MeasureUnit getArcSecond();
283 #endif /* U_HIDE_DRAFT_API */
284 
292  static MeasureUnit *createDegree(UErrorCode &status);
293 
294 #ifndef U_HIDE_DRAFT_API
295 
300  static MeasureUnit getDegree();
301 #endif /* U_HIDE_DRAFT_API */
302 
310  static MeasureUnit *createRadian(UErrorCode &status);
311 
312 #ifndef U_HIDE_DRAFT_API
313 
318  static MeasureUnit getRadian();
319 #endif /* U_HIDE_DRAFT_API */
320 
328  static MeasureUnit *createRevolutionAngle(UErrorCode &status);
329 
330 #ifndef U_HIDE_DRAFT_API
331 
336  static MeasureUnit getRevolutionAngle();
337 #endif /* U_HIDE_DRAFT_API */
338 
346  static MeasureUnit *createAcre(UErrorCode &status);
347 
348 #ifndef U_HIDE_DRAFT_API
349 
354  static MeasureUnit getAcre();
355 #endif /* U_HIDE_DRAFT_API */
356 
357 #ifndef U_HIDE_DRAFT_API
358 
365  static MeasureUnit *createDunam(UErrorCode &status);
366 
372  static MeasureUnit getDunam();
373 #endif /* U_HIDE_DRAFT_API */
374 
382  static MeasureUnit *createHectare(UErrorCode &status);
383 
384 #ifndef U_HIDE_DRAFT_API
385 
390  static MeasureUnit getHectare();
391 #endif /* U_HIDE_DRAFT_API */
392 
400  static MeasureUnit *createSquareCentimeter(UErrorCode &status);
401 
402 #ifndef U_HIDE_DRAFT_API
403 
408  static MeasureUnit getSquareCentimeter();
409 #endif /* U_HIDE_DRAFT_API */
410 
418  static MeasureUnit *createSquareFoot(UErrorCode &status);
419 
420 #ifndef U_HIDE_DRAFT_API
421 
426  static MeasureUnit getSquareFoot();
427 #endif /* U_HIDE_DRAFT_API */
428 
436  static MeasureUnit *createSquareInch(UErrorCode &status);
437 
438 #ifndef U_HIDE_DRAFT_API
439 
444  static MeasureUnit getSquareInch();
445 #endif /* U_HIDE_DRAFT_API */
446 
454  static MeasureUnit *createSquareKilometer(UErrorCode &status);
455 
456 #ifndef U_HIDE_DRAFT_API
457 
462  static MeasureUnit getSquareKilometer();
463 #endif /* U_HIDE_DRAFT_API */
464 
472  static MeasureUnit *createSquareMeter(UErrorCode &status);
473 
474 #ifndef U_HIDE_DRAFT_API
475 
480  static MeasureUnit getSquareMeter();
481 #endif /* U_HIDE_DRAFT_API */
482 
490  static MeasureUnit *createSquareMile(UErrorCode &status);
491 
492 #ifndef U_HIDE_DRAFT_API
493 
498  static MeasureUnit getSquareMile();
499 #endif /* U_HIDE_DRAFT_API */
500 
508  static MeasureUnit *createSquareYard(UErrorCode &status);
509 
510 #ifndef U_HIDE_DRAFT_API
511 
516  static MeasureUnit getSquareYard();
517 #endif /* U_HIDE_DRAFT_API */
518 
526  static MeasureUnit *createKarat(UErrorCode &status);
527 
528 #ifndef U_HIDE_DRAFT_API
529 
534  static MeasureUnit getKarat();
535 #endif /* U_HIDE_DRAFT_API */
536 
544  static MeasureUnit *createMilligramPerDeciliter(UErrorCode &status);
545 
546 #ifndef U_HIDE_DRAFT_API
547 
552  static MeasureUnit getMilligramPerDeciliter();
553 #endif /* U_HIDE_DRAFT_API */
554 
562  static MeasureUnit *createMillimolePerLiter(UErrorCode &status);
563 
564 #ifndef U_HIDE_DRAFT_API
565 
570  static MeasureUnit getMillimolePerLiter();
571 #endif /* U_HIDE_DRAFT_API */
572 
573 #ifndef U_HIDE_DRAFT_API
574 
581  static MeasureUnit *createMole(UErrorCode &status);
582 
588  static MeasureUnit getMole();
589 #endif /* U_HIDE_DRAFT_API */
590 
598  static MeasureUnit *createPartPerMillion(UErrorCode &status);
599 
600 #ifndef U_HIDE_DRAFT_API
601 
606  static MeasureUnit getPartPerMillion();
607 #endif /* U_HIDE_DRAFT_API */
608 
616  static MeasureUnit *createPercent(UErrorCode &status);
617 
618 #ifndef U_HIDE_DRAFT_API
619 
624  static MeasureUnit getPercent();
625 #endif /* U_HIDE_DRAFT_API */
626 
634  static MeasureUnit *createPermille(UErrorCode &status);
635 
636 #ifndef U_HIDE_DRAFT_API
637 
642  static MeasureUnit getPermille();
643 #endif /* U_HIDE_DRAFT_API */
644 
645 #ifndef U_HIDE_DRAFT_API
646 
653  static MeasureUnit *createPermyriad(UErrorCode &status);
654 
660  static MeasureUnit getPermyriad();
661 #endif /* U_HIDE_DRAFT_API */
662 
670  static MeasureUnit *createLiterPer100Kilometers(UErrorCode &status);
671 
672 #ifndef U_HIDE_DRAFT_API
673 
678  static MeasureUnit getLiterPer100Kilometers();
679 #endif /* U_HIDE_DRAFT_API */
680 
688  static MeasureUnit *createLiterPerKilometer(UErrorCode &status);
689 
690 #ifndef U_HIDE_DRAFT_API
691 
696  static MeasureUnit getLiterPerKilometer();
697 #endif /* U_HIDE_DRAFT_API */
698 
706  static MeasureUnit *createMilePerGallon(UErrorCode &status);
707 
708 #ifndef U_HIDE_DRAFT_API
709 
714  static MeasureUnit getMilePerGallon();
715 #endif /* U_HIDE_DRAFT_API */
716 
724  static MeasureUnit *createMilePerGallonImperial(UErrorCode &status);
725 
726 #ifndef U_HIDE_DRAFT_API
727 
732  static MeasureUnit getMilePerGallonImperial();
733 #endif /* U_HIDE_DRAFT_API */
734 
742  static MeasureUnit *createBit(UErrorCode &status);
743 
744 #ifndef U_HIDE_DRAFT_API
745 
750  static MeasureUnit getBit();
751 #endif /* U_HIDE_DRAFT_API */
752 
760  static MeasureUnit *createByte(UErrorCode &status);
761 
762 #ifndef U_HIDE_DRAFT_API
763 
768  static MeasureUnit getByte();
769 #endif /* U_HIDE_DRAFT_API */
770 
778  static MeasureUnit *createGigabit(UErrorCode &status);
779 
780 #ifndef U_HIDE_DRAFT_API
781 
786  static MeasureUnit getGigabit();
787 #endif /* U_HIDE_DRAFT_API */
788 
796  static MeasureUnit *createGigabyte(UErrorCode &status);
797 
798 #ifndef U_HIDE_DRAFT_API
799 
804  static MeasureUnit getGigabyte();
805 #endif /* U_HIDE_DRAFT_API */
806 
814  static MeasureUnit *createKilobit(UErrorCode &status);
815 
816 #ifndef U_HIDE_DRAFT_API
817 
822  static MeasureUnit getKilobit();
823 #endif /* U_HIDE_DRAFT_API */
824 
832  static MeasureUnit *createKilobyte(UErrorCode &status);
833 
834 #ifndef U_HIDE_DRAFT_API
835 
840  static MeasureUnit getKilobyte();
841 #endif /* U_HIDE_DRAFT_API */
842 
850  static MeasureUnit *createMegabit(UErrorCode &status);
851 
852 #ifndef U_HIDE_DRAFT_API
853 
858  static MeasureUnit getMegabit();
859 #endif /* U_HIDE_DRAFT_API */
860 
868  static MeasureUnit *createMegabyte(UErrorCode &status);
869 
870 #ifndef U_HIDE_DRAFT_API
871 
876  static MeasureUnit getMegabyte();
877 #endif /* U_HIDE_DRAFT_API */
878 
886  static MeasureUnit *createPetabyte(UErrorCode &status);
887 
888 #ifndef U_HIDE_DRAFT_API
889 
894  static MeasureUnit getPetabyte();
895 #endif /* U_HIDE_DRAFT_API */
896 
904  static MeasureUnit *createTerabit(UErrorCode &status);
905 
906 #ifndef U_HIDE_DRAFT_API
907 
912  static MeasureUnit getTerabit();
913 #endif /* U_HIDE_DRAFT_API */
914 
922  static MeasureUnit *createTerabyte(UErrorCode &status);
923 
924 #ifndef U_HIDE_DRAFT_API
925 
930  static MeasureUnit getTerabyte();
931 #endif /* U_HIDE_DRAFT_API */
932 
940  static MeasureUnit *createCentury(UErrorCode &status);
941 
942 #ifndef U_HIDE_DRAFT_API
943 
948  static MeasureUnit getCentury();
949 #endif /* U_HIDE_DRAFT_API */
950 
958  static MeasureUnit *createDay(UErrorCode &status);
959 
960 #ifndef U_HIDE_DRAFT_API
961 
966  static MeasureUnit getDay();
967 #endif /* U_HIDE_DRAFT_API */
968 
969 #ifndef U_HIDE_DRAFT_API
970 
977  static MeasureUnit *createDayPerson(UErrorCode &status);
978 
984  static MeasureUnit getDayPerson();
985 #endif /* U_HIDE_DRAFT_API */
986 
987 #ifndef U_HIDE_DRAFT_API
988 
995  static MeasureUnit *createDecade(UErrorCode &status);
996 
1002  static MeasureUnit getDecade();
1003 #endif /* U_HIDE_DRAFT_API */
1004 
1012  static MeasureUnit *createHour(UErrorCode &status);
1013 
1014 #ifndef U_HIDE_DRAFT_API
1015 
1020  static MeasureUnit getHour();
1021 #endif /* U_HIDE_DRAFT_API */
1022 
1030  static MeasureUnit *createMicrosecond(UErrorCode &status);
1031 
1032 #ifndef U_HIDE_DRAFT_API
1033 
1038  static MeasureUnit getMicrosecond();
1039 #endif /* U_HIDE_DRAFT_API */
1040 
1048  static MeasureUnit *createMillisecond(UErrorCode &status);
1049 
1050 #ifndef U_HIDE_DRAFT_API
1051 
1056  static MeasureUnit getMillisecond();
1057 #endif /* U_HIDE_DRAFT_API */
1058 
1066  static MeasureUnit *createMinute(UErrorCode &status);
1067 
1068 #ifndef U_HIDE_DRAFT_API
1069 
1074  static MeasureUnit getMinute();
1075 #endif /* U_HIDE_DRAFT_API */
1076 
1084  static MeasureUnit *createMonth(UErrorCode &status);
1085 
1086 #ifndef U_HIDE_DRAFT_API
1087 
1092  static MeasureUnit getMonth();
1093 #endif /* U_HIDE_DRAFT_API */
1094 
1095 #ifndef U_HIDE_DRAFT_API
1096 
1103  static MeasureUnit *createMonthPerson(UErrorCode &status);
1104 
1110  static MeasureUnit getMonthPerson();
1111 #endif /* U_HIDE_DRAFT_API */
1112 
1120  static MeasureUnit *createNanosecond(UErrorCode &status);
1121 
1122 #ifndef U_HIDE_DRAFT_API
1123 
1128  static MeasureUnit getNanosecond();
1129 #endif /* U_HIDE_DRAFT_API */
1130 
1138  static MeasureUnit *createSecond(UErrorCode &status);
1139 
1140 #ifndef U_HIDE_DRAFT_API
1141 
1146  static MeasureUnit getSecond();
1147 #endif /* U_HIDE_DRAFT_API */
1148 
1156  static MeasureUnit *createWeek(UErrorCode &status);
1157 
1158 #ifndef U_HIDE_DRAFT_API
1159 
1164  static MeasureUnit getWeek();
1165 #endif /* U_HIDE_DRAFT_API */
1166 
1167 #ifndef U_HIDE_DRAFT_API
1168 
1175  static MeasureUnit *createWeekPerson(UErrorCode &status);
1176 
1182  static MeasureUnit getWeekPerson();
1183 #endif /* U_HIDE_DRAFT_API */
1184 
1192  static MeasureUnit *createYear(UErrorCode &status);
1193 
1194 #ifndef U_HIDE_DRAFT_API
1195 
1200  static MeasureUnit getYear();
1201 #endif /* U_HIDE_DRAFT_API */
1202 
1203 #ifndef U_HIDE_DRAFT_API
1204 
1211  static MeasureUnit *createYearPerson(UErrorCode &status);
1212 
1218  static MeasureUnit getYearPerson();
1219 #endif /* U_HIDE_DRAFT_API */
1220 
1228  static MeasureUnit *createAmpere(UErrorCode &status);
1229 
1230 #ifndef U_HIDE_DRAFT_API
1231 
1236  static MeasureUnit getAmpere();
1237 #endif /* U_HIDE_DRAFT_API */
1238 
1246  static MeasureUnit *createMilliampere(UErrorCode &status);
1247 
1248 #ifndef U_HIDE_DRAFT_API
1249 
1254  static MeasureUnit getMilliampere();
1255 #endif /* U_HIDE_DRAFT_API */
1256 
1264  static MeasureUnit *createOhm(UErrorCode &status);
1265 
1266 #ifndef U_HIDE_DRAFT_API
1267 
1272  static MeasureUnit getOhm();
1273 #endif /* U_HIDE_DRAFT_API */
1274 
1282  static MeasureUnit *createVolt(UErrorCode &status);
1283 
1284 #ifndef U_HIDE_DRAFT_API
1285 
1290  static MeasureUnit getVolt();
1291 #endif /* U_HIDE_DRAFT_API */
1292 
1293 #ifndef U_HIDE_DRAFT_API
1294 
1301  static MeasureUnit *createBritishThermalUnit(UErrorCode &status);
1302 
1308  static MeasureUnit getBritishThermalUnit();
1309 #endif /* U_HIDE_DRAFT_API */
1310 
1318  static MeasureUnit *createCalorie(UErrorCode &status);
1319 
1320 #ifndef U_HIDE_DRAFT_API
1321 
1326  static MeasureUnit getCalorie();
1327 #endif /* U_HIDE_DRAFT_API */
1328 
1329 #ifndef U_HIDE_DRAFT_API
1330 
1337  static MeasureUnit *createElectronvolt(UErrorCode &status);
1338 
1344  static MeasureUnit getElectronvolt();
1345 #endif /* U_HIDE_DRAFT_API */
1346 
1354  static MeasureUnit *createFoodcalorie(UErrorCode &status);
1355 
1356 #ifndef U_HIDE_DRAFT_API
1357 
1362  static MeasureUnit getFoodcalorie();
1363 #endif /* U_HIDE_DRAFT_API */
1364 
1372  static MeasureUnit *createJoule(UErrorCode &status);
1373 
1374 #ifndef U_HIDE_DRAFT_API
1375 
1380  static MeasureUnit getJoule();
1381 #endif /* U_HIDE_DRAFT_API */
1382 
1390  static MeasureUnit *createKilocalorie(UErrorCode &status);
1391 
1392 #ifndef U_HIDE_DRAFT_API
1393 
1398  static MeasureUnit getKilocalorie();
1399 #endif /* U_HIDE_DRAFT_API */
1400 
1408  static MeasureUnit *createKilojoule(UErrorCode &status);
1409 
1410 #ifndef U_HIDE_DRAFT_API
1411 
1416  static MeasureUnit getKilojoule();
1417 #endif /* U_HIDE_DRAFT_API */
1418 
1426  static MeasureUnit *createKilowattHour(UErrorCode &status);
1427 
1428 #ifndef U_HIDE_DRAFT_API
1429 
1434  static MeasureUnit getKilowattHour();
1435 #endif /* U_HIDE_DRAFT_API */
1436 
1437 #ifndef U_HIDE_DRAFT_API
1438 
1445  static MeasureUnit *createThermUs(UErrorCode &status);
1446 
1452  static MeasureUnit getThermUs();
1453 #endif /* U_HIDE_DRAFT_API */
1454 
1455 #ifndef U_HIDE_DRAFT_API
1456 
1463  static MeasureUnit *createNewton(UErrorCode &status);
1464 
1470  static MeasureUnit getNewton();
1471 #endif /* U_HIDE_DRAFT_API */
1472 
1473 #ifndef U_HIDE_DRAFT_API
1474 
1481  static MeasureUnit *createPoundForce(UErrorCode &status);
1482 
1488  static MeasureUnit getPoundForce();
1489 #endif /* U_HIDE_DRAFT_API */
1490 
1498  static MeasureUnit *createGigahertz(UErrorCode &status);
1499 
1500 #ifndef U_HIDE_DRAFT_API
1501 
1506  static MeasureUnit getGigahertz();
1507 #endif /* U_HIDE_DRAFT_API */
1508 
1516  static MeasureUnit *createHertz(UErrorCode &status);
1517 
1518 #ifndef U_HIDE_DRAFT_API
1519 
1524  static MeasureUnit getHertz();
1525 #endif /* U_HIDE_DRAFT_API */
1526 
1534  static MeasureUnit *createKilohertz(UErrorCode &status);
1535 
1536 #ifndef U_HIDE_DRAFT_API
1537 
1542  static MeasureUnit getKilohertz();
1543 #endif /* U_HIDE_DRAFT_API */
1544 
1552  static MeasureUnit *createMegahertz(UErrorCode &status);
1553 
1554 #ifndef U_HIDE_DRAFT_API
1555 
1560  static MeasureUnit getMegahertz();
1561 #endif /* U_HIDE_DRAFT_API */
1562 
1563 #ifndef U_HIDE_DRAFT_API
1564 
1571  static MeasureUnit *createDotPerCentimeter(UErrorCode &status);
1572 
1578  static MeasureUnit getDotPerCentimeter();
1579 #endif /* U_HIDE_DRAFT_API */
1580 
1581 #ifndef U_HIDE_DRAFT_API
1582 
1589  static MeasureUnit *createDotPerInch(UErrorCode &status);
1590 
1596  static MeasureUnit getDotPerInch();
1597 #endif /* U_HIDE_DRAFT_API */
1598 
1599 #ifndef U_HIDE_DRAFT_API
1600 
1607  static MeasureUnit *createEm(UErrorCode &status);
1608 
1614  static MeasureUnit getEm();
1615 #endif /* U_HIDE_DRAFT_API */
1616 
1617 #ifndef U_HIDE_DRAFT_API
1618 
1625  static MeasureUnit *createMegapixel(UErrorCode &status);
1626 
1632  static MeasureUnit getMegapixel();
1633 #endif /* U_HIDE_DRAFT_API */
1634 
1635 #ifndef U_HIDE_DRAFT_API
1636 
1643  static MeasureUnit *createPixel(UErrorCode &status);
1644 
1650  static MeasureUnit getPixel();
1651 #endif /* U_HIDE_DRAFT_API */
1652 
1653 #ifndef U_HIDE_DRAFT_API
1654 
1661  static MeasureUnit *createPixelPerCentimeter(UErrorCode &status);
1662 
1668  static MeasureUnit getPixelPerCentimeter();
1669 #endif /* U_HIDE_DRAFT_API */
1670 
1671 #ifndef U_HIDE_DRAFT_API
1672 
1679  static MeasureUnit *createPixelPerInch(UErrorCode &status);
1680 
1686  static MeasureUnit getPixelPerInch();
1687 #endif /* U_HIDE_DRAFT_API */
1688 
1696  static MeasureUnit *createAstronomicalUnit(UErrorCode &status);
1697 
1698 #ifndef U_HIDE_DRAFT_API
1699 
1704  static MeasureUnit getAstronomicalUnit();
1705 #endif /* U_HIDE_DRAFT_API */
1706 
1714  static MeasureUnit *createCentimeter(UErrorCode &status);
1715 
1716 #ifndef U_HIDE_DRAFT_API
1717 
1722  static MeasureUnit getCentimeter();
1723 #endif /* U_HIDE_DRAFT_API */
1724 
1732  static MeasureUnit *createDecimeter(UErrorCode &status);
1733 
1734 #ifndef U_HIDE_DRAFT_API
1735 
1740  static MeasureUnit getDecimeter();
1741 #endif /* U_HIDE_DRAFT_API */
1742 
1750  static MeasureUnit *createFathom(UErrorCode &status);
1751 
1752 #ifndef U_HIDE_DRAFT_API
1753 
1758  static MeasureUnit getFathom();
1759 #endif /* U_HIDE_DRAFT_API */
1760 
1768  static MeasureUnit *createFoot(UErrorCode &status);
1769 
1770 #ifndef U_HIDE_DRAFT_API
1771 
1776  static MeasureUnit getFoot();
1777 #endif /* U_HIDE_DRAFT_API */
1778 
1786  static MeasureUnit *createFurlong(UErrorCode &status);
1787 
1788 #ifndef U_HIDE_DRAFT_API
1789 
1794  static MeasureUnit getFurlong();
1795 #endif /* U_HIDE_DRAFT_API */
1796 
1804  static MeasureUnit *createInch(UErrorCode &status);
1805 
1806 #ifndef U_HIDE_DRAFT_API
1807 
1812  static MeasureUnit getInch();
1813 #endif /* U_HIDE_DRAFT_API */
1814 
1822  static MeasureUnit *createKilometer(UErrorCode &status);
1823 
1824 #ifndef U_HIDE_DRAFT_API
1825 
1830  static MeasureUnit getKilometer();
1831 #endif /* U_HIDE_DRAFT_API */
1832 
1840  static MeasureUnit *createLightYear(UErrorCode &status);
1841 
1842 #ifndef U_HIDE_DRAFT_API
1843 
1848  static MeasureUnit getLightYear();
1849 #endif /* U_HIDE_DRAFT_API */
1850 
1858  static MeasureUnit *createMeter(UErrorCode &status);
1859 
1860 #ifndef U_HIDE_DRAFT_API
1861 
1866  static MeasureUnit getMeter();
1867 #endif /* U_HIDE_DRAFT_API */
1868 
1876  static MeasureUnit *createMicrometer(UErrorCode &status);
1877 
1878 #ifndef U_HIDE_DRAFT_API
1879 
1884  static MeasureUnit getMicrometer();
1885 #endif /* U_HIDE_DRAFT_API */
1886 
1894  static MeasureUnit *createMile(UErrorCode &status);
1895 
1896 #ifndef U_HIDE_DRAFT_API
1897 
1902  static MeasureUnit getMile();
1903 #endif /* U_HIDE_DRAFT_API */
1904 
1912  static MeasureUnit *createMileScandinavian(UErrorCode &status);
1913 
1914 #ifndef U_HIDE_DRAFT_API
1915 
1920  static MeasureUnit getMileScandinavian();
1921 #endif /* U_HIDE_DRAFT_API */
1922 
1930  static MeasureUnit *createMillimeter(UErrorCode &status);
1931 
1932 #ifndef U_HIDE_DRAFT_API
1933 
1938  static MeasureUnit getMillimeter();
1939 #endif /* U_HIDE_DRAFT_API */
1940 
1948  static MeasureUnit *createNanometer(UErrorCode &status);
1949 
1950 #ifndef U_HIDE_DRAFT_API
1951 
1956  static MeasureUnit getNanometer();
1957 #endif /* U_HIDE_DRAFT_API */
1958 
1966  static MeasureUnit *createNauticalMile(UErrorCode &status);
1967 
1968 #ifndef U_HIDE_DRAFT_API
1969 
1974  static MeasureUnit getNauticalMile();
1975 #endif /* U_HIDE_DRAFT_API */
1976 
1984  static MeasureUnit *createParsec(UErrorCode &status);
1985 
1986 #ifndef U_HIDE_DRAFT_API
1987 
1992  static MeasureUnit getParsec();
1993 #endif /* U_HIDE_DRAFT_API */
1994 
2002  static MeasureUnit *createPicometer(UErrorCode &status);
2003 
2004 #ifndef U_HIDE_DRAFT_API
2005 
2010  static MeasureUnit getPicometer();
2011 #endif /* U_HIDE_DRAFT_API */
2012 
2020  static MeasureUnit *createPoint(UErrorCode &status);
2021 
2022 #ifndef U_HIDE_DRAFT_API
2023 
2028  static MeasureUnit getPoint();
2029 #endif /* U_HIDE_DRAFT_API */
2030 
2031 #ifndef U_HIDE_DRAFT_API
2032 
2039  static MeasureUnit *createSolarRadius(UErrorCode &status);
2040 
2046  static MeasureUnit getSolarRadius();
2047 #endif /* U_HIDE_DRAFT_API */
2048 
2056  static MeasureUnit *createYard(UErrorCode &status);
2057 
2058 #ifndef U_HIDE_DRAFT_API
2059 
2064  static MeasureUnit getYard();
2065 #endif /* U_HIDE_DRAFT_API */
2066 
2074  static MeasureUnit *createLux(UErrorCode &status);
2075 
2076 #ifndef U_HIDE_DRAFT_API
2077 
2082  static MeasureUnit getLux();
2083 #endif /* U_HIDE_DRAFT_API */
2084 
2085 #ifndef U_HIDE_DRAFT_API
2086 
2093  static MeasureUnit *createSolarLuminosity(UErrorCode &status);
2094 
2100  static MeasureUnit getSolarLuminosity();
2101 #endif /* U_HIDE_DRAFT_API */
2102 
2110  static MeasureUnit *createCarat(UErrorCode &status);
2111 
2112 #ifndef U_HIDE_DRAFT_API
2113 
2118  static MeasureUnit getCarat();
2119 #endif /* U_HIDE_DRAFT_API */
2120 
2121 #ifndef U_HIDE_DRAFT_API
2122 
2129  static MeasureUnit *createDalton(UErrorCode &status);
2130 
2136  static MeasureUnit getDalton();
2137 #endif /* U_HIDE_DRAFT_API */
2138 
2139 #ifndef U_HIDE_DRAFT_API
2140 
2147  static MeasureUnit *createEarthMass(UErrorCode &status);
2148 
2154  static MeasureUnit getEarthMass();
2155 #endif /* U_HIDE_DRAFT_API */
2156 
2164  static MeasureUnit *createGram(UErrorCode &status);
2165 
2166 #ifndef U_HIDE_DRAFT_API
2167 
2172  static MeasureUnit getGram();
2173 #endif /* U_HIDE_DRAFT_API */
2174 
2182  static MeasureUnit *createKilogram(UErrorCode &status);
2183 
2184 #ifndef U_HIDE_DRAFT_API
2185 
2190  static MeasureUnit getKilogram();
2191 #endif /* U_HIDE_DRAFT_API */
2192 
2200  static MeasureUnit *createMetricTon(UErrorCode &status);
2201 
2202 #ifndef U_HIDE_DRAFT_API
2203 
2208  static MeasureUnit getMetricTon();
2209 #endif /* U_HIDE_DRAFT_API */
2210 
2218  static MeasureUnit *createMicrogram(UErrorCode &status);
2219 
2220 #ifndef U_HIDE_DRAFT_API
2221 
2226  static MeasureUnit getMicrogram();
2227 #endif /* U_HIDE_DRAFT_API */
2228 
2236  static MeasureUnit *createMilligram(UErrorCode &status);
2237 
2238 #ifndef U_HIDE_DRAFT_API
2239 
2244  static MeasureUnit getMilligram();
2245 #endif /* U_HIDE_DRAFT_API */
2246 
2254  static MeasureUnit *createOunce(UErrorCode &status);
2255 
2256 #ifndef U_HIDE_DRAFT_API
2257 
2262  static MeasureUnit getOunce();
2263 #endif /* U_HIDE_DRAFT_API */
2264 
2272  static MeasureUnit *createOunceTroy(UErrorCode &status);
2273 
2274 #ifndef U_HIDE_DRAFT_API
2275 
2280  static MeasureUnit getOunceTroy();
2281 #endif /* U_HIDE_DRAFT_API */
2282 
2290  static MeasureUnit *createPound(UErrorCode &status);
2291 
2292 #ifndef U_HIDE_DRAFT_API
2293 
2298  static MeasureUnit getPound();
2299 #endif /* U_HIDE_DRAFT_API */
2300 
2301 #ifndef U_HIDE_DRAFT_API
2302 
2309  static MeasureUnit *createSolarMass(UErrorCode &status);
2310 
2316  static MeasureUnit getSolarMass();
2317 #endif /* U_HIDE_DRAFT_API */
2318 
2326  static MeasureUnit *createStone(UErrorCode &status);
2327 
2328 #ifndef U_HIDE_DRAFT_API
2329 
2334  static MeasureUnit getStone();
2335 #endif /* U_HIDE_DRAFT_API */
2336 
2344  static MeasureUnit *createTon(UErrorCode &status);
2345 
2346 #ifndef U_HIDE_DRAFT_API
2347 
2352  static MeasureUnit getTon();
2353 #endif /* U_HIDE_DRAFT_API */
2354 
2362  static MeasureUnit *createGigawatt(UErrorCode &status);
2363 
2364 #ifndef U_HIDE_DRAFT_API
2365 
2370  static MeasureUnit getGigawatt();
2371 #endif /* U_HIDE_DRAFT_API */
2372 
2380  static MeasureUnit *createHorsepower(UErrorCode &status);
2381 
2382 #ifndef U_HIDE_DRAFT_API
2383 
2388  static MeasureUnit getHorsepower();
2389 #endif /* U_HIDE_DRAFT_API */
2390 
2398  static MeasureUnit *createKilowatt(UErrorCode &status);
2399 
2400 #ifndef U_HIDE_DRAFT_API
2401 
2406  static MeasureUnit getKilowatt();
2407 #endif /* U_HIDE_DRAFT_API */
2408 
2416  static MeasureUnit *createMegawatt(UErrorCode &status);
2417 
2418 #ifndef U_HIDE_DRAFT_API
2419 
2424  static MeasureUnit getMegawatt();
2425 #endif /* U_HIDE_DRAFT_API */
2426 
2434  static MeasureUnit *createMilliwatt(UErrorCode &status);
2435 
2436 #ifndef U_HIDE_DRAFT_API
2437 
2442  static MeasureUnit getMilliwatt();
2443 #endif /* U_HIDE_DRAFT_API */
2444 
2452  static MeasureUnit *createWatt(UErrorCode &status);
2453 
2454 #ifndef U_HIDE_DRAFT_API
2455 
2460  static MeasureUnit getWatt();
2461 #endif /* U_HIDE_DRAFT_API */
2462 
2470  static MeasureUnit *createAtmosphere(UErrorCode &status);
2471 
2472 #ifndef U_HIDE_DRAFT_API
2473 
2478  static MeasureUnit getAtmosphere();
2479 #endif /* U_HIDE_DRAFT_API */
2480 
2481 #ifndef U_HIDE_DRAFT_API
2482 
2489  static MeasureUnit *createBar(UErrorCode &status);
2490 
2496  static MeasureUnit getBar();
2497 #endif /* U_HIDE_DRAFT_API */
2498 
2506  static MeasureUnit *createHectopascal(UErrorCode &status);
2507 
2508 #ifndef U_HIDE_DRAFT_API
2509 
2514  static MeasureUnit getHectopascal();
2515 #endif /* U_HIDE_DRAFT_API */
2516 
2524  static MeasureUnit *createInchHg(UErrorCode &status);
2525 
2526 #ifndef U_HIDE_DRAFT_API
2527 
2532  static MeasureUnit getInchHg();
2533 #endif /* U_HIDE_DRAFT_API */
2534 
2535 #ifndef U_HIDE_DRAFT_API
2536 
2543  static MeasureUnit *createKilopascal(UErrorCode &status);
2544 
2550  static MeasureUnit getKilopascal();
2551 #endif /* U_HIDE_DRAFT_API */
2552 
2553 #ifndef U_HIDE_DRAFT_API
2554 
2561  static MeasureUnit *createMegapascal(UErrorCode &status);
2562 
2568  static MeasureUnit getMegapascal();
2569 #endif /* U_HIDE_DRAFT_API */
2570 
2578  static MeasureUnit *createMillibar(UErrorCode &status);
2579 
2580 #ifndef U_HIDE_DRAFT_API
2581 
2586  static MeasureUnit getMillibar();
2587 #endif /* U_HIDE_DRAFT_API */
2588 
2596  static MeasureUnit *createMillimeterOfMercury(UErrorCode &status);
2597 
2598 #ifndef U_HIDE_DRAFT_API
2599 
2604  static MeasureUnit getMillimeterOfMercury();
2605 #endif /* U_HIDE_DRAFT_API */
2606 
2607 #ifndef U_HIDE_DRAFT_API
2608 
2615  static MeasureUnit *createPascal(UErrorCode &status);
2616 
2622  static MeasureUnit getPascal();
2623 #endif /* U_HIDE_DRAFT_API */
2624 
2632  static MeasureUnit *createPoundPerSquareInch(UErrorCode &status);
2633 
2634 #ifndef U_HIDE_DRAFT_API
2635 
2640  static MeasureUnit getPoundPerSquareInch();
2641 #endif /* U_HIDE_DRAFT_API */
2642 
2650  static MeasureUnit *createKilometerPerHour(UErrorCode &status);
2651 
2652 #ifndef U_HIDE_DRAFT_API
2653 
2658  static MeasureUnit getKilometerPerHour();
2659 #endif /* U_HIDE_DRAFT_API */
2660 
2668  static MeasureUnit *createKnot(UErrorCode &status);
2669 
2670 #ifndef U_HIDE_DRAFT_API
2671 
2676  static MeasureUnit getKnot();
2677 #endif /* U_HIDE_DRAFT_API */
2678 
2686  static MeasureUnit *createMeterPerSecond(UErrorCode &status);
2687 
2688 #ifndef U_HIDE_DRAFT_API
2689 
2694  static MeasureUnit getMeterPerSecond();
2695 #endif /* U_HIDE_DRAFT_API */
2696 
2704  static MeasureUnit *createMilePerHour(UErrorCode &status);
2705 
2706 #ifndef U_HIDE_DRAFT_API
2707 
2712  static MeasureUnit getMilePerHour();
2713 #endif /* U_HIDE_DRAFT_API */
2714 
2722  static MeasureUnit *createCelsius(UErrorCode &status);
2723 
2724 #ifndef U_HIDE_DRAFT_API
2725 
2730  static MeasureUnit getCelsius();
2731 #endif /* U_HIDE_DRAFT_API */
2732 
2740  static MeasureUnit *createFahrenheit(UErrorCode &status);
2741 
2742 #ifndef U_HIDE_DRAFT_API
2743 
2748  static MeasureUnit getFahrenheit();
2749 #endif /* U_HIDE_DRAFT_API */
2750 
2758  static MeasureUnit *createGenericTemperature(UErrorCode &status);
2759 
2760 #ifndef U_HIDE_DRAFT_API
2761 
2766  static MeasureUnit getGenericTemperature();
2767 #endif /* U_HIDE_DRAFT_API */
2768 
2776  static MeasureUnit *createKelvin(UErrorCode &status);
2777 
2778 #ifndef U_HIDE_DRAFT_API
2779 
2784  static MeasureUnit getKelvin();
2785 #endif /* U_HIDE_DRAFT_API */
2786 
2787 #ifndef U_HIDE_DRAFT_API
2788 
2795  static MeasureUnit *createNewtonMeter(UErrorCode &status);
2796 
2802  static MeasureUnit getNewtonMeter();
2803 #endif /* U_HIDE_DRAFT_API */
2804 
2805 #ifndef U_HIDE_DRAFT_API
2806 
2813  static MeasureUnit *createPoundFoot(UErrorCode &status);
2814 
2820  static MeasureUnit getPoundFoot();
2821 #endif /* U_HIDE_DRAFT_API */
2822 
2830  static MeasureUnit *createAcreFoot(UErrorCode &status);
2831 
2832 #ifndef U_HIDE_DRAFT_API
2833 
2838  static MeasureUnit getAcreFoot();
2839 #endif /* U_HIDE_DRAFT_API */
2840 
2841 #ifndef U_HIDE_DRAFT_API
2842 
2849  static MeasureUnit *createBarrel(UErrorCode &status);
2850 
2856  static MeasureUnit getBarrel();
2857 #endif /* U_HIDE_DRAFT_API */
2858 
2866  static MeasureUnit *createBushel(UErrorCode &status);
2867 
2868 #ifndef U_HIDE_DRAFT_API
2869 
2874  static MeasureUnit getBushel();
2875 #endif /* U_HIDE_DRAFT_API */
2876 
2884  static MeasureUnit *createCentiliter(UErrorCode &status);
2885 
2886 #ifndef U_HIDE_DRAFT_API
2887 
2892  static MeasureUnit getCentiliter();
2893 #endif /* U_HIDE_DRAFT_API */
2894 
2902  static MeasureUnit *createCubicCentimeter(UErrorCode &status);
2903 
2904 #ifndef U_HIDE_DRAFT_API
2905 
2910  static MeasureUnit getCubicCentimeter();
2911 #endif /* U_HIDE_DRAFT_API */
2912 
2920  static MeasureUnit *createCubicFoot(UErrorCode &status);
2921 
2922 #ifndef U_HIDE_DRAFT_API
2923 
2928  static MeasureUnit getCubicFoot();
2929 #endif /* U_HIDE_DRAFT_API */
2930 
2938  static MeasureUnit *createCubicInch(UErrorCode &status);
2939 
2940 #ifndef U_HIDE_DRAFT_API
2941 
2946  static MeasureUnit getCubicInch();
2947 #endif /* U_HIDE_DRAFT_API */
2948 
2956  static MeasureUnit *createCubicKilometer(UErrorCode &status);
2957 
2958 #ifndef U_HIDE_DRAFT_API
2959 
2964  static MeasureUnit getCubicKilometer();
2965 #endif /* U_HIDE_DRAFT_API */
2966 
2974  static MeasureUnit *createCubicMeter(UErrorCode &status);
2975 
2976 #ifndef U_HIDE_DRAFT_API
2977 
2982  static MeasureUnit getCubicMeter();
2983 #endif /* U_HIDE_DRAFT_API */
2984 
2992  static MeasureUnit *createCubicMile(UErrorCode &status);
2993 
2994 #ifndef U_HIDE_DRAFT_API
2995 
3000  static MeasureUnit getCubicMile();
3001 #endif /* U_HIDE_DRAFT_API */
3002 
3010  static MeasureUnit *createCubicYard(UErrorCode &status);
3011 
3012 #ifndef U_HIDE_DRAFT_API
3013 
3018  static MeasureUnit getCubicYard();
3019 #endif /* U_HIDE_DRAFT_API */
3020 
3028  static MeasureUnit *createCup(UErrorCode &status);
3029 
3030 #ifndef U_HIDE_DRAFT_API
3031 
3036  static MeasureUnit getCup();
3037 #endif /* U_HIDE_DRAFT_API */
3038 
3046  static MeasureUnit *createCupMetric(UErrorCode &status);
3047 
3048 #ifndef U_HIDE_DRAFT_API
3049 
3054  static MeasureUnit getCupMetric();
3055 #endif /* U_HIDE_DRAFT_API */
3056 
3064  static MeasureUnit *createDeciliter(UErrorCode &status);
3065 
3066 #ifndef U_HIDE_DRAFT_API
3067 
3072  static MeasureUnit getDeciliter();
3073 #endif /* U_HIDE_DRAFT_API */
3074 
3082  static MeasureUnit *createFluidOunce(UErrorCode &status);
3083 
3084 #ifndef U_HIDE_DRAFT_API
3085 
3090  static MeasureUnit getFluidOunce();
3091 #endif /* U_HIDE_DRAFT_API */
3092 
3093 #ifndef U_HIDE_DRAFT_API
3094 
3101  static MeasureUnit *createFluidOunceImperial(UErrorCode &status);
3102 
3108  static MeasureUnit getFluidOunceImperial();
3109 #endif /* U_HIDE_DRAFT_API */
3110 
3118  static MeasureUnit *createGallon(UErrorCode &status);
3119 
3120 #ifndef U_HIDE_DRAFT_API
3121 
3126  static MeasureUnit getGallon();
3127 #endif /* U_HIDE_DRAFT_API */
3128 
3136  static MeasureUnit *createGallonImperial(UErrorCode &status);
3137 
3138 #ifndef U_HIDE_DRAFT_API
3139 
3144  static MeasureUnit getGallonImperial();
3145 #endif /* U_HIDE_DRAFT_API */
3146 
3154  static MeasureUnit *createHectoliter(UErrorCode &status);
3155 
3156 #ifndef U_HIDE_DRAFT_API
3157 
3162  static MeasureUnit getHectoliter();
3163 #endif /* U_HIDE_DRAFT_API */
3164 
3172  static MeasureUnit *createLiter(UErrorCode &status);
3173 
3174 #ifndef U_HIDE_DRAFT_API
3175 
3180  static MeasureUnit getLiter();
3181 #endif /* U_HIDE_DRAFT_API */
3182 
3190  static MeasureUnit *createMegaliter(UErrorCode &status);
3191 
3192 #ifndef U_HIDE_DRAFT_API
3193 
3198  static MeasureUnit getMegaliter();
3199 #endif /* U_HIDE_DRAFT_API */
3200 
3208  static MeasureUnit *createMilliliter(UErrorCode &status);
3209 
3210 #ifndef U_HIDE_DRAFT_API
3211 
3216  static MeasureUnit getMilliliter();
3217 #endif /* U_HIDE_DRAFT_API */
3218 
3226  static MeasureUnit *createPint(UErrorCode &status);
3227 
3228 #ifndef U_HIDE_DRAFT_API
3229 
3234  static MeasureUnit getPint();
3235 #endif /* U_HIDE_DRAFT_API */
3236 
3244  static MeasureUnit *createPintMetric(UErrorCode &status);
3245 
3246 #ifndef U_HIDE_DRAFT_API
3247 
3252  static MeasureUnit getPintMetric();
3253 #endif /* U_HIDE_DRAFT_API */
3254 
3262  static MeasureUnit *createQuart(UErrorCode &status);
3263 
3264 #ifndef U_HIDE_DRAFT_API
3265 
3270  static MeasureUnit getQuart();
3271 #endif /* U_HIDE_DRAFT_API */
3272 
3280  static MeasureUnit *createTablespoon(UErrorCode &status);
3281 
3282 #ifndef U_HIDE_DRAFT_API
3283 
3288  static MeasureUnit getTablespoon();
3289 #endif /* U_HIDE_DRAFT_API */
3290 
3298  static MeasureUnit *createTeaspoon(UErrorCode &status);
3299 
3300 #ifndef U_HIDE_DRAFT_API
3301 
3306  static MeasureUnit getTeaspoon();
3307 #endif /* U_HIDE_DRAFT_API */
3308 
3309 
3310 // End generated createXXX methods
3311 
3312  protected:
3313 
3314 #ifndef U_HIDE_INTERNAL_API
3315 
3319  void initTime(const char *timeId);
3320 
3325  void initCurrency(const char *isoCurrency);
3326 
3331  void initNoUnit(const char *subtype);
3332 
3333 #endif /* U_HIDE_INTERNAL_API */
3334 
3335 private:
3336  int32_t fTypeId;
3337  int32_t fSubTypeId;
3338  char fCurrency[4];
3339 
3340  MeasureUnit(int32_t typeId, int32_t subTypeId) : fTypeId(typeId), fSubTypeId(subTypeId) {
3341  fCurrency[0] = 0;
3342  }
3343  void setTo(int32_t typeId, int32_t subTypeId);
3344  int32_t getOffset() const;
3345  static MeasureUnit *create(int typeId, int subTypeId, UErrorCode &status);
3346 };
3347 
3348 U_NAMESPACE_END
3349 
3350 #endif // !UNCONFIG_NO_FORMATTING
3351 
3352 #endif /* U_SHOW_CPLUSPLUS_API */
3353 
3354 #endif // __MEASUREUNIT_H__
A unit such as length, mass, volume, currency, etc.
Definition: measunit.h:40
C++ API: Unicode String.
U_EXPORT UBool operator==(const StringPiece &x, const StringPiece &y)
Global operator == for StringPiece.
UBool operator!=(const UObject &other) const
Inequality operator.
Definition: measunit.h:87
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Definition: uobject.h:96
Base class for 'pure' C++ implementations of uenum api.
Definition: strenum.h:61
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside...
Definition: utypes.h:301
virtual UClassID getDynamicClassID() const
ICU4C "poor man's RTTI", returns a UClassID for the actual ICU class.
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition: utypes.h:415
Basic definitions for ICU, for both C and C++ APIs.
UObject is the common ICU "boilerplate" class.
Definition: uobject.h:223
int8_t UBool
The ICU boolean type.
Definition: umachine.h:261