@swiftbrowser/wasm-sdk-foundation 0.0.0-stage → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (368) hide show
  1. package/LICENSE.txt +1445 -0
  2. package/README.md +24 -2
  3. package/files.json +366 -0
  4. package/package.json +18 -4
  5. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/HTMLparser.h +320 -0
  6. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/HTMLtree.h +147 -0
  7. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/SAX.h +204 -0
  8. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/SAX2.h +173 -0
  9. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/c14n.h +128 -0
  10. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/catalog.h +182 -0
  11. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/chvalid.h +230 -0
  12. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/debugXML.h +217 -0
  13. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/dict.h +81 -0
  14. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/encoding.h +233 -0
  15. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/entities.h +151 -0
  16. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/globals.h +529 -0
  17. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/hash.h +236 -0
  18. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/list.h +137 -0
  19. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/nanoftp.h +186 -0
  20. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/nanohttp.h +81 -0
  21. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/parser.h +1265 -0
  22. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/parserInternals.h +662 -0
  23. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/pattern.h +100 -0
  24. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/relaxng.h +218 -0
  25. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/schemasInternals.h +958 -0
  26. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/schematron.h +142 -0
  27. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/threads.h +94 -0
  28. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/tree.h +1314 -0
  29. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/uri.h +94 -0
  30. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/valid.h +448 -0
  31. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/xinclude.h +129 -0
  32. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/xlink.h +189 -0
  33. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/xmlIO.h +369 -0
  34. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/xmlautomata.h +146 -0
  35. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/xmlerror.h +919 -0
  36. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/xmlexports.h +50 -0
  37. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/xmlmemory.h +228 -0
  38. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/xmlmodule.h +57 -0
  39. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/xmlreader.h +428 -0
  40. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/xmlregexp.h +222 -0
  41. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/xmlsave.h +88 -0
  42. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/xmlschemas.h +246 -0
  43. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/xmlschemastypes.h +152 -0
  44. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/xmlstring.h +140 -0
  45. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/xmlunicode.h +202 -0
  46. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/xmlversion.h +526 -0
  47. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/xmlwriter.h +488 -0
  48. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/xpath.h +575 -0
  49. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/xpathInternals.h +632 -0
  50. package/wasm32-unknown-wasip1/WASI.sdk/include/libxml2/libxml/xpointer.h +137 -0
  51. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFArray.h +673 -0
  52. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFAttributedString.h +157 -0
  53. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFAttributedStringPriv.h +25 -0
  54. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFAvailability.h +236 -0
  55. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFBag.h +97 -0
  56. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFBase.h +702 -0
  57. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFBigNumber.h +76 -0
  58. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFBinaryHeap.h +294 -0
  59. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFBitVector.h +49 -0
  60. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFBundle.h +349 -0
  61. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFBundlePriv.h +334 -0
  62. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFBundle_BinaryTypes.h +61 -0
  63. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFBurstTrie.h +181 -0
  64. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFByteOrder.h +305 -0
  65. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFCalendar.h +116 -0
  66. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFCalendarPriv.h +52 -0
  67. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFCharacterSet.h +387 -0
  68. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFCharacterSetPriv.h +78 -0
  69. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFConstantKeys.h +128 -0
  70. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFData.h +79 -0
  71. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFDate.h +113 -0
  72. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFDateComponents.h +92 -0
  73. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFDateFormatter.h +193 -0
  74. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFDateFormatter_Private.h +31 -0
  75. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFDateInterval.h +62 -0
  76. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFDateIntervalFormatter.h +96 -0
  77. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFDictionary.h +674 -0
  78. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFError.h +183 -0
  79. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFError_Private.h +27 -0
  80. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFKnownLocations.h +42 -0
  81. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFListFormatter.h +32 -0
  82. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFLocale.h +204 -0
  83. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFLocale_Private.h +35 -0
  84. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFLocking.h +124 -0
  85. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFLogUtilities.h +52 -0
  86. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFMachPort.h +53 -0
  87. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFMessagePort.h +66 -0
  88. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFNotificationCenter.h +81 -0
  89. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFNumber.h +129 -0
  90. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFNumberFormatter.h +174 -0
  91. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFNumber_Private.h +30 -0
  92. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFOverflow.h +88 -0
  93. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFPlugIn.h +124 -0
  94. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFPlugInCOM.h +117 -0
  95. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFPreferences.h +130 -0
  96. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFPriv.h +721 -0
  97. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFPropertyList.h +151 -0
  98. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFPropertyList_Private.h +19 -0
  99. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFRegularExpression.h +68 -0
  100. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFRelativeDateTimeFormatter.h +61 -0
  101. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFRunArray.h +57 -0
  102. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFRunLoop.h +203 -0
  103. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFRuntime.h +281 -0
  104. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFSet.h +491 -0
  105. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFSocket.h +220 -0
  106. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFStorage.h +296 -0
  107. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFStream.h +505 -0
  108. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFStreamAbstract.h +181 -0
  109. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFStreamPriv.h +126 -0
  110. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFString.h +915 -0
  111. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFStringDefaultEncoding.h +45 -0
  112. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFStringEncodingConverter.h +82 -0
  113. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFStringEncodingConverterExt.h +121 -0
  114. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFStringEncodingConverterPriv.h +47 -0
  115. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFStringEncodingDatabase.h +23 -0
  116. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFStringEncodingExt.h +184 -0
  117. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFString_Private.h +32 -0
  118. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFTargetConditionals.h +284 -0
  119. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFTimeZone.h +98 -0
  120. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFTree.h +330 -0
  121. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFURL.h +1256 -0
  122. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFURLAccess.h +128 -0
  123. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFURLComponents.h +123 -0
  124. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFURLPriv.h +879 -0
  125. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFUUID.h +78 -0
  126. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFUniChar.h +244 -0
  127. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFUnicodeDecomposition.h +35 -0
  128. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFUnicodePrecomposition.h +23 -0
  129. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFUserNotification.h +185 -0
  130. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CFUtilities.h +27 -0
  131. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/CoreFoundation.h +105 -0
  132. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/ForFoundationOnly.h +816 -0
  133. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/ForSwiftFoundationOnly.h +689 -0
  134. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/module.modulemap +8 -0
  135. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/CoreFoundation/static-module.map +7 -0
  136. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_FoundationCShims/CFUniCharBitmapData.h +17 -0
  137. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_FoundationCShims/CFUniCharBitmapData.inc.h +14707 -0
  138. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_FoundationCShims/CFUniCharBitmapDataAccess.h +16 -0
  139. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_FoundationCShims/_CShimsMacros.h +24 -0
  140. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_FoundationCShims/_CShimsTargetConditionals.h +56 -0
  141. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_FoundationCShims/_CStdlib.h +169 -0
  142. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_FoundationCShims/_FoundationCShims.h +32 -0
  143. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_FoundationCShims/bplist_shims.h +19 -0
  144. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_FoundationCShims/filemanager_shims.h +156 -0
  145. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_FoundationCShims/io_shims.h +89 -0
  146. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_FoundationCShims/module.modulemap +5 -0
  147. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_FoundationCShims/platform_shims.h +112 -0
  148. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_FoundationCShims/string_shims.h +52 -0
  149. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_FoundationCShims/uuid.h +81 -0
  150. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/alphaindex.h +766 -0
  151. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/appendable.h +239 -0
  152. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/basictz.h +248 -0
  153. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/brkiter.h +694 -0
  154. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/bytestream.h +307 -0
  155. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/bytestrie.h +568 -0
  156. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/bytestriebuilder.h +193 -0
  157. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/calendar.h +2609 -0
  158. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/caniter.h +215 -0
  159. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/casemap.h +497 -0
  160. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/char16ptr.h +384 -0
  161. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/chariter.h +734 -0
  162. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/choicfmt.h +601 -0
  163. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/coleitr.h +411 -0
  164. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/coll.h +1387 -0
  165. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/compactdecimalformat.h +196 -0
  166. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/curramt.h +133 -0
  167. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/currpinf.h +274 -0
  168. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/currunit.h +146 -0
  169. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/datefmt.h +968 -0
  170. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/dbbi.h +48 -0
  171. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/dcfmtsym.h +636 -0
  172. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/decimfmt.h +2233 -0
  173. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/displayoptions.h +270 -0
  174. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/docmain.h +247 -0
  175. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/dtfmtsym.h +1055 -0
  176. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/dtintrv.h +163 -0
  177. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/dtitvfmt.h +1231 -0
  178. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/dtitvinf.h +524 -0
  179. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/dtptngen.h +676 -0
  180. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/dtrule.h +256 -0
  181. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/edits.h +531 -0
  182. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/enumset.h +69 -0
  183. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/errorcode.h +144 -0
  184. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/fieldpos.h +298 -0
  185. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/filteredbrk.h +152 -0
  186. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/fmtable.h +758 -0
  187. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/format.h +316 -0
  188. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/formattednumber.h +215 -0
  189. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/formattedvalue.h +318 -0
  190. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/fpositer.h +124 -0
  191. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/gender.h +122 -0
  192. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/gregocal.h +737 -0
  193. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/icudataver.h +43 -0
  194. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/icuplug.h +391 -0
  195. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/idna.h +333 -0
  196. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/listformatter.h +291 -0
  197. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/localebuilder.h +309 -0
  198. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/localematcher.h +710 -0
  199. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/localpointer.h +609 -0
  200. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/locdspnm.h +211 -0
  201. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/locid.h +1293 -0
  202. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/measfmt.h +501 -0
  203. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/measunit.h +3928 -0
  204. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/measure.h +174 -0
  205. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/messagepattern.h +950 -0
  206. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/module.modulemap +209 -0
  207. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/msgfmt.h +1117 -0
  208. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/normalizer2.h +791 -0
  209. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/normlzr.h +816 -0
  210. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/nounit.h +86 -0
  211. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/numberformatter.h +2862 -0
  212. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/numberrangeformatter.h +802 -0
  213. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/numfmt.h +1299 -0
  214. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/numsys.h +220 -0
  215. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/parseerr.h +94 -0
  216. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/parsepos.h +237 -0
  217. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/platform.h +874 -0
  218. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/plurfmt.h +601 -0
  219. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/plurrule.h +591 -0
  220. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/ptypes.h +66 -0
  221. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/putil.h +183 -0
  222. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/rbbi.h +902 -0
  223. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/rbnf.h +1153 -0
  224. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/rbtz.h +373 -0
  225. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/regex.h +1882 -0
  226. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/region.h +229 -0
  227. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/reldatefmt.h +758 -0
  228. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/rep.h +266 -0
  229. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/resbund.h +489 -0
  230. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/schriter.h +187 -0
  231. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/scientificnumberformatter.h +222 -0
  232. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/search.h +580 -0
  233. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/selfmt.h +374 -0
  234. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/simpleformatter.h +414 -0
  235. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/simplenumberformatter.h +326 -0
  236. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/simpletz.h +940 -0
  237. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/smpdtfmt.h +1383 -0
  238. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/sortkey.h +344 -0
  239. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/std_string.h +41 -0
  240. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/strenum.h +281 -0
  241. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/stringoptions.h +190 -0
  242. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/stringpiece.h +354 -0
  243. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/stringtriebuilder.h +426 -0
  244. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/stsearch.h +509 -0
  245. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/symtable.h +119 -0
  246. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/tblcoll.h +886 -0
  247. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/timezone.h +1067 -0
  248. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/tmunit.h +142 -0
  249. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/tmutamt.h +174 -0
  250. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/tmutfmt.h +238 -0
  251. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/translit.h +1593 -0
  252. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/tzfmt.h +1102 -0
  253. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/tznames.h +419 -0
  254. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/tzrule.h +820 -0
  255. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/tztrans.h +201 -0
  256. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/ualoc.h +372 -0
  257. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/uameasureformat.h +487 -0
  258. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/uameasureunit.h +249 -0
  259. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/uatimeunitformat.h +377 -0
  260. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/uatimezone.h +114 -0
  261. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/ubidi.h +2368 -0
  262. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/ubiditransform.h +326 -0
  263. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/ubrk.h +684 -0
  264. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/ucal.h +1825 -0
  265. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/ucasemap.h +388 -0
  266. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/ucat.h +160 -0
  267. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/uchar.h +4410 -0
  268. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/ucharstrie.h +623 -0
  269. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/ucharstriebuilder.h +193 -0
  270. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/uchriter.h +393 -0
  271. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/uclean.h +262 -0
  272. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/ucnv.h +2053 -0
  273. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/ucnv_cb.h +164 -0
  274. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/ucnv_err.h +465 -0
  275. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/ucnvsel.h +193 -0
  276. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/ucol.h +1649 -0
  277. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/ucoleitr.h +344 -0
  278. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/uconfig.h +501 -0
  279. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/ucpmap.h +158 -0
  280. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/ucptrie.h +645 -0
  281. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/ucsdet.h +426 -0
  282. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/ucurr.h +466 -0
  283. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/udat.h +1767 -0
  284. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/udata.h +454 -0
  285. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/udateintervalformat.h +458 -0
  286. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/udatintv.h +146 -0
  287. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/udatpg.h +806 -0
  288. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/udisplaycontext.h +233 -0
  289. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/udisplayoptions.h +321 -0
  290. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/uenum.h +209 -0
  291. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/ufieldpositer.h +123 -0
  292. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/uformattable.h +290 -0
  293. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/uformattednumber.h +224 -0
  294. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/uformattedvalue.h +445 -0
  295. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/ugender.h +86 -0
  296. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/uidna.h +794 -0
  297. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/uiter.h +709 -0
  298. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/uldnames.h +307 -0
  299. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/ulistformatter.h +333 -0
  300. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/uloc.h +1437 -0
  301. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/ulocale.h +226 -0
  302. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/ulocbuilder.h +437 -0
  303. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/ulocdata.h +299 -0
  304. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/umachine.h +491 -0
  305. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/umisc.h +62 -0
  306. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/umsg.h +628 -0
  307. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/umutablecptrie.h +240 -0
  308. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/unifilt.h +136 -0
  309. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/unifunct.h +132 -0
  310. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/unimatch.h +168 -0
  311. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/unirepl.h +103 -0
  312. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/uniset.h +1909 -0
  313. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/unistr.h +5095 -0
  314. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/unorm.h +476 -0
  315. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/unorm2.h +626 -0
  316. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/unum.h +1524 -0
  317. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/unumberformatter.h +576 -0
  318. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/unumberoptions.h +173 -0
  319. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/unumberrangeformatter.h +471 -0
  320. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/unumsys.h +176 -0
  321. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/uobject.h +324 -0
  322. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/uplrule.h +82 -0
  323. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/upluralrules.h +263 -0
  324. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/urbtok.h +276 -0
  325. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/uregex.h +1617 -0
  326. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/uregion.h +252 -0
  327. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/ureldatefmt.h +510 -0
  328. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/urename.h +4026 -0
  329. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/urep.h +157 -0
  330. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/ures.h +912 -0
  331. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/uscript.h +742 -0
  332. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/usearch.h +911 -0
  333. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/uset.h +1898 -0
  334. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/usetiter.h +323 -0
  335. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/ushape.h +476 -0
  336. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/usimplenumberformatter.h +297 -0
  337. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/uspoof.h +1852 -0
  338. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/usprep.h +274 -0
  339. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/ustdio.h +1021 -0
  340. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/ustream.h +69 -0
  341. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/ustring.h +1719 -0
  342. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/ustringtrie.h +97 -0
  343. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/utext.h +1613 -0
  344. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/utf.h +225 -0
  345. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/utf16.h +740 -0
  346. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/utf32.h +25 -0
  347. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/utf8.h +882 -0
  348. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/utf_old.h +1207 -0
  349. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/utmscale.h +490 -0
  350. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/utrace.h +506 -0
  351. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/utrans.h +660 -0
  352. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/utypes.h +826 -0
  353. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/uvernum.h +191 -0
  354. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/uversion.h +230 -0
  355. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/_foundation_unicode/vtzone.h +471 -0
  356. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/Foundation.swiftmodule/wasm32-unknown-wasip1.swiftmodule +0 -0
  357. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/FoundationEssentials.swiftmodule/wasm32-unknown-wasip1.swiftmodule +0 -0
  358. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/FoundationInternationalization.swiftmodule/wasm32-unknown-wasip1.swiftmodule +0 -0
  359. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/FoundationXML.swiftmodule/wasm32-unknown-wasip1.swiftmodule +0 -0
  360. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/_FoundationCollections.swiftmodule/wasm32-unknown-wasip1.swiftmodule +0 -0
  361. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/libCoreFoundation.a +0 -0
  362. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/libFoundation.a +0 -0
  363. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/libFoundationEssentials.a +0 -0
  364. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/libFoundationInternationalization.a +0 -0
  365. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/libFoundationXML.a +0 -0
  366. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/lib_CFXMLInterface.a +0 -0
  367. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/lib_FoundationCShims.a +0 -0
  368. package/wasm32-unknown-wasip1/swift.xctoolchain/usr/lib/swift_static/wasi/lib_FoundationCollections.a +0 -0
