measunit.h 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356
  1. /*
  2. **********************************************************************
  3. * Copyright (c) 2004-2015, 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. #include "unicode/utypes.h"
  14. #if !UCONFIG_NO_FORMATTING
  15. #include "unicode/unistr.h"
  16. /**
  17. * \file
  18. * \brief C++ API: A unit for measuring a quantity.
  19. */
  20. U_NAMESPACE_BEGIN
  21. class StringEnumeration;
  22. /**
  23. * A unit such as length, mass, volume, currency, etc. A unit is
  24. * coupled with a numeric amount to produce a Measure.
  25. *
  26. * @author Alan Liu
  27. * @stable ICU 3.0
  28. */
  29. class U_I18N_API MeasureUnit: public UObject {
  30. public:
  31. /**
  32. * Default constructor.
  33. * @stable ICU 3.0
  34. */
  35. MeasureUnit() : fTypeId(0), fSubTypeId(0) {
  36. fCurrency[0] = 0;
  37. }
  38. /**
  39. * Copy constructor.
  40. * @stable ICU 3.0
  41. */
  42. MeasureUnit(const MeasureUnit &other);
  43. /**
  44. * Assignment operator.
  45. * @stable ICU 3.0
  46. */
  47. MeasureUnit &operator=(const MeasureUnit &other);
  48. /**
  49. * Returns a polymorphic clone of this object. The result will
  50. * have the same class as returned by getDynamicClassID().
  51. * @stable ICU 3.0
  52. */
  53. virtual UObject* clone() const;
  54. /**
  55. * Destructor
  56. * @stable ICU 3.0
  57. */
  58. virtual ~MeasureUnit();
  59. /**
  60. * Equality operator. Return true if this object is equal
  61. * to the given object.
  62. * @stable ICU 3.0
  63. */
  64. virtual UBool operator==(const UObject& other) const;
  65. /**
  66. * Inequality operator. Return true if this object is not equal
  67. * to the given object.
  68. * @stable ICU 53
  69. */
  70. UBool operator!=(const UObject& other) const {
  71. return !(*this == other);
  72. }
  73. /**
  74. * Get the type.
  75. * @stable ICU 53
  76. */
  77. const char *getType() const;
  78. /**
  79. * Get the sub type.
  80. * @stable ICU 53
  81. */
  82. const char *getSubtype() const;
  83. /**
  84. * getAvailable gets all of the available units.
  85. * If there are too many units to fit into destCapacity then the
  86. * error code is set to U_BUFFER_OVERFLOW_ERROR.
  87. *
  88. * @param destArray destination buffer.
  89. * @param destCapacity number of MeasureUnit instances available at dest.
  90. * @param errorCode ICU error code.
  91. * @return number of available units.
  92. * @stable ICU 53
  93. */
  94. static int32_t getAvailable(
  95. MeasureUnit *destArray,
  96. int32_t destCapacity,
  97. UErrorCode &errorCode);
  98. /**
  99. * getAvailable gets all of the available units for a specific type.
  100. * If there are too many units to fit into destCapacity then the
  101. * error code is set to U_BUFFER_OVERFLOW_ERROR.
  102. *
  103. * @param type the type
  104. * @param destArray destination buffer.
  105. * @param destCapacity number of MeasureUnit instances available at dest.
  106. * @param errorCode ICU error code.
  107. * @return number of available units for type.
  108. * @stable ICU 53
  109. */
  110. static int32_t getAvailable(
  111. const char *type,
  112. MeasureUnit *destArray,
  113. int32_t destCapacity,
  114. UErrorCode &errorCode);
  115. /**
  116. * getAvailableTypes gets all of the available types. Caller owns the
  117. * returned StringEnumeration and must delete it when finished using it.
  118. *
  119. * @param errorCode ICU error code.
  120. * @return the types.
  121. * @stable ICU 53
  122. */
  123. static StringEnumeration* getAvailableTypes(UErrorCode &errorCode);
  124. /**
  125. * Return the class ID for this class. This is useful only for comparing to
  126. * a return value from getDynamicClassID(). For example:
  127. * <pre>
  128. * . Base* polymorphic_pointer = createPolymorphicObject();
  129. * . if (polymorphic_pointer->getDynamicClassID() ==
  130. * . erived::getStaticClassID()) ...
  131. * </pre>
  132. * @return The class ID for all objects of this class.
  133. * @stable ICU 53
  134. */
  135. static UClassID U_EXPORT2 getStaticClassID(void);
  136. /**
  137. * Returns a unique class ID POLYMORPHICALLY. Pure virtual override. This
  138. * method is to implement a simple version of RTTI, since not all C++
  139. * compilers support genuine RTTI. Polymorphic operator==() and clone()
  140. * methods call this method.
  141. *
  142. * @return The class ID for this object. All objects of a
  143. * given class have the same class ID. Objects of
  144. * other classes have different class IDs.
  145. * @stable ICU 53
  146. */
  147. virtual UClassID getDynamicClassID(void) const;
  148. #ifndef U_HIDE_INTERNAL_API
  149. /**
  150. * ICU use only.
  151. * Returns associated array index for this measure unit. Only valid for
  152. * non-currency measure units.
  153. * @internal
  154. */
  155. int32_t getIndex() const;
  156. /**
  157. * ICU use only.
  158. * Returns maximum value from getIndex plus 1.
  159. * @internal
  160. */
  161. static int32_t getIndexCount();
  162. /**
  163. * ICU use only.
  164. * @internal
  165. */
  166. static MeasureUnit *resolveUnitPerUnit(
  167. const MeasureUnit &unit, const MeasureUnit &perUnit);
  168. #endif /* U_HIDE_INTERNAL_API */
  169. // All code between the "Start generated createXXX methods" comment and
  170. // the "End generated createXXX methods" comment is auto generated code
  171. // and must not be edited manually. For instructions on how to correctly
  172. // update this code, refer to:
  173. // http://site.icu-project.org/design/formatting/measureformat/updating-measure-unit
  174. //
  175. // Start generated createXXX methods
  176. /**
  177. * Returns unit of acceleration: g-force.
  178. * Caller owns returned value and must free it.
  179. * @param status ICU error code.
  180. * @stable ICU 53
  181. */
  182. static MeasureUnit *createGForce(UErrorCode &status);
  183. #ifndef U_HIDE_DRAFT_API
  184. /**
  185. * Returns unit of acceleration: meter-per-second-squared.
  186. * Caller owns returned value and must free it.
  187. * @param status ICU error code.
  188. * @draft ICU 54
  189. */
  190. static MeasureUnit *createMeterPerSecondSquared(UErrorCode &status);
  191. #endif /* U_HIDE_DRAFT_API */
  192. /**
  193. * Returns unit of angle: arc-minute.
  194. * Caller owns returned value and must free it.
  195. * @param status ICU error code.
  196. * @stable ICU 53
  197. */
  198. static MeasureUnit *createArcMinute(UErrorCode &status);
  199. /**
  200. * Returns unit of angle: arc-second.
  201. * Caller owns returned value and must free it.
  202. * @param status ICU error code.
  203. * @stable ICU 53
  204. */
  205. static MeasureUnit *createArcSecond(UErrorCode &status);
  206. /**
  207. * Returns unit of angle: degree.
  208. * Caller owns returned value and must free it.
  209. * @param status ICU error code.
  210. * @stable ICU 53
  211. */
  212. static MeasureUnit *createDegree(UErrorCode &status);
  213. #ifndef U_HIDE_DRAFT_API
  214. /**
  215. * Returns unit of angle: radian.
  216. * Caller owns returned value and must free it.
  217. * @param status ICU error code.
  218. * @draft ICU 54
  219. */
  220. static MeasureUnit *createRadian(UErrorCode &status);
  221. #endif /* U_HIDE_DRAFT_API */
  222. /**
  223. * Returns unit of area: acre.
  224. * Caller owns returned value and must free it.
  225. * @param status ICU error code.
  226. * @stable ICU 53
  227. */
  228. static MeasureUnit *createAcre(UErrorCode &status);
  229. /**
  230. * Returns unit of area: hectare.
  231. * Caller owns returned value and must free it.
  232. * @param status ICU error code.
  233. * @stable ICU 53
  234. */
  235. static MeasureUnit *createHectare(UErrorCode &status);
  236. #ifndef U_HIDE_DRAFT_API
  237. /**
  238. * Returns unit of area: square-centimeter.
  239. * Caller owns returned value and must free it.
  240. * @param status ICU error code.
  241. * @draft ICU 54
  242. */
  243. static MeasureUnit *createSquareCentimeter(UErrorCode &status);
  244. #endif /* U_HIDE_DRAFT_API */
  245. /**
  246. * Returns unit of area: square-foot.
  247. * Caller owns returned value and must free it.
  248. * @param status ICU error code.
  249. * @stable ICU 53
  250. */
  251. static MeasureUnit *createSquareFoot(UErrorCode &status);
  252. #ifndef U_HIDE_DRAFT_API
  253. /**
  254. * Returns unit of area: square-inch.
  255. * Caller owns returned value and must free it.
  256. * @param status ICU error code.
  257. * @draft ICU 54
  258. */
  259. static MeasureUnit *createSquareInch(UErrorCode &status);
  260. #endif /* U_HIDE_DRAFT_API */
  261. /**
  262. * Returns unit of area: square-kilometer.
  263. * Caller owns returned value and must free it.
  264. * @param status ICU error code.
  265. * @stable ICU 53
  266. */
  267. static MeasureUnit *createSquareKilometer(UErrorCode &status);
  268. /**
  269. * Returns unit of area: square-meter.
  270. * Caller owns returned value and must free it.
  271. * @param status ICU error code.
  272. * @stable ICU 53
  273. */
  274. static MeasureUnit *createSquareMeter(UErrorCode &status);
  275. /**
  276. * Returns unit of area: square-mile.
  277. * Caller owns returned value and must free it.
  278. * @param status ICU error code.
  279. * @stable ICU 53
  280. */
  281. static MeasureUnit *createSquareMile(UErrorCode &status);
  282. #ifndef U_HIDE_DRAFT_API
  283. /**
  284. * Returns unit of area: square-yard.
  285. * Caller owns returned value and must free it.
  286. * @param status ICU error code.
  287. * @draft ICU 54
  288. */
  289. static MeasureUnit *createSquareYard(UErrorCode &status);
  290. #endif /* U_HIDE_DRAFT_API */
  291. #ifndef U_HIDE_DRAFT_API
  292. /**
  293. * Returns unit of consumption: liter-per-kilometer.
  294. * Caller owns returned value and must free it.
  295. * @param status ICU error code.
  296. * @draft ICU 54
  297. */
  298. static MeasureUnit *createLiterPerKilometer(UErrorCode &status);
  299. #endif /* U_HIDE_DRAFT_API */
  300. #ifndef U_HIDE_DRAFT_API
  301. /**
  302. * Returns unit of consumption: mile-per-gallon.
  303. * Caller owns returned value and must free it.
  304. * @param status ICU error code.
  305. * @draft ICU 54
  306. */
  307. static MeasureUnit *createMilePerGallon(UErrorCode &status);
  308. #endif /* U_HIDE_DRAFT_API */
  309. #ifndef U_HIDE_DRAFT_API
  310. /**
  311. * Returns unit of digital: bit.
  312. * Caller owns returned value and must free it.
  313. * @param status ICU error code.
  314. * @draft ICU 54
  315. */
  316. static MeasureUnit *createBit(UErrorCode &status);
  317. #endif /* U_HIDE_DRAFT_API */
  318. #ifndef U_HIDE_DRAFT_API
  319. /**
  320. * Returns unit of digital: byte.
  321. * Caller owns returned value and must free it.
  322. * @param status ICU error code.
  323. * @draft ICU 54
  324. */
  325. static MeasureUnit *createByte(UErrorCode &status);
  326. #endif /* U_HIDE_DRAFT_API */
  327. #ifndef U_HIDE_DRAFT_API
  328. /**
  329. * Returns unit of digital: gigabit.
  330. * Caller owns returned value and must free it.
  331. * @param status ICU error code.
  332. * @draft ICU 54
  333. */
  334. static MeasureUnit *createGigabit(UErrorCode &status);
  335. #endif /* U_HIDE_DRAFT_API */
  336. #ifndef U_HIDE_DRAFT_API
  337. /**
  338. * Returns unit of digital: gigabyte.
  339. * Caller owns returned value and must free it.
  340. * @param status ICU error code.
  341. * @draft ICU 54
  342. */
  343. static MeasureUnit *createGigabyte(UErrorCode &status);
  344. #endif /* U_HIDE_DRAFT_API */
  345. #ifndef U_HIDE_DRAFT_API
  346. /**
  347. * Returns unit of digital: kilobit.
  348. * Caller owns returned value and must free it.
  349. * @param status ICU error code.
  350. * @draft ICU 54
  351. */
  352. static MeasureUnit *createKilobit(UErrorCode &status);
  353. #endif /* U_HIDE_DRAFT_API */
  354. #ifndef U_HIDE_DRAFT_API
  355. /**
  356. * Returns unit of digital: kilobyte.
  357. * Caller owns returned value and must free it.
  358. * @param status ICU error code.
  359. * @draft ICU 54
  360. */
  361. static MeasureUnit *createKilobyte(UErrorCode &status);
  362. #endif /* U_HIDE_DRAFT_API */
  363. #ifndef U_HIDE_DRAFT_API
  364. /**
  365. * Returns unit of digital: megabit.
  366. * Caller owns returned value and must free it.
  367. * @param status ICU error code.
  368. * @draft ICU 54
  369. */
  370. static MeasureUnit *createMegabit(UErrorCode &status);
  371. #endif /* U_HIDE_DRAFT_API */
  372. #ifndef U_HIDE_DRAFT_API
  373. /**
  374. * Returns unit of digital: megabyte.
  375. * Caller owns returned value and must free it.
  376. * @param status ICU error code.
  377. * @draft ICU 54
  378. */
  379. static MeasureUnit *createMegabyte(UErrorCode &status);
  380. #endif /* U_HIDE_DRAFT_API */
  381. #ifndef U_HIDE_DRAFT_API
  382. /**
  383. * Returns unit of digital: terabit.
  384. * Caller owns returned value and must free it.
  385. * @param status ICU error code.
  386. * @draft ICU 54
  387. */
  388. static MeasureUnit *createTerabit(UErrorCode &status);
  389. #endif /* U_HIDE_DRAFT_API */
  390. #ifndef U_HIDE_DRAFT_API
  391. /**
  392. * Returns unit of digital: terabyte.
  393. * Caller owns returned value and must free it.
  394. * @param status ICU error code.
  395. * @draft ICU 54
  396. */
  397. static MeasureUnit *createTerabyte(UErrorCode &status);
  398. #endif /* U_HIDE_DRAFT_API */
  399. /**
  400. * Returns unit of duration: day.
  401. * Caller owns returned value and must free it.
  402. * @param status ICU error code.
  403. * @stable ICU 53
  404. */
  405. static MeasureUnit *createDay(UErrorCode &status);
  406. /**
  407. * Returns unit of duration: hour.
  408. * Caller owns returned value and must free it.
  409. * @param status ICU error code.
  410. * @stable ICU 53
  411. */
  412. static MeasureUnit *createHour(UErrorCode &status);
  413. #ifndef U_HIDE_DRAFT_API
  414. /**
  415. * Returns unit of duration: microsecond.
  416. * Caller owns returned value and must free it.
  417. * @param status ICU error code.
  418. * @draft ICU 54
  419. */
  420. static MeasureUnit *createMicrosecond(UErrorCode &status);
  421. #endif /* U_HIDE_DRAFT_API */
  422. /**
  423. * Returns unit of duration: millisecond.
  424. * Caller owns returned value and must free it.
  425. * @param status ICU error code.
  426. * @stable ICU 53
  427. */
  428. static MeasureUnit *createMillisecond(UErrorCode &status);
  429. /**
  430. * Returns unit of duration: minute.
  431. * Caller owns returned value and must free it.
  432. * @param status ICU error code.
  433. * @stable ICU 53
  434. */
  435. static MeasureUnit *createMinute(UErrorCode &status);
  436. /**
  437. * Returns unit of duration: month.
  438. * Caller owns returned value and must free it.
  439. * @param status ICU error code.
  440. * @stable ICU 53
  441. */
  442. static MeasureUnit *createMonth(UErrorCode &status);
  443. #ifndef U_HIDE_DRAFT_API
  444. /**
  445. * Returns unit of duration: nanosecond.
  446. * Caller owns returned value and must free it.
  447. * @param status ICU error code.
  448. * @draft ICU 54
  449. */
  450. static MeasureUnit *createNanosecond(UErrorCode &status);
  451. #endif /* U_HIDE_DRAFT_API */
  452. /**
  453. * Returns unit of duration: second.
  454. * Caller owns returned value and must free it.
  455. * @param status ICU error code.
  456. * @stable ICU 53
  457. */
  458. static MeasureUnit *createSecond(UErrorCode &status);
  459. /**
  460. * Returns unit of duration: week.
  461. * Caller owns returned value and must free it.
  462. * @param status ICU error code.
  463. * @stable ICU 53
  464. */
  465. static MeasureUnit *createWeek(UErrorCode &status);
  466. /**
  467. * Returns unit of duration: year.
  468. * Caller owns returned value and must free it.
  469. * @param status ICU error code.
  470. * @stable ICU 53
  471. */
  472. static MeasureUnit *createYear(UErrorCode &status);
  473. #ifndef U_HIDE_DRAFT_API
  474. /**
  475. * Returns unit of electric: ampere.
  476. * Caller owns returned value and must free it.
  477. * @param status ICU error code.
  478. * @draft ICU 54
  479. */
  480. static MeasureUnit *createAmpere(UErrorCode &status);
  481. #endif /* U_HIDE_DRAFT_API */
  482. #ifndef U_HIDE_DRAFT_API
  483. /**
  484. * Returns unit of electric: milliampere.
  485. * Caller owns returned value and must free it.
  486. * @param status ICU error code.
  487. * @draft ICU 54
  488. */
  489. static MeasureUnit *createMilliampere(UErrorCode &status);
  490. #endif /* U_HIDE_DRAFT_API */
  491. #ifndef U_HIDE_DRAFT_API
  492. /**
  493. * Returns unit of electric: ohm.
  494. * Caller owns returned value and must free it.
  495. * @param status ICU error code.
  496. * @draft ICU 54
  497. */
  498. static MeasureUnit *createOhm(UErrorCode &status);
  499. #endif /* U_HIDE_DRAFT_API */
  500. #ifndef U_HIDE_DRAFT_API
  501. /**
  502. * Returns unit of electric: volt.
  503. * Caller owns returned value and must free it.
  504. * @param status ICU error code.
  505. * @draft ICU 54
  506. */
  507. static MeasureUnit *createVolt(UErrorCode &status);
  508. #endif /* U_HIDE_DRAFT_API */
  509. #ifndef U_HIDE_DRAFT_API
  510. /**
  511. * Returns unit of energy: calorie.
  512. * Caller owns returned value and must free it.
  513. * @param status ICU error code.
  514. * @draft ICU 54
  515. */
  516. static MeasureUnit *createCalorie(UErrorCode &status);
  517. #endif /* U_HIDE_DRAFT_API */
  518. #ifndef U_HIDE_DRAFT_API
  519. /**
  520. * Returns unit of energy: foodcalorie.
  521. * Caller owns returned value and must free it.
  522. * @param status ICU error code.
  523. * @draft ICU 54
  524. */
  525. static MeasureUnit *createFoodcalorie(UErrorCode &status);
  526. #endif /* U_HIDE_DRAFT_API */
  527. #ifndef U_HIDE_DRAFT_API
  528. /**
  529. * Returns unit of energy: joule.
  530. * Caller owns returned value and must free it.
  531. * @param status ICU error code.
  532. * @draft ICU 54
  533. */
  534. static MeasureUnit *createJoule(UErrorCode &status);
  535. #endif /* U_HIDE_DRAFT_API */
  536. #ifndef U_HIDE_DRAFT_API
  537. /**
  538. * Returns unit of energy: kilocalorie.
  539. * Caller owns returned value and must free it.
  540. * @param status ICU error code.
  541. * @draft ICU 54
  542. */
  543. static MeasureUnit *createKilocalorie(UErrorCode &status);
  544. #endif /* U_HIDE_DRAFT_API */
  545. #ifndef U_HIDE_DRAFT_API
  546. /**
  547. * Returns unit of energy: kilojoule.
  548. * Caller owns returned value and must free it.
  549. * @param status ICU error code.
  550. * @draft ICU 54
  551. */
  552. static MeasureUnit *createKilojoule(UErrorCode &status);
  553. #endif /* U_HIDE_DRAFT_API */
  554. #ifndef U_HIDE_DRAFT_API
  555. /**
  556. * Returns unit of energy: kilowatt-hour.
  557. * Caller owns returned value and must free it.
  558. * @param status ICU error code.
  559. * @draft ICU 54
  560. */
  561. static MeasureUnit *createKilowattHour(UErrorCode &status);
  562. #endif /* U_HIDE_DRAFT_API */
  563. #ifndef U_HIDE_DRAFT_API
  564. /**
  565. * Returns unit of frequency: gigahertz.
  566. * Caller owns returned value and must free it.
  567. * @param status ICU error code.
  568. * @draft ICU 54
  569. */
  570. static MeasureUnit *createGigahertz(UErrorCode &status);
  571. #endif /* U_HIDE_DRAFT_API */
  572. #ifndef U_HIDE_DRAFT_API
  573. /**
  574. * Returns unit of frequency: hertz.
  575. * Caller owns returned value and must free it.
  576. * @param status ICU error code.
  577. * @draft ICU 54
  578. */
  579. static MeasureUnit *createHertz(UErrorCode &status);
  580. #endif /* U_HIDE_DRAFT_API */
  581. #ifndef U_HIDE_DRAFT_API
  582. /**
  583. * Returns unit of frequency: kilohertz.
  584. * Caller owns returned value and must free it.
  585. * @param status ICU error code.
  586. * @draft ICU 54
  587. */
  588. static MeasureUnit *createKilohertz(UErrorCode &status);
  589. #endif /* U_HIDE_DRAFT_API */
  590. #ifndef U_HIDE_DRAFT_API
  591. /**
  592. * Returns unit of frequency: megahertz.
  593. * Caller owns returned value and must free it.
  594. * @param status ICU error code.
  595. * @draft ICU 54
  596. */
  597. static MeasureUnit *createMegahertz(UErrorCode &status);
  598. #endif /* U_HIDE_DRAFT_API */
  599. #ifndef U_HIDE_DRAFT_API
  600. /**
  601. * Returns unit of length: astronomical-unit.
  602. * Caller owns returned value and must free it.
  603. * @param status ICU error code.
  604. * @draft ICU 54
  605. */
  606. static MeasureUnit *createAstronomicalUnit(UErrorCode &status);
  607. #endif /* U_HIDE_DRAFT_API */
  608. /**
  609. * Returns unit of length: centimeter.
  610. * Caller owns returned value and must free it.
  611. * @param status ICU error code.
  612. * @stable ICU 53
  613. */
  614. static MeasureUnit *createCentimeter(UErrorCode &status);
  615. #ifndef U_HIDE_DRAFT_API
  616. /**
  617. * Returns unit of length: decimeter.
  618. * Caller owns returned value and must free it.
  619. * @param status ICU error code.
  620. * @draft ICU 54
  621. */
  622. static MeasureUnit *createDecimeter(UErrorCode &status);
  623. #endif /* U_HIDE_DRAFT_API */
  624. #ifndef U_HIDE_DRAFT_API
  625. /**
  626. * Returns unit of length: fathom.
  627. * Caller owns returned value and must free it.
  628. * @param status ICU error code.
  629. * @draft ICU 54
  630. */
  631. static MeasureUnit *createFathom(UErrorCode &status);
  632. #endif /* U_HIDE_DRAFT_API */
  633. /**
  634. * Returns unit of length: foot.
  635. * Caller owns returned value and must free it.
  636. * @param status ICU error code.
  637. * @stable ICU 53
  638. */
  639. static MeasureUnit *createFoot(UErrorCode &status);
  640. #ifndef U_HIDE_DRAFT_API
  641. /**
  642. * Returns unit of length: furlong.
  643. * Caller owns returned value and must free it.
  644. * @param status ICU error code.
  645. * @draft ICU 54
  646. */
  647. static MeasureUnit *createFurlong(UErrorCode &status);
  648. #endif /* U_HIDE_DRAFT_API */
  649. /**
  650. * Returns unit of length: inch.
  651. * Caller owns returned value and must free it.
  652. * @param status ICU error code.
  653. * @stable ICU 53
  654. */
  655. static MeasureUnit *createInch(UErrorCode &status);
  656. /**
  657. * Returns unit of length: kilometer.
  658. * Caller owns returned value and must free it.
  659. * @param status ICU error code.
  660. * @stable ICU 53
  661. */
  662. static MeasureUnit *createKilometer(UErrorCode &status);
  663. /**
  664. * Returns unit of length: light-year.
  665. * Caller owns returned value and must free it.
  666. * @param status ICU error code.
  667. * @stable ICU 53
  668. */
  669. static MeasureUnit *createLightYear(UErrorCode &status);
  670. /**
  671. * Returns unit of length: meter.
  672. * Caller owns returned value and must free it.
  673. * @param status ICU error code.
  674. * @stable ICU 53
  675. */
  676. static MeasureUnit *createMeter(UErrorCode &status);
  677. #ifndef U_HIDE_DRAFT_API
  678. /**
  679. * Returns unit of length: micrometer.
  680. * Caller owns returned value and must free it.
  681. * @param status ICU error code.
  682. * @draft ICU 54
  683. */
  684. static MeasureUnit *createMicrometer(UErrorCode &status);
  685. #endif /* U_HIDE_DRAFT_API */
  686. /**
  687. * Returns unit of length: mile.
  688. * Caller owns returned value and must free it.
  689. * @param status ICU error code.
  690. * @stable ICU 53
  691. */
  692. static MeasureUnit *createMile(UErrorCode &status);
  693. /**
  694. * Returns unit of length: millimeter.
  695. * Caller owns returned value and must free it.
  696. * @param status ICU error code.
  697. * @stable ICU 53
  698. */
  699. static MeasureUnit *createMillimeter(UErrorCode &status);
  700. #ifndef U_HIDE_DRAFT_API
  701. /**
  702. * Returns unit of length: nanometer.
  703. * Caller owns returned value and must free it.
  704. * @param status ICU error code.
  705. * @draft ICU 54
  706. */
  707. static MeasureUnit *createNanometer(UErrorCode &status);
  708. #endif /* U_HIDE_DRAFT_API */
  709. #ifndef U_HIDE_DRAFT_API
  710. /**
  711. * Returns unit of length: nautical-mile.
  712. * Caller owns returned value and must free it.
  713. * @param status ICU error code.
  714. * @draft ICU 54
  715. */
  716. static MeasureUnit *createNauticalMile(UErrorCode &status);
  717. #endif /* U_HIDE_DRAFT_API */
  718. #ifndef U_HIDE_DRAFT_API
  719. /**
  720. * Returns unit of length: parsec.
  721. * Caller owns returned value and must free it.
  722. * @param status ICU error code.
  723. * @draft ICU 54
  724. */
  725. static MeasureUnit *createParsec(UErrorCode &status);
  726. #endif /* U_HIDE_DRAFT_API */
  727. /**
  728. * Returns unit of length: picometer.
  729. * Caller owns returned value and must free it.
  730. * @param status ICU error code.
  731. * @stable ICU 53
  732. */
  733. static MeasureUnit *createPicometer(UErrorCode &status);
  734. /**
  735. * Returns unit of length: yard.
  736. * Caller owns returned value and must free it.
  737. * @param status ICU error code.
  738. * @stable ICU 53
  739. */
  740. static MeasureUnit *createYard(UErrorCode &status);
  741. #ifndef U_HIDE_DRAFT_API
  742. /**
  743. * Returns unit of light: lux.
  744. * Caller owns returned value and must free it.
  745. * @param status ICU error code.
  746. * @draft ICU 54
  747. */
  748. static MeasureUnit *createLux(UErrorCode &status);
  749. #endif /* U_HIDE_DRAFT_API */
  750. #ifndef U_HIDE_DRAFT_API
  751. /**
  752. * Returns unit of mass: carat.
  753. * Caller owns returned value and must free it.
  754. * @param status ICU error code.
  755. * @draft ICU 54
  756. */
  757. static MeasureUnit *createCarat(UErrorCode &status);
  758. #endif /* U_HIDE_DRAFT_API */
  759. /**
  760. * Returns unit of mass: gram.
  761. * Caller owns returned value and must free it.
  762. * @param status ICU error code.
  763. * @stable ICU 53
  764. */
  765. static MeasureUnit *createGram(UErrorCode &status);
  766. /**
  767. * Returns unit of mass: kilogram.
  768. * Caller owns returned value and must free it.
  769. * @param status ICU error code.
  770. * @stable ICU 53
  771. */
  772. static MeasureUnit *createKilogram(UErrorCode &status);
  773. #ifndef U_HIDE_DRAFT_API
  774. /**
  775. * Returns unit of mass: metric-ton.
  776. * Caller owns returned value and must free it.
  777. * @param status ICU error code.
  778. * @draft ICU 54
  779. */
  780. static MeasureUnit *createMetricTon(UErrorCode &status);
  781. #endif /* U_HIDE_DRAFT_API */
  782. #ifndef U_HIDE_DRAFT_API
  783. /**
  784. * Returns unit of mass: microgram.
  785. * Caller owns returned value and must free it.
  786. * @param status ICU error code.
  787. * @draft ICU 54
  788. */
  789. static MeasureUnit *createMicrogram(UErrorCode &status);
  790. #endif /* U_HIDE_DRAFT_API */
  791. #ifndef U_HIDE_DRAFT_API
  792. /**
  793. * Returns unit of mass: milligram.
  794. * Caller owns returned value and must free it.
  795. * @param status ICU error code.
  796. * @draft ICU 54
  797. */
  798. static MeasureUnit *createMilligram(UErrorCode &status);
  799. #endif /* U_HIDE_DRAFT_API */
  800. /**
  801. * Returns unit of mass: ounce.
  802. * Caller owns returned value and must free it.
  803. * @param status ICU error code.
  804. * @stable ICU 53
  805. */
  806. static MeasureUnit *createOunce(UErrorCode &status);
  807. #ifndef U_HIDE_DRAFT_API
  808. /**
  809. * Returns unit of mass: ounce-troy.
  810. * Caller owns returned value and must free it.
  811. * @param status ICU error code.
  812. * @draft ICU 54
  813. */
  814. static MeasureUnit *createOunceTroy(UErrorCode &status);
  815. #endif /* U_HIDE_DRAFT_API */
  816. /**
  817. * Returns unit of mass: pound.
  818. * Caller owns returned value and must free it.
  819. * @param status ICU error code.
  820. * @stable ICU 53
  821. */
  822. static MeasureUnit *createPound(UErrorCode &status);
  823. #ifndef U_HIDE_DRAFT_API
  824. /**
  825. * Returns unit of mass: stone.
  826. * Caller owns returned value and must free it.
  827. * @param status ICU error code.
  828. * @draft ICU 54
  829. */
  830. static MeasureUnit *createStone(UErrorCode &status);
  831. #endif /* U_HIDE_DRAFT_API */
  832. #ifndef U_HIDE_DRAFT_API
  833. /**
  834. * Returns unit of mass: ton.
  835. * Caller owns returned value and must free it.
  836. * @param status ICU error code.
  837. * @draft ICU 54
  838. */
  839. static MeasureUnit *createTon(UErrorCode &status);
  840. #endif /* U_HIDE_DRAFT_API */
  841. #ifndef U_HIDE_DRAFT_API
  842. /**
  843. * Returns unit of power: gigawatt.
  844. * Caller owns returned value and must free it.
  845. * @param status ICU error code.
  846. * @draft ICU 54
  847. */
  848. static MeasureUnit *createGigawatt(UErrorCode &status);
  849. #endif /* U_HIDE_DRAFT_API */
  850. /**
  851. * Returns unit of power: horsepower.
  852. * Caller owns returned value and must free it.
  853. * @param status ICU error code.
  854. * @stable ICU 53
  855. */
  856. static MeasureUnit *createHorsepower(UErrorCode &status);
  857. /**
  858. * Returns unit of power: kilowatt.
  859. * Caller owns returned value and must free it.
  860. * @param status ICU error code.
  861. * @stable ICU 53
  862. */
  863. static MeasureUnit *createKilowatt(UErrorCode &status);
  864. #ifndef U_HIDE_DRAFT_API
  865. /**
  866. * Returns unit of power: megawatt.
  867. * Caller owns returned value and must free it.
  868. * @param status ICU error code.
  869. * @draft ICU 54
  870. */
  871. static MeasureUnit *createMegawatt(UErrorCode &status);
  872. #endif /* U_HIDE_DRAFT_API */
  873. #ifndef U_HIDE_DRAFT_API
  874. /**
  875. * Returns unit of power: milliwatt.
  876. * Caller owns returned value and must free it.
  877. * @param status ICU error code.
  878. * @draft ICU 54
  879. */
  880. static MeasureUnit *createMilliwatt(UErrorCode &status);
  881. #endif /* U_HIDE_DRAFT_API */
  882. /**
  883. * Returns unit of power: watt.
  884. * Caller owns returned value and must free it.
  885. * @param status ICU error code.
  886. * @stable ICU 53
  887. */
  888. static MeasureUnit *createWatt(UErrorCode &status);
  889. /**
  890. * Returns unit of pressure: hectopascal.
  891. * Caller owns returned value and must free it.
  892. * @param status ICU error code.
  893. * @stable ICU 53
  894. */
  895. static MeasureUnit *createHectopascal(UErrorCode &status);
  896. /**
  897. * Returns unit of pressure: inch-hg.
  898. * Caller owns returned value and must free it.
  899. * @param status ICU error code.
  900. * @stable ICU 53
  901. */
  902. static MeasureUnit *createInchHg(UErrorCode &status);
  903. /**
  904. * Returns unit of pressure: millibar.
  905. * Caller owns returned value and must free it.
  906. * @param status ICU error code.
  907. * @stable ICU 53
  908. */
  909. static MeasureUnit *createMillibar(UErrorCode &status);
  910. #ifndef U_HIDE_DRAFT_API
  911. /**
  912. * Returns unit of pressure: millimeter-of-mercury.
  913. * Caller owns returned value and must free it.
  914. * @param status ICU error code.
  915. * @draft ICU 54
  916. */
  917. static MeasureUnit *createMillimeterOfMercury(UErrorCode &status);
  918. #endif /* U_HIDE_DRAFT_API */
  919. #ifndef U_HIDE_DRAFT_API
  920. /**
  921. * Returns unit of pressure: pound-per-square-inch.
  922. * Caller owns returned value and must free it.
  923. * @param status ICU error code.
  924. * @draft ICU 54
  925. */
  926. static MeasureUnit *createPoundPerSquareInch(UErrorCode &status);
  927. #endif /* U_HIDE_DRAFT_API */
  928. #ifndef U_HIDE_DRAFT_API
  929. /**
  930. * Returns unit of proportion: karat.
  931. * Caller owns returned value and must free it.
  932. * @param status ICU error code.
  933. * @draft ICU 54
  934. */
  935. static MeasureUnit *createKarat(UErrorCode &status);
  936. #endif /* U_HIDE_DRAFT_API */
  937. /**
  938. * Returns unit of speed: kilometer-per-hour.
  939. * Caller owns returned value and must free it.
  940. * @param status ICU error code.
  941. * @stable ICU 53
  942. */
  943. static MeasureUnit *createKilometerPerHour(UErrorCode &status);
  944. /**
  945. * Returns unit of speed: meter-per-second.
  946. * Caller owns returned value and must free it.
  947. * @param status ICU error code.
  948. * @stable ICU 53
  949. */
  950. static MeasureUnit *createMeterPerSecond(UErrorCode &status);
  951. /**
  952. * Returns unit of speed: mile-per-hour.
  953. * Caller owns returned value and must free it.
  954. * @param status ICU error code.
  955. * @stable ICU 53
  956. */
  957. static MeasureUnit *createMilePerHour(UErrorCode &status);
  958. /**
  959. * Returns unit of temperature: celsius.
  960. * Caller owns returned value and must free it.
  961. * @param status ICU error code.
  962. * @stable ICU 53
  963. */
  964. static MeasureUnit *createCelsius(UErrorCode &status);
  965. /**
  966. * Returns unit of temperature: fahrenheit.
  967. * Caller owns returned value and must free it.
  968. * @param status ICU error code.
  969. * @stable ICU 53
  970. */
  971. static MeasureUnit *createFahrenheit(UErrorCode &status);
  972. #ifndef U_HIDE_DRAFT_API
  973. /**
  974. * Returns unit of temperature: kelvin.
  975. * Caller owns returned value and must free it.
  976. * @param status ICU error code.
  977. * @draft ICU 54
  978. */
  979. static MeasureUnit *createKelvin(UErrorCode &status);
  980. #endif /* U_HIDE_DRAFT_API */
  981. #ifndef U_HIDE_DRAFT_API
  982. /**
  983. * Returns unit of volume: acre-foot.
  984. * Caller owns returned value and must free it.
  985. * @param status ICU error code.
  986. * @draft ICU 54
  987. */
  988. static MeasureUnit *createAcreFoot(UErrorCode &status);
  989. #endif /* U_HIDE_DRAFT_API */
  990. #ifndef U_HIDE_DRAFT_API
  991. /**
  992. * Returns unit of volume: bushel.
  993. * Caller owns returned value and must free it.
  994. * @param status ICU error code.
  995. * @draft ICU 54
  996. */
  997. static MeasureUnit *createBushel(UErrorCode &status);
  998. #endif /* U_HIDE_DRAFT_API */
  999. #ifndef U_HIDE_DRAFT_API
  1000. /**
  1001. * Returns unit of volume: centiliter.
  1002. * Caller owns returned value and must free it.
  1003. * @param status ICU error code.
  1004. * @draft ICU 54
  1005. */
  1006. static MeasureUnit *createCentiliter(UErrorCode &status);
  1007. #endif /* U_HIDE_DRAFT_API */
  1008. #ifndef U_HIDE_DRAFT_API
  1009. /**
  1010. * Returns unit of volume: cubic-centimeter.
  1011. * Caller owns returned value and must free it.
  1012. * @param status ICU error code.
  1013. * @draft ICU 54
  1014. */
  1015. static MeasureUnit *createCubicCentimeter(UErrorCode &status);
  1016. #endif /* U_HIDE_DRAFT_API */
  1017. #ifndef U_HIDE_DRAFT_API
  1018. /**
  1019. * Returns unit of volume: cubic-foot.
  1020. * Caller owns returned value and must free it.
  1021. * @param status ICU error code.
  1022. * @draft ICU 54
  1023. */
  1024. static MeasureUnit *createCubicFoot(UErrorCode &status);
  1025. #endif /* U_HIDE_DRAFT_API */
  1026. #ifndef U_HIDE_DRAFT_API
  1027. /**
  1028. * Returns unit of volume: cubic-inch.
  1029. * Caller owns returned value and must free it.
  1030. * @param status ICU error code.
  1031. * @draft ICU 54
  1032. */
  1033. static MeasureUnit *createCubicInch(UErrorCode &status);
  1034. #endif /* U_HIDE_DRAFT_API */
  1035. /**
  1036. * Returns unit of volume: cubic-kilometer.
  1037. * Caller owns returned value and must free it.
  1038. * @param status ICU error code.
  1039. * @stable ICU 53
  1040. */
  1041. static MeasureUnit *createCubicKilometer(UErrorCode &status);
  1042. #ifndef U_HIDE_DRAFT_API
  1043. /**
  1044. * Returns unit of volume: cubic-meter.
  1045. * Caller owns returned value and must free it.
  1046. * @param status ICU error code.
  1047. * @draft ICU 54
  1048. */
  1049. static MeasureUnit *createCubicMeter(UErrorCode &status);
  1050. #endif /* U_HIDE_DRAFT_API */
  1051. /**
  1052. * Returns unit of volume: cubic-mile.
  1053. * Caller owns returned value and must free it.
  1054. * @param status ICU error code.
  1055. * @stable ICU 53
  1056. */
  1057. static MeasureUnit *createCubicMile(UErrorCode &status);
  1058. #ifndef U_HIDE_DRAFT_API
  1059. /**
  1060. * Returns unit of volume: cubic-yard.
  1061. * Caller owns returned value and must free it.
  1062. * @param status ICU error code.
  1063. * @draft ICU 54
  1064. */
  1065. static MeasureUnit *createCubicYard(UErrorCode &status);
  1066. #endif /* U_HIDE_DRAFT_API */
  1067. #ifndef U_HIDE_DRAFT_API
  1068. /**
  1069. * Returns unit of volume: cup.
  1070. * Caller owns returned value and must free it.
  1071. * @param status ICU error code.
  1072. * @draft ICU 54
  1073. */
  1074. static MeasureUnit *createCup(UErrorCode &status);
  1075. #endif /* U_HIDE_DRAFT_API */
  1076. #ifndef U_HIDE_DRAFT_API
  1077. /**
  1078. * Returns unit of volume: deciliter.
  1079. * Caller owns returned value and must free it.
  1080. * @param status ICU error code.
  1081. * @draft ICU 54
  1082. */
  1083. static MeasureUnit *createDeciliter(UErrorCode &status);
  1084. #endif /* U_HIDE_DRAFT_API */
  1085. #ifndef U_HIDE_DRAFT_API
  1086. /**
  1087. * Returns unit of volume: fluid-ounce.
  1088. * Caller owns returned value and must free it.
  1089. * @param status ICU error code.
  1090. * @draft ICU 54
  1091. */
  1092. static MeasureUnit *createFluidOunce(UErrorCode &status);
  1093. #endif /* U_HIDE_DRAFT_API */
  1094. #ifndef U_HIDE_DRAFT_API
  1095. /**
  1096. * Returns unit of volume: gallon.
  1097. * Caller owns returned value and must free it.
  1098. * @param status ICU error code.
  1099. * @draft ICU 54
  1100. */
  1101. static MeasureUnit *createGallon(UErrorCode &status);
  1102. #endif /* U_HIDE_DRAFT_API */
  1103. #ifndef U_HIDE_DRAFT_API
  1104. /**
  1105. * Returns unit of volume: hectoliter.
  1106. * Caller owns returned value and must free it.
  1107. * @param status ICU error code.
  1108. * @draft ICU 54
  1109. */
  1110. static MeasureUnit *createHectoliter(UErrorCode &status);
  1111. #endif /* U_HIDE_DRAFT_API */
  1112. /**
  1113. * Returns unit of volume: liter.
  1114. * Caller owns returned value and must free it.
  1115. * @param status ICU error code.
  1116. * @stable ICU 53
  1117. */
  1118. static MeasureUnit *createLiter(UErrorCode &status);
  1119. #ifndef U_HIDE_DRAFT_API
  1120. /**
  1121. * Returns unit of volume: megaliter.
  1122. * Caller owns returned value and must free it.
  1123. * @param status ICU error code.
  1124. * @draft ICU 54
  1125. */
  1126. static MeasureUnit *createMegaliter(UErrorCode &status);
  1127. #endif /* U_HIDE_DRAFT_API */
  1128. #ifndef U_HIDE_DRAFT_API
  1129. /**
  1130. * Returns unit of volume: milliliter.
  1131. * Caller owns returned value and must free it.
  1132. * @param status ICU error code.
  1133. * @draft ICU 54
  1134. */
  1135. static MeasureUnit *createMilliliter(UErrorCode &status);
  1136. #endif /* U_HIDE_DRAFT_API */
  1137. #ifndef U_HIDE_DRAFT_API
  1138. /**
  1139. * Returns unit of volume: pint.
  1140. * Caller owns returned value and must free it.
  1141. * @param status ICU error code.
  1142. * @draft ICU 54
  1143. */
  1144. static MeasureUnit *createPint(UErrorCode &status);
  1145. #endif /* U_HIDE_DRAFT_API */
  1146. #ifndef U_HIDE_DRAFT_API
  1147. /**
  1148. * Returns unit of volume: quart.
  1149. * Caller owns returned value and must free it.
  1150. * @param status ICU error code.
  1151. * @draft ICU 54
  1152. */
  1153. static MeasureUnit *createQuart(UErrorCode &status);
  1154. #endif /* U_HIDE_DRAFT_API */
  1155. #ifndef U_HIDE_DRAFT_API
  1156. /**
  1157. * Returns unit of volume: tablespoon.
  1158. * Caller owns returned value and must free it.
  1159. * @param status ICU error code.
  1160. * @draft ICU 54
  1161. */
  1162. static MeasureUnit *createTablespoon(UErrorCode &status);
  1163. #endif /* U_HIDE_DRAFT_API */
  1164. #ifndef U_HIDE_DRAFT_API
  1165. /**
  1166. * Returns unit of volume: teaspoon.
  1167. * Caller owns returned value and must free it.
  1168. * @param status ICU error code.
  1169. * @draft ICU 54
  1170. */
  1171. static MeasureUnit *createTeaspoon(UErrorCode &status);
  1172. #endif /* U_HIDE_DRAFT_API */
  1173. // End generated createXXX methods
  1174. protected:
  1175. #ifndef U_HIDE_INTERNAL_API
  1176. /**
  1177. * For ICU use only.
  1178. * @internal
  1179. */
  1180. void initTime(const char *timeId);
  1181. /**
  1182. * For ICU use only.
  1183. * @internal
  1184. */
  1185. void initCurrency(const char *isoCurrency);
  1186. #endif /* U_HIDE_INTERNAL_API */
  1187. private:
  1188. int32_t fTypeId;
  1189. int32_t fSubTypeId;
  1190. char fCurrency[4];
  1191. MeasureUnit(int32_t typeId, int32_t subTypeId) : fTypeId(typeId), fSubTypeId(subTypeId) {
  1192. fCurrency[0] = 0;
  1193. }
  1194. void setTo(int32_t typeId, int32_t subTypeId);
  1195. int32_t getOffset() const;
  1196. static MeasureUnit *create(int typeId, int subTypeId, UErrorCode &status);
  1197. };
  1198. U_NAMESPACE_END
  1199. #endif // !UNCONFIG_NO_FORMATTING
  1200. #endif // __MEASUREUNIT_H__