ICU 54.1 54.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
measunit.h
Go to the documentation of this file.
1 /*
2 **********************************************************************
3 * Copyright (c) 2004-2014, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 **********************************************************************
6 * Author: Alan Liu
7 * Created: April 26, 2004
8 * Since: ICU 3.0
9 **********************************************************************
10 */
11 #ifndef __MEASUREUNIT_H__
12 #define __MEASUREUNIT_H__
13
14 #include "unicode/utypes.h"
15
16 #if !UCONFIG_NO_FORMATTING
17
18 #include "unicode/unistr.h"
19
25 U_NAMESPACE_BEGIN
26
27 class StringEnumeration;
28
36 class U_I18N_API MeasureUnit: public UObject {
37 public:
38
43 MeasureUnit() : fTypeId(0), fSubTypeId(0) {
44 fCurrency[0] = 0;
45 }
46
51 MeasureUnit(const MeasureUnit &other);
52
57 MeasureUnit &operator=(const MeasureUnit &other);
58
64 virtual UObject* clone() const;
65
70 virtual ~MeasureUnit();
71
77 virtual UBool operator==(const UObject& other) const;
78
79 #ifndef U_HIDE_DRAFT_API
80
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 #endif /* U_HIDE_DRAFT_API */
145
157 static UClassID U_EXPORT2 getStaticClassID(void);
158
170 virtual UClassID getDynamicClassID(void) const;
171
172 #ifndef U_HIDE_INTERNAL_API
173
179 int32_t getIndex() const;
180
186 static int32_t getIndexCount();
187 #endif /* U_HIDE_INTERNAL_API */
188
189 // All code between the "Start generated createXXX methods" comment and
190 // the "End generated createXXX methods" comment is auto generated code
191 // and must not be edited manually. For instructions on how to correctly
192 // update this code, refer to:
193 // https://sites.google.com/site/icusite/design/formatting/measureformat/updating-measure-unit
194 //
195 // Start generated createXXX methods
196
197 #ifndef U_HIDE_DRAFT_API
198
204 static MeasureUnit *createGForce(UErrorCode &status);
205
206 #endif /* U_HIDE_DRAFT_API */
207 #ifndef U_HIDE_DRAFT_API
208
214 static MeasureUnit *createMeterPerSecondSquared(UErrorCode &status);
215
216 #endif /* U_HIDE_DRAFT_API */
217 #ifndef U_HIDE_DRAFT_API
218
224 static MeasureUnit *createArcMinute(UErrorCode &status);
225
226 #endif /* U_HIDE_DRAFT_API */
227 #ifndef U_HIDE_DRAFT_API
228
234 static MeasureUnit *createArcSecond(UErrorCode &status);
235
236 #endif /* U_HIDE_DRAFT_API */
237 #ifndef U_HIDE_DRAFT_API
238
244 static MeasureUnit *createDegree(UErrorCode &status);
245
246 #endif /* U_HIDE_DRAFT_API */
247 #ifndef U_HIDE_DRAFT_API
248
254 static MeasureUnit *createRadian(UErrorCode &status);
255
256 #endif /* U_HIDE_DRAFT_API */
257 #ifndef U_HIDE_DRAFT_API
258
264 static MeasureUnit *createAcre(UErrorCode &status);
265
266 #endif /* U_HIDE_DRAFT_API */
267 #ifndef U_HIDE_DRAFT_API
268
274 static MeasureUnit *createHectare(UErrorCode &status);
275
276 #endif /* U_HIDE_DRAFT_API */
277 #ifndef U_HIDE_DRAFT_API
278
284 static MeasureUnit *createSquareCentimeter(UErrorCode &status);
285
286 #endif /* U_HIDE_DRAFT_API */
287 #ifndef U_HIDE_DRAFT_API
288
294 static MeasureUnit *createSquareFoot(UErrorCode &status);
295
296 #endif /* U_HIDE_DRAFT_API */
297 #ifndef U_HIDE_DRAFT_API
298
304 static MeasureUnit *createSquareInch(UErrorCode &status);
305
306 #endif /* U_HIDE_DRAFT_API */
307 #ifndef U_HIDE_DRAFT_API
308
314 static MeasureUnit *createSquareKilometer(UErrorCode &status);
315
316 #endif /* U_HIDE_DRAFT_API */
317 #ifndef U_HIDE_DRAFT_API
318
324 static MeasureUnit *createSquareMeter(UErrorCode &status);
325
326 #endif /* U_HIDE_DRAFT_API */
327 #ifndef U_HIDE_DRAFT_API
328
334 static MeasureUnit *createSquareMile(UErrorCode &status);
335
336 #endif /* U_HIDE_DRAFT_API */
337 #ifndef U_HIDE_DRAFT_API
338
344 static MeasureUnit *createSquareYard(UErrorCode &status);
345
346 #endif /* U_HIDE_DRAFT_API */
347 #ifndef U_HIDE_DRAFT_API
348
354 static MeasureUnit *createLiterPerKilometer(UErrorCode &status);
355
356 #endif /* U_HIDE_DRAFT_API */
357 #ifndef U_HIDE_DRAFT_API
358
364 static MeasureUnit *createMilePerGallon(UErrorCode &status);
365
366 #endif /* U_HIDE_DRAFT_API */
367 #ifndef U_HIDE_DRAFT_API
368
374 static MeasureUnit *createBit(UErrorCode &status);
375
376 #endif /* U_HIDE_DRAFT_API */
377 #ifndef U_HIDE_DRAFT_API
378
384 static MeasureUnit *createByte(UErrorCode &status);
385
386 #endif /* U_HIDE_DRAFT_API */
387 #ifndef U_HIDE_DRAFT_API
388
394 static MeasureUnit *createGigabit(UErrorCode &status);
395
396 #endif /* U_HIDE_DRAFT_API */
397 #ifndef U_HIDE_DRAFT_API
398
404 static MeasureUnit *createGigabyte(UErrorCode &status);
405
406 #endif /* U_HIDE_DRAFT_API */
407 #ifndef U_HIDE_DRAFT_API
408
414 static MeasureUnit *createKilobit(UErrorCode &status);
415
416 #endif /* U_HIDE_DRAFT_API */
417 #ifndef U_HIDE_DRAFT_API
418
424 static MeasureUnit *createKilobyte(UErrorCode &status);
425
426 #endif /* U_HIDE_DRAFT_API */
427 #ifndef U_HIDE_DRAFT_API
428
434 static MeasureUnit *createMegabit(UErrorCode &status);
435
436 #endif /* U_HIDE_DRAFT_API */
437 #ifndef U_HIDE_DRAFT_API
438
444 static MeasureUnit *createMegabyte(UErrorCode &status);
445
446 #endif /* U_HIDE_DRAFT_API */
447 #ifndef U_HIDE_DRAFT_API
448
454 static MeasureUnit *createTerabit(UErrorCode &status);
455
456 #endif /* U_HIDE_DRAFT_API */
457 #ifndef U_HIDE_DRAFT_API
458
464 static MeasureUnit *createTerabyte(UErrorCode &status);
465
466 #endif /* U_HIDE_DRAFT_API */
467 #ifndef U_HIDE_DRAFT_API
468
474 static MeasureUnit *createDay(UErrorCode &status);
475
476 #endif /* U_HIDE_DRAFT_API */
477 #ifndef U_HIDE_DRAFT_API
478
484 static MeasureUnit *createHour(UErrorCode &status);
485
486 #endif /* U_HIDE_DRAFT_API */
487 #ifndef U_HIDE_DRAFT_API
488
494 static MeasureUnit *createMicrosecond(UErrorCode &status);
495
496 #endif /* U_HIDE_DRAFT_API */
497 #ifndef U_HIDE_DRAFT_API
498
504 static MeasureUnit *createMillisecond(UErrorCode &status);
505
506 #endif /* U_HIDE_DRAFT_API */
507 #ifndef U_HIDE_DRAFT_API
508
514 static MeasureUnit *createMinute(UErrorCode &status);
515
516 #endif /* U_HIDE_DRAFT_API */
517 #ifndef U_HIDE_DRAFT_API
518
524 static MeasureUnit *createMonth(UErrorCode &status);
525
526 #endif /* U_HIDE_DRAFT_API */
527 #ifndef U_HIDE_DRAFT_API
528
534 static MeasureUnit *createNanosecond(UErrorCode &status);
535
536 #endif /* U_HIDE_DRAFT_API */
537 #ifndef U_HIDE_DRAFT_API
538
544 static MeasureUnit *createSecond(UErrorCode &status);
545
546 #endif /* U_HIDE_DRAFT_API */
547 #ifndef U_HIDE_DRAFT_API
548
554 static MeasureUnit *createWeek(UErrorCode &status);
555
556 #endif /* U_HIDE_DRAFT_API */
557 #ifndef U_HIDE_DRAFT_API
558
564 static MeasureUnit *createYear(UErrorCode &status);
565
566 #endif /* U_HIDE_DRAFT_API */
567 #ifndef U_HIDE_DRAFT_API
568
574 static MeasureUnit *createAmpere(UErrorCode &status);
575
576 #endif /* U_HIDE_DRAFT_API */
577 #ifndef U_HIDE_DRAFT_API
578
584 static MeasureUnit *createMilliampere(UErrorCode &status);
585
586 #endif /* U_HIDE_DRAFT_API */
587 #ifndef U_HIDE_DRAFT_API
588
594 static MeasureUnit *createOhm(UErrorCode &status);
595
596 #endif /* U_HIDE_DRAFT_API */
597 #ifndef U_HIDE_DRAFT_API
598
604 static MeasureUnit *createVolt(UErrorCode &status);
605
606 #endif /* U_HIDE_DRAFT_API */
607 #ifndef U_HIDE_DRAFT_API
608
614 static MeasureUnit *createCalorie(UErrorCode &status);
615
616 #endif /* U_HIDE_DRAFT_API */
617 #ifndef U_HIDE_DRAFT_API
618
624 static MeasureUnit *createFoodcalorie(UErrorCode &status);
625
626 #endif /* U_HIDE_DRAFT_API */
627 #ifndef U_HIDE_DRAFT_API
628
634 static MeasureUnit *createJoule(UErrorCode &status);
635
636 #endif /* U_HIDE_DRAFT_API */
637 #ifndef U_HIDE_DRAFT_API
638
644 static MeasureUnit *createKilocalorie(UErrorCode &status);
645
646 #endif /* U_HIDE_DRAFT_API */
647 #ifndef U_HIDE_DRAFT_API
648
654 static MeasureUnit *createKilojoule(UErrorCode &status);
655
656 #endif /* U_HIDE_DRAFT_API */
657 #ifndef U_HIDE_DRAFT_API
658
664 static MeasureUnit *createKilowattHour(UErrorCode &status);
665
666 #endif /* U_HIDE_DRAFT_API */
667 #ifndef U_HIDE_DRAFT_API
668
674 static MeasureUnit *createGigahertz(UErrorCode &status);
675
676 #endif /* U_HIDE_DRAFT_API */
677 #ifndef U_HIDE_DRAFT_API
678
684 static MeasureUnit *createHertz(UErrorCode &status);
685
686 #endif /* U_HIDE_DRAFT_API */
687 #ifndef U_HIDE_DRAFT_API
688
694 static MeasureUnit *createKilohertz(UErrorCode &status);
695
696 #endif /* U_HIDE_DRAFT_API */
697 #ifndef U_HIDE_DRAFT_API
698
704 static MeasureUnit *createMegahertz(UErrorCode &status);
705
706 #endif /* U_HIDE_DRAFT_API */
707 #ifndef U_HIDE_DRAFT_API
708
714 static MeasureUnit *createAstronomicalUnit(UErrorCode &status);
715
716 #endif /* U_HIDE_DRAFT_API */
717 #ifndef U_HIDE_DRAFT_API
718
724 static MeasureUnit *createCentimeter(UErrorCode &status);
725
726 #endif /* U_HIDE_DRAFT_API */
727 #ifndef U_HIDE_DRAFT_API
728
734 static MeasureUnit *createDecimeter(UErrorCode &status);
735
736 #endif /* U_HIDE_DRAFT_API */
737 #ifndef U_HIDE_DRAFT_API
738
744 static MeasureUnit *createFathom(UErrorCode &status);
745
746 #endif /* U_HIDE_DRAFT_API */
747 #ifndef U_HIDE_DRAFT_API
748
754 static MeasureUnit *createFoot(UErrorCode &status);
755
756 #endif /* U_HIDE_DRAFT_API */
757 #ifndef U_HIDE_DRAFT_API
758
764 static MeasureUnit *createFurlong(UErrorCode &status);
765
766 #endif /* U_HIDE_DRAFT_API */
767 #ifndef U_HIDE_DRAFT_API
768
774 static MeasureUnit *createInch(UErrorCode &status);
775
776 #endif /* U_HIDE_DRAFT_API */
777 #ifndef U_HIDE_DRAFT_API
778
784 static MeasureUnit *createKilometer(UErrorCode &status);
785
786 #endif /* U_HIDE_DRAFT_API */
787 #ifndef U_HIDE_DRAFT_API
788
794 static MeasureUnit *createLightYear(UErrorCode &status);
795
796 #endif /* U_HIDE_DRAFT_API */
797 #ifndef U_HIDE_DRAFT_API
798
804 static MeasureUnit *createMeter(UErrorCode &status);
805
806 #endif /* U_HIDE_DRAFT_API */
807 #ifndef U_HIDE_DRAFT_API
808
814 static MeasureUnit *createMicrometer(UErrorCode &status);
815
816 #endif /* U_HIDE_DRAFT_API */
817 #ifndef U_HIDE_DRAFT_API
818
824 static MeasureUnit *createMile(UErrorCode &status);
825
826 #endif /* U_HIDE_DRAFT_API */
827 #ifndef U_HIDE_DRAFT_API
828
834 static MeasureUnit *createMillimeter(UErrorCode &status);
835
836 #endif /* U_HIDE_DRAFT_API */
837 #ifndef U_HIDE_DRAFT_API
838
844 static MeasureUnit *createNanometer(UErrorCode &status);
845
846 #endif /* U_HIDE_DRAFT_API */
847 #ifndef U_HIDE_DRAFT_API
848
854 static MeasureUnit *createNauticalMile(UErrorCode &status);
855
856 #endif /* U_HIDE_DRAFT_API */
857 #ifndef U_HIDE_DRAFT_API
858
864 static MeasureUnit *createParsec(UErrorCode &status);
865
866 #endif /* U_HIDE_DRAFT_API */
867 #ifndef U_HIDE_DRAFT_API
868
874 static MeasureUnit *createPicometer(UErrorCode &status);
875
876 #endif /* U_HIDE_DRAFT_API */
877 #ifndef U_HIDE_DRAFT_API
878
884 static MeasureUnit *createYard(UErrorCode &status);
885
886 #endif /* U_HIDE_DRAFT_API */
887 #ifndef U_HIDE_DRAFT_API
888
894 static MeasureUnit *createLux(UErrorCode &status);
895
896 #endif /* U_HIDE_DRAFT_API */
897 #ifndef U_HIDE_DRAFT_API
898
904 static MeasureUnit *createCarat(UErrorCode &status);
905
906 #endif /* U_HIDE_DRAFT_API */
907 #ifndef U_HIDE_DRAFT_API
908
914 static MeasureUnit *createGram(UErrorCode &status);
915
916 #endif /* U_HIDE_DRAFT_API */
917 #ifndef U_HIDE_DRAFT_API
918
924 static MeasureUnit *createKilogram(UErrorCode &status);
925
926 #endif /* U_HIDE_DRAFT_API */
927 #ifndef U_HIDE_DRAFT_API
928
934 static MeasureUnit *createMetricTon(UErrorCode &status);
935
936 #endif /* U_HIDE_DRAFT_API */
937 #ifndef U_HIDE_DRAFT_API
938
944 static MeasureUnit *createMicrogram(UErrorCode &status);
945
946 #endif /* U_HIDE_DRAFT_API */
947 #ifndef U_HIDE_DRAFT_API
948
954 static MeasureUnit *createMilligram(UErrorCode &status);
955
956 #endif /* U_HIDE_DRAFT_API */
957 #ifndef U_HIDE_DRAFT_API
958
964 static MeasureUnit *createOunce(UErrorCode &status);
965
966 #endif /* U_HIDE_DRAFT_API */
967 #ifndef U_HIDE_DRAFT_API
968
974 static MeasureUnit *createOunceTroy(UErrorCode &status);
975
976 #endif /* U_HIDE_DRAFT_API */
977 #ifndef U_HIDE_DRAFT_API
978
984 static MeasureUnit *createPound(UErrorCode &status);
985
986 #endif /* U_HIDE_DRAFT_API */
987 #ifndef U_HIDE_DRAFT_API
988
994 static MeasureUnit *createStone(UErrorCode &status);
995
996 #endif /* U_HIDE_DRAFT_API */
997 #ifndef U_HIDE_DRAFT_API
998
1004 static MeasureUnit *createTon(UErrorCode &status);
1005
1006 #endif /* U_HIDE_DRAFT_API */
1007 #ifndef U_HIDE_DRAFT_API
1008
1014 static MeasureUnit *createGigawatt(UErrorCode &status);
1015
1016 #endif /* U_HIDE_DRAFT_API */
1017 #ifndef U_HIDE_DRAFT_API
1018
1024 static MeasureUnit *createHorsepower(UErrorCode &status);
1025
1026 #endif /* U_HIDE_DRAFT_API */
1027 #ifndef U_HIDE_DRAFT_API
1028
1034 static MeasureUnit *createKilowatt(UErrorCode &status);
1035
1036 #endif /* U_HIDE_DRAFT_API */
1037 #ifndef U_HIDE_DRAFT_API
1038
1044 static MeasureUnit *createMegawatt(UErrorCode &status);
1045
1046 #endif /* U_HIDE_DRAFT_API */
1047 #ifndef U_HIDE_DRAFT_API
1048
1054 static MeasureUnit *createMilliwatt(UErrorCode &status);
1055
1056 #endif /* U_HIDE_DRAFT_API */
1057 #ifndef U_HIDE_DRAFT_API
1058
1064 static MeasureUnit *createWatt(UErrorCode &status);
1065
1066 #endif /* U_HIDE_DRAFT_API */
1067 #ifndef U_HIDE_DRAFT_API
1068
1074 static MeasureUnit *createHectopascal(UErrorCode &status);
1075
1076 #endif /* U_HIDE_DRAFT_API */
1077 #ifndef U_HIDE_DRAFT_API
1078
1084 static MeasureUnit *createInchHg(UErrorCode &status);
1085
1086 #endif /* U_HIDE_DRAFT_API */
1087 #ifndef U_HIDE_DRAFT_API
1088
1094 static MeasureUnit *createMillibar(UErrorCode &status);
1095
1096 #endif /* U_HIDE_DRAFT_API */
1097 #ifndef U_HIDE_DRAFT_API
1098
1104 static MeasureUnit *createMillimeterOfMercury(UErrorCode &status);
1105
1106 #endif /* U_HIDE_DRAFT_API */
1107 #ifndef U_HIDE_DRAFT_API
1108
1114 static MeasureUnit *createPoundPerSquareInch(UErrorCode &status);
1115
1116 #endif /* U_HIDE_DRAFT_API */
1117 #ifndef U_HIDE_DRAFT_API
1118
1124 static MeasureUnit *createKarat(UErrorCode &status);
1125
1126 #endif /* U_HIDE_DRAFT_API */
1127 #ifndef U_HIDE_DRAFT_API
1128
1134 static MeasureUnit *createKilometerPerHour(UErrorCode &status);
1135
1136 #endif /* U_HIDE_DRAFT_API */
1137 #ifndef U_HIDE_DRAFT_API
1138
1144 static MeasureUnit *createMeterPerSecond(UErrorCode &status);
1145
1146 #endif /* U_HIDE_DRAFT_API */
1147 #ifndef U_HIDE_DRAFT_API
1148
1154 static MeasureUnit *createMilePerHour(UErrorCode &status);
1155
1156 #endif /* U_HIDE_DRAFT_API */
1157 #ifndef U_HIDE_DRAFT_API
1158
1164 static MeasureUnit *createCelsius(UErrorCode &status);
1165
1166 #endif /* U_HIDE_DRAFT_API */
1167 #ifndef U_HIDE_DRAFT_API
1168
1174 static MeasureUnit *createFahrenheit(UErrorCode &status);
1175
1176 #endif /* U_HIDE_DRAFT_API */
1177 #ifndef U_HIDE_DRAFT_API
1178
1184 static MeasureUnit *createKelvin(UErrorCode &status);
1185
1186 #endif /* U_HIDE_DRAFT_API */
1187 #ifndef U_HIDE_DRAFT_API
1188
1194 static MeasureUnit *createAcreFoot(UErrorCode &status);
1195
1196 #endif /* U_HIDE_DRAFT_API */
1197 #ifndef U_HIDE_DRAFT_API
1198
1204 static MeasureUnit *createBushel(UErrorCode &status);
1205
1206 #endif /* U_HIDE_DRAFT_API */
1207 #ifndef U_HIDE_DRAFT_API
1208
1214 static MeasureUnit *createCentiliter(UErrorCode &status);
1215
1216 #endif /* U_HIDE_DRAFT_API */
1217 #ifndef U_HIDE_DRAFT_API
1218
1224 static MeasureUnit *createCubicCentimeter(UErrorCode &status);
1225
1226 #endif /* U_HIDE_DRAFT_API */
1227 #ifndef U_HIDE_DRAFT_API
1228
1234 static MeasureUnit *createCubicFoot(UErrorCode &status);
1235
1236 #endif /* U_HIDE_DRAFT_API */
1237 #ifndef U_HIDE_DRAFT_API
1238
1244 static MeasureUnit *createCubicInch(UErrorCode &status);
1245
1246 #endif /* U_HIDE_DRAFT_API */
1247 #ifndef U_HIDE_DRAFT_API
1248
1254 static MeasureUnit *createCubicKilometer(UErrorCode &status);
1255
1256 #endif /* U_HIDE_DRAFT_API */
1257 #ifndef U_HIDE_DRAFT_API
1258
1264 static MeasureUnit *createCubicMeter(UErrorCode &status);
1265
1266 #endif /* U_HIDE_DRAFT_API */
1267 #ifndef U_HIDE_DRAFT_API
1268
1274 static MeasureUnit *createCubicMile(UErrorCode &status);
1275
1276 #endif /* U_HIDE_DRAFT_API */
1277 #ifndef U_HIDE_DRAFT_API
1278
1284 static MeasureUnit *createCubicYard(UErrorCode &status);
1285
1286 #endif /* U_HIDE_DRAFT_API */
1287 #ifndef U_HIDE_DRAFT_API
1288
1294 static MeasureUnit *createCup(UErrorCode &status);
1295
1296 #endif /* U_HIDE_DRAFT_API */
1297 #ifndef U_HIDE_DRAFT_API
1298
1304 static MeasureUnit *createDeciliter(UErrorCode &status);
1305
1306 #endif /* U_HIDE_DRAFT_API */
1307 #ifndef U_HIDE_DRAFT_API
1308
1314 static MeasureUnit *createFluidOunce(UErrorCode &status);
1315
1316 #endif /* U_HIDE_DRAFT_API */
1317 #ifndef U_HIDE_DRAFT_API
1318
1324 static MeasureUnit *createGallon(UErrorCode &status);
1325
1326 #endif /* U_HIDE_DRAFT_API */
1327 #ifndef U_HIDE_DRAFT_API
1328
1334 static MeasureUnit *createHectoliter(UErrorCode &status);
1335
1336 #endif /* U_HIDE_DRAFT_API */
1337 #ifndef U_HIDE_DRAFT_API
1338
1344 static MeasureUnit *createLiter(UErrorCode &status);
1345
1346 #endif /* U_HIDE_DRAFT_API */
1347 #ifndef U_HIDE_DRAFT_API
1348
1354 static MeasureUnit *createMegaliter(UErrorCode &status);
1355
1356 #endif /* U_HIDE_DRAFT_API */
1357 #ifndef U_HIDE_DRAFT_API
1358
1364 static MeasureUnit *createMilliliter(UErrorCode &status);
1365
1366 #endif /* U_HIDE_DRAFT_API */
1367 #ifndef U_HIDE_DRAFT_API
1368
1374 static MeasureUnit *createPint(UErrorCode &status);
1375
1376 #endif /* U_HIDE_DRAFT_API */
1377 #ifndef U_HIDE_DRAFT_API
1378
1384 static MeasureUnit *createQuart(UErrorCode &status);
1385
1386 #endif /* U_HIDE_DRAFT_API */
1387 #ifndef U_HIDE_DRAFT_API
1388
1394 static MeasureUnit *createTablespoon(UErrorCode &status);
1395
1396 #endif /* U_HIDE_DRAFT_API */
1397 #ifndef U_HIDE_DRAFT_API
1398
1404 static MeasureUnit *createTeaspoon(UErrorCode &status);
1405
1406 #endif /* U_HIDE_DRAFT_API */
1407
1408 // End generated createXXX methods
1409
1410 protected:
1411
1412 #ifndef U_HIDE_INTERNAL_API
1413
1417 void initTime(const char *timeId);
1418
1423 void initCurrency(const char *isoCurrency);
1424
1425 #endif /* U_HIDE_INTERNAL_API */
1426
1427 private:
1428 int32_t fTypeId;
1429 int32_t fSubTypeId;
1430 char fCurrency[4];
1431
1432 MeasureUnit(int32_t typeId, int32_t subTypeId) : fTypeId(typeId), fSubTypeId(subTypeId) {
1433 fCurrency[0] = 0;
1434 }
1435 void setTo(int32_t typeId, int32_t subTypeId);
1436 int32_t getOffset() const;
1437 static MeasureUnit *create(int typeId, int subTypeId, UErrorCode &status);
1438 };
1439
1440 U_NAMESPACE_END
1441
1442 #endif // !UNCONFIG_NO_FORMATTING
1443 #endif // __MEASUREUNIT_H__