@@ -0,0 +1,2862 @@
1
+ // © 2017 and later: Unicode, Inc. and others.
2
+ // License & terms of use: http://www.unicode.org/copyright.html
3
+
4
+ #ifndef __NUMBERFORMATTER_H__
5
+ #define __NUMBERFORMATTER_H__
6
+
7
+ #include <_foundation_unicode/utypes.h>
8
+
9
+ #if U_SHOW_CPLUSPLUS_API
10
+
11
+ #if !UCONFIG_NO_FORMATTING
12
+
13
+ #include <_foundation_unicode/appendable.h>
14
+ #include <_foundation_unicode/bytestream.h>
15
+ #include <_foundation_unicode/currunit.h>
16
+ #include <_foundation_unicode/dcfmtsym.h>
17
+ #include <_foundation_unicode/displayoptions.h>
18
+ #include <_foundation_unicode/fieldpos.h>
19
+ #include <_foundation_unicode/fpositer.h>
20
+ #include <_foundation_unicode/measunit.h>
21
+ #include <_foundation_unicode/nounit.h>
22
+ #include <_foundation_unicode/parseerr.h>
23
+ #include <_foundation_unicode/plurrule.h>
24
+ #include <_foundation_unicode/ucurr.h>
25
+ #include <_foundation_unicode/unum.h>
26
+ #include <_foundation_unicode/unumberformatter.h>
27
+ #include <_foundation_unicode/uobject.h>
28
+ #include <_foundation_unicode/unumberoptions.h>
29
+ #include <_foundation_unicode/formattednumber.h>
30
+
31
+ /**
32
+ * \file
33
+ * \brief C++ API: All-in-one formatter for localized numbers, currencies, and units.
34
+ *
35
+ * For a full list of options, see icu::number::NumberFormatterSettings.
36
+ *
37
+ * <pre>
38
+ * // Most basic usage:
39
+ * NumberFormatter::withLocale(...).format(123).toString(); // 1,234 in en-US
40
+ *
41
+ * // Custom notation, unit, and rounding precision:
42
+ * NumberFormatter::with()
43
+ * .notation(Notation::compactShort())
44
+ * .unit(CurrencyUnit("EUR", status))
45
+ * .precision(Precision::maxDigits(2))
46
+ * .locale(...)
47
+ * .format(1234)
48
+ * .toString(); // €1.2K in en-US
49
+ *
50
+ * // Create a formatter in a singleton by value for use later:
51
+ * static const LocalizedNumberFormatter formatter = NumberFormatter::withLocale(...)
52
+ * .unit(NoUnit::percent())
53
+ * .precision(Precision::fixedFraction(3));
54
+ * formatter.format(5.9831).toString(); // 5.983% in en-US
55
+ *
56
+ * // Create a "template" in a singleton unique_ptr but without setting a locale until the call site:
57
+ * std::unique_ptr<UnlocalizedNumberFormatter> template = NumberFormatter::with()
58
+ * .sign(UNumberSignDisplay::UNUM_SIGN_ALWAYS)
59
+ * .unit(MeasureUnit::getMeter())
60
+ * .unitWidth(UNumberUnitWidth::UNUM_UNIT_WIDTH_FULL_NAME)
61
+ * .clone();
62
+ * template->locale(...).format(1234).toString(); // +1,234 meters in en-US
63
+ * </pre>
64
+ *
65
+ * <p>
66
+ * This API offers more features than DecimalFormat and is geared toward new users of ICU.
67
+ *
68
+ * <p>
69
+ * NumberFormatter instances (i.e., LocalizedNumberFormatter and UnlocalizedNumberFormatter)
70
+ * are immutable and thread safe. This means that invoking a configuration method has no
71
+ * effect on the receiving instance; you must store and use the new number formatter instance it returns instead.
72
+ *
73
+ * <pre>
74
+ * UnlocalizedNumberFormatter formatter = UnlocalizedNumberFormatter::with().notation(Notation::scientific());
75
+ * formatter.precision(Precision.maxFraction(2)); // does nothing!
76
+ * formatter.locale(Locale.getEnglish()).format(9.8765).toString(); // prints "9.8765E0", not "9.88E0"
77
+ * </pre>
78
+ *
79
+ * <p>
80
+ * This API is based on the <em>fluent</em> design pattern popularized by libraries such as Google's Guava. For
81
+ * extensive details on the design of this API, read <a href="https://goo.gl/szi5VB">the design doc</a>.
82
+ *
83
+ * <p>
84
+ * Note: To format monetary/currency values, specify the currency in the `.unit()` function.
85
+ *
86
+ * @author Shane Carr
87
+ */
88
+
89
+ U_NAMESPACE_BEGIN
90
+
91
+ // Forward declarations:
92
+ class IFixedDecimal;
93
+ class FieldPositionIteratorHandler;
94
+ class FormattedStringBuilder;
95
+
96
+ namespace numparse::impl {
97
+
98
+ // Forward declarations:
99
+ class NumberParserImpl;
100
+ class MultiplierParseHandler;
101
+
102
+ } // namespace numparse::impl
103
+
104
+ namespace units {
105
+
106
+ // Forward declarations:
107
+ class UnitsRouter;
108
+
109
+ } // namespace units
110
+
111
+ namespace number { // icu::number
112
+
113
+ // Forward declarations:
114
+ class UnlocalizedNumberFormatter;
115
+ class LocalizedNumberFormatter;
116
+ class SimpleNumberFormatter;
117
+ class FormattedNumber;
118
+ class Notation;
119
+ class ScientificNotation;
120
+ class Precision;
121
+ class FractionPrecision;
122
+ class CurrencyPrecision;
123
+ class IncrementPrecision;
124
+ class IntegerWidth;
125
+
126
+ namespace impl {
127
+
128
+ // can't be #ifndef U_HIDE_INTERNAL_API; referenced throughout this file in public classes
129
+ /**
130
+ * Datatype for minimum/maximum fraction digits. Must be able to hold kMaxIntFracSig.
131
+ *
132
+ * @internal
133
+ */
134
+ typedef int16_t digits_t;
135
+
136
+ // can't be #ifndef U_HIDE_INTERNAL_API; needed for struct initialization
137
+ /**
138
+ * Use a default threshold of 3. This means that the third time .format() is called, the data structures get built
139
+ * using the "safe" code path. The first two calls to .format() will trigger the unsafe code path.
140
+ *
141
+ * @internal
142
+ */
143
+ static constexpr int32_t kInternalDefaultThreshold = 3;
144
+
145
+ // Forward declarations:
146
+ class Padder;
147
+ struct MacroProps;
148
+ struct MicroProps;
149
+ class DecimalQuantity;
150
+ class UFormattedNumberData;
151
+ class NumberFormatterImpl;
152
+ struct ParsedPatternInfo;
153
+ class ScientificModifier;
154
+ class MultiplierProducer;
155
+ class RoundingImpl;
156
+ class ScientificHandler;
157
+ class Modifier;
158
+ class AffixPatternProvider;
159
+ class NumberPropertyMapper;
160
+ struct DecimalFormatProperties;
161
+ class MultiplierFormatHandler;
162
+ class CurrencySymbols;
163
+ class GeneratorHelpers;
164
+ class DecNum;
165
+ class NumberRangeFormatterImpl;
166
+ struct RangeMacroProps;
167
+ struct UFormattedNumberImpl;
168
+ class MutablePatternModifier;
169
+ class ImmutablePatternModifier;
170
+ struct DecimalFormatWarehouse;
171
+ struct SimpleMicroProps;
172
+ class AdoptingSignumModifierStore;
173
+
174
+ /**
175
+ * Used for NumberRangeFormatter and implemented in numrange_fluent.cpp.
176
+ * Declared here so it can be friended.
177
+ *
178
+ * @internal
179
+ */
180
+ void touchRangeLocales(impl::RangeMacroProps& macros);
181
+
182
+ } // namespace impl
183
+
184
+ /**
185
+ * Extra name reserved in case it is needed in the future.
186
+ *
187
+ * @stable ICU 63
188
+ */
189
+ typedef Notation CompactNotation;
190
+
191
+ /**
192
+ * Extra name reserved in case it is needed in the future.
193
+ *
194
+ * @stable ICU 63
195
+ */
196
+ typedef Notation SimpleNotation;
197
+
198
+ /**
199
+ * A class that defines the notation style to be used when formatting numbers in NumberFormatter.
200
+ *
201
+ * @stable ICU 60
202
+ */
203
+ class U_I18N_API Notation : public UMemory {
204
+ public:
205
+ /**
206
+ * Print the number using scientific notation (also known as scientific form, standard index form, or standard form
207
+ * in the UK). The format for scientific notation varies by locale; for example, many Western locales display the
208
+ * number in the form "#E0", where the number is displayed with one digit before the decimal separator, zero or more
209
+ * digits after the decimal separator, and the corresponding power of 10 displayed after the "E".
210
+ *
211
+ * <p>
212
+ * Example outputs in <em>en-US</em> when printing 8.765E4 through 8.765E-3:
213
+ *
214
+ * <pre>
215
+ * 8.765E4
216
+ * 8.765E3
217
+ * 8.765E2
218
+ * 8.765E1
219
+ * 8.765E0
220
+ * 8.765E-1
221
+ * 8.765E-2
222
+ * 8.765E-3
223
+ * 0E0
224
+ * </pre>
225
+ *
226
+ * @return A ScientificNotation for chaining or passing to the NumberFormatter notation() setter.
227
+ * @stable ICU 60
228
+ */
229
+ static ScientificNotation scientific();
230
+
231
+ /**
232
+ * Print the number using engineering notation, a variant of scientific notation in which the exponent must be
233
+ * divisible by 3.
234
+ *
235
+ * <p>
236
+ * Example outputs in <em>en-US</em> when printing 8.765E4 through 8.765E-3:
237
+ *
238
+ * <pre>
239
+ * 87.65E3
240
+ * 8.765E3
241
+ * 876.5E0
242
+ * 87.65E0
243
+ * 8.765E0
244
+ * 876.5E-3
245
+ * 87.65E-3
246
+ * 8.765E-3
247
+ * 0E0
248
+ * </pre>
249
+ *
250
+ * @return A ScientificNotation for chaining or passing to the NumberFormatter notation() setter.
251
+ * @stable ICU 60
252
+ */
253
+ static ScientificNotation engineering();
254
+
255
+ /**
256
+ * Print the number using short-form compact notation.
257
+ *
258
+ * <p>
259
+ * <em>Compact notation</em>, defined in Unicode Technical Standard #35 Part 3 Section 2.4.1, prints numbers with
260
+ * localized prefixes or suffixes corresponding to different powers of ten. Compact notation is similar to
261
+ * engineering notation in how it scales numbers.
262
+ *
263
+ * <p>
264
+ * Compact notation is ideal for displaying large numbers (over ~1000) to humans while at the same time minimizing
265
+ * screen real estate.
266
+ *
267
+ * <p>
268
+ * In short form, the powers of ten are abbreviated. In <em>en-US</em>, the abbreviations are "K" for thousands, "M"
269
+ * for millions, "B" for billions, and "T" for trillions. Example outputs in <em>en-US</em> when printing 8.765E7
270
+ * through 8.765E0:
271
+ *
272
+ * <pre>
273
+ * 88M
274
+ * 8.8M
275
+ * 876K
276
+ * 88K
277
+ * 8.8K
278
+ * 876
279
+ * 88
280
+ * 8.8
281
+ * </pre>
282
+ *
283
+ * <p>
284
+ * When compact notation is specified without an explicit rounding precision, numbers are rounded off to the closest
285
+ * integer after scaling the number by the corresponding power of 10, but with a digit shown after the decimal
286
+ * separator if there is only one digit before the decimal separator. The default compact notation rounding precision
287
+ * is equivalent to:
288
+ *
289
+ * <pre>
290
+ * Precision::integer().withMinDigits(2)
291
+ * </pre>
292
+ *
293
+ * @return A CompactNotation for passing to the NumberFormatter notation() setter.
294
+ * @stable ICU 60
295
+ */
296
+ static CompactNotation compactShort();
297
+
298
+ /**
299
+ * Print the number using long-form compact notation. For more information on compact notation, see
300
+ * {@link #compactShort}.
301
+ *
302
+ * <p>
303
+ * In long form, the powers of ten are spelled out fully. Example outputs in <em>en-US</em> when printing 8.765E7
304
+ * through 8.765E0:
305
+ *
306
+ * <pre>
307
+ * 88 million
308
+ * 8.8 million
309
+ * 876 thousand
310
+ * 88 thousand
311
+ * 8.8 thousand
312
+ * 876
313
+ * 88
314
+ * 8.8
315
+ * </pre>
316
+ *
317
+ * @return A CompactNotation for passing to the NumberFormatter notation() setter.
318
+ * @stable ICU 60
319
+ */
320
+ static CompactNotation compactLong();
321
+
322
+ /**
323
+ * Print the number using simple notation without any scaling by powers of ten. This is the default behavior.
324
+ *
325
+ * <p>
326
+ * Since this is the default behavior, this method needs to be called only when it is necessary to override a
327
+ * previous setting.
328
+ *
329
+ * <p>
330
+ * Example outputs in <em>en-US</em> when printing 8.765E7 through 8.765E0:
331
+ *
332
+ * <pre>
333
+ * 87,650,000
334
+ * 8,765,000
335
+ * 876,500
336
+ * 87,650
337
+ * 8,765
338
+ * 876.5
339
+ * 87.65
340
+ * 8.765
341
+ * </pre>
342
+ *
343
+ * @return A SimpleNotation for passing to the NumberFormatter notation() setter.
344
+ * @stable ICU 60
345
+ */
346
+ static SimpleNotation simple();
347
+
348
+ private:
349
+ enum NotationType {
350
+ NTN_SCIENTIFIC, NTN_COMPACT, NTN_SIMPLE, NTN_ERROR
351
+ } fType;
352
+
353
+ union NotationUnion {
354
+ // For NTN_SCIENTIFIC
355
+ /** @internal (private) */
356
+ struct ScientificSettings {
357
+ /** @internal (private) */
358
+ int8_t fEngineeringInterval;
359
+ /** @internal (private) */
360
+ bool fRequireMinInt;
361
+ /** @internal (private) */
362
+ impl::digits_t fMinExponentDigits;
363
+ /** @internal (private) */
364
+ UNumberSignDisplay fExponentSignDisplay;
365
+ } scientific;
366
+
367
+ // For NTN_COMPACT
368
+ UNumberCompactStyle compactStyle;
369
+
370
+ // For NTN_ERROR
371
+ UErrorCode errorCode;
372
+ } fUnion;
373
+
374
+ typedef NotationUnion::ScientificSettings ScientificSettings;
375
+
376
+ Notation(const NotationType &type, const NotationUnion &union_) : fType(type), fUnion(union_) {}
377
+
378
+ Notation(UErrorCode errorCode) : fType(NTN_ERROR) {
379
+ fUnion.errorCode = errorCode;
380
+ }
381
+
382
+ Notation() : fType(NTN_SIMPLE), fUnion() {}
383
+
384
+ UBool copyErrorTo(UErrorCode &status) const {
385
+ if (fType == NTN_ERROR) {
386
+ status = fUnion.errorCode;
387
+ return true;
388
+ }
389
+ return false;
390
+ }
391
+
392
+ // To allow MacroProps to initialize empty instances:
393
+ friend struct impl::MacroProps;
394
+ friend class ScientificNotation;
395
+
396
+ // To allow implementation to access internal types:
397
+ friend class impl::NumberFormatterImpl;
398
+ friend class impl::ScientificModifier;
399
+ friend class impl::ScientificHandler;
400
+
401
+ // To allow access to the skeleton generation code:
402
+ friend class impl::GeneratorHelpers;
403
+ };
404
+
405
+ /**
406
+ * A class that defines the scientific notation style to be used when formatting numbers in NumberFormatter.
407
+ *
408
+ * <p>
409
+ * To create a ScientificNotation, use one of the factory methods in {@link Notation}.
410
+ *
411
+ * @stable ICU 60
412
+ */
413
+ class U_I18N_API ScientificNotation : public Notation {
414
+ public:
415
+ /**
416
+ * Sets the minimum number of digits to show in the exponent of scientific notation, padding with zeros if
417
+ * necessary. Useful for fixed-width display.
418
+ *
419
+ * <p>
420
+ * For example, with minExponentDigits=2, the number 123 will be printed as "1.23E02" in <em>en-US</em> instead of
421
+ * the default "1.23E2".
422
+ *
423
+ * @param minExponentDigits
424
+ * The minimum number of digits to show in the exponent.
425
+ * @return A ScientificNotation, for chaining.
426
+ * @stable ICU 60
427
+ */
428
+ ScientificNotation withMinExponentDigits(int32_t minExponentDigits) const;
429
+
430
+ /**
431
+ * Sets whether to show the sign on positive and negative exponents in scientific notation. The default is AUTO,
432
+ * showing the minus sign but not the plus sign.
433
+ *
434
+ * <p>
435
+ * For example, with exponentSignDisplay=ALWAYS, the number 123 will be printed as "1.23E+2" in <em>en-US</em>
436
+ * instead of the default "1.23E2".
437
+ *
438
+ * @param exponentSignDisplay
439
+ * The strategy for displaying the sign in the exponent.
440
+ * @return A ScientificNotation, for chaining.
441
+ * @stable ICU 60
442
+ */
443
+ ScientificNotation withExponentSignDisplay(UNumberSignDisplay exponentSignDisplay) const;
444
+
445
+ private:
446
+ // Inherit constructor
447
+ using Notation::Notation;
448
+
449
+ // Raw constructor for NumberPropertyMapper
450
+ ScientificNotation(int8_t fEngineeringInterval, bool fRequireMinInt, impl::digits_t fMinExponentDigits,
451
+ UNumberSignDisplay fExponentSignDisplay);
452
+
453
+ friend class Notation;
454
+
455
+ // So that NumberPropertyMapper can create instances
456
+ friend class impl::NumberPropertyMapper;
457
+ };
458
+
459
+ /**
460
+ * Extra name reserved in case it is needed in the future.
461
+ *
462
+ * @stable ICU 63
463
+ */
464
+ typedef Precision SignificantDigitsPrecision;
465
+
466
+ /**
467
+ * A class that defines the rounding precision to be used when formatting numbers in NumberFormatter.
468
+ *
469
+ * <p>
470
+ * To create a Precision, use one of the factory methods.
471
+ *
472
+ * @stable ICU 60
473
+ */
474
+ class U_I18N_API Precision : public UMemory {
475
+
476
+ public:
477
+ /**
478
+ * Show all available digits to full precision.
479
+ *
480
+ * <p>
481
+ * <strong>NOTE:</strong> When formatting a <em>double</em>, this method, along with {@link #minFraction} and
482
+ * {@link #minSignificantDigits}, will trigger complex algorithm similar to <em>Dragon4</em> to determine the
483
+ * low-order digits and the number of digits to display based on the value of the double.
484
+ * If the number of fraction places or significant digits can be bounded, consider using {@link #maxFraction}
485
+ * or {@link #maxSignificantDigits} instead to maximize performance.
486
+ * For more information, read the following blog post.
487
+ *
488
+ * <p>
489
+ * http://www.serpentine.com/blog/2011/06/29/here-be-dragons-advances-in-problems-you-didnt-even-know-you-had/
490
+ *
491
+ * @return A Precision for chaining or passing to the NumberFormatter precision() setter.
492
+ * @stable ICU 60
493
+ */
494
+ static Precision unlimited();
495
+
496
+ /**
497
+ * Show numbers rounded if necessary to the nearest integer.
498
+ *
499
+ * @return A FractionPrecision for chaining or passing to the NumberFormatter precision() setter.
500
+ * @stable ICU 60
501
+ */
502
+ static FractionPrecision integer();
503
+
504
+ /**
505
+ * Show numbers rounded if necessary to a certain number of fraction places (numerals after the decimal separator).
506
+ * Additionally, pad with zeros to ensure that this number of places are always shown.
507
+ *
508
+ * <p>
509
+ * Example output with minMaxFractionPlaces = 3:
510
+ *
511
+ * <p>
512
+ * 87,650.000<br>
513
+ * 8,765.000<br>
514
+ * 876.500<br>
515
+ * 87.650<br>
516
+ * 8.765<br>
517
+ * 0.876<br>
518
+ * 0.088<br>
519
+ * 0.009<br>
520
+ * 0.000 (zero)
521
+ *
522
+ * <p>
523
+ * This method is equivalent to {@link #minMaxFraction} with both arguments equal.
524
+ *
525
+ * @param minMaxFractionPlaces
526
+ * The minimum and maximum number of numerals to display after the decimal separator (rounding if too
527
+ * long or padding with zeros if too short).
528
+ * @return A FractionPrecision for chaining or passing to the NumberFormatter precision() setter.
529
+ * @stable ICU 60
530
+ */
531
+ static FractionPrecision fixedFraction(int32_t minMaxFractionPlaces);
532
+
533
+ /**
534
+ * Always show at least a certain number of fraction places after the decimal separator, padding with zeros if
535
+ * necessary. Do not perform rounding (display numbers to their full precision).
536
+ *
537
+ * <p>
538
+ * <strong>NOTE:</strong> If you are formatting <em>doubles</em>, see the performance note in {@link #unlimited}.
539
+ *
540
+ * @param minFractionPlaces
541
+ * The minimum number of numerals to display after the decimal separator (padding with zeros if
542
+ * necessary).
543
+ * @return A FractionPrecision for chaining or passing to the NumberFormatter precision() setter.
544
+ * @stable ICU 60
545
+ */
546
+ static FractionPrecision minFraction(int32_t minFractionPlaces);
547
+
548
+ /**
549
+ * Show numbers rounded if necessary to a certain number of fraction places (numerals after the decimal separator).
550
+ * Unlike the other fraction rounding strategies, this strategy does <em>not</em> pad zeros to the end of the
551
+ * number.
552
+ *
553
+ * @param maxFractionPlaces
554
+ * The maximum number of numerals to display after the decimal mark (rounding if necessary).
555
+ * @return A FractionPrecision for chaining or passing to the NumberFormatter precision() setter.
556
+ * @stable ICU 60
557
+ */
558
+ static FractionPrecision maxFraction(int32_t maxFractionPlaces);
559
+
560
+ /**
561
+ * Show numbers rounded if necessary to a certain number of fraction places (numerals after the decimal separator);
562
+ * in addition, always show at least a certain number of places after the decimal separator, padding with zeros if
563
+ * necessary.
564
+ *
565
+ * @param minFractionPlaces
566
+ * The minimum number of numerals to display after the decimal separator (padding with zeros if
567
+ * necessary).
568
+ * @param maxFractionPlaces
569
+ * The maximum number of numerals to display after the decimal separator (rounding if necessary).
570
+ * @return A FractionPrecision for chaining or passing to the NumberFormatter precision() setter.
571
+ * @stable ICU 60
572
+ */
573
+ static FractionPrecision minMaxFraction(int32_t minFractionPlaces, int32_t maxFractionPlaces);
574
+
575
+ /**
576
+ * Show numbers rounded if necessary to a certain number of significant digits or significant figures. Additionally,
577
+ * pad with zeros to ensure that this number of significant digits/figures are always shown.
578
+ *
579
+ * <p>
580
+ * This method is equivalent to {@link #minMaxSignificantDigits} with both arguments equal.
581
+ *
582
+ * @param minMaxSignificantDigits
583
+ * The minimum and maximum number of significant digits to display (rounding if too long or padding with
584
+ * zeros if too short).
585
+ * @return A precision for chaining or passing to the NumberFormatter precision() setter.
586
+ * @stable ICU 62
587
+ */
588
+ static SignificantDigitsPrecision fixedSignificantDigits(int32_t minMaxSignificantDigits);
589
+
590
+ /**
591
+ * Always show at least a certain number of significant digits/figures, padding with zeros if necessary. Do not
592
+ * perform rounding (display numbers to their full precision).
593
+ *
594
+ * <p>
595
+ * <strong>NOTE:</strong> If you are formatting <em>doubles</em>, see the performance note in {@link #unlimited}.
596
+ *
597
+ * @param minSignificantDigits
598
+ * The minimum number of significant digits to display (padding with zeros if too short).
599
+ * @return A precision for chaining or passing to the NumberFormatter precision() setter.
600
+ * @stable ICU 62
601
+ */
602
+ static SignificantDigitsPrecision minSignificantDigits(int32_t minSignificantDigits);
603
+
604
+ /**
605
+ * Show numbers rounded if necessary to a certain number of significant digits/figures.
606
+ *
607
+ * @param maxSignificantDigits
608
+ * The maximum number of significant digits to display (rounding if too long).
609
+ * @return A precision for chaining or passing to the NumberFormatter precision() setter.
610
+ * @stable ICU 62
611
+ */
612
+ static SignificantDigitsPrecision maxSignificantDigits(int32_t maxSignificantDigits);
613
+
614
+ /**
615
+ * Show numbers rounded if necessary to a certain number of significant digits/figures; in addition, always show at
616
+ * least a certain number of significant digits, padding with zeros if necessary.
617
+ *
618
+ * @param minSignificantDigits
619
+ * The minimum number of significant digits to display (padding with zeros if necessary).
620
+ * @param maxSignificantDigits
621
+ * The maximum number of significant digits to display (rounding if necessary).
622
+ * @return A precision for chaining or passing to the NumberFormatter precision() setter.
623
+ * @stable ICU 62
624
+ */
625
+ static SignificantDigitsPrecision minMaxSignificantDigits(int32_t minSignificantDigits,
626
+ int32_t maxSignificantDigits);
627
+
628
+ /**
629
+ * Show numbers rounded if necessary to the closest multiple of a certain rounding increment. For example, if the
630
+ * rounding increment is 0.5, then round 1.2 to 1 and round 1.3 to 1.5.
631
+ *
632
+ * <p>
633
+ * In order to ensure that numbers are padded to the appropriate number of fraction places, call
634
+ * withMinFraction() on the return value of this method.
635
+ * For example, to round to the nearest 0.5 and always display 2 numerals after the
636
+ * decimal separator (to display 1.2 as "1.00" and 1.3 as "1.50"), you can run:
637
+ *
638
+ * <pre>
639
+ * Precision::increment(0.5).withMinFraction(2)
640
+ * </pre>
641
+ *
642
+ * @param roundingIncrement
643
+ * The increment to which to round numbers.
644
+ * @return A precision for chaining or passing to the NumberFormatter precision() setter.
645
+ * @stable ICU 60
646
+ */
647
+ static IncrementPrecision increment(double roundingIncrement);
648
+
649
+ /**
650
+ * Version of `Precision::increment()` that takes an integer at a particular power of 10.
651
+ *
652
+ * To round to the nearest 0.5 and display 2 fraction digits, with this function, you should write one of the following:
653
+ *
654
+ * <pre>
655
+ * Precision::incrementExact(5, -1).withMinFraction(2)
656
+ * Precision::incrementExact(50, -2).withMinFraction(2)
657
+ * Precision::incrementExact(50, -2)
658
+ * </pre>
659
+ *
660
+ * This is analagous to ICU4J `Precision.increment(new BigDecimal("0.50"))`.
661
+ *
662
+ * This behavior is modeled after ECMA-402. For more information, see:
663
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#roundingincrement
664
+ *
665
+ * @param mantissa
666
+ * The increment to which to round numbers.
667
+ * @param magnitude
668
+ * The power of 10 of the ones digit of the mantissa.
669
+ * @return A precision for chaining or passing to the NumberFormatter precision() setter.
670
+ * @stable ICU 71
671
+ */
672
+ static IncrementPrecision incrementExact(uint64_t mantissa, int16_t magnitude);
673
+
674
+ /**
675
+ * Show numbers rounded and padded according to the rules for the currency unit. The most common
676
+ * rounding precision settings for currencies include <code>Precision::fixedFraction(2)</code>,
677
+ * <code>Precision::integer()</code>, and <code>Precision::increment(0.05)</code> for cash transactions
678
+ * ("nickel rounding").
679
+ *
680
+ * <p>
681
+ * The exact rounding details will be resolved at runtime based on the currency unit specified in the
682
+ * NumberFormatter chain. To round according to the rules for one currency while displaying the symbol for another
683
+ * currency, the withCurrency() method can be called on the return value of this method.
684
+ *
685
+ * @param currencyUsage
686
+ * Either STANDARD (for digital transactions) or CASH (for transactions where the rounding increment may
687
+ * be limited by the available denominations of cash or coins).
688
+ * @return A CurrencyPrecision for chaining or passing to the NumberFormatter precision() setter.
689
+ * @stable ICU 60
690
+ */
691
+ static CurrencyPrecision currency(UCurrencyUsage currencyUsage);
692
+
693
+ /**
694
+ * Configure how trailing zeros are displayed on numbers. For example, to hide trailing zeros
695
+ * when the number is an integer, use UNUM_TRAILING_ZERO_HIDE_IF_WHOLE.
696
+ *
697
+ * @param trailingZeroDisplay Option to configure the display of trailing zeros.
698
+ * @stable ICU 69
699
+ */
700
+ Precision trailingZeroDisplay(UNumberTrailingZeroDisplay trailingZeroDisplay) const;
701
+
702
+ private:
703
+ enum PrecisionType {
704
+ RND_BOGUS,
705
+ RND_NONE,
706
+ RND_FRACTION,
707
+ RND_SIGNIFICANT,
708
+ RND_FRACTION_SIGNIFICANT,
709
+
710
+ // Used for strange increments like 3.14.
711
+ RND_INCREMENT,
712
+
713
+ // Used for increments with 1 as the only digit. This is different than fraction
714
+ // rounding because it supports having additional trailing zeros. For example, this
715
+ // class is used to round with the increment 0.010.
716
+ RND_INCREMENT_ONE,
717
+
718
+ // Used for increments with 5 as the only digit (nickel rounding).
719
+ RND_INCREMENT_FIVE,
720
+
721
+ RND_CURRENCY,
722
+ #if APPLE_ICU_CHANGES
723
+ // rdar://52538227 8e26bee05d.. New Precision type combining roundingIncr and sig digits; use when both are set
724
+ RND_INCREMENT_SIGNIFICANT,
725
+ #endif // APPLE_ICU_CHANGES
726
+ RND_ERROR
727
+ } fType;
728
+
729
+ union PrecisionUnion {
730
+ /** @internal (private) */
731
+ struct FractionSignificantSettings {
732
+ // For RND_FRACTION, RND_SIGNIFICANT, and RND_FRACTION_SIGNIFICANT
733
+ /** @internal (private) */
734
+ impl::digits_t fMinFrac;
735
+ /** @internal (private) */
736
+ impl::digits_t fMaxFrac;
737
+ /** @internal (private) */
738
+ impl::digits_t fMinSig;
739
+ /** @internal (private) */
740
+ impl::digits_t fMaxSig;
741
+ /** @internal (private) */
742
+ UNumberRoundingPriority fPriority;
743
+ /**
744
+ * Whether to retain trailing zeros based on the looser strategy.
745
+ * @internal (private)
746
+ */
747
+ bool fRetain;
748
+ } fracSig;
749
+ /** @internal (private) */
750
+ struct IncrementSettings {
751
+ // For RND_INCREMENT, RND_INCREMENT_ONE, and RND_INCREMENT_FIVE
752
+ // Note: This is a union, so we shouldn't own memory, since
753
+ // the default destructor would leak it.
754
+ /** @internal (private) */
755
+ uint64_t fIncrement;
756
+ /** @internal (private) */
757
+ impl::digits_t fIncrementMagnitude;
758
+ /** @internal (private) */
759
+ impl::digits_t fMinFrac;
760
+ } increment;
761
+ #if APPLE_ICU_CHANGES
762
+ // rdar://52538227 8e26bee05d.. New Precision type combining roundingIncr and sig digits; use when both are set
763
+ /** @internal */
764
+ struct IncrementSignificantSettings {
765
+ /** @internal */
766
+ double fIncrement;
767
+ /** @internal */
768
+ impl::digits_t fMinSig;
769
+ /** @internal */
770
+ impl::digits_t fMaxSig;
771
+ } incrSig;
772
+ #endif // APPLE_ICU_CHANGES
773
+ UCurrencyUsage currencyUsage; // For RND_CURRENCY
774
+ UErrorCode errorCode; // For RND_ERROR
775
+ } fUnion;
776
+
777
+ UNumberTrailingZeroDisplay fTrailingZeroDisplay = UNUM_TRAILING_ZERO_AUTO;
778
+
779
+ typedef PrecisionUnion::FractionSignificantSettings FractionSignificantSettings;
780
+ typedef PrecisionUnion::IncrementSettings IncrementSettings;
781
+ #if APPLE_ICU_CHANGES
782
+ // rdar://52538227 8e26bee05d.. New Precision type combining roundingIncr and sig digits; use when both are set
783
+ typedef PrecisionUnion::IncrementSignificantSettings IncrementSignificantSettings;
784
+ #endif // APPLE_ICU_CHANGES
785
+
786
+ Precision(const PrecisionType& type, const PrecisionUnion& union_)
787
+ : fType(type), fUnion(union_) {}
788
+
789
+ Precision(UErrorCode errorCode) : fType(RND_ERROR) {
790
+ fUnion.errorCode = errorCode;
791
+ }
792
+
793
+ Precision() : fType(RND_BOGUS) {}
794
+
795
+ bool isBogus() const {
796
+ return fType == RND_BOGUS;
797
+ }
798
+
799
+ UBool copyErrorTo(UErrorCode &status) const {
800
+ if (fType == RND_ERROR) {
801
+ status = fUnion.errorCode;
802
+ return true;
803
+ }
804
+ return false;
805
+ }
806
+
807
+ // On the parent type so that this method can be called internally on Precision instances.
808
+ Precision withCurrency(const CurrencyUnit &currency, UErrorCode &status) const;
809
+
810
+ static FractionPrecision constructFraction(int32_t minFrac, int32_t maxFrac);
811
+
812
+ static Precision constructSignificant(int32_t minSig, int32_t maxSig);
813
+
814
+ #if APPLE_ICU_CHANGES
815
+ // rdar://52538227 8e26bee05d.. New Precision type combining roundingIncr and sig digits; use when both are set
816
+ static Precision constructIncrementSignificant(double increment, int32_t minSig, int32_t maxSig); // Apple
817
+ #endif // APPLE_ICU_CHANGES
818
+
819
+ static Precision constructFractionSignificant(
820
+ const FractionPrecision &base,
821
+ int32_t minSig,
822
+ int32_t maxSig,
823
+ UNumberRoundingPriority priority,
824
+ bool retain);
825
+
826
+ static IncrementPrecision constructIncrement(uint64_t increment, impl::digits_t magnitude);
827
+
828
+ static CurrencyPrecision constructCurrency(UCurrencyUsage usage);
829
+
830
+ // To allow MacroProps/MicroProps to initialize bogus instances:
831
+ friend struct impl::MacroProps;
832
+ friend struct impl::MicroProps;
833
+
834
+ // To allow NumberFormatterImpl to access isBogus() and other internal methods:
835
+ friend class impl::NumberFormatterImpl;
836
+
837
+ // To allow NumberPropertyMapper to create instances from DecimalFormatProperties:
838
+ friend class impl::NumberPropertyMapper;
839
+
840
+ // To allow access to the main implementation class:
841
+ friend class impl::RoundingImpl;
842
+
843
+ // To allow child classes to call private methods:
844
+ friend class FractionPrecision;
845
+ friend class CurrencyPrecision;
846
+ friend class IncrementPrecision;
847
+
848
+ // To allow access to the skeleton generation code:
849
+ friend class impl::GeneratorHelpers;
850
+
851
+ // To allow access to isBogus and the default (bogus) constructor:
852
+ friend class units::UnitsRouter;
853
+ };
854
+
855
+ /**
856
+ * A class that defines a rounding precision based on a number of fraction places and optionally significant digits to be
857
+ * used when formatting numbers in NumberFormatter.
858
+ *
859
+ * <p>
860
+ * To create a FractionPrecision, use one of the factory methods on Precision.
861
+ *
862
+ * @stable ICU 60
863
+ */
864
+ class U_I18N_API FractionPrecision : public Precision {
865
+ public:
866
+ /**
867
+ * Override maximum fraction digits with maximum significant digits depending on the magnitude
868
+ * of the number. See UNumberRoundingPriority.
869
+ *
870
+ * @param minSignificantDigits
871
+ * Pad trailing zeros to achieve this minimum number of significant digits.
872
+ * @param maxSignificantDigits
873
+ * Round the number to achieve this maximum number of significant digits.
874
+ * @param priority
875
+ * How to disambiguate between fraction digits and significant digits.
876
+ * @return A precision for chaining or passing to the NumberFormatter precision() setter.
877
+ *
878
+ * @stable ICU 69
879
+ */
880
+ Precision withSignificantDigits(
881
+ int32_t minSignificantDigits,
882
+ int32_t maxSignificantDigits,
883
+ UNumberRoundingPriority priority) const;
884
+
885
+ /**
886
+ * Ensure that no less than this number of significant digits are retained when rounding
887
+ * according to fraction rules.
888
+ *
889
+ * For example, with integer rounding, the number 3.141 becomes "3". However, with minimum
890
+ * figures set to 2, 3.141 becomes "3.1" instead.
891
+ *
892
+ * This setting does not affect the number of trailing zeros. For example, 3.01 would print as
893
+ * "3", not "3.0".
894
+ *
895
+ * This is equivalent to `withSignificantDigits(1, minSignificantDigits, RELAXED)`.
896
+ *
897
+ * @param minSignificantDigits
898
+ * The number of significant figures to guarantee.
899
+ * @return A precision for chaining or passing to the NumberFormatter precision() setter.
900
+ * @stable ICU 60
901
+ */
902
+ Precision withMinDigits(int32_t minSignificantDigits) const;
903
+
904
+ /**
905
+ * Ensure that no more than this number of significant digits are retained when rounding
906
+ * according to fraction rules.
907
+ *
908
+ * For example, with integer rounding, the number 123.4 becomes "123". However, with maximum
909
+ * figures set to 2, 123.4 becomes "120" instead.
910
+ *
911
+ * This setting does not affect the number of trailing zeros. For example, with fixed fraction
912
+ * of 2, 123.4 would become "120.00".
913
+ *
914
+ * This is equivalent to `withSignificantDigits(1, maxSignificantDigits, STRICT)`.
915
+ *
916
+ * @param maxSignificantDigits
917
+ * Round the number to no more than this number of significant figures.
918
+ * @return A precision for chaining or passing to the NumberFormatter precision() setter.
919
+ * @stable ICU 60
920
+ */
921
+ Precision withMaxDigits(int32_t maxSignificantDigits) const;
922
+
923
+ private:
924
+ // Inherit constructor
925
+ using Precision::Precision;
926
+
927
+ // To allow parent class to call this class's constructor:
928
+ friend class Precision;
929
+ };
930
+
931
+ /**
932
+ * A class that defines a rounding precision parameterized by a currency to be used when formatting numbers in
933
+ * NumberFormatter.
934
+ *
935
+ * <p>
936
+ * To create a CurrencyPrecision, use one of the factory methods on Precision.
937
+ *
938
+ * @stable ICU 60
939
+ */
940
+ class U_I18N_API CurrencyPrecision : public Precision {
941
+ public:
942
+ /**
943
+ * Associates a currency with this rounding precision.
944
+ *
945
+ * <p>
946
+ * <strong>Calling this method is <em>not required</em></strong>, because the currency specified in unit()
947
+ * is automatically applied to currency rounding precisions. However,
948
+ * this method enables you to override that automatic association.
949
+ *
950
+ * <p>
951
+ * This method also enables numbers to be formatted using currency rounding rules without explicitly using a
952
+ * currency format.
953
+ *
954
+ * @param currency
955
+ * The currency to associate with this rounding precision.
956
+ * @return A precision for chaining or passing to the NumberFormatter precision() setter.
957
+ * @stable ICU 60
958
+ */
959
+ Precision withCurrency(const CurrencyUnit &currency) const;
960
+
961
+ private:
962
+ // Inherit constructor
963
+ using Precision::Precision;
964
+
965
+ // To allow parent class to call this class's constructor:
966
+ friend class Precision;
967
+ };
968
+
969
+ /**
970
+ * A class that defines a rounding precision parameterized by a rounding increment to be used when formatting numbers in
971
+ * NumberFormatter.
972
+ *
973
+ * <p>
974
+ * To create an IncrementPrecision, use one of the factory methods on Precision.
975
+ *
976
+ * @stable ICU 60
977
+ */
978
+ class U_I18N_API IncrementPrecision : public Precision {
979
+ public:
980
+ /**
981
+ * Specifies the minimum number of fraction digits to render after the decimal separator, padding with zeros if
982
+ * necessary. By default, no trailing zeros are added.
983
+ *
984
+ * <p>
985
+ * For example, if the rounding increment is 0.5 and minFrac is 2, then the resulting strings include "0.00",
986
+ * "0.50", "1.00", and "1.50".
987
+ *
988
+ * <p>
989
+ * Note: In ICU4J, this functionality is accomplished via the scale of the BigDecimal rounding increment.
990
+ *
991
+ * @param minFrac The minimum number of digits after the decimal separator.
992
+ * @return A precision for chaining or passing to the NumberFormatter precision() setter.
993
+ * @stable ICU 60
994
+ */
995
+ Precision withMinFraction(int32_t minFrac) const;
996
+
997
+ private:
998
+ // Inherit constructor
999
+ using Precision::Precision;
1000
+
1001
+ // To allow parent class to call this class's constructor:
1002
+ friend class Precision;
1003
+ };
1004
+
1005
+ /**
1006
+ * A class that defines the strategy for padding and truncating integers before the decimal separator.
1007
+ *
1008
+ * <p>
1009
+ * To create an IntegerWidth, use one of the factory methods.
1010
+ *
1011
+ * @stable ICU 60
1012
+ * @see NumberFormatter
1013
+ */
1014
+ class U_I18N_API IntegerWidth : public UMemory {
1015
+ public:
1016
+ /**
1017
+ * Pad numbers at the beginning with zeros to guarantee a certain number of numerals before the decimal separator.
1018
+ *
1019
+ * <p>
1020
+ * For example, with minInt=3, the number 55 will get printed as "055".
1021
+ *
1022
+ * @param minInt
1023
+ * The minimum number of places before the decimal separator.
1024
+ * @return An IntegerWidth for chaining or passing to the NumberFormatter integerWidth() setter.
1025
+ * @stable ICU 60
1026
+ */
1027
+ static IntegerWidth zeroFillTo(int32_t minInt);
1028
+
1029
+ /**
1030
+ * Truncate numbers exceeding a certain number of numerals before the decimal separator.
1031
+ *
1032
+ * For example, with maxInt=3, the number 1234 will get printed as "234".
1033
+ *
1034
+ * @param maxInt
1035
+ * The maximum number of places before the decimal separator. maxInt == -1 means no
1036
+ * truncation.
1037
+ * @return An IntegerWidth for passing to the NumberFormatter integerWidth() setter.
1038
+ * @stable ICU 60
1039
+ */
1040
+ IntegerWidth truncateAt(int32_t maxInt);
1041
+
1042
+ private:
1043
+ union {
1044
+ struct {
1045
+ impl::digits_t fMinInt;
1046
+ impl::digits_t fMaxInt;
1047
+ bool fFormatFailIfMoreThanMaxDigits;
1048
+ } minMaxInt;
1049
+ UErrorCode errorCode;
1050
+ } fUnion;
1051
+ bool fHasError = false;
1052
+
1053
+ IntegerWidth(impl::digits_t minInt, impl::digits_t maxInt, bool formatFailIfMoreThanMaxDigits);
1054
+
1055
+ IntegerWidth(UErrorCode errorCode) { // NOLINT
1056
+ fUnion.errorCode = errorCode;
1057
+ fHasError = true;
1058
+ }
1059
+
1060
+ IntegerWidth() { // NOLINT
1061
+ fUnion.minMaxInt.fMinInt = -1;
1062
+ }
1063
+
1064
+ /** Returns the default instance. */
1065
+ static IntegerWidth standard() {
1066
+ return IntegerWidth::zeroFillTo(1);
1067
+ }
1068
+
1069
+ bool isBogus() const {
1070
+ return !fHasError && fUnion.minMaxInt.fMinInt == -1;
1071
+ }
1072
+
1073
+ UBool copyErrorTo(UErrorCode &status) const {
1074
+ if (fHasError) {
1075
+ status = fUnion.errorCode;
1076
+ return true;
1077
+ }
1078
+ return false;
1079
+ }
1080
+
1081
+ void apply(impl::DecimalQuantity &quantity, UErrorCode &status) const;
1082
+
1083
+ bool operator==(const IntegerWidth& other) const;
1084
+
1085
+ // To allow MacroProps/MicroProps to initialize empty instances:
1086
+ friend struct impl::MacroProps;
1087
+ friend struct impl::MicroProps;
1088
+
1089
+ // To allow NumberFormatterImpl to access isBogus():
1090
+ friend class impl::NumberFormatterImpl;
1091
+
1092
+ // To allow the use of this class when formatting:
1093
+ friend class impl::MutablePatternModifier;
1094
+ friend class impl::ImmutablePatternModifier;
1095
+
1096
+ // So that NumberPropertyMapper can create instances
1097
+ friend class impl::NumberPropertyMapper;
1098
+
1099
+ // To allow access to the skeleton generation code:
1100
+ friend class impl::GeneratorHelpers;
1101
+ };
1102
+
1103
+ /**
1104
+ * A class that defines a quantity by which a number should be multiplied when formatting.
1105
+ *
1106
+ * <p>
1107
+ * To create a Scale, use one of the factory methods.
1108
+ *
1109
+ * @stable ICU 62
1110
+ */
1111
+ class U_I18N_API Scale : public UMemory {
1112
+ public:
1113
+ /**
1114
+ * Do not change the value of numbers when formatting or parsing.
1115
+ *
1116
+ * @return A Scale to prevent any multiplication.
1117
+ * @stable ICU 62
1118
+ */
1119
+ static Scale none();
1120
+
1121
+ /**
1122
+ * Multiply numbers by a power of ten before formatting. Useful for combining with a percent unit:
1123
+ *
1124
+ * <pre>
1125
+ * NumberFormatter::with().unit(NoUnit::percent()).multiplier(Scale::powerOfTen(2))
1126
+ * </pre>
1127
+ *
1128
+ * @return A Scale for passing to the setter in NumberFormatter.
1129
+ * @stable ICU 62
1130
+ */
1131
+ static Scale powerOfTen(int32_t power);
1132
+
1133
+ /**
1134
+ * Multiply numbers by an arbitrary value before formatting. Useful for unit conversions.
1135
+ *
1136
+ * This method takes a string in a decimal number format with syntax
1137
+ * as defined in the Decimal Arithmetic Specification, available at
1138
+ * http://speleotrove.com/decimal
1139
+ *
1140
+ * Also see the version of this method that takes a double.
1141
+ *
1142
+ * @return A Scale for passing to the setter in NumberFormatter.
1143
+ * @stable ICU 62
1144
+ */
1145
+ static Scale byDecimal(StringPiece multiplicand);
1146
+
1147
+ /**
1148
+ * Multiply numbers by an arbitrary value before formatting. Useful for unit conversions.
1149
+ *
1150
+ * This method takes a double; also see the version of this method that takes an exact decimal.
1151
+ *
1152
+ * @return A Scale for passing to the setter in NumberFormatter.
1153
+ * @stable ICU 62
1154
+ */
1155
+ static Scale byDouble(double multiplicand);
1156
+
1157
+ /**
1158
+ * Multiply a number by both a power of ten and by an arbitrary double value.
1159
+ *
1160
+ * @return A Scale for passing to the setter in NumberFormatter.
1161
+ * @stable ICU 62
1162
+ */
1163
+ static Scale byDoubleAndPowerOfTen(double multiplicand, int32_t power);
1164
+
1165
+ // We need a custom destructor for the DecNum, which means we need to declare
1166
+ // the copy/move constructor/assignment quartet.
1167
+
1168
+ /** @stable ICU 62 */
1169
+ Scale(const Scale& other);
1170
+
1171
+ /** @stable ICU 62 */
1172
+ Scale& operator=(const Scale& other);
1173
+
1174
+ /** @stable ICU 62 */
1175
+ Scale(Scale&& src) noexcept;
1176
+
1177
+ /** @stable ICU 62 */
1178
+ Scale& operator=(Scale&& src) noexcept;
1179
+
1180
+ /** @stable ICU 62 */
1181
+ ~Scale();
1182
+
1183
+ #ifndef U_HIDE_INTERNAL_API
1184
+ /** @internal */
1185
+ Scale(int32_t magnitude, impl::DecNum* arbitraryToAdopt);
1186
+ #endif /* U_HIDE_INTERNAL_API */
1187
+
1188
+ private:
1189
+ int32_t fMagnitude;
1190
+ impl::DecNum* fArbitrary;
1191
+ UErrorCode fError;
1192
+
1193
+ Scale(UErrorCode error) : fMagnitude(0), fArbitrary(nullptr), fError(error) {}
1194
+
1195
+ Scale() : fMagnitude(0), fArbitrary(nullptr), fError(U_ZERO_ERROR) {}
1196
+
1197
+ bool isValid() const {
1198
+ return fMagnitude != 0 || fArbitrary != nullptr;
1199
+ }
1200
+
1201
+ UBool copyErrorTo(UErrorCode &status) const {
1202
+ if (U_FAILURE(fError)) {
1203
+ status = fError;
1204
+ return true;
1205
+ }
1206
+ return false;
1207
+ }
1208
+
1209
+ void applyTo(impl::DecimalQuantity& quantity) const;
1210
+
1211
+ void applyReciprocalTo(impl::DecimalQuantity& quantity) const;
1212
+
1213
+ // To allow MacroProps/MicroProps to initialize empty instances:
1214
+ friend struct impl::MacroProps;
1215
+ friend struct impl::MicroProps;
1216
+
1217
+ // To allow NumberFormatterImpl to access isBogus() and perform other operations:
1218
+ friend class impl::NumberFormatterImpl;
1219
+
1220
+ // To allow the helper class MultiplierFormatHandler access to private fields:
1221
+ friend class impl::MultiplierFormatHandler;
1222
+
1223
+ // To allow access to the skeleton generation code:
1224
+ friend class impl::GeneratorHelpers;
1225
+
1226
+ // To allow access to parsing code:
1227
+ friend class ::icu::numparse::impl::NumberParserImpl;
1228
+ friend class ::icu::numparse::impl::MultiplierParseHandler;
1229
+ };
1230
+
1231
+ namespace impl {
1232
+
1233
+ // Do not enclose entire StringProp with #ifndef U_HIDE_INTERNAL_API, needed for a protected field.
1234
+ // And do not enclose its class boilerplate within #ifndef U_HIDE_INTERNAL_API.
1235
+ /**
1236
+ * Manages NumberFormatterSettings::usage()'s char* instance on the heap.
1237
+ * @internal
1238
+ */
1239
+ class U_I18N_API StringProp : public UMemory {
1240
+
1241
+ public:
1242
+ /** @internal */
1243
+ ~StringProp();
1244
+
1245
+ /** @internal */
1246
+ StringProp(const StringProp &other);
1247
+
1248
+ /** @internal */
1249
+ StringProp &operator=(const StringProp &other);
1250
+
1251
+ #ifndef U_HIDE_INTERNAL_API
1252
+
1253
+ /** @internal */
1254
+ StringProp(StringProp &&src) noexcept;
1255
+
1256
+ /** @internal */
1257
+ StringProp &operator=(StringProp &&src) noexcept;
1258
+
1259
+ /** @internal */
1260
+ int16_t length() const {
1261
+ return fLength;
1262
+ }
1263
+
1264
+ /** @internal
1265
+ * Makes a copy of value. Set to "" to unset.
1266
+ */
1267
+ void set(StringPiece value);
1268
+
1269
+ /** @internal */
1270
+ bool isSet() const {
1271
+ return fLength > 0;
1272
+ }
1273
+
1274
+ #endif // U_HIDE_INTERNAL_API
1275
+
1276
+ private:
1277
+ char *fValue;
1278
+ int16_t fLength;
1279
+ UErrorCode fError;
1280
+
1281
+ StringProp() : fValue(nullptr), fLength(0), fError(U_ZERO_ERROR) {
1282
+ }
1283
+
1284
+ /** @internal (private) */
1285
+ UBool copyErrorTo(UErrorCode &status) const {
1286
+ if (U_FAILURE(fError)) {
1287
+ status = fError;
1288
+ return true;
1289
+ }
1290
+ return false;
1291
+ }
1292
+
1293
+ // Allow NumberFormatterImpl to access fValue.
1294
+ friend class impl::NumberFormatterImpl;
1295
+
1296
+ // Allow skeleton generation code to access private members.
1297
+ friend class impl::GeneratorHelpers;
1298
+
1299
+ // Allow MacroProps/MicroProps to initialize empty instances and to call
1300
+ // copyErrorTo().
1301
+ friend struct impl::MacroProps;
1302
+ };
1303
+
1304
+ // Do not enclose entire SymbolsWrapper with #ifndef U_HIDE_INTERNAL_API, needed for a protected field
1305
+ /** @internal */
1306
+ class U_I18N_API SymbolsWrapper : public UMemory {
1307
+ public:
1308
+ /** @internal */
1309
+ SymbolsWrapper() : fType(SYMPTR_NONE), fPtr{nullptr} {}
1310
+
1311
+ /** @internal */
1312
+ SymbolsWrapper(const SymbolsWrapper &other);
1313
+
1314
+ /** @internal */
1315
+ SymbolsWrapper &operator=(const SymbolsWrapper &other);
1316
+
1317
+ /** @internal */
1318
+ SymbolsWrapper(SymbolsWrapper&& src) noexcept;
1319
+
1320
+ /** @internal */
1321
+ SymbolsWrapper &operator=(SymbolsWrapper&& src) noexcept;
1322
+
1323
+ /** @internal */
1324
+ ~SymbolsWrapper();
1325
+
1326
+ #ifndef U_HIDE_INTERNAL_API
1327
+
1328
+ /**
1329
+ * The provided object is copied, but we do not adopt it.
1330
+ * @internal
1331
+ */
1332
+ void setTo(const DecimalFormatSymbols &dfs);
1333
+
1334
+ /**
1335
+ * Adopt the provided object.
1336
+ * @internal
1337
+ */
1338
+ void setTo(const NumberingSystem *ns);
1339
+
1340
+ /**
1341
+ * Whether the object is currently holding a DecimalFormatSymbols.
1342
+ * @internal
1343
+ */
1344
+ bool isDecimalFormatSymbols() const;
1345
+
1346
+ /**
1347
+ * Whether the object is currently holding a NumberingSystem.
1348
+ * @internal
1349
+ */
1350
+ bool isNumberingSystem() const;
1351
+
1352
+ /**
1353
+ * Get the DecimalFormatSymbols pointer. No ownership change.
1354
+ * @internal
1355
+ */
1356
+ const DecimalFormatSymbols *getDecimalFormatSymbols() const;
1357
+
1358
+ /**
1359
+ * Get the NumberingSystem pointer. No ownership change.
1360
+ * @internal
1361
+ */
1362
+ const NumberingSystem *getNumberingSystem() const;
1363
+
1364
+ #endif // U_HIDE_INTERNAL_API
1365
+
1366
+ /** @internal */
1367
+ UBool copyErrorTo(UErrorCode &status) const {
1368
+ if (fType == SYMPTR_DFS && fPtr.dfs == nullptr) {
1369
+ status = U_MEMORY_ALLOCATION_ERROR;
1370
+ return true;
1371
+ } else if (fType == SYMPTR_NS && fPtr.ns == nullptr) {
1372
+ status = U_MEMORY_ALLOCATION_ERROR;
1373
+ return true;
1374
+ }
1375
+ return false;
1376
+ }
1377
+
1378
+ private:
1379
+ enum SymbolsPointerType {
1380
+ SYMPTR_NONE, SYMPTR_DFS, SYMPTR_NS
1381
+ } fType;
1382
+
1383
+ union {
1384
+ const DecimalFormatSymbols *dfs;
1385
+ const NumberingSystem *ns;
1386
+ } fPtr;
1387
+
1388
+ void doCopyFrom(const SymbolsWrapper &other);
1389
+
1390
+ void doMoveFrom(SymbolsWrapper&& src);
1391
+
1392
+ void doCleanup();
1393
+ };
1394
+
1395
+ // Do not enclose entire Grouper with #ifndef U_HIDE_INTERNAL_API, needed for a protected field
1396
+ /** @internal */
1397
+ class U_I18N_API Grouper : public UMemory {
1398
+ public:
1399
+ #ifndef U_HIDE_INTERNAL_API
1400
+ /** @internal */
1401
+ static Grouper forStrategy(UNumberGroupingStrategy grouping);
1402
+
1403
+ /**
1404
+ * Resolve the values in Properties to a Grouper object.
1405
+ * @internal
1406
+ */
1407
+ static Grouper forProperties(const DecimalFormatProperties& properties);
1408
+
1409
+ // Future: static Grouper forProperties(DecimalFormatProperties& properties);
1410
+
1411
+ /** @internal */
1412
+ Grouper(int16_t grouping1, int16_t grouping2, int16_t minGrouping, UNumberGroupingStrategy strategy)
1413
+ : fGrouping1(grouping1),
1414
+ fGrouping2(grouping2),
1415
+ fMinGrouping(minGrouping),
1416
+ fStrategy(strategy) {}
1417
+
1418
+ /** @internal */
1419
+ int16_t getPrimary() const;
1420
+
1421
+ /** @internal */
1422
+ int16_t getSecondary() const;
1423
+ #endif // U_HIDE_INTERNAL_API
1424
+
1425
+ private:
1426
+ /**
1427
+ * The grouping sizes, with the following special values:
1428
+ * <ul>
1429
+ * <li>-1 = no grouping
1430
+ * <li>-2 = needs locale data
1431
+ * <li>-4 = fall back to Western grouping if not in locale
1432
+ * </ul>
1433
+ */
1434
+ int16_t fGrouping1;
1435
+ int16_t fGrouping2;
1436
+
1437
+ /**
1438
+ * The minimum grouping size, with the following special values:
1439
+ * <ul>
1440
+ * <li>-2 = needs locale data
1441
+ * <li>-3 = no less than 2
1442
+ * </ul>
1443
+ */
1444
+ int16_t fMinGrouping;
1445
+
1446
+ /**
1447
+ * The UNumberGroupingStrategy that was used to create this Grouper, or UNUM_GROUPING_COUNT if this
1448
+ * was not created from a UNumberGroupingStrategy.
1449
+ */
1450
+ UNumberGroupingStrategy fStrategy;
1451
+
1452
+ Grouper() : fGrouping1(-3) {}
1453
+
1454
+ bool isBogus() const {
1455
+ return fGrouping1 == -3;
1456
+ }
1457
+
1458
+ /** NON-CONST: mutates the current instance. */
1459
+ void setLocaleData(const impl::ParsedPatternInfo &patternInfo, const Locale& locale);
1460
+
1461
+ bool groupAtPosition(int32_t position, const impl::DecimalQuantity &value) const;
1462
+
1463
+ // To allow MacroProps/MicroProps to initialize empty instances:
1464
+ friend struct MacroProps;
1465
+ friend struct MicroProps;
1466
+ friend struct SimpleMicroProps;
1467
+
1468
+ // To allow NumberFormatterImpl to access isBogus() and perform other operations:
1469
+ friend class NumberFormatterImpl;
1470
+ friend class ::icu::number::SimpleNumberFormatter;
1471
+
1472
+ // To allow NumberParserImpl to perform setLocaleData():
1473
+ friend class ::icu::numparse::impl::NumberParserImpl;
1474
+
1475
+ // To allow access to the skeleton generation code:
1476
+ friend class impl::GeneratorHelpers;
1477
+ };
1478
+
1479
+ // Do not enclose entire Padder with #ifndef U_HIDE_INTERNAL_API, needed for a protected field
1480
+ /** @internal */
1481
+ class U_I18N_API Padder : public UMemory {
1482
+ public:
1483
+ #ifndef U_HIDE_INTERNAL_API
1484
+ /** @internal */
1485
+ static Padder none();
1486
+
1487
+ /** @internal */
1488
+ static Padder codePoints(UChar32 cp, int32_t targetWidth, UNumberFormatPadPosition position);
1489
+
1490
+ /** @internal */
1491
+ static Padder forProperties(const DecimalFormatProperties& properties);
1492
+ #endif // U_HIDE_INTERNAL_API
1493
+
1494
+ private:
1495
+ UChar32 fWidth; // -3 = error; -2 = bogus; -1 = no padding
1496
+ union {
1497
+ struct {
1498
+ int32_t fCp;
1499
+ UNumberFormatPadPosition fPosition;
1500
+ } padding;
1501
+ UErrorCode errorCode;
1502
+ } fUnion;
1503
+
1504
+ Padder(UChar32 cp, int32_t width, UNumberFormatPadPosition position);
1505
+
1506
+ Padder(int32_t width);
1507
+
1508
+ Padder(UErrorCode errorCode) : fWidth(-3) { // NOLINT
1509
+ fUnion.errorCode = errorCode;
1510
+ }
1511
+
1512
+ Padder() : fWidth(-2) {} // NOLINT
1513
+
1514
+ bool isBogus() const {
1515
+ return fWidth == -2;
1516
+ }
1517
+
1518
+ UBool copyErrorTo(UErrorCode &status) const {
1519
+ if (fWidth == -3) {
1520
+ status = fUnion.errorCode;
1521
+ return true;
1522
+ }
1523
+ return false;
1524
+ }
1525
+
1526
+ bool isValid() const {
1527
+ return fWidth > 0;
1528
+ }
1529
+
1530
+ int32_t padAndApply(const impl::Modifier &mod1, const impl::Modifier &mod2,
1531
+ FormattedStringBuilder &string, int32_t leftIndex, int32_t rightIndex,
1532
+ UErrorCode &status) const;
1533
+
1534
+ // To allow MacroProps/MicroProps to initialize empty instances:
1535
+ friend struct MacroProps;
1536
+ friend struct MicroProps;
1537
+
1538
+ // To allow NumberFormatterImpl to access isBogus() and perform other operations:
1539
+ friend class impl::NumberFormatterImpl;
1540
+
1541
+ // To allow access to the skeleton generation code:
1542
+ friend class impl::GeneratorHelpers;
1543
+ };
1544
+
1545
+ // Do not enclose entire MacroProps with #ifndef U_HIDE_INTERNAL_API, needed for a protected field
1546
+ /** @internal */
1547
+ struct U_I18N_API MacroProps : public UMemory {
1548
+ /** @internal */
1549
+ Notation notation;
1550
+
1551
+ /** @internal */
1552
+ MeasureUnit unit; // = MeasureUnit(); (the base dimensionless unit)
1553
+
1554
+ /** @internal */
1555
+ MeasureUnit perUnit; // = MeasureUnit(); (the base dimensionless unit)
1556
+
1557
+ /** @internal */
1558
+ Precision precision; // = Precision(); (bogus)
1559
+
1560
+ /** @internal */
1561
+ UNumberFormatRoundingMode roundingMode = UNUM_ROUND_HALFEVEN;
1562
+
1563
+ /** @internal */
1564
+ Grouper grouper; // = Grouper(); (bogus)
1565
+
1566
+ /** @internal */
1567
+ Padder padder; // = Padder(); (bogus)
1568
+
1569
+ /** @internal */
1570
+ IntegerWidth integerWidth; // = IntegerWidth(); (bogus)
1571
+
1572
+ /** @internal */
1573
+ SymbolsWrapper symbols;
1574
+
1575
+ // UNUM_XYZ_COUNT denotes null (bogus) values.
1576
+
1577
+ /** @internal */
1578
+ UNumberUnitWidth unitWidth = UNUM_UNIT_WIDTH_COUNT;
1579
+
1580
+ /** @internal */
1581
+ UNumberSignDisplay sign = UNUM_SIGN_COUNT;
1582
+
1583
+ /** @internal */
1584
+ bool approximately = false;
1585
+
1586
+ /** @internal */
1587
+ UNumberDecimalSeparatorDisplay decimal = UNUM_DECIMAL_SEPARATOR_COUNT;
1588
+
1589
+ /** @internal */
1590
+ Scale scale; // = Scale(); (benign value)
1591
+
1592
+ /** @internal */
1593
+ StringProp usage; // = StringProp(); (no usage)
1594
+
1595
+ /** @internal */
1596
+ StringProp unitDisplayCase; // = StringProp(); (nominative)
1597
+
1598
+ /** @internal */
1599
+ const AffixPatternProvider* affixProvider = nullptr; // no ownership
1600
+
1601
+ /** @internal */
1602
+ const PluralRules* rules = nullptr; // no ownership
1603
+
1604
+ /** @internal */
1605
+ int32_t threshold = kInternalDefaultThreshold;
1606
+
1607
+ #if APPLE_ICU_CHANGES
1608
+ // rdar://39240173
1609
+ /** @internal */
1610
+ bool adjustDoublePrecision = false;
1611
+ // rdar://107351099 SimpleDateFormat perf
1612
+ /** @internal */
1613
+ bool forDateFormat = false;
1614
+ #endif // APPLE_ICU_CHANGES
1615
+
1616
+ /** @internal */
1617
+ Locale locale;
1618
+
1619
+ // NOTE: Uses default copy and move constructors.
1620
+
1621
+ /**
1622
+ * Check all members for errors.
1623
+ * @internal
1624
+ */
1625
+ bool copyErrorTo(UErrorCode &status) const {
1626
+ return notation.copyErrorTo(status) || precision.copyErrorTo(status) ||
1627
+ padder.copyErrorTo(status) || integerWidth.copyErrorTo(status) ||
1628
+ symbols.copyErrorTo(status) || scale.copyErrorTo(status) || usage.copyErrorTo(status) ||
1629
+ unitDisplayCase.copyErrorTo(status);
1630
+ }
1631
+ };
1632
+
1633
+ } // namespace impl
1634
+
1635
+ #if (U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN) && defined(_MSC_VER)
1636
+ // Ignore MSVC warning 4661. This is generated for NumberFormatterSettings<>::toSkeleton() as this method
1637
+ // is defined elsewhere (in number_skeletons.cpp). The compiler is warning that the explicit template instantiation
1638
+ // inside this single translation unit (CPP file) is incomplete, and thus it isn't sure if the template class is
1639
+ // fully defined. However, since each translation unit explicitly instantiates all the necessary template classes,
1640
+ // they will all be passed to the linker, and the linker will still find and export all the class members.
1641
+ #pragma warning(push)
1642
+ #pragma warning(disable: 4661)
1643
+ #endif
1644
+
1645
+ /**
1646
+ * An abstract base class for specifying settings related to number formatting. This class is implemented by
1647
+ * {@link UnlocalizedNumberFormatter} and {@link LocalizedNumberFormatter}. This class is not intended for
1648
+ * public subclassing.
1649
+ */
1650
+ template<typename Derived>
1651
+ class U_I18N_API NumberFormatterSettings {
1652
+ public:
1653
+ /**
1654
+ * Specifies the notation style (simple, scientific, or compact) for rendering numbers.
1655
+ *
1656
+ * <ul>
1657
+ * <li>Simple notation: "12,300"
1658
+ * <li>Scientific notation: "1.23E4"
1659
+ * <li>Compact notation: "12K"
1660
+ * </ul>
1661
+ *
1662
+ * <p>
1663
+ * All notation styles will be properly localized with locale data, and all notation styles are compatible with
1664
+ * units, rounding precisions, and other number formatter settings.
1665
+ *
1666
+ * <p>
1667
+ * Pass this method the return value of a {@link Notation} factory method. For example:
1668
+ *
1669
+ * <pre>
1670
+ * NumberFormatter::with().notation(Notation::compactShort())
1671
+ * </pre>
1672
+ *
1673
+ * The default is to use simple notation.
1674
+ *
1675
+ * @param notation
1676
+ * The notation strategy to use.
1677
+ * @return The fluent chain.
1678
+ * @see Notation
1679
+ * @stable ICU 60
1680
+ */
1681
+ Derived notation(const Notation &notation) const &;
1682
+
1683
+ /**
1684
+ * Overload of notation() for use on an rvalue reference.
1685
+ *
1686
+ * @param notation
1687
+ * The notation strategy to use.
1688
+ * @return The fluent chain.
1689
+ * @see #notation
1690
+ * @stable ICU 62
1691
+ */
1692
+ Derived notation(const Notation &notation) &&;
1693
+
1694
+ /**
1695
+ * Specifies the unit (unit of measure, currency, or percent) to associate with rendered numbers.
1696
+ *
1697
+ * <ul>
1698
+ * <li>Unit of measure: "12.3 meters"
1699
+ * <li>Currency: "$12.30"
1700
+ * <li>Percent: "12.3%"
1701
+ * </ul>
1702
+ *
1703
+ * All units will be properly localized with locale data, and all units are compatible with notation styles,
1704
+ * rounding precisions, and other number formatter settings.
1705
+ *
1706
+ * \note If the usage() is set, the output unit **will be changed** to
1707
+ * produce localised units, according to usage, locale and unit. See
1708
+ * FormattedNumber::getOutputUnit().
1709
+ *
1710
+ * Pass this method any instance of {@link MeasureUnit}. For units of measure:
1711
+ *
1712
+ * <pre>
1713
+ * NumberFormatter::with().unit(MeasureUnit::getMeter())
1714
+ * NumberFormatter::with().unit(MeasureUnit::forIdentifier("foot-per-second", status))
1715
+ * </pre>
1716
+ *
1717
+ * Currency:
1718
+ *
1719
+ * <pre>
1720
+ * NumberFormatter::with().unit(CurrencyUnit(u"USD", status))
1721
+ * </pre>
1722
+ *
1723
+ * Percent:
1724
+ *
1725
+ * <pre>
1726
+ * NumberFormatter::with().unit(NoUnit.percent())
1727
+ * </pre>
1728
+ *
1729
+ * See {@link #perUnit} for information on how to format strings like "5 meters per second".
1730
+ *
1731
+ * The default is to render without units (equivalent to NoUnit.base()).
1732
+ *
1733
+ * @param unit
1734
+ * The unit to render.
1735
+ * @return The fluent chain.
1736
+ * @see MeasureUnit
1737
+ * @see Currency
1738
+ * @see NoUnit
1739
+ * @see #perUnit
1740
+ * @stable ICU 60
1741
+ */
1742
+ Derived unit(const icu::MeasureUnit &unit) const &;
1743
+
1744
+ /**
1745
+ * Overload of unit() for use on an rvalue reference.
1746
+ *
1747
+ * @param unit
1748
+ * The unit to render.
1749
+ * @return The fluent chain.
1750
+ * @see #unit
1751
+ * @stable ICU 62
1752
+ */
1753
+ Derived unit(const icu::MeasureUnit &unit) &&;
1754
+
1755
+ /**
1756
+ * Like unit(), but takes ownership of a pointer. Convenient for use with the MeasureFormat factory
1757
+ * methods that return pointers that need ownership.
1758
+ *
1759
+ * Note: consider using the MeasureFormat factory methods that return by value.
1760
+ *
1761
+ * @param unit
1762
+ * The unit to render.
1763
+ * @return The fluent chain.
1764
+ * @see #unit
1765
+ * @see MeasureUnit
1766
+ * @stable ICU 60
1767
+ */
1768
+ Derived adoptUnit(icu::MeasureUnit *unit) const &;
1769
+
1770
+ /**
1771
+ * Overload of adoptUnit() for use on an rvalue reference.
1772
+ *
1773
+ * @param unit
1774
+ * The unit to render.
1775
+ * @return The fluent chain.
1776
+ * @see #adoptUnit
1777
+ * @stable ICU 62
1778
+ */
1779
+ Derived adoptUnit(icu::MeasureUnit *unit) &&;
1780
+
1781
+ /**
1782
+ * Sets a unit to be used in the denominator. For example, to format "3 m/s", pass METER to the unit and SECOND to
1783
+ * the perUnit.
1784
+ *
1785
+ * Pass this method any instance of {@link MeasureUnit}. Example:
1786
+ *
1787
+ * <pre>
1788
+ * NumberFormatter::with()
1789
+ * .unit(MeasureUnit::getMeter())
1790
+ * .perUnit(MeasureUnit::getSecond())
1791
+ * </pre>
1792
+ *
1793
+ * The default is not to display any unit in the denominator.
1794
+ *
1795
+ * If a per-unit is specified without a primary unit via {@link #unit}, the behavior is undefined.
1796
+ *
1797
+ * @param perUnit
1798
+ * The unit to render in the denominator.
1799
+ * @return The fluent chain
1800
+ * @see #unit
1801
+ * @stable ICU 61
1802
+ */
1803
+ Derived perUnit(const icu::MeasureUnit &perUnit) const &;
1804
+
1805
+ /**
1806
+ * Overload of perUnit() for use on an rvalue reference.
1807
+ *
1808
+ * @param perUnit
1809
+ * The unit to render in the denominator.
1810
+ * @return The fluent chain.
1811
+ * @see #perUnit
1812
+ * @stable ICU 62
1813
+ */
1814
+ Derived perUnit(const icu::MeasureUnit &perUnit) &&;
1815
+
1816
+ /**
1817
+ * Like perUnit(), but takes ownership of a pointer. Convenient for use with the MeasureFormat factory
1818
+ * methods that return pointers that need ownership.
1819
+ *
1820
+ * Note: consider using the MeasureFormat factory methods that return by value.
1821
+ *
1822
+ * @param perUnit
1823
+ * The unit to render in the denominator.
1824
+ * @return The fluent chain.
1825
+ * @see #perUnit
1826
+ * @see MeasureUnit
1827
+ * @stable ICU 61
1828
+ */
1829
+ Derived adoptPerUnit(icu::MeasureUnit *perUnit) const &;
1830
+
1831
+ /**
1832
+ * Overload of adoptPerUnit() for use on an rvalue reference.
1833
+ *
1834
+ * @param perUnit
1835
+ * The unit to render in the denominator.
1836
+ * @return The fluent chain.
1837
+ * @see #adoptPerUnit
1838
+ * @stable ICU 62
1839
+ */
1840
+ Derived adoptPerUnit(icu::MeasureUnit *perUnit) &&;
1841
+
1842
+ /**
1843
+ * Specifies the rounding precision to use when formatting numbers.
1844
+ *
1845
+ * <ul>
1846
+ * <li>Round to 3 decimal places: "3.142"
1847
+ * <li>Round to 3 significant figures: "3.14"
1848
+ * <li>Round to the closest nickel: "3.15"
1849
+ * <li>Do not perform rounding: "3.1415926..."
1850
+ * </ul>
1851
+ *
1852
+ * <p>
1853
+ * Pass this method the return value of one of the factory methods on {@link Precision}. For example:
1854
+ *
1855
+ * <pre>
1856
+ * NumberFormatter::with().precision(Precision::fixedFraction(2))
1857
+ * </pre>
1858
+ *
1859
+ * <p>
1860
+ * In most cases, the default rounding strategy is to round to 6 fraction places; i.e.,
1861
+ * <code>Precision.maxFraction(6)</code>. The exceptions are if compact notation is being used, then the compact
1862
+ * notation rounding strategy is used (see {@link Notation#compactShort} for details), or if the unit is a currency,
1863
+ * then standard currency rounding is used, which varies from currency to currency (see {@link Precision#currency} for
1864
+ * details).
1865
+ *
1866
+ * @param precision
1867
+ * The rounding precision to use.
1868
+ * @return The fluent chain.
1869
+ * @see Precision
1870
+ * @stable ICU 62
1871
+ */
1872
+ Derived precision(const Precision& precision) const &;
1873
+
1874
+ /**
1875
+ * Overload of precision() for use on an rvalue reference.
1876
+ *
1877
+ * @param precision
1878
+ * The rounding precision to use.
1879
+ * @return The fluent chain.
1880
+ * @see #precision
1881
+ * @stable ICU 62
1882
+ */
1883
+ Derived precision(const Precision& precision) &&;
1884
+
1885
+ /**
1886
+ * Specifies how to determine the direction to round a number when it has more digits than fit in the
1887
+ * desired precision. When formatting 1.235:
1888
+ *
1889
+ * <ul>
1890
+ * <li>Ceiling rounding mode with integer precision: "2"
1891
+ * <li>Half-down rounding mode with 2 fixed fraction digits: "1.23"
1892
+ * <li>Half-up rounding mode with 2 fixed fraction digits: "1.24"
1893
+ * </ul>
1894
+ *
1895
+ * The default is HALF_EVEN. For more information on rounding mode, see the ICU userguide here:
1896
+ *
1897
+ * https://unicode-org.github.io/icu/userguide/format_parse/numbers/rounding-modes
1898
+ *
1899
+ * @param roundingMode The rounding mode to use.
1900
+ * @return The fluent chain.
1901
+ * @stable ICU 62
1902
+ */
1903
+ Derived roundingMode(UNumberFormatRoundingMode roundingMode) const &;
1904
+
1905
+ /**
1906
+ * Overload of roundingMode() for use on an rvalue reference.
1907
+ *
1908
+ * @param roundingMode The rounding mode to use.
1909
+ * @return The fluent chain.
1910
+ * @see #roundingMode
1911
+ * @stable ICU 62
1912
+ */
1913
+ Derived roundingMode(UNumberFormatRoundingMode roundingMode) &&;
1914
+
1915
+ /**
1916
+ * Specifies the grouping strategy to use when formatting numbers.
1917
+ *
1918
+ * <ul>
1919
+ * <li>Default grouping: "12,300" and "1,230"
1920
+ * <li>Grouping with at least 2 digits: "12,300" and "1230"
1921
+ * <li>No grouping: "12300" and "1230"
1922
+ * </ul>
1923
+ *
1924
+ * <p>
1925
+ * The exact grouping widths will be chosen based on the locale.
1926
+ *
1927
+ * <p>
1928
+ * Pass this method an element from the {@link UNumberGroupingStrategy} enum. For example:
1929
+ *
1930
+ * <pre>
1931
+ * NumberFormatter::with().grouping(UNUM_GROUPING_MIN2)
1932
+ * </pre>
1933
+ *
1934
+ * The default is to perform grouping according to locale data; most locales, but not all locales,
1935
+ * enable it by default.
1936
+ *
1937
+ * @param strategy
1938
+ * The grouping strategy to use.
1939
+ * @return The fluent chain.
1940
+ * @stable ICU 61
1941
+ */
1942
+ Derived grouping(UNumberGroupingStrategy strategy) const &;
1943
+
1944
+ /**
1945
+ * Overload of grouping() for use on an rvalue reference.
1946
+ *
1947
+ * @param strategy
1948
+ * The grouping strategy to use.
1949
+ * @return The fluent chain.
1950
+ * @see #grouping
1951
+ * @stable ICU 62
1952
+ */
1953
+ Derived grouping(UNumberGroupingStrategy strategy) &&;
1954
+
1955
+ /**
1956
+ * Specifies the minimum and maximum number of digits to render before the decimal mark.
1957
+ *
1958
+ * <ul>
1959
+ * <li>Zero minimum integer digits: ".08"
1960
+ * <li>One minimum integer digit: "0.08"
1961
+ * <li>Two minimum integer digits: "00.08"
1962
+ * </ul>
1963
+ *
1964
+ * <p>
1965
+ * Pass this method the return value of {@link IntegerWidth#zeroFillTo}. For example:
1966
+ *
1967
+ * <pre>
1968
+ * NumberFormatter::with().integerWidth(IntegerWidth::zeroFillTo(2))
1969
+ * </pre>
1970
+ *
1971
+ * The default is to have one minimum integer digit.
1972
+ *
1973
+ * @param style
1974
+ * The integer width to use.
1975
+ * @return The fluent chain.
1976
+ * @see IntegerWidth
1977
+ * @stable ICU 60
1978
+ */
1979
+ Derived integerWidth(const IntegerWidth &style) const &;
1980
+
1981
+ /**
1982
+ * Overload of integerWidth() for use on an rvalue reference.
1983
+ *
1984
+ * @param style
1985
+ * The integer width to use.
1986
+ * @return The fluent chain.
1987
+ * @see #integerWidth
1988
+ * @stable ICU 62
1989
+ */
1990
+ Derived integerWidth(const IntegerWidth &style) &&;
1991
+
1992
+ /**
1993
+ * Specifies the symbols (decimal separator, grouping separator, percent sign, numerals, etc.) to use when rendering
1994
+ * numbers.
1995
+ *
1996
+ * <ul>
1997
+ * <li><em>en_US</em> symbols: "12,345.67"
1998
+ * <li><em>fr_FR</em> symbols: "12&nbsp;345,67"
1999
+ * <li><em>de_CH</em> symbols: "12’345.67"
2000
+ * <li><em>my_MY</em> symbols: "၁၂,၃၄၅.၆၇"
2001
+ * </ul>
2002
+ *
2003
+ * <p>
2004
+ * Pass this method an instance of {@link DecimalFormatSymbols}. For example:
2005
+ *
2006
+ * <pre>
2007
+ * NumberFormatter::with().symbols(DecimalFormatSymbols(Locale("de_CH"), status))
2008
+ * </pre>
2009
+ *
2010
+ * <p>
2011
+ * <strong>Note:</strong> DecimalFormatSymbols automatically chooses the best numbering system based on the locale.
2012
+ * In the examples above, the first three are using the Latin numbering system, and the fourth is using the Myanmar
2013
+ * numbering system.
2014
+ *
2015
+ * <p>
2016
+ * <strong>Note:</strong> The instance of DecimalFormatSymbols will be copied: changes made to the symbols object
2017
+ * after passing it into the fluent chain will not be seen.
2018
+ *
2019
+ * <p>
2020
+ * <strong>Note:</strong> Calling this method will override any previously specified DecimalFormatSymbols
2021
+ * or NumberingSystem.
2022
+ *
2023
+ * <p>
2024
+ * The default is to choose the symbols based on the locale specified in the fluent chain.
2025
+ *
2026
+ * @param symbols
2027
+ * The DecimalFormatSymbols to use.
2028
+ * @return The fluent chain.
2029
+ * @see DecimalFormatSymbols
2030
+ * @stable ICU 60
2031
+ */
2032
+ Derived symbols(const DecimalFormatSymbols &symbols) const &;
2033
+
2034
+ /**
2035
+ * Overload of symbols() for use on an rvalue reference.
2036
+ *
2037
+ * @param symbols
2038
+ * The DecimalFormatSymbols to use.
2039
+ * @return The fluent chain.
2040
+ * @see #symbols
2041
+ * @stable ICU 62
2042
+ */
2043
+ Derived symbols(const DecimalFormatSymbols &symbols) &&;
2044
+
2045
+ /**
2046
+ * Specifies that the given numbering system should be used when fetching symbols.
2047
+ *
2048
+ * <ul>
2049
+ * <li>Latin numbering system: "12,345"
2050
+ * <li>Myanmar numbering system: "၁၂,၃၄၅"
2051
+ * <li>Math Sans Bold numbering system: "𝟭𝟮,𝟯𝟰𝟱"
2052
+ * </ul>
2053
+ *
2054
+ * <p>
2055
+ * Pass this method an instance of {@link NumberingSystem}. For example, to force the locale to always use the Latin
2056
+ * alphabet numbering system (ASCII digits):
2057
+ *
2058
+ * <pre>
2059
+ * NumberFormatter::with().adoptSymbols(NumberingSystem::createInstanceByName("latn", status))
2060
+ * </pre>
2061
+ *
2062
+ * <p>
2063
+ * <strong>Note:</strong> Calling this method will override any previously specified DecimalFormatSymbols
2064
+ * or NumberingSystem.
2065
+ *
2066
+ * <p>
2067
+ * The default is to choose the best numbering system for the locale.
2068
+ *
2069
+ * <p>
2070
+ * This method takes ownership of a pointer in order to work nicely with the NumberingSystem factory methods.
2071
+ *
2072
+ * @param symbols
2073
+ * The NumberingSystem to use.
2074
+ * @return The fluent chain.
2075
+ * @see NumberingSystem
2076
+ * @stable ICU 60
2077
+ */
2078
+ Derived adoptSymbols(NumberingSystem *symbols) const &;
2079
+
2080
+ /**
2081
+ * Overload of adoptSymbols() for use on an rvalue reference.
2082
+ *
2083
+ * @param symbols
2084
+ * The NumberingSystem to use.
2085
+ * @return The fluent chain.
2086
+ * @see #adoptSymbols
2087
+ * @stable ICU 62
2088
+ */
2089
+ Derived adoptSymbols(NumberingSystem *symbols) &&;
2090
+
2091
+ /**
2092
+ * Sets the width of the unit (measure unit or currency). Most common values:
2093
+ *
2094
+ * <ul>
2095
+ * <li>Short: "$12.00", "12 m"
2096
+ * <li>ISO Code: "USD 12.00"
2097
+ * <li>Full name: "12.00 US dollars", "12 meters"
2098
+ * </ul>
2099
+ *
2100
+ * <p>
2101
+ * Pass an element from the {@link UNumberUnitWidth} enum to this setter. For example:
2102
+ *
2103
+ * <pre>
2104
+ * NumberFormatter::with().unitWidth(UNumberUnitWidth::UNUM_UNIT_WIDTH_FULL_NAME)
2105
+ * </pre>
2106
+ *
2107
+ * <p>
2108
+ * The default is the SHORT width.
2109
+ *
2110
+ * @param width
2111
+ * The width to use when rendering numbers.
2112
+ * @return The fluent chain
2113
+ * @see UNumberUnitWidth
2114
+ * @stable ICU 60
2115
+ */
2116
+ Derived unitWidth(UNumberUnitWidth width) const &;
2117
+
2118
+ /**
2119
+ * Overload of unitWidth() for use on an rvalue reference.
2120
+ *
2121
+ * @param width
2122
+ * The width to use when rendering numbers.
2123
+ * @return The fluent chain.
2124
+ * @see #unitWidth
2125
+ * @stable ICU 62
2126
+ */
2127
+ Derived unitWidth(UNumberUnitWidth width) &&;
2128
+
2129
+ /**
2130
+ * Sets the plus/minus sign display strategy. Most common values:
2131
+ *
2132
+ * <ul>
2133
+ * <li>Auto: "123", "-123"
2134
+ * <li>Always: "+123", "-123"
2135
+ * <li>Accounting: "$123", "($123)"
2136
+ * </ul>
2137
+ *
2138
+ * <p>
2139
+ * Pass an element from the {@link UNumberSignDisplay} enum to this setter. For example:
2140
+ *
2141
+ * <pre>
2142
+ * NumberFormatter::with().sign(UNumberSignDisplay::UNUM_SIGN_ALWAYS)
2143
+ * </pre>
2144
+ *
2145
+ * <p>
2146
+ * The default is AUTO sign display.
2147
+ *
2148
+ * @param style
2149
+ * The sign display strategy to use when rendering numbers.
2150
+ * @return The fluent chain
2151
+ * @see UNumberSignDisplay
2152
+ * @stable ICU 60
2153
+ */
2154
+ Derived sign(UNumberSignDisplay style) const &;
2155
+
2156
+ /**
2157
+ * Overload of sign() for use on an rvalue reference.
2158
+ *
2159
+ * @param style
2160
+ * The sign display strategy to use when rendering numbers.
2161
+ * @return The fluent chain.
2162
+ * @see #sign
2163
+ * @stable ICU 62
2164
+ */
2165
+ Derived sign(UNumberSignDisplay style) &&;
2166
+
2167
+ /**
2168
+ * Sets the decimal separator display strategy. This affects integer numbers with no fraction part. Most common
2169
+ * values:
2170
+ *
2171
+ * <ul>
2172
+ * <li>Auto: "1"
2173
+ * <li>Always: "1."
2174
+ * </ul>
2175
+ *
2176
+ * <p>
2177
+ * Pass an element from the {@link UNumberDecimalSeparatorDisplay} enum to this setter. For example:
2178
+ *
2179
+ * <pre>
2180
+ * NumberFormatter::with().decimal(UNumberDecimalSeparatorDisplay::UNUM_DECIMAL_SEPARATOR_ALWAYS)
2181
+ * </pre>
2182
+ *
2183
+ * <p>
2184
+ * The default is AUTO decimal separator display.
2185
+ *
2186
+ * @param style
2187
+ * The decimal separator display strategy to use when rendering numbers.
2188
+ * @return The fluent chain
2189
+ * @see UNumberDecimalSeparatorDisplay
2190
+ * @stable ICU 60
2191
+ */
2192
+ Derived decimal(UNumberDecimalSeparatorDisplay style) const &;
2193
+
2194
+ /**
2195
+ * Overload of decimal() for use on an rvalue reference.
2196
+ *
2197
+ * @param style
2198
+ * The decimal separator display strategy to use when rendering numbers.
2199
+ * @return The fluent chain.
2200
+ * @see #decimal
2201
+ * @stable ICU 62
2202
+ */
2203
+ Derived decimal(UNumberDecimalSeparatorDisplay style) &&;
2204
+
2205
+ /**
2206
+ * Sets a scale (multiplier) to be used to scale the number by an arbitrary amount before formatting.
2207
+ * Most common values:
2208
+ *
2209
+ * <ul>
2210
+ * <li>Multiply by 100: useful for percentages.
2211
+ * <li>Multiply by an arbitrary value: useful for unit conversions.
2212
+ * </ul>
2213
+ *
2214
+ * <p>
2215
+ * Pass an element from a {@link Scale} factory method to this setter. For example:
2216
+ *
2217
+ * <pre>
2218
+ * NumberFormatter::with().scale(Scale::powerOfTen(2))
2219
+ * </pre>
2220
+ *
2221
+ * <p>
2222
+ * The default is to not apply any multiplier.
2223
+ *
2224
+ * @param scale
2225
+ * The scale to apply when rendering numbers.
2226
+ * @return The fluent chain
2227
+ * @stable ICU 62
2228
+ */
2229
+ Derived scale(const Scale &scale) const &;
2230
+
2231
+ /**
2232
+ * Overload of scale() for use on an rvalue reference.
2233
+ *
2234
+ * @param scale
2235
+ * The scale to apply when rendering numbers.
2236
+ * @return The fluent chain.
2237
+ * @see #scale
2238
+ * @stable ICU 62
2239
+ */
2240
+ Derived scale(const Scale &scale) &&;
2241
+
2242
+ /**
2243
+ * Specifies the usage for which numbers will be formatted ("person-height",
2244
+ * "road", "rainfall", etc.)
2245
+ *
2246
+ * When a `usage` is specified, the output unit will change depending on the
2247
+ * `Locale` and the unit quantity. For example, formatting length
2248
+ * measurements specified in meters:
2249
+ *
2250
+ * `NumberFormatter::with().usage("person").unit(MeasureUnit::getMeter()).locale("en-US")`
2251
+ * * When formatting 0.25, the output will be "10 inches".
2252
+ * * When formatting 1.50, the output will be "4 feet and 11 inches".
2253
+ *
2254
+ * The input unit specified via unit() determines the type of measurement
2255
+ * being formatted (e.g. "length" when the unit is "foot"). The usage
2256
+ * requested will be looked for only within this category of measurement
2257
+ * units.
2258
+ *
2259
+ * The output unit can be found via FormattedNumber::getOutputUnit().
2260
+ *
2261
+ * If the usage has multiple parts (e.g. "land-agriculture-grain") and does
2262
+ * not match a known usage preference, the last part will be dropped
2263
+ * repeatedly until a match is found (e.g. trying "land-agriculture", then
2264
+ * "land"). If a match is still not found, usage will fall back to
2265
+ * "default".
2266
+ *
2267
+ * Setting usage to an empty string clears the usage (disables usage-based
2268
+ * localized formatting).
2269
+ *
2270
+ * Setting a usage string but not a correct input unit will result in an
2271
+ * U_ILLEGAL_ARGUMENT_ERROR.
2272
+ *
2273
+ * When using usage, specifying rounding or precision is unnecessary.
2274
+ * Specifying a precision in some manner will override the default
2275
+ * formatting.
2276
+ *
2277
+ * @param usage A `usage` parameter from the units resource. See the
2278
+ * unitPreferenceData in *source/data/misc/units.txt*, generated from
2279
+ * `unitPreferenceData` in [CLDR's
2280
+ * supplemental/units.xml](https://github.com/unicode-org/cldr/blob/main/common/supplemental/units.xml).
2281
+ * @return The fluent chain.
2282
+ * @stable ICU 68
2283
+ */
2284
+ Derived usage(StringPiece usage) const &;
2285
+
2286
+ /**
2287
+ * Overload of usage() for use on an rvalue reference.
2288
+ *
2289
+ * @param usage The unit `usage`.
2290
+ * @return The fluent chain.
2291
+ * @stable ICU 68
2292
+ */
2293
+ Derived usage(StringPiece usage) &&;
2294
+
2295
+ /**
2296
+ * Specifies the DisplayOptions. For example, UDisplayOptionsGrammaticalCase specifies
2297
+ * the desired case for a unit formatter's output (e.g. accusative, dative, genitive).
2298
+ *
2299
+ * @param displayOptions
2300
+ * @return The fluent chain.
2301
+ * @stable ICU 72
2302
+ */
2303
+ Derived displayOptions(const DisplayOptions &displayOptions) const &;
2304
+
2305
+ /**
2306
+ * Overload of displayOptions() for use on an rvalue reference.
2307
+ *
2308
+ * @param displayOptions
2309
+ * @return The fluent chain.
2310
+ * @stable ICU 72
2311
+ */
2312
+ Derived displayOptions(const DisplayOptions &displayOptions) &&;
2313
+
2314
+ #ifndef U_HIDE_INTERNAL_API
2315
+ /**
2316
+ * NOTE: Use `displayOptions` instead. This method was part of
2317
+ * an internal technology preview in ICU 69, but will be removed
2318
+ * in ICU 73, in favor of `displayOptions`
2319
+ *
2320
+ * Specifies the desired case for a unit formatter's output (e.g.
2321
+ * accusative, dative, genitive).
2322
+ *
2323
+ * @internal
2324
+ */
2325
+ Derived unitDisplayCase(StringPiece unitDisplayCase) const &;
2326
+
2327
+ /**
2328
+ * NOTE: Use `displayOptions` instead. This method was part of
2329
+ * an internal technology preview in ICU 69, but will be removed
2330
+ * in ICU 73, in favor of `displayOptions`
2331
+ *
2332
+ * Overload of unitDisplayCase() for use on an rvalue reference.
2333
+ *
2334
+ * @internal
2335
+ */
2336
+ Derived unitDisplayCase(StringPiece unitDisplayCase) &&;
2337
+ #endif // U_HIDE_INTERNAL_API
2338
+
2339
+ #ifndef U_HIDE_INTERNAL_API
2340
+
2341
+ /**
2342
+ * Set the padding strategy. May be added in the future; see #13338.
2343
+ *
2344
+ * @internal ICU 60: This API is ICU internal only.
2345
+ */
2346
+ Derived padding(const impl::Padder &padder) const &;
2347
+
2348
+ /** @internal */
2349
+ Derived padding(const impl::Padder &padder) &&;
2350
+
2351
+ /**
2352
+ * Internal fluent setter to support a custom regulation threshold. A threshold of 1 causes the data structures to
2353
+ * be built right away. A threshold of 0 prevents the data structures from being built.
2354
+ *
2355
+ * @internal ICU 60: This API is ICU internal only.
2356
+ */
2357
+ Derived threshold(int32_t threshold) const &;
2358
+
2359
+ /** @internal */
2360
+ Derived threshold(int32_t threshold) &&;
2361
+
2362
+ #if APPLE_ICU_CHANGES
2363
+ // rdar://107351099 SimpleDateFormat perf
2364
+
2365
+ /**
2366
+ * Internal fluent setter to set forDateFormat flag.
2367
+ * If true uses simpler DecimalFormatSymbols.
2368
+ *
2369
+ * @internal: This API is ICU internal only.
2370
+ */
2371
+ Derived forDateFormat(bool forDateFormat) const &;
2372
+
2373
+ /** @internal */
2374
+ Derived forDateFormat(bool forDateFormat) &&;
2375
+
2376
+ #endif // APPLE_ICU_CHANGES
2377
+
2378
+ /**
2379
+ * Internal fluent setter to overwrite the entire macros object.
2380
+ *
2381
+ * @internal ICU 60: This API is ICU internal only.
2382
+ */
2383
+ Derived macros(const impl::MacroProps& macros) const &;
2384
+
2385
+ /** @internal */
2386
+ Derived macros(const impl::MacroProps& macros) &&;
2387
+
2388
+ /** @internal */
2389
+ Derived macros(impl::MacroProps&& macros) const &;
2390
+
2391
+ /** @internal */
2392
+ Derived macros(impl::MacroProps&& macros) &&;
2393
+
2394
+ #endif /* U_HIDE_INTERNAL_API */
2395
+
2396
+ /**
2397
+ * Creates a skeleton string representation of this number formatter. A skeleton string is a
2398
+ * locale-agnostic serialized form of a number formatter.
2399
+ *
2400
+ * Not all options are capable of being represented in the skeleton string; for example, a
2401
+ * DecimalFormatSymbols object. If any such option is encountered, the error code is set to
2402
+ * U_UNSUPPORTED_ERROR.
2403
+ *
2404
+ * The returned skeleton is in normalized form, such that two number formatters with equivalent
2405
+ * behavior should produce the same skeleton.
2406
+ *
2407
+ * For more information on number skeleton strings, see:
2408
+ * https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html
2409
+ *
2410
+ * @return A number skeleton string with behavior corresponding to this number formatter.
2411
+ * @stable ICU 62
2412
+ */
2413
+ UnicodeString toSkeleton(UErrorCode& status) const;
2414
+
2415
+ /**
2416
+ * Returns the current (Un)LocalizedNumberFormatter as a LocalPointer
2417
+ * wrapping a heap-allocated copy of the current object.
2418
+ *
2419
+ * This is equivalent to new-ing the move constructor with a value object
2420
+ * as the argument.
2421
+ *
2422
+ * @return A wrapped (Un)LocalizedNumberFormatter pointer, or a wrapped
2423
+ * nullptr on failure.
2424
+ * @stable ICU 64
2425
+ */
2426
+ LocalPointer<Derived> clone() const &;
2427
+
2428
+ /**
2429
+ * Overload of clone for use on an rvalue reference.
2430
+ *
2431
+ * @return A wrapped (Un)LocalizedNumberFormatter pointer, or a wrapped
2432
+ * nullptr on failure.
2433
+ * @stable ICU 64
2434
+ */
2435
+ LocalPointer<Derived> clone() &&;
2436
+
2437
+ /**
2438
+ * Sets the UErrorCode if an error occurred in the fluent chain.
2439
+ * Preserves older error codes in the outErrorCode.
2440
+ * @return true if U_FAILURE(outErrorCode)
2441
+ * @stable ICU 60
2442
+ */
2443
+ UBool copyErrorTo(UErrorCode &outErrorCode) const {
2444
+ if (U_FAILURE(outErrorCode)) {
2445
+ // Do not overwrite the older error code
2446
+ return true;
2447
+ }
2448
+ fMacros.copyErrorTo(outErrorCode);
2449
+ return U_FAILURE(outErrorCode);
2450
+ }
2451
+
2452
+ // NOTE: Uses default copy and move constructors.
2453
+
2454
+ private:
2455
+ impl::MacroProps fMacros;
2456
+
2457
+ // Don't construct me directly! Use (Un)LocalizedNumberFormatter.
2458
+ NumberFormatterSettings() = default;
2459
+
2460
+ friend class LocalizedNumberFormatter;
2461
+ friend class UnlocalizedNumberFormatter;
2462
+
2463
+ // Give NumberRangeFormatter access to the MacroProps
2464
+ friend void impl::touchRangeLocales(impl::RangeMacroProps& macros);
2465
+ friend class impl::NumberRangeFormatterImpl;
2466
+ };
2467
+
2468
+ // Explicit instantiations in source/i18n/number_fluent.cpp.
2469
+ // (MSVC treats imports/exports of explicit instantiations differently.)
2470
+ #ifndef _MSC_VER
2471
+ extern template class NumberFormatterSettings<UnlocalizedNumberFormatter>;
2472
+ extern template class NumberFormatterSettings<LocalizedNumberFormatter>;
2473
+ #endif
2474
+
2475
+ /**
2476
+ * A NumberFormatter that does not yet have a locale. In order to format numbers, a locale must be specified.
2477
+ *
2478
+ * Instances of this class are immutable and thread-safe.
2479
+ *
2480
+ * @see NumberFormatter
2481
+ * @stable ICU 60
2482
+ */
2483
+ class U_I18N_API UnlocalizedNumberFormatter
2484
+ : public NumberFormatterSettings<UnlocalizedNumberFormatter>, public UMemory {
2485
+
2486
+ public:
2487
+ /**
2488
+ * Associate the given locale with the number formatter. The locale is used for picking the appropriate symbols,
2489
+ * formats, and other data for number display.
2490
+ *
2491
+ * @param locale
2492
+ * The locale to use when loading data for number formatting.
2493
+ * @return The fluent chain.
2494
+ * @stable ICU 60
2495
+ */
2496
+ LocalizedNumberFormatter locale(const icu::Locale &locale) const &;
2497
+
2498
+ /**
2499
+ * Overload of locale() for use on an rvalue reference.
2500
+ *
2501
+ * @param locale
2502
+ * The locale to use when loading data for number formatting.
2503
+ * @return The fluent chain.
2504
+ * @see #locale
2505
+ * @stable ICU 62
2506
+ */
2507
+ LocalizedNumberFormatter locale(const icu::Locale &locale) &&;
2508
+
2509
+ /**
2510
+ * Default constructor: puts the formatter into a valid but undefined state.
2511
+ *
2512
+ * @stable ICU 62
2513
+ */
2514
+ UnlocalizedNumberFormatter() = default;
2515
+
2516
+ /**
2517
+ * Returns a copy of this UnlocalizedNumberFormatter.
2518
+ * @stable ICU 60
2519
+ */
2520
+ UnlocalizedNumberFormatter(const UnlocalizedNumberFormatter &other);
2521
+
2522
+ /**
2523
+ * Move constructor:
2524
+ * The source UnlocalizedNumberFormatter will be left in a valid but undefined state.
2525
+ * @stable ICU 62
2526
+ */
2527
+ UnlocalizedNumberFormatter(UnlocalizedNumberFormatter&& src) noexcept;
2528
+
2529
+ /**
2530
+ * Copy assignment operator.
2531
+ * @stable ICU 62
2532
+ */
2533
+ UnlocalizedNumberFormatter& operator=(const UnlocalizedNumberFormatter& other);
2534
+
2535
+ /**
2536
+ * Move assignment operator:
2537
+ * The source UnlocalizedNumberFormatter will be left in a valid but undefined state.
2538
+ * @stable ICU 62
2539
+ */
2540
+ UnlocalizedNumberFormatter& operator=(UnlocalizedNumberFormatter&& src) noexcept;
2541
+
2542
+ private:
2543
+ explicit UnlocalizedNumberFormatter(const NumberFormatterSettings<UnlocalizedNumberFormatter>& other);
2544
+
2545
+ explicit UnlocalizedNumberFormatter(
2546
+ NumberFormatterSettings<UnlocalizedNumberFormatter>&& src) noexcept;
2547
+
2548
+ explicit UnlocalizedNumberFormatter(const impl::MacroProps &macros);
2549
+
2550
+ explicit UnlocalizedNumberFormatter(impl::MacroProps &&macros);
2551
+
2552
+ // To give the fluent setters access to this class's constructor:
2553
+ friend class NumberFormatterSettings<UnlocalizedNumberFormatter>;
2554
+
2555
+ // To give NumberFormatter::with() access to this class's constructor:
2556
+ friend class NumberFormatter;
2557
+
2558
+ // To give LNF::withoutLocale() access to this class's constructor:
2559
+ friend class LocalizedNumberFormatter;
2560
+ };
2561
+
2562
+ /**
2563
+ * A NumberFormatter that has a locale associated with it; this means .format() methods are available.
2564
+ *
2565
+ * Instances of this class are immutable and thread-safe.
2566
+ *
2567
+ * @see NumberFormatter
2568
+ * @stable ICU 60
2569
+ */
2570
+ class U_I18N_API LocalizedNumberFormatter
2571
+ : public NumberFormatterSettings<LocalizedNumberFormatter>, public UMemory {
2572
+ public:
2573
+ /**
2574
+ * Format the given integer number to a string using the settings specified in the NumberFormatter fluent
2575
+ * setting chain.
2576
+ *
2577
+ * @param value
2578
+ * The number to format.
2579
+ * @param status
2580
+ * Set to an ErrorCode if one occurred in the setter chain or during formatting.
2581
+ * @return A FormattedNumber object; call .toString() to get the string.
2582
+ * @stable ICU 60
2583
+ */
2584
+ FormattedNumber formatInt(int64_t value, UErrorCode &status) const;
2585
+
2586
+ /**
2587
+ * Format the given float or double to a string using the settings specified in the NumberFormatter fluent setting
2588
+ * chain.
2589
+ *
2590
+ * @param value
2591
+ * The number to format.
2592
+ * @param status
2593
+ * Set to an ErrorCode if one occurred in the setter chain or during formatting.
2594
+ * @return A FormattedNumber object; call .toString() to get the string.
2595
+ * @stable ICU 60
2596
+ */
2597
+ FormattedNumber formatDouble(double value, UErrorCode &status) const;
2598
+
2599
+ /**
2600
+ * Format the given decimal number to a string using the settings
2601
+ * specified in the NumberFormatter fluent setting chain.
2602
+ * The syntax of the unformatted number is a "numeric string"
2603
+ * as defined in the Decimal Arithmetic Specification, available at
2604
+ * http://speleotrove.com/decimal
2605
+ *
2606
+ * @param value
2607
+ * The number to format.
2608
+ * @param status
2609
+ * Set to an ErrorCode if one occurred in the setter chain or during formatting.
2610
+ * @return A FormattedNumber object; call .toString() to get the string.
2611
+ * @stable ICU 60
2612
+ */
2613
+ FormattedNumber formatDecimal(StringPiece value, UErrorCode& status) const;
2614
+
2615
+ #ifndef U_HIDE_INTERNAL_API
2616
+
2617
+
2618
+ /**
2619
+ * @internal
2620
+ */
2621
+ const DecimalFormatSymbols* getDecimalFormatSymbols() const;
2622
+
2623
+ /** Internal method.
2624
+ * @internal
2625
+ */
2626
+ FormattedNumber formatDecimalQuantity(const impl::DecimalQuantity& dq, UErrorCode& status) const;
2627
+
2628
+ /** Internal method for DecimalFormat compatibility.
2629
+ * @internal
2630
+ */
2631
+ void getAffixImpl(bool isPrefix, bool isNegative, UnicodeString& result, UErrorCode& status) const;
2632
+
2633
+ /**
2634
+ * Internal method for testing.
2635
+ * @internal
2636
+ */
2637
+ const impl::NumberFormatterImpl* getCompiled() const;
2638
+
2639
+ /**
2640
+ * Internal method for testing.
2641
+ * @internal
2642
+ */
2643
+ int32_t getCallCount() const;
2644
+
2645
+ #endif /* U_HIDE_INTERNAL_API */
2646
+
2647
+ /**
2648
+ * Creates a representation of this LocalizedNumberFormat as an icu::Format, enabling the use
2649
+ * of this number formatter with APIs that need an object of that type, such as MessageFormat.
2650
+ *
2651
+ * This API is not intended to be used other than for enabling API compatibility. The formatDouble,
2652
+ * formatInt, and formatDecimal methods should normally be used when formatting numbers, not the Format
2653
+ * object returned by this method.
2654
+ *
2655
+ * The caller owns the returned object and must delete it when finished.
2656
+ *
2657
+ * @return A Format wrapping this LocalizedNumberFormatter.
2658
+ * @stable ICU 62
2659
+ */
2660
+ Format* toFormat(UErrorCode& status) const;
2661
+
2662
+ #ifndef U_HIDE_DRAFT_API
2663
+ /**
2664
+ * Disassociate the locale from this formatter.
2665
+ *
2666
+ * @return The fluent chain.
2667
+ * @draft ICU 75
2668
+ */
2669
+ UnlocalizedNumberFormatter withoutLocale() const &;
2670
+
2671
+ /**
2672
+ * Overload of withoutLocale() for use on an rvalue reference.
2673
+ *
2674
+ * @return The fluent chain.
2675
+ * @see #withoutLocale
2676
+ * @draft ICU 75
2677
+ */
2678
+ UnlocalizedNumberFormatter withoutLocale() &&;
2679
+ #endif // U_HIDE_DRAFT_API
2680
+
2681
+ /**
2682
+ * Default constructor: puts the formatter into a valid but undefined state.
2683
+ *
2684
+ * @stable ICU 62
2685
+ */
2686
+ LocalizedNumberFormatter() = default;
2687
+
2688
+ /**
2689
+ * Returns a copy of this LocalizedNumberFormatter.
2690
+ * @stable ICU 60
2691
+ */
2692
+ LocalizedNumberFormatter(const LocalizedNumberFormatter &other);
2693
+
2694
+ /**
2695
+ * Move constructor:
2696
+ * The source LocalizedNumberFormatter will be left in a valid but undefined state.
2697
+ * @stable ICU 62
2698
+ */
2699
+ LocalizedNumberFormatter(LocalizedNumberFormatter&& src) noexcept;
2700
+
2701
+ /**
2702
+ * Copy assignment operator.
2703
+ * @stable ICU 62
2704
+ */
2705
+ LocalizedNumberFormatter& operator=(const LocalizedNumberFormatter& other);
2706
+
2707
+ /**
2708
+ * Move assignment operator:
2709
+ * The source LocalizedNumberFormatter will be left in a valid but undefined state.
2710
+ * @stable ICU 62
2711
+ */
2712
+ LocalizedNumberFormatter& operator=(LocalizedNumberFormatter&& src) noexcept;
2713
+
2714
+ #ifndef U_HIDE_INTERNAL_API
2715
+
2716
+ /**
2717
+ * This is the core entrypoint to the number formatting pipeline. It performs self-regulation: a static code path
2718
+ * for the first few calls, and compiling a more efficient data structure if called repeatedly.
2719
+ *
2720
+ * <p>
2721
+ * This function is very hot, being called in every call to the number formatting pipeline.
2722
+ *
2723
+ * @param results
2724
+ * The results object. This method will mutate it to save the results.
2725
+ * @param status
2726
+ * @internal
2727
+ */
2728
+ void formatImpl(impl::UFormattedNumberData *results, UErrorCode &status) const;
2729
+
2730
+ #endif /* U_HIDE_INTERNAL_API */
2731
+
2732
+ /**
2733
+ * Destruct this LocalizedNumberFormatter, cleaning up any memory it might own.
2734
+ * @stable ICU 60
2735
+ */
2736
+ ~LocalizedNumberFormatter();
2737
+
2738
+ private:
2739
+ // Note: fCompiled can't be a LocalPointer because impl::NumberFormatterImpl is defined in an internal
2740
+ // header, and LocalPointer needs the full class definition in order to delete the instance.
2741
+ const impl::NumberFormatterImpl* fCompiled {nullptr};
2742
+ char fUnsafeCallCount[8] {}; // internally cast to u_atomic_int32_t
2743
+
2744
+ // Owned pointer to a DecimalFormatWarehouse, used when copying a LocalizedNumberFormatter
2745
+ // from a DecimalFormat.
2746
+ const impl::DecimalFormatWarehouse* fWarehouse {nullptr};
2747
+
2748
+ explicit LocalizedNumberFormatter(const NumberFormatterSettings<LocalizedNumberFormatter>& other);
2749
+
2750
+ explicit LocalizedNumberFormatter(NumberFormatterSettings<LocalizedNumberFormatter>&& src) noexcept;
2751
+
2752
+ LocalizedNumberFormatter(const impl::MacroProps &macros, const Locale &locale);
2753
+
2754
+ LocalizedNumberFormatter(impl::MacroProps &&macros, const Locale &locale);
2755
+
2756
+ void resetCompiled();
2757
+
2758
+ void lnfMoveHelper(LocalizedNumberFormatter&& src);
2759
+
2760
+ void lnfCopyHelper(const LocalizedNumberFormatter& src, UErrorCode& status);
2761
+
2762
+ /**
2763
+ * @return true if the compiled formatter is available.
2764
+ */
2765
+ bool computeCompiled(UErrorCode& status) const;
2766
+
2767
+ // To give the fluent setters access to this class's constructor:
2768
+ friend class NumberFormatterSettings<UnlocalizedNumberFormatter>;
2769
+ friend class NumberFormatterSettings<LocalizedNumberFormatter>;
2770
+
2771
+ // To give UnlocalizedNumberFormatter::locale() access to this class's constructor:
2772
+ friend class UnlocalizedNumberFormatter;
2773
+ };
2774
+
2775
+ #if (U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN) && defined(_MSC_VER)
2776
+ // Warning 4661.
2777
+ #pragma warning(pop)
2778
+ #endif
2779
+
2780
+ /**
2781
+ * See the main description in numberformatter.h for documentation and examples.
2782
+ *
2783
+ * @stable ICU 60
2784
+ */
2785
+ class U_I18N_API NumberFormatter final {
2786
+ public:
2787
+ /**
2788
+ * Call this method at the beginning of a NumberFormatter fluent chain in which the locale is not currently known at
2789
+ * the call site.
2790
+ *
2791
+ * @return An {@link UnlocalizedNumberFormatter}, to be used for chaining.
2792
+ * @stable ICU 60
2793
+ */
2794
+ static UnlocalizedNumberFormatter with();
2795
+
2796
+ /**
2797
+ * Call this method at the beginning of a NumberFormatter fluent chain in which the locale is known at the call
2798
+ * site.
2799
+ *
2800
+ * @param locale
2801
+ * The locale from which to load formats and symbols for number formatting.
2802
+ * @return A {@link LocalizedNumberFormatter}, to be used for chaining.
2803
+ * @stable ICU 60
2804
+ */
2805
+ static LocalizedNumberFormatter withLocale(const Locale &locale);
2806
+
2807
+ /**
2808
+ * Call this method at the beginning of a NumberFormatter fluent chain to create an instance based
2809
+ * on a given number skeleton string.
2810
+ *
2811
+ * It is possible for an error to occur while parsing. See the overload of this method if you are
2812
+ * interested in the location of a possible parse error.
2813
+ *
2814
+ * For more information on number skeleton strings, see:
2815
+ * https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html
2816
+ *
2817
+ * @param skeleton
2818
+ * The skeleton string off of which to base this NumberFormatter.
2819
+ * @param status
2820
+ * Set to U_NUMBER_SKELETON_SYNTAX_ERROR if the skeleton was invalid.
2821
+ * @return An UnlocalizedNumberFormatter, to be used for chaining.
2822
+ * @stable ICU 62
2823
+ */
2824
+ static UnlocalizedNumberFormatter forSkeleton(const UnicodeString& skeleton, UErrorCode& status);
2825
+
2826
+ /**
2827
+ * Call this method at the beginning of a NumberFormatter fluent chain to create an instance based
2828
+ * on a given number skeleton string.
2829
+ *
2830
+ * If an error occurs while parsing the skeleton string, the offset into the skeleton string at
2831
+ * which the error occurred will be saved into the UParseError, if provided.
2832
+ *
2833
+ * For more information on number skeleton strings, see:
2834
+ * https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html
2835
+ *
2836
+ * @param skeleton
2837
+ * The skeleton string off of which to base this NumberFormatter.
2838
+ * @param perror
2839
+ * A parse error struct populated if an error occurs when parsing.
2840
+ * If no error occurs, perror.offset will be set to -1.
2841
+ * @param status
2842
+ * Set to U_NUMBER_SKELETON_SYNTAX_ERROR if the skeleton was invalid.
2843
+ * @return An UnlocalizedNumberFormatter, to be used for chaining.
2844
+ * @stable ICU 64
2845
+ */
2846
+ static UnlocalizedNumberFormatter forSkeleton(const UnicodeString& skeleton,
2847
+ UParseError& perror, UErrorCode& status);
2848
+
2849
+ /**
2850
+ * Use factory methods instead of the constructor to create a NumberFormatter.
2851
+ */
2852
+ NumberFormatter() = delete;
2853
+ };
2854
+
2855
+ } // namespace number
2856
+ U_NAMESPACE_END
2857
+
2858
+ #endif /* #if !UCONFIG_NO_FORMATTING */
2859
+
2860
+ #endif /* U_SHOW_CPLUSPLUS_API */
2861
+
2862
+ #endif // __NUMBERFORMATTER_H__