ICU 64.2  64.2
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 !UCONFIG_NO_FORMATTING
19 
20 #include "unicode/unistr.h"
21 
28 
29 class StringEnumeration;
30 
39  public:
40 
46  MeasureUnit();
47 
52  MeasureUnit(const MeasureUnit &other);
53 
58  MeasureUnit &operator=(const MeasureUnit &other);
59 
65  virtual UObject* clone() const;
66 
71  virtual ~MeasureUnit();
72 
78  virtual UBool operator==(const UObject& other) const;
79 
85  UBool operator!=(const UObject& other) const {
86  return !(*this == other);
87  }
88 
93  const char *getType() const;
94 
99  const char *getSubtype() const;
100 
112  static int32_t getAvailable(
113  MeasureUnit *destArray,
114  int32_t destCapacity,
115  UErrorCode &errorCode);
116 
129  static int32_t getAvailable(
130  const char *type,
131  MeasureUnit *destArray,
132  int32_t destCapacity,
133  UErrorCode &errorCode);
134 
143  static StringEnumeration* getAvailableTypes(UErrorCode &errorCode);
144 
156  static UClassID U_EXPORT2 getStaticClassID(void);
157 
169  virtual UClassID getDynamicClassID(void) const;
170 
171 #ifndef U_HIDE_INTERNAL_API
172 
178  int32_t getIndex() const;
179 
185  static int32_t getIndexCount();
186 
193  static int32_t internalGetIndexForTypeAndSubtype(const char *type, const char *subtype);
194 
199  static MeasureUnit resolveUnitPerUnit(
200  const MeasureUnit &unit, const MeasureUnit &perUnit, bool* isResolved);
201 #endif /* U_HIDE_INTERNAL_API */
202 
203 // All code between the "Start generated createXXX methods" comment and
204 // the "End generated createXXX methods" comment is auto generated code
205 // and must not be edited manually. For instructions on how to correctly
206 // update this code, refer to:
207 // http://site.icu-project.org/design/formatting/measureformat/updating-measure-unit
208 //
209 // Start generated createXXX methods
210 
218  static MeasureUnit *createGForce(UErrorCode &status);
219 
220 #ifndef U_HIDE_DRAFT_API
221 
226  static MeasureUnit getGForce();
227 #endif /* U_HIDE_DRAFT_API */
228 
236  static MeasureUnit *createMeterPerSecondSquared(UErrorCode &status);
237 
238 #ifndef U_HIDE_DRAFT_API
239 
244  static MeasureUnit getMeterPerSecondSquared();
245 #endif /* U_HIDE_DRAFT_API */
246 
254  static MeasureUnit *createArcMinute(UErrorCode &status);
255 
256 #ifndef U_HIDE_DRAFT_API
257 
262  static MeasureUnit getArcMinute();
263 #endif /* U_HIDE_DRAFT_API */
264 
272  static MeasureUnit *createArcSecond(UErrorCode &status);
273 
274 #ifndef U_HIDE_DRAFT_API
275 
280  static MeasureUnit getArcSecond();
281 #endif /* U_HIDE_DRAFT_API */
282 
290  static MeasureUnit *createDegree(UErrorCode &status);
291 
292 #ifndef U_HIDE_DRAFT_API
293 
298  static MeasureUnit getDegree();
299 #endif /* U_HIDE_DRAFT_API */
300 
308  static MeasureUnit *createRadian(UErrorCode &status);
309 
310 #ifndef U_HIDE_DRAFT_API
311 
316  static MeasureUnit getRadian();
317 #endif /* U_HIDE_DRAFT_API */
318 
326  static MeasureUnit *createRevolutionAngle(UErrorCode &status);
327 
328 #ifndef U_HIDE_DRAFT_API
329 
334  static MeasureUnit getRevolutionAngle();
335 #endif /* U_HIDE_DRAFT_API */
336 
344  static MeasureUnit *createAcre(UErrorCode &status);
345 
346 #ifndef U_HIDE_DRAFT_API
347 
352  static MeasureUnit getAcre();
353 #endif /* U_HIDE_DRAFT_API */
354 
355 #ifndef U_HIDE_DRAFT_API
356 
363  static MeasureUnit *createDunam(UErrorCode &status);
364 
370  static MeasureUnit getDunam();
371 #endif /* U_HIDE_DRAFT_API */
372 
380  static MeasureUnit *createHectare(UErrorCode &status);
381 
382 #ifndef U_HIDE_DRAFT_API
383 
388  static MeasureUnit getHectare();
389 #endif /* U_HIDE_DRAFT_API */
390 
398  static MeasureUnit *createSquareCentimeter(UErrorCode &status);
399 
400 #ifndef U_HIDE_DRAFT_API
401 
406  static MeasureUnit getSquareCentimeter();
407 #endif /* U_HIDE_DRAFT_API */
408 
416  static MeasureUnit *createSquareFoot(UErrorCode &status);
417 
418 #ifndef U_HIDE_DRAFT_API
419 
424  static MeasureUnit getSquareFoot();
425 #endif /* U_HIDE_DRAFT_API */
426 
434  static MeasureUnit *createSquareInch(UErrorCode &status);
435 
436 #ifndef U_HIDE_DRAFT_API
437 
442  static MeasureUnit getSquareInch();
443 #endif /* U_HIDE_DRAFT_API */
444 
452  static MeasureUnit *createSquareKilometer(UErrorCode &status);
453 
454 #ifndef U_HIDE_DRAFT_API
455 
460  static MeasureUnit getSquareKilometer();
461 #endif /* U_HIDE_DRAFT_API */
462 
470  static MeasureUnit *createSquareMeter(UErrorCode &status);
471 
472 #ifndef U_HIDE_DRAFT_API
473 
478  static MeasureUnit getSquareMeter();
479 #endif /* U_HIDE_DRAFT_API */
480 
488  static MeasureUnit *createSquareMile(UErrorCode &status);
489 
490 #ifndef U_HIDE_DRAFT_API
491 
496  static MeasureUnit getSquareMile();
497 #endif /* U_HIDE_DRAFT_API */
498 
506  static MeasureUnit *createSquareYard(UErrorCode &status);
507 
508 #ifndef U_HIDE_DRAFT_API
509 
514  static MeasureUnit getSquareYard();
515 #endif /* U_HIDE_DRAFT_API */
516 
524  static MeasureUnit *createKarat(UErrorCode &status);
525 
526 #ifndef U_HIDE_DRAFT_API
527 
532  static MeasureUnit getKarat();
533 #endif /* U_HIDE_DRAFT_API */
534 
542  static MeasureUnit *createMilligramPerDeciliter(UErrorCode &status);
543 
544 #ifndef U_HIDE_DRAFT_API
545 
550  static MeasureUnit getMilligramPerDeciliter();
551 #endif /* U_HIDE_DRAFT_API */
552 
560  static MeasureUnit *createMillimolePerLiter(UErrorCode &status);
561 
562 #ifndef U_HIDE_DRAFT_API
563 
568  static MeasureUnit getMillimolePerLiter();
569 #endif /* U_HIDE_DRAFT_API */
570 
571 #ifndef U_HIDE_DRAFT_API
572 
579  static MeasureUnit *createMole(UErrorCode &status);
580 
586  static MeasureUnit getMole();
587 #endif /* U_HIDE_DRAFT_API */
588 
596  static MeasureUnit *createPartPerMillion(UErrorCode &status);
597 
598 #ifndef U_HIDE_DRAFT_API
599 
604  static MeasureUnit getPartPerMillion();
605 #endif /* U_HIDE_DRAFT_API */
606 
607 #ifndef U_HIDE_DRAFT_API
608 
615  static MeasureUnit *createPercent(UErrorCode &status);
616 #endif /* U_HIDE_DRAFT_API */
617 
618 #ifndef U_HIDE_DRAFT_API
619 
624  static MeasureUnit getPercent();
625 #endif /* U_HIDE_DRAFT_API */
626 
627 #ifndef U_HIDE_DRAFT_API
628 
635  static MeasureUnit *createPermille(UErrorCode &status);
636 #endif /* U_HIDE_DRAFT_API */
637 
638 #ifndef U_HIDE_DRAFT_API
639 
644  static MeasureUnit getPermille();
645 #endif /* U_HIDE_DRAFT_API */
646 
647 #ifndef U_HIDE_DRAFT_API
648 
655  static MeasureUnit *createPermyriad(UErrorCode &status);
656 
662  static MeasureUnit getPermyriad();
663 #endif /* U_HIDE_DRAFT_API */
664 
672  static MeasureUnit *createLiterPer100Kilometers(UErrorCode &status);
673 
674 #ifndef U_HIDE_DRAFT_API
675 
680  static MeasureUnit getLiterPer100Kilometers();
681 #endif /* U_HIDE_DRAFT_API */
682 
690  static MeasureUnit *createLiterPerKilometer(UErrorCode &status);
691 
692 #ifndef U_HIDE_DRAFT_API
693 
698  static MeasureUnit getLiterPerKilometer();
699 #endif /* U_HIDE_DRAFT_API */
700 
708  static MeasureUnit *createMilePerGallon(UErrorCode &status);
709 
710 #ifndef U_HIDE_DRAFT_API
711 
716  static MeasureUnit getMilePerGallon();
717 #endif /* U_HIDE_DRAFT_API */
718 
726  static MeasureUnit *createMilePerGallonImperial(UErrorCode &status);
727 
728 #ifndef U_HIDE_DRAFT_API
729 
734  static MeasureUnit getMilePerGallonImperial();
735 #endif /* U_HIDE_DRAFT_API */
736 
744  static MeasureUnit *createBit(UErrorCode &status);
745 
746 #ifndef U_HIDE_DRAFT_API
747 
752  static MeasureUnit getBit();
753 #endif /* U_HIDE_DRAFT_API */
754 
762  static MeasureUnit *createByte(UErrorCode &status);
763 
764 #ifndef U_HIDE_DRAFT_API
765 
770  static MeasureUnit getByte();
771 #endif /* U_HIDE_DRAFT_API */
772 
780  static MeasureUnit *createGigabit(UErrorCode &status);
781 
782 #ifndef U_HIDE_DRAFT_API
783 
788  static MeasureUnit getGigabit();
789 #endif /* U_HIDE_DRAFT_API */
790 
798  static MeasureUnit *createGigabyte(UErrorCode &status);
799 
800 #ifndef U_HIDE_DRAFT_API
801 
806  static MeasureUnit getGigabyte();
807 #endif /* U_HIDE_DRAFT_API */
808 
816  static MeasureUnit *createKilobit(UErrorCode &status);
817 
818 #ifndef U_HIDE_DRAFT_API
819 
824  static MeasureUnit getKilobit();
825 #endif /* U_HIDE_DRAFT_API */
826 
834  static MeasureUnit *createKilobyte(UErrorCode &status);
835 
836 #ifndef U_HIDE_DRAFT_API
837 
842  static MeasureUnit getKilobyte();
843 #endif /* U_HIDE_DRAFT_API */
844 
852  static MeasureUnit *createMegabit(UErrorCode &status);
853 
854 #ifndef U_HIDE_DRAFT_API
855 
860  static MeasureUnit getMegabit();
861 #endif /* U_HIDE_DRAFT_API */
862 
870  static MeasureUnit *createMegabyte(UErrorCode &status);
871 
872 #ifndef U_HIDE_DRAFT_API
873 
878  static MeasureUnit getMegabyte();
879 #endif /* U_HIDE_DRAFT_API */
880 
881 #ifndef U_HIDE_DRAFT_API
882 
889  static MeasureUnit *createPetabyte(UErrorCode &status);
890 #endif /* U_HIDE_DRAFT_API */
891 
892 #ifndef U_HIDE_DRAFT_API
893 
898  static MeasureUnit getPetabyte();
899 #endif /* U_HIDE_DRAFT_API */
900 
908  static MeasureUnit *createTerabit(UErrorCode &status);
909 
910 #ifndef U_HIDE_DRAFT_API
911 
916  static MeasureUnit getTerabit();
917 #endif /* U_HIDE_DRAFT_API */
918 
926  static MeasureUnit *createTerabyte(UErrorCode &status);
927 
928 #ifndef U_HIDE_DRAFT_API
929 
934  static MeasureUnit getTerabyte();
935 #endif /* U_HIDE_DRAFT_API */
936 
944  static MeasureUnit *createCentury(UErrorCode &status);
945 
946 #ifndef U_HIDE_DRAFT_API
947 
952  static MeasureUnit getCentury();
953 #endif /* U_HIDE_DRAFT_API */
954 
962  static MeasureUnit *createDay(UErrorCode &status);
963 
964 #ifndef U_HIDE_DRAFT_API
965 
970  static MeasureUnit getDay();
971 #endif /* U_HIDE_DRAFT_API */
972 
973 #ifndef U_HIDE_DRAFT_API
974 
981  static MeasureUnit *createDayPerson(UErrorCode &status);
982 #endif /* U_HIDE_DRAFT_API */
983 
984 #ifndef U_HIDE_DRAFT_API
985 
990  static MeasureUnit getDayPerson();
991 #endif /* U_HIDE_DRAFT_API */
992 
1000  static MeasureUnit *createHour(UErrorCode &status);
1001 
1002 #ifndef U_HIDE_DRAFT_API
1003 
1008  static MeasureUnit getHour();
1009 #endif /* U_HIDE_DRAFT_API */
1010 
1018  static MeasureUnit *createMicrosecond(UErrorCode &status);
1019 
1020 #ifndef U_HIDE_DRAFT_API
1021 
1026  static MeasureUnit getMicrosecond();
1027 #endif /* U_HIDE_DRAFT_API */
1028 
1036  static MeasureUnit *createMillisecond(UErrorCode &status);
1037 
1038 #ifndef U_HIDE_DRAFT_API
1039 
1044  static MeasureUnit getMillisecond();
1045 #endif /* U_HIDE_DRAFT_API */
1046 
1054  static MeasureUnit *createMinute(UErrorCode &status);
1055 
1056 #ifndef U_HIDE_DRAFT_API
1057 
1062  static MeasureUnit getMinute();
1063 #endif /* U_HIDE_DRAFT_API */
1064 
1072  static MeasureUnit *createMonth(UErrorCode &status);
1073 
1074 #ifndef U_HIDE_DRAFT_API
1075 
1080  static MeasureUnit getMonth();
1081 #endif /* U_HIDE_DRAFT_API */
1082 
1083 #ifndef U_HIDE_DRAFT_API
1084 
1091  static MeasureUnit *createMonthPerson(UErrorCode &status);
1092 #endif /* U_HIDE_DRAFT_API */
1093 
1094 #ifndef U_HIDE_DRAFT_API
1095 
1100  static MeasureUnit getMonthPerson();
1101 #endif /* U_HIDE_DRAFT_API */
1102 
1110  static MeasureUnit *createNanosecond(UErrorCode &status);
1111 
1112 #ifndef U_HIDE_DRAFT_API
1113 
1118  static MeasureUnit getNanosecond();
1119 #endif /* U_HIDE_DRAFT_API */
1120 
1128  static MeasureUnit *createSecond(UErrorCode &status);
1129 
1130 #ifndef U_HIDE_DRAFT_API
1131 
1136  static MeasureUnit getSecond();
1137 #endif /* U_HIDE_DRAFT_API */
1138 
1146  static MeasureUnit *createWeek(UErrorCode &status);
1147 
1148 #ifndef U_HIDE_DRAFT_API
1149 
1154  static MeasureUnit getWeek();
1155 #endif /* U_HIDE_DRAFT_API */
1156 
1157 #ifndef U_HIDE_DRAFT_API
1158 
1165  static MeasureUnit *createWeekPerson(UErrorCode &status);
1166 #endif /* U_HIDE_DRAFT_API */
1167 
1168 #ifndef U_HIDE_DRAFT_API
1169 
1174  static MeasureUnit getWeekPerson();
1175 #endif /* U_HIDE_DRAFT_API */
1176 
1184  static MeasureUnit *createYear(UErrorCode &status);
1185 
1186 #ifndef U_HIDE_DRAFT_API
1187 
1192  static MeasureUnit getYear();
1193 #endif /* U_HIDE_DRAFT_API */
1194 
1195 #ifndef U_HIDE_DRAFT_API
1196 
1203  static MeasureUnit *createYearPerson(UErrorCode &status);
1204 #endif /* U_HIDE_DRAFT_API */
1205 
1206 #ifndef U_HIDE_DRAFT_API
1207 
1212  static MeasureUnit getYearPerson();
1213 #endif /* U_HIDE_DRAFT_API */
1214 
1222  static MeasureUnit *createAmpere(UErrorCode &status);
1223 
1224 #ifndef U_HIDE_DRAFT_API
1225 
1230  static MeasureUnit getAmpere();
1231 #endif /* U_HIDE_DRAFT_API */
1232 
1240  static MeasureUnit *createMilliampere(UErrorCode &status);
1241 
1242 #ifndef U_HIDE_DRAFT_API
1243 
1248  static MeasureUnit getMilliampere();
1249 #endif /* U_HIDE_DRAFT_API */
1250 
1258  static MeasureUnit *createOhm(UErrorCode &status);
1259 
1260 #ifndef U_HIDE_DRAFT_API
1261 
1266  static MeasureUnit getOhm();
1267 #endif /* U_HIDE_DRAFT_API */
1268 
1276  static MeasureUnit *createVolt(UErrorCode &status);
1277 
1278 #ifndef U_HIDE_DRAFT_API
1279 
1284  static MeasureUnit getVolt();
1285 #endif /* U_HIDE_DRAFT_API */
1286 
1287 #ifndef U_HIDE_DRAFT_API
1288 
1295  static MeasureUnit *createBritishThermalUnit(UErrorCode &status);
1296 
1302  static MeasureUnit getBritishThermalUnit();
1303 #endif /* U_HIDE_DRAFT_API */
1304 
1312  static MeasureUnit *createCalorie(UErrorCode &status);
1313 
1314 #ifndef U_HIDE_DRAFT_API
1315 
1320  static MeasureUnit getCalorie();
1321 #endif /* U_HIDE_DRAFT_API */
1322 
1323 #ifndef U_HIDE_DRAFT_API
1324 
1331  static MeasureUnit *createElectronvolt(UErrorCode &status);
1332 
1338  static MeasureUnit getElectronvolt();
1339 #endif /* U_HIDE_DRAFT_API */
1340 
1348  static MeasureUnit *createFoodcalorie(UErrorCode &status);
1349 
1350 #ifndef U_HIDE_DRAFT_API
1351 
1356  static MeasureUnit getFoodcalorie();
1357 #endif /* U_HIDE_DRAFT_API */
1358 
1366  static MeasureUnit *createJoule(UErrorCode &status);
1367 
1368 #ifndef U_HIDE_DRAFT_API
1369 
1374  static MeasureUnit getJoule();
1375 #endif /* U_HIDE_DRAFT_API */
1376 
1384  static MeasureUnit *createKilocalorie(UErrorCode &status);
1385 
1386 #ifndef U_HIDE_DRAFT_API
1387 
1392  static MeasureUnit getKilocalorie();
1393 #endif /* U_HIDE_DRAFT_API */
1394 
1402  static MeasureUnit *createKilojoule(UErrorCode &status);
1403 
1404 #ifndef U_HIDE_DRAFT_API
1405 
1410  static MeasureUnit getKilojoule();
1411 #endif /* U_HIDE_DRAFT_API */
1412 
1420  static MeasureUnit *createKilowattHour(UErrorCode &status);
1421 
1422 #ifndef U_HIDE_DRAFT_API
1423 
1428  static MeasureUnit getKilowattHour();
1429 #endif /* U_HIDE_DRAFT_API */
1430 
1431 #ifndef U_HIDE_DRAFT_API
1432 
1439  static MeasureUnit *createNewton(UErrorCode &status);
1440 
1446  static MeasureUnit getNewton();
1447 #endif /* U_HIDE_DRAFT_API */
1448 
1449 #ifndef U_HIDE_DRAFT_API
1450 
1457  static MeasureUnit *createPoundForce(UErrorCode &status);
1458 
1464  static MeasureUnit getPoundForce();
1465 #endif /* U_HIDE_DRAFT_API */
1466 
1474  static MeasureUnit *createGigahertz(UErrorCode &status);
1475 
1476 #ifndef U_HIDE_DRAFT_API
1477 
1482  static MeasureUnit getGigahertz();
1483 #endif /* U_HIDE_DRAFT_API */
1484 
1492  static MeasureUnit *createHertz(UErrorCode &status);
1493 
1494 #ifndef U_HIDE_DRAFT_API
1495 
1500  static MeasureUnit getHertz();
1501 #endif /* U_HIDE_DRAFT_API */
1502 
1510  static MeasureUnit *createKilohertz(UErrorCode &status);
1511 
1512 #ifndef U_HIDE_DRAFT_API
1513 
1518  static MeasureUnit getKilohertz();
1519 #endif /* U_HIDE_DRAFT_API */
1520 
1528  static MeasureUnit *createMegahertz(UErrorCode &status);
1529 
1530 #ifndef U_HIDE_DRAFT_API
1531 
1536  static MeasureUnit getMegahertz();
1537 #endif /* U_HIDE_DRAFT_API */
1538 
1546  static MeasureUnit *createAstronomicalUnit(UErrorCode &status);
1547 
1548 #ifndef U_HIDE_DRAFT_API
1549 
1554  static MeasureUnit getAstronomicalUnit();
1555 #endif /* U_HIDE_DRAFT_API */
1556 
1564  static MeasureUnit *createCentimeter(UErrorCode &status);
1565 
1566 #ifndef U_HIDE_DRAFT_API
1567 
1572  static MeasureUnit getCentimeter();
1573 #endif /* U_HIDE_DRAFT_API */
1574 
1582  static MeasureUnit *createDecimeter(UErrorCode &status);
1583 
1584 #ifndef U_HIDE_DRAFT_API
1585 
1590  static MeasureUnit getDecimeter();
1591 #endif /* U_HIDE_DRAFT_API */
1592 
1600  static MeasureUnit *createFathom(UErrorCode &status);
1601 
1602 #ifndef U_HIDE_DRAFT_API
1603 
1608  static MeasureUnit getFathom();
1609 #endif /* U_HIDE_DRAFT_API */
1610 
1618  static MeasureUnit *createFoot(UErrorCode &status);
1619 
1620 #ifndef U_HIDE_DRAFT_API
1621 
1626  static MeasureUnit getFoot();
1627 #endif /* U_HIDE_DRAFT_API */
1628 
1636  static MeasureUnit *createFurlong(UErrorCode &status);
1637 
1638 #ifndef U_HIDE_DRAFT_API
1639 
1644  static MeasureUnit getFurlong();
1645 #endif /* U_HIDE_DRAFT_API */
1646 
1654  static MeasureUnit *createInch(UErrorCode &status);
1655 
1656 #ifndef U_HIDE_DRAFT_API
1657 
1662  static MeasureUnit getInch();
1663 #endif /* U_HIDE_DRAFT_API */
1664 
1672  static MeasureUnit *createKilometer(UErrorCode &status);
1673 
1674 #ifndef U_HIDE_DRAFT_API
1675 
1680  static MeasureUnit getKilometer();
1681 #endif /* U_HIDE_DRAFT_API */
1682 
1690  static MeasureUnit *createLightYear(UErrorCode &status);
1691 
1692 #ifndef U_HIDE_DRAFT_API
1693 
1698  static MeasureUnit getLightYear();
1699 #endif /* U_HIDE_DRAFT_API */
1700 
1708  static MeasureUnit *createMeter(UErrorCode &status);
1709 
1710 #ifndef U_HIDE_DRAFT_API
1711 
1716  static MeasureUnit getMeter();
1717 #endif /* U_HIDE_DRAFT_API */
1718 
1726  static MeasureUnit *createMicrometer(UErrorCode &status);
1727 
1728 #ifndef U_HIDE_DRAFT_API
1729 
1734  static MeasureUnit getMicrometer();
1735 #endif /* U_HIDE_DRAFT_API */
1736 
1744  static MeasureUnit *createMile(UErrorCode &status);
1745 
1746 #ifndef U_HIDE_DRAFT_API
1747 
1752  static MeasureUnit getMile();
1753 #endif /* U_HIDE_DRAFT_API */
1754 
1762  static MeasureUnit *createMileScandinavian(UErrorCode &status);
1763 
1764 #ifndef U_HIDE_DRAFT_API
1765 
1770  static MeasureUnit getMileScandinavian();
1771 #endif /* U_HIDE_DRAFT_API */
1772 
1780  static MeasureUnit *createMillimeter(UErrorCode &status);
1781 
1782 #ifndef U_HIDE_DRAFT_API
1783 
1788  static MeasureUnit getMillimeter();
1789 #endif /* U_HIDE_DRAFT_API */
1790 
1798  static MeasureUnit *createNanometer(UErrorCode &status);
1799 
1800 #ifndef U_HIDE_DRAFT_API
1801 
1806  static MeasureUnit getNanometer();
1807 #endif /* U_HIDE_DRAFT_API */
1808 
1816  static MeasureUnit *createNauticalMile(UErrorCode &status);
1817 
1818 #ifndef U_HIDE_DRAFT_API
1819 
1824  static MeasureUnit getNauticalMile();
1825 #endif /* U_HIDE_DRAFT_API */
1826 
1834  static MeasureUnit *createParsec(UErrorCode &status);
1835 
1836 #ifndef U_HIDE_DRAFT_API
1837 
1842  static MeasureUnit getParsec();
1843 #endif /* U_HIDE_DRAFT_API */
1844 
1852  static MeasureUnit *createPicometer(UErrorCode &status);
1853 
1854 #ifndef U_HIDE_DRAFT_API
1855 
1860  static MeasureUnit getPicometer();
1861 #endif /* U_HIDE_DRAFT_API */
1862 
1870  static MeasureUnit *createPoint(UErrorCode &status);
1871 
1872 #ifndef U_HIDE_DRAFT_API
1873 
1878  static MeasureUnit getPoint();
1879 #endif /* U_HIDE_DRAFT_API */
1880 
1881 #ifndef U_HIDE_DRAFT_API
1882 
1889  static MeasureUnit *createSolarRadius(UErrorCode &status);
1890 
1896  static MeasureUnit getSolarRadius();
1897 #endif /* U_HIDE_DRAFT_API */
1898 
1906  static MeasureUnit *createYard(UErrorCode &status);
1907 
1908 #ifndef U_HIDE_DRAFT_API
1909 
1914  static MeasureUnit getYard();
1915 #endif /* U_HIDE_DRAFT_API */
1916 
1924  static MeasureUnit *createLux(UErrorCode &status);
1925 
1926 #ifndef U_HIDE_DRAFT_API
1927 
1932  static MeasureUnit getLux();
1933 #endif /* U_HIDE_DRAFT_API */
1934 
1935 #ifndef U_HIDE_DRAFT_API
1936 
1943  static MeasureUnit *createSolarLuminosity(UErrorCode &status);
1944 
1950  static MeasureUnit getSolarLuminosity();
1951 #endif /* U_HIDE_DRAFT_API */
1952 
1960  static MeasureUnit *createCarat(UErrorCode &status);
1961 
1962 #ifndef U_HIDE_DRAFT_API
1963 
1968  static MeasureUnit getCarat();
1969 #endif /* U_HIDE_DRAFT_API */
1970 
1971 #ifndef U_HIDE_DRAFT_API
1972 
1979  static MeasureUnit *createDalton(UErrorCode &status);
1980 
1986  static MeasureUnit getDalton();
1987 #endif /* U_HIDE_DRAFT_API */
1988 
1989 #ifndef U_HIDE_DRAFT_API
1990 
1997  static MeasureUnit *createEarthMass(UErrorCode &status);
1998 
2004  static MeasureUnit getEarthMass();
2005 #endif /* U_HIDE_DRAFT_API */
2006 
2014  static MeasureUnit *createGram(UErrorCode &status);
2015 
2016 #ifndef U_HIDE_DRAFT_API
2017 
2022  static MeasureUnit getGram();
2023 #endif /* U_HIDE_DRAFT_API */
2024 
2032  static MeasureUnit *createKilogram(UErrorCode &status);
2033 
2034 #ifndef U_HIDE_DRAFT_API
2035 
2040  static MeasureUnit getKilogram();
2041 #endif /* U_HIDE_DRAFT_API */
2042 
2050  static MeasureUnit *createMetricTon(UErrorCode &status);
2051 
2052 #ifndef U_HIDE_DRAFT_API
2053 
2058  static MeasureUnit getMetricTon();
2059 #endif /* U_HIDE_DRAFT_API */
2060 
2068  static MeasureUnit *createMicrogram(UErrorCode &status);
2069 
2070 #ifndef U_HIDE_DRAFT_API
2071 
2076  static MeasureUnit getMicrogram();
2077 #endif /* U_HIDE_DRAFT_API */
2078 
2086  static MeasureUnit *createMilligram(UErrorCode &status);
2087 
2088 #ifndef U_HIDE_DRAFT_API
2089 
2094  static MeasureUnit getMilligram();
2095 #endif /* U_HIDE_DRAFT_API */
2096 
2104  static MeasureUnit *createOunce(UErrorCode &status);
2105 
2106 #ifndef U_HIDE_DRAFT_API
2107 
2112  static MeasureUnit getOunce();
2113 #endif /* U_HIDE_DRAFT_API */
2114 
2122  static MeasureUnit *createOunceTroy(UErrorCode &status);
2123 
2124 #ifndef U_HIDE_DRAFT_API
2125 
2130  static MeasureUnit getOunceTroy();
2131 #endif /* U_HIDE_DRAFT_API */
2132 
2140  static MeasureUnit *createPound(UErrorCode &status);
2141 
2142 #ifndef U_HIDE_DRAFT_API
2143 
2148  static MeasureUnit getPound();
2149 #endif /* U_HIDE_DRAFT_API */
2150 
2151 #ifndef U_HIDE_DRAFT_API
2152 
2159  static MeasureUnit *createSolarMass(UErrorCode &status);
2160 
2166  static MeasureUnit getSolarMass();
2167 #endif /* U_HIDE_DRAFT_API */
2168 
2176  static MeasureUnit *createStone(UErrorCode &status);
2177 
2178 #ifndef U_HIDE_DRAFT_API
2179 
2184  static MeasureUnit getStone();
2185 #endif /* U_HIDE_DRAFT_API */
2186 
2194  static MeasureUnit *createTon(UErrorCode &status);
2195 
2196 #ifndef U_HIDE_DRAFT_API
2197 
2202  static MeasureUnit getTon();
2203 #endif /* U_HIDE_DRAFT_API */
2204 
2212  static MeasureUnit *createGigawatt(UErrorCode &status);
2213 
2214 #ifndef U_HIDE_DRAFT_API
2215 
2220  static MeasureUnit getGigawatt();
2221 #endif /* U_HIDE_DRAFT_API */
2222 
2230  static MeasureUnit *createHorsepower(UErrorCode &status);
2231 
2232 #ifndef U_HIDE_DRAFT_API
2233 
2238  static MeasureUnit getHorsepower();
2239 #endif /* U_HIDE_DRAFT_API */
2240 
2248  static MeasureUnit *createKilowatt(UErrorCode &status);
2249 
2250 #ifndef U_HIDE_DRAFT_API
2251 
2256  static MeasureUnit getKilowatt();
2257 #endif /* U_HIDE_DRAFT_API */
2258 
2266  static MeasureUnit *createMegawatt(UErrorCode &status);
2267 
2268 #ifndef U_HIDE_DRAFT_API
2269 
2274  static MeasureUnit getMegawatt();
2275 #endif /* U_HIDE_DRAFT_API */
2276 
2284  static MeasureUnit *createMilliwatt(UErrorCode &status);
2285 
2286 #ifndef U_HIDE_DRAFT_API
2287 
2292  static MeasureUnit getMilliwatt();
2293 #endif /* U_HIDE_DRAFT_API */
2294 
2302  static MeasureUnit *createWatt(UErrorCode &status);
2303 
2304 #ifndef U_HIDE_DRAFT_API
2305 
2310  static MeasureUnit getWatt();
2311 #endif /* U_HIDE_DRAFT_API */
2312 
2313 #ifndef U_HIDE_DRAFT_API
2314 
2321  static MeasureUnit *createAtmosphere(UErrorCode &status);
2322 #endif /* U_HIDE_DRAFT_API */
2323 
2324 #ifndef U_HIDE_DRAFT_API
2325 
2330  static MeasureUnit getAtmosphere();
2331 #endif /* U_HIDE_DRAFT_API */
2332 
2340  static MeasureUnit *createHectopascal(UErrorCode &status);
2341 
2342 #ifndef U_HIDE_DRAFT_API
2343 
2348  static MeasureUnit getHectopascal();
2349 #endif /* U_HIDE_DRAFT_API */
2350 
2358  static MeasureUnit *createInchHg(UErrorCode &status);
2359 
2360 #ifndef U_HIDE_DRAFT_API
2361 
2366  static MeasureUnit getInchHg();
2367 #endif /* U_HIDE_DRAFT_API */
2368 
2369 #ifndef U_HIDE_DRAFT_API
2370 
2377  static MeasureUnit *createKilopascal(UErrorCode &status);
2378 
2384  static MeasureUnit getKilopascal();
2385 #endif /* U_HIDE_DRAFT_API */
2386 
2387 #ifndef U_HIDE_DRAFT_API
2388 
2395  static MeasureUnit *createMegapascal(UErrorCode &status);
2396 
2402  static MeasureUnit getMegapascal();
2403 #endif /* U_HIDE_DRAFT_API */
2404 
2412  static MeasureUnit *createMillibar(UErrorCode &status);
2413 
2414 #ifndef U_HIDE_DRAFT_API
2415 
2420  static MeasureUnit getMillibar();
2421 #endif /* U_HIDE_DRAFT_API */
2422 
2430  static MeasureUnit *createMillimeterOfMercury(UErrorCode &status);
2431 
2432 #ifndef U_HIDE_DRAFT_API
2433 
2438  static MeasureUnit getMillimeterOfMercury();
2439 #endif /* U_HIDE_DRAFT_API */
2440 
2448  static MeasureUnit *createPoundPerSquareInch(UErrorCode &status);
2449 
2450 #ifndef U_HIDE_DRAFT_API
2451 
2456  static MeasureUnit getPoundPerSquareInch();
2457 #endif /* U_HIDE_DRAFT_API */
2458 
2466  static MeasureUnit *createKilometerPerHour(UErrorCode &status);
2467 
2468 #ifndef U_HIDE_DRAFT_API
2469 
2474  static MeasureUnit getKilometerPerHour();
2475 #endif /* U_HIDE_DRAFT_API */
2476 
2484  static MeasureUnit *createKnot(UErrorCode &status);
2485 
2486 #ifndef U_HIDE_DRAFT_API
2487 
2492  static MeasureUnit getKnot();
2493 #endif /* U_HIDE_DRAFT_API */
2494 
2502  static MeasureUnit *createMeterPerSecond(UErrorCode &status);
2503 
2504 #ifndef U_HIDE_DRAFT_API
2505 
2510  static MeasureUnit getMeterPerSecond();
2511 #endif /* U_HIDE_DRAFT_API */
2512 
2520  static MeasureUnit *createMilePerHour(UErrorCode &status);
2521 
2522 #ifndef U_HIDE_DRAFT_API
2523 
2528  static MeasureUnit getMilePerHour();
2529 #endif /* U_HIDE_DRAFT_API */
2530 
2538  static MeasureUnit *createCelsius(UErrorCode &status);
2539 
2540 #ifndef U_HIDE_DRAFT_API
2541 
2546  static MeasureUnit getCelsius();
2547 #endif /* U_HIDE_DRAFT_API */
2548 
2556  static MeasureUnit *createFahrenheit(UErrorCode &status);
2557 
2558 #ifndef U_HIDE_DRAFT_API
2559 
2564  static MeasureUnit getFahrenheit();
2565 #endif /* U_HIDE_DRAFT_API */
2566 
2574  static MeasureUnit *createGenericTemperature(UErrorCode &status);
2575 
2576 #ifndef U_HIDE_DRAFT_API
2577 
2582  static MeasureUnit getGenericTemperature();
2583 #endif /* U_HIDE_DRAFT_API */
2584 
2592  static MeasureUnit *createKelvin(UErrorCode &status);
2593 
2594 #ifndef U_HIDE_DRAFT_API
2595 
2600  static MeasureUnit getKelvin();
2601 #endif /* U_HIDE_DRAFT_API */
2602 
2603 #ifndef U_HIDE_DRAFT_API
2604 
2611  static MeasureUnit *createNewtonMeter(UErrorCode &status);
2612 
2618  static MeasureUnit getNewtonMeter();
2619 #endif /* U_HIDE_DRAFT_API */
2620 
2621 #ifndef U_HIDE_DRAFT_API
2622 
2629  static MeasureUnit *createPoundFoot(UErrorCode &status);
2630 
2636  static MeasureUnit getPoundFoot();
2637 #endif /* U_HIDE_DRAFT_API */
2638 
2646  static MeasureUnit *createAcreFoot(UErrorCode &status);
2647 
2648 #ifndef U_HIDE_DRAFT_API
2649 
2654  static MeasureUnit getAcreFoot();
2655 #endif /* U_HIDE_DRAFT_API */
2656 
2657 #ifndef U_HIDE_DRAFT_API
2658 
2665  static MeasureUnit *createBarrel(UErrorCode &status);
2666 
2672  static MeasureUnit getBarrel();
2673 #endif /* U_HIDE_DRAFT_API */
2674 
2682  static MeasureUnit *createBushel(UErrorCode &status);
2683 
2684 #ifndef U_HIDE_DRAFT_API
2685 
2690  static MeasureUnit getBushel();
2691 #endif /* U_HIDE_DRAFT_API */
2692 
2700  static MeasureUnit *createCentiliter(UErrorCode &status);
2701 
2702 #ifndef U_HIDE_DRAFT_API
2703 
2708  static MeasureUnit getCentiliter();
2709 #endif /* U_HIDE_DRAFT_API */
2710 
2718  static MeasureUnit *createCubicCentimeter(UErrorCode &status);
2719 
2720 #ifndef U_HIDE_DRAFT_API
2721 
2726  static MeasureUnit getCubicCentimeter();
2727 #endif /* U_HIDE_DRAFT_API */
2728 
2736  static MeasureUnit *createCubicFoot(UErrorCode &status);
2737 
2738 #ifndef U_HIDE_DRAFT_API
2739 
2744  static MeasureUnit getCubicFoot();
2745 #endif /* U_HIDE_DRAFT_API */
2746 
2754  static MeasureUnit *createCubicInch(UErrorCode &status);
2755 
2756 #ifndef U_HIDE_DRAFT_API
2757 
2762  static MeasureUnit getCubicInch();
2763 #endif /* U_HIDE_DRAFT_API */
2764 
2772  static MeasureUnit *createCubicKilometer(UErrorCode &status);
2773 
2774 #ifndef U_HIDE_DRAFT_API
2775 
2780  static MeasureUnit getCubicKilometer();
2781 #endif /* U_HIDE_DRAFT_API */
2782 
2790  static MeasureUnit *createCubicMeter(UErrorCode &status);
2791 
2792 #ifndef U_HIDE_DRAFT_API
2793 
2798  static MeasureUnit getCubicMeter();
2799 #endif /* U_HIDE_DRAFT_API */
2800 
2808  static MeasureUnit *createCubicMile(UErrorCode &status);
2809 
2810 #ifndef U_HIDE_DRAFT_API
2811 
2816  static MeasureUnit getCubicMile();
2817 #endif /* U_HIDE_DRAFT_API */
2818 
2826  static MeasureUnit *createCubicYard(UErrorCode &status);
2827 
2828 #ifndef U_HIDE_DRAFT_API
2829 
2834  static MeasureUnit getCubicYard();
2835 #endif /* U_HIDE_DRAFT_API */
2836 
2844  static MeasureUnit *createCup(UErrorCode &status);
2845 
2846 #ifndef U_HIDE_DRAFT_API
2847 
2852  static MeasureUnit getCup();
2853 #endif /* U_HIDE_DRAFT_API */
2854 
2862  static MeasureUnit *createCupMetric(UErrorCode &status);
2863 
2864 #ifndef U_HIDE_DRAFT_API
2865 
2870  static MeasureUnit getCupMetric();
2871 #endif /* U_HIDE_DRAFT_API */
2872 
2880  static MeasureUnit *createDeciliter(UErrorCode &status);
2881 
2882 #ifndef U_HIDE_DRAFT_API
2883 
2888  static MeasureUnit getDeciliter();
2889 #endif /* U_HIDE_DRAFT_API */
2890 
2898  static MeasureUnit *createFluidOunce(UErrorCode &status);
2899 
2900 #ifndef U_HIDE_DRAFT_API
2901 
2906  static MeasureUnit getFluidOunce();
2907 #endif /* U_HIDE_DRAFT_API */
2908 
2909 #ifndef U_HIDE_DRAFT_API
2910 
2917  static MeasureUnit *createFluidOunceImperial(UErrorCode &status);
2918 
2924  static MeasureUnit getFluidOunceImperial();
2925 #endif /* U_HIDE_DRAFT_API */
2926 
2934  static MeasureUnit *createGallon(UErrorCode &status);
2935 
2936 #ifndef U_HIDE_DRAFT_API
2937 
2942  static MeasureUnit getGallon();
2943 #endif /* U_HIDE_DRAFT_API */
2944 
2952  static MeasureUnit *createGallonImperial(UErrorCode &status);
2953 
2954 #ifndef U_HIDE_DRAFT_API
2955 
2960  static MeasureUnit getGallonImperial();
2961 #endif /* U_HIDE_DRAFT_API */
2962 
2970  static MeasureUnit *createHectoliter(UErrorCode &status);
2971 
2972 #ifndef U_HIDE_DRAFT_API
2973 
2978  static MeasureUnit getHectoliter();
2979 #endif /* U_HIDE_DRAFT_API */
2980 
2988  static MeasureUnit *createLiter(UErrorCode &status);
2989 
2990 #ifndef U_HIDE_DRAFT_API
2991 
2996  static MeasureUnit getLiter();
2997 #endif /* U_HIDE_DRAFT_API */
2998 
3006  static MeasureUnit *createMegaliter(UErrorCode &status);
3007 
3008 #ifndef U_HIDE_DRAFT_API
3009 
3014  static MeasureUnit getMegaliter();
3015 #endif /* U_HIDE_DRAFT_API */
3016 
3024  static MeasureUnit *createMilliliter(UErrorCode &status);
3025 
3026 #ifndef U_HIDE_DRAFT_API
3027 
3032  static MeasureUnit getMilliliter();
3033 #endif /* U_HIDE_DRAFT_API */
3034 
3042  static MeasureUnit *createPint(UErrorCode &status);
3043 
3044 #ifndef U_HIDE_DRAFT_API
3045 
3050  static MeasureUnit getPint();
3051 #endif /* U_HIDE_DRAFT_API */
3052 
3060  static MeasureUnit *createPintMetric(UErrorCode &status);
3061 
3062 #ifndef U_HIDE_DRAFT_API
3063 
3068  static MeasureUnit getPintMetric();
3069 #endif /* U_HIDE_DRAFT_API */
3070 
3078  static MeasureUnit *createQuart(UErrorCode &status);
3079 
3080 #ifndef U_HIDE_DRAFT_API
3081 
3086  static MeasureUnit getQuart();
3087 #endif /* U_HIDE_DRAFT_API */
3088 
3096  static MeasureUnit *createTablespoon(UErrorCode &status);
3097 
3098 #ifndef U_HIDE_DRAFT_API
3099 
3104  static MeasureUnit getTablespoon();
3105 #endif /* U_HIDE_DRAFT_API */
3106 
3114  static MeasureUnit *createTeaspoon(UErrorCode &status);
3115 
3116 #ifndef U_HIDE_DRAFT_API
3117 
3122  static MeasureUnit getTeaspoon();
3123 #endif /* U_HIDE_DRAFT_API */
3124 
3125 
3126 // End generated createXXX methods
3127 
3128  protected:
3129 
3130 #ifndef U_HIDE_INTERNAL_API
3131 
3135  void initTime(const char *timeId);
3136 
3141  void initCurrency(const char *isoCurrency);
3142 
3147  void initNoUnit(const char *subtype);
3148 
3149 #endif /* U_HIDE_INTERNAL_API */
3150 
3151 private:
3152  int32_t fTypeId;
3153  int32_t fSubTypeId;
3154  char fCurrency[4];
3155 
3156  MeasureUnit(int32_t typeId, int32_t subTypeId) : fTypeId(typeId), fSubTypeId(subTypeId) {
3157  fCurrency[0] = 0;
3158  }
3159  void setTo(int32_t typeId, int32_t subTypeId);
3160  int32_t getOffset() const;
3161  static MeasureUnit *create(int typeId, int subTypeId, UErrorCode &status);
3162 };
3163 
3165 
3166 #endif // !UNCONFIG_NO_FORMATTING
3167 #endif // __MEASUREUNIT_H__
A unit such as length, mass, volume, currency, etc.
Definition: measunit.h:38
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:85
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Definition: uobject.h:93
Base class for 'pure' C++ implementations of uenum api.
Definition: strenum.h:57
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside...
Definition: utypes.h:301
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:137
virtual UClassID getDynamicClassID() const
ICU4C "poor man's RTTI", returns a UClassID for the actual ICU class.
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:138
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:401
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:225