@eosrio/node-abieos 2.1.0-beta.0 → 2.2.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 (740) hide show
  1. package/README.md +4 -1
  2. package/dist/abieos.node +0 -0
  3. package/lib/abieos.d.ts +19 -0
  4. package/lib/abieos.d.ts.map +1 -0
  5. package/lib/abieos.js +100 -0
  6. package/lib/abieos.ts +107 -0
  7. package/package.json +13 -8
  8. package/.gitmodules +0 -6
  9. package/.idea/misc.xml +0 -6
  10. package/.idea/modules.xml +0 -8
  11. package/.idea/node-abieos.iml +0 -12
  12. package/.idea/vcs.xml +0 -9
  13. package/.idea/workspace.xml +0 -266
  14. package/CMakeLists.txt +0 -35
  15. package/abieos.d.ts +0 -21
  16. package/abieos.js +0 -59
  17. package/eosio.json +0 -1596
  18. package/external/date/CMakeLists.txt +0 -175
  19. package/external/date/LICENSE.txt +0 -31
  20. package/external/date/README.md +0 -61
  21. package/external/date/compile_fail.sh +0 -16
  22. package/external/date/include/date/chrono_io.h +0 -34
  23. package/external/date/include/date/date.h +0 -8335
  24. package/external/date/include/date/ios.h +0 -50
  25. package/external/date/include/date/islamic.h +0 -3031
  26. package/external/date/include/date/iso_week.h +0 -1745
  27. package/external/date/include/date/julian.h +0 -3046
  28. package/external/date/include/date/ptz.h +0 -592
  29. package/external/date/include/date/tz.h +0 -2760
  30. package/external/date/include/date/tz_private.h +0 -318
  31. package/external/date/src/ios.mm +0 -337
  32. package/external/date/src/tz.cpp +0 -3801
  33. package/external/date/test/clock_cast_test/custom_clock.pass.cpp +0 -213
  34. package/external/date/test/clock_cast_test/deprecated.pass.cpp +0 -90
  35. package/external/date/test/clock_cast_test/local_t.pass.cpp +0 -132
  36. package/external/date/test/clock_cast_test/noncastable.pass.cpp +0 -251
  37. package/external/date/test/clock_cast_test/normal_clocks.pass.cpp +0 -102
  38. package/external/date/test/clock_cast_test/to_sys_return_int.fail.cpp +0 -49
  39. package/external/date/test/clock_cast_test/to_sys_return_reference.fail.cpp +0 -51
  40. package/external/date/test/clock_cast_test/to_sys_return_utc_time.fail.cpp +0 -49
  41. package/external/date/test/date_test/day.pass.cpp +0 -143
  42. package/external/date/test/date_test/daypday.fail.cpp +0 -32
  43. package/external/date/test/date_test/daysmday.fail.cpp +0 -32
  44. package/external/date/test/date_test/daysmweekday.fail.cpp +0 -32
  45. package/external/date/test/date_test/detail/decimal_format_seconds.pass.cpp +0 -145
  46. package/external/date/test/date_test/detail/make_precision.pass.cpp +0 -63
  47. package/external/date/test/date_test/detail/static_pow10.pass.cpp +0 -50
  48. package/external/date/test/date_test/detail/width.pass.cpp +0 -64
  49. package/external/date/test/date_test/durations.pass.cpp +0 -62
  50. package/external/date/test/date_test/durations_output.pass.cpp +0 -328
  51. package/external/date/test/date_test/format/century.pass.cpp +0 -117
  52. package/external/date/test/date_test/format/misc.pass.cpp +0 -52
  53. package/external/date/test/date_test/format/range.pass.cpp +0 -78
  54. package/external/date/test/date_test/format/two_dight_year.pass.cpp +0 -121
  55. package/external/date/test/date_test/last.pass.cpp +0 -34
  56. package/external/date/test/date_test/make_time.pass.cpp +0 -164
  57. package/external/date/test/date_test/month.pass.cpp +0 -181
  58. package/external/date/test/date_test/month_day.pass.cpp +0 -82
  59. package/external/date/test/date_test/month_day_last.pass.cpp +0 -75
  60. package/external/date/test/date_test/month_weekday.pass.cpp +0 -77
  61. package/external/date/test/date_test/month_weekday_last.pass.cpp +0 -77
  62. package/external/date/test/date_test/month_weekday_last_less.fail.cpp +0 -34
  63. package/external/date/test/date_test/month_weekday_less.fail.cpp +0 -34
  64. package/external/date/test/date_test/monthpmonth.fail.cpp +0 -32
  65. package/external/date/test/date_test/months_m_year_month.fail.cpp +0 -33
  66. package/external/date/test/date_test/months_m_year_month_day.fail.cpp +0 -33
  67. package/external/date/test/date_test/monthsmmonth.fail.cpp +0 -32
  68. package/external/date/test/date_test/multi_year_duration_addition.pass.cpp +0 -297
  69. package/external/date/test/date_test/op_div_day_day.fail.cpp +0 -33
  70. package/external/date/test/date_test/op_div_int_month.fail.cpp +0 -33
  71. package/external/date/test/date_test/op_div_int_year.fail.cpp +0 -33
  72. package/external/date/test/date_test/op_div_last_last.fail.cpp +0 -33
  73. package/external/date/test/date_test/op_div_month_day.pass.cpp +0 -41
  74. package/external/date/test/date_test/op_div_month_day_last.pass.cpp +0 -39
  75. package/external/date/test/date_test/op_div_month_day_month_day.fail.cpp +0 -33
  76. package/external/date/test/date_test/op_div_month_month.fail.cpp +0 -33
  77. package/external/date/test/date_test/op_div_month_weekday.pass.cpp +0 -39
  78. package/external/date/test/date_test/op_div_month_weekday_last.pass.cpp +0 -39
  79. package/external/date/test/date_test/op_div_month_year.fail.cpp +0 -33
  80. package/external/date/test/date_test/op_div_survey.pass.cpp +0 -437
  81. package/external/date/test/date_test/op_div_weekday_indexed_weekday_indexed.fail.cpp +0 -33
  82. package/external/date/test/date_test/op_div_weekday_last_weekday_last.fail.cpp +0 -33
  83. package/external/date/test/date_test/op_div_year_month.pass.cpp +0 -35
  84. package/external/date/test/date_test/op_div_year_month_day.pass.cpp +0 -43
  85. package/external/date/test/date_test/op_div_year_month_day_last.pass.cpp +0 -41
  86. package/external/date/test/date_test/op_div_year_month_weekday.pass.cpp +0 -41
  87. package/external/date/test/date_test/op_div_year_month_weekday_last.pass.cpp +0 -41
  88. package/external/date/test/date_test/op_div_year_month_year_month.fail.cpp +0 -33
  89. package/external/date/test/date_test/op_div_year_year.fail.cpp +0 -33
  90. package/external/date/test/date_test/parse.pass.cpp +0 -904
  91. package/external/date/test/date_test/sizeof.pass.cpp +0 -62
  92. package/external/date/test/date_test/time_of_day_hours.pass.cpp +0 -104
  93. package/external/date/test/date_test/time_of_day_microfortnights.pass.cpp +0 -119
  94. package/external/date/test/date_test/time_of_day_milliseconds.pass.cpp +0 -126
  95. package/external/date/test/date_test/time_of_day_minutes.pass.cpp +0 -110
  96. package/external/date/test/date_test/time_of_day_nanoseconds.pass.cpp +0 -126
  97. package/external/date/test/date_test/time_of_day_seconds.pass.cpp +0 -116
  98. package/external/date/test/date_test/weekday.pass.cpp +0 -201
  99. package/external/date/test/date_test/weekday_indexed.pass.cpp +0 -70
  100. package/external/date/test/date_test/weekday_last.pass.cpp +0 -66
  101. package/external/date/test/date_test/weekday_lessthan.fail.cpp +0 -32
  102. package/external/date/test/date_test/weekday_sum.fail.cpp +0 -32
  103. package/external/date/test/date_test/year.pass.cpp +0 -146
  104. package/external/date/test/date_test/year_month.pass.cpp +0 -142
  105. package/external/date/test/date_test/year_month_day.pass.cpp +0 -244
  106. package/external/date/test/date_test/year_month_day_last.pass.cpp +0 -177
  107. package/external/date/test/date_test/year_month_day_m_year_month_day.fail.cpp +0 -33
  108. package/external/date/test/date_test/year_month_day_p_year_month_day.fail.cpp +0 -33
  109. package/external/date/test/date_test/year_month_p_year_month.fail.cpp +0 -33
  110. package/external/date/test/date_test/year_month_weekday.pass.cpp +0 -178
  111. package/external/date/test/date_test/year_month_weekday_last.pass.cpp +0 -169
  112. package/external/date/test/date_test/year_p_year.fail.cpp +0 -32
  113. package/external/date/test/date_test/years_m_year.fail.cpp +0 -32
  114. package/external/date/test/date_test/years_m_year_month.fail.cpp +0 -33
  115. package/external/date/test/date_test/years_m_year_month_day.fail.cpp +0 -33
  116. package/external/date/test/iso_week/last.pass.cpp +0 -34
  117. package/external/date/test/iso_week/lastweek_weekday.pass.cpp +0 -82
  118. package/external/date/test/iso_week/op_div_survey.pass.cpp +0 -196
  119. package/external/date/test/iso_week/weekday.pass.cpp +0 -227
  120. package/external/date/test/iso_week/weekday_lessthan.fail.cpp +0 -32
  121. package/external/date/test/iso_week/weekday_sum.fail.cpp +0 -32
  122. package/external/date/test/iso_week/weeknum.pass.cpp +0 -121
  123. package/external/date/test/iso_week/weeknum_p_weeknum.fail.cpp +0 -32
  124. package/external/date/test/iso_week/weeknum_weekday.pass.cpp +0 -86
  125. package/external/date/test/iso_week/year.pass.cpp +0 -120
  126. package/external/date/test/iso_week/year_lastweek.pass.cpp +0 -97
  127. package/external/date/test/iso_week/year_lastweek_weekday.pass.cpp +0 -129
  128. package/external/date/test/iso_week/year_p_year.fail.cpp +0 -32
  129. package/external/date/test/iso_week/year_weeknum.pass.cpp +0 -97
  130. package/external/date/test/iso_week/year_weeknum_weekday.pass.cpp +0 -139
  131. package/external/date/test/iso_week/years_m_year.fail.cpp +0 -32
  132. package/external/date/test/just.pass.cpp +0 -26
  133. package/external/date/test/testit +0 -177
  134. package/external/date/test/tz_test/OffsetZone.pass.cpp +0 -81
  135. package/external/date/test/tz_test/README.md +0 -22
  136. package/external/date/test/tz_test/tzdata2015e.txt.zip +0 -0
  137. package/external/date/test/tz_test/tzdata2015f.txt.zip +0 -0
  138. package/external/date/test/tz_test/tzdata2016c.txt.zip +0 -0
  139. package/external/date/test/tz_test/tzdata2016d.txt.zip +0 -0
  140. package/external/date/test/tz_test/tzdata2016e.txt.zip +0 -0
  141. package/external/date/test/tz_test/tzdata2016f.txt.zip +0 -0
  142. package/external/date/test/tz_test/validate.cpp +0 -165
  143. package/external/date/test/tz_test/zone.pass.cpp +0 -37
  144. package/external/date/test/tz_test/zoned_time.pass.cpp +0 -464
  145. package/external/date/test_fail.sh +0 -10
  146. package/external/rapidjson/.gitattributes +0 -22
  147. package/external/rapidjson/.gitmodules +0 -3
  148. package/external/rapidjson/.travis.yml +0 -99
  149. package/external/rapidjson/CHANGELOG.md +0 -158
  150. package/external/rapidjson/CMakeLists.txt +0 -221
  151. package/external/rapidjson/CMakeModules/FindGTestSrc.cmake +0 -30
  152. package/external/rapidjson/RapidJSON.pc.in +0 -7
  153. package/external/rapidjson/RapidJSONConfig.cmake.in +0 -15
  154. package/external/rapidjson/RapidJSONConfigVersion.cmake.in +0 -10
  155. package/external/rapidjson/appveyor.yml +0 -54
  156. package/external/rapidjson/bin/data/glossary.json +0 -22
  157. package/external/rapidjson/bin/data/menu.json +0 -27
  158. package/external/rapidjson/bin/data/readme.txt +0 -1
  159. package/external/rapidjson/bin/data/sample.json +0 -3315
  160. package/external/rapidjson/bin/data/webapp.json +0 -88
  161. package/external/rapidjson/bin/data/widget.json +0 -26
  162. package/external/rapidjson/bin/encodings/utf16be.json +0 -0
  163. package/external/rapidjson/bin/encodings/utf16bebom.json +0 -0
  164. package/external/rapidjson/bin/encodings/utf16le.json +0 -0
  165. package/external/rapidjson/bin/encodings/utf16lebom.json +0 -0
  166. package/external/rapidjson/bin/encodings/utf32be.json +0 -0
  167. package/external/rapidjson/bin/encodings/utf32bebom.json +0 -0
  168. package/external/rapidjson/bin/encodings/utf32le.json +0 -0
  169. package/external/rapidjson/bin/encodings/utf32lebom.json +0 -0
  170. package/external/rapidjson/bin/encodings/utf8.json +0 -7
  171. package/external/rapidjson/bin/encodings/utf8bom.json +0 -7
  172. package/external/rapidjson/bin/jsonchecker/fail1.json +0 -1
  173. package/external/rapidjson/bin/jsonchecker/fail10.json +0 -1
  174. package/external/rapidjson/bin/jsonchecker/fail11.json +0 -1
  175. package/external/rapidjson/bin/jsonchecker/fail12.json +0 -1
  176. package/external/rapidjson/bin/jsonchecker/fail13.json +0 -1
  177. package/external/rapidjson/bin/jsonchecker/fail14.json +0 -1
  178. package/external/rapidjson/bin/jsonchecker/fail15.json +0 -1
  179. package/external/rapidjson/bin/jsonchecker/fail16.json +0 -1
  180. package/external/rapidjson/bin/jsonchecker/fail17.json +0 -1
  181. package/external/rapidjson/bin/jsonchecker/fail18.json +0 -1
  182. package/external/rapidjson/bin/jsonchecker/fail19.json +0 -1
  183. package/external/rapidjson/bin/jsonchecker/fail2.json +0 -1
  184. package/external/rapidjson/bin/jsonchecker/fail20.json +0 -1
  185. package/external/rapidjson/bin/jsonchecker/fail21.json +0 -1
  186. package/external/rapidjson/bin/jsonchecker/fail22.json +0 -1
  187. package/external/rapidjson/bin/jsonchecker/fail23.json +0 -1
  188. package/external/rapidjson/bin/jsonchecker/fail24.json +0 -1
  189. package/external/rapidjson/bin/jsonchecker/fail25.json +0 -1
  190. package/external/rapidjson/bin/jsonchecker/fail26.json +0 -1
  191. package/external/rapidjson/bin/jsonchecker/fail27.json +0 -2
  192. package/external/rapidjson/bin/jsonchecker/fail28.json +0 -2
  193. package/external/rapidjson/bin/jsonchecker/fail29.json +0 -1
  194. package/external/rapidjson/bin/jsonchecker/fail3.json +0 -1
  195. package/external/rapidjson/bin/jsonchecker/fail30.json +0 -1
  196. package/external/rapidjson/bin/jsonchecker/fail31.json +0 -1
  197. package/external/rapidjson/bin/jsonchecker/fail32.json +0 -1
  198. package/external/rapidjson/bin/jsonchecker/fail33.json +0 -1
  199. package/external/rapidjson/bin/jsonchecker/fail4.json +0 -1
  200. package/external/rapidjson/bin/jsonchecker/fail5.json +0 -1
  201. package/external/rapidjson/bin/jsonchecker/fail6.json +0 -1
  202. package/external/rapidjson/bin/jsonchecker/fail7.json +0 -1
  203. package/external/rapidjson/bin/jsonchecker/fail8.json +0 -1
  204. package/external/rapidjson/bin/jsonchecker/fail9.json +0 -1
  205. package/external/rapidjson/bin/jsonchecker/pass1.json +0 -58
  206. package/external/rapidjson/bin/jsonchecker/pass2.json +0 -1
  207. package/external/rapidjson/bin/jsonchecker/pass3.json +0 -6
  208. package/external/rapidjson/bin/jsonchecker/readme.txt +0 -3
  209. package/external/rapidjson/bin/types/booleans.json +0 -102
  210. package/external/rapidjson/bin/types/floats.json +0 -102
  211. package/external/rapidjson/bin/types/guids.json +0 -102
  212. package/external/rapidjson/bin/types/integers.json +0 -102
  213. package/external/rapidjson/bin/types/mixed.json +0 -592
  214. package/external/rapidjson/bin/types/nulls.json +0 -102
  215. package/external/rapidjson/bin/types/paragraphs.json +0 -102
  216. package/external/rapidjson/bin/types/readme.txt +0 -1
  217. package/external/rapidjson/contrib/natvis/LICENSE +0 -45
  218. package/external/rapidjson/contrib/natvis/README.md +0 -7
  219. package/external/rapidjson/contrib/natvis/rapidjson.natvis +0 -38
  220. package/external/rapidjson/doc/CMakeLists.txt +0 -27
  221. package/external/rapidjson/doc/Doxyfile.in +0 -2369
  222. package/external/rapidjson/doc/Doxyfile.zh-cn.in +0 -2369
  223. package/external/rapidjson/doc/diagram/architecture.dot +0 -50
  224. package/external/rapidjson/doc/diagram/architecture.png +0 -0
  225. package/external/rapidjson/doc/diagram/insituparsing.dot +0 -65
  226. package/external/rapidjson/doc/diagram/insituparsing.png +0 -0
  227. package/external/rapidjson/doc/diagram/iterative-parser-states-diagram.dot +0 -62
  228. package/external/rapidjson/doc/diagram/iterative-parser-states-diagram.png +0 -0
  229. package/external/rapidjson/doc/diagram/move1.dot +0 -47
  230. package/external/rapidjson/doc/diagram/move1.png +0 -0
  231. package/external/rapidjson/doc/diagram/move2.dot +0 -62
  232. package/external/rapidjson/doc/diagram/move2.png +0 -0
  233. package/external/rapidjson/doc/diagram/move3.dot +0 -60
  234. package/external/rapidjson/doc/diagram/move3.png +0 -0
  235. package/external/rapidjson/doc/diagram/normalparsing.dot +0 -56
  236. package/external/rapidjson/doc/diagram/normalparsing.png +0 -0
  237. package/external/rapidjson/doc/diagram/simpledom.dot +0 -54
  238. package/external/rapidjson/doc/diagram/simpledom.png +0 -0
  239. package/external/rapidjson/doc/diagram/tutorial.dot +0 -58
  240. package/external/rapidjson/doc/diagram/tutorial.png +0 -0
  241. package/external/rapidjson/doc/diagram/utilityclass.dot +0 -73
  242. package/external/rapidjson/doc/diagram/utilityclass.png +0 -0
  243. package/external/rapidjson/doc/dom.md +0 -280
  244. package/external/rapidjson/doc/dom.zh-cn.md +0 -284
  245. package/external/rapidjson/doc/encoding.md +0 -146
  246. package/external/rapidjson/doc/encoding.zh-cn.md +0 -152
  247. package/external/rapidjson/doc/faq.md +0 -289
  248. package/external/rapidjson/doc/faq.zh-cn.md +0 -290
  249. package/external/rapidjson/doc/features.md +0 -104
  250. package/external/rapidjson/doc/features.zh-cn.md +0 -103
  251. package/external/rapidjson/doc/internals.md +0 -368
  252. package/external/rapidjson/doc/internals.zh-cn.md +0 -363
  253. package/external/rapidjson/doc/logo/rapidjson.png +0 -0
  254. package/external/rapidjson/doc/logo/rapidjson.svg +0 -119
  255. package/external/rapidjson/doc/misc/DoxygenLayout.xml +0 -194
  256. package/external/rapidjson/doc/misc/doxygenextra.css +0 -274
  257. package/external/rapidjson/doc/misc/footer.html +0 -11
  258. package/external/rapidjson/doc/misc/header.html +0 -24
  259. package/external/rapidjson/doc/npm.md +0 -31
  260. package/external/rapidjson/doc/performance.md +0 -26
  261. package/external/rapidjson/doc/performance.zh-cn.md +0 -26
  262. package/external/rapidjson/doc/pointer.md +0 -234
  263. package/external/rapidjson/doc/pointer.zh-cn.md +0 -234
  264. package/external/rapidjson/doc/sax.md +0 -509
  265. package/external/rapidjson/doc/sax.zh-cn.md +0 -487
  266. package/external/rapidjson/doc/schema.md +0 -505
  267. package/external/rapidjson/doc/schema.zh-cn.md +0 -237
  268. package/external/rapidjson/doc/stream.md +0 -429
  269. package/external/rapidjson/doc/stream.zh-cn.md +0 -429
  270. package/external/rapidjson/doc/tutorial.md +0 -536
  271. package/external/rapidjson/doc/tutorial.zh-cn.md +0 -535
  272. package/external/rapidjson/docker/debian/Dockerfile +0 -8
  273. package/external/rapidjson/example/CMakeLists.txt +0 -45
  274. package/external/rapidjson/example/archiver/archiver.cpp +0 -292
  275. package/external/rapidjson/example/archiver/archiver.h +0 -145
  276. package/external/rapidjson/example/archiver/archivertest.cpp +0 -287
  277. package/external/rapidjson/example/capitalize/capitalize.cpp +0 -67
  278. package/external/rapidjson/example/condense/condense.cpp +0 -32
  279. package/external/rapidjson/example/filterkey/filterkey.cpp +0 -135
  280. package/external/rapidjson/example/filterkeydom/filterkeydom.cpp +0 -170
  281. package/external/rapidjson/example/jsonx/jsonx.cpp +0 -207
  282. package/external/rapidjson/example/lookaheadparser/lookaheadparser.cpp +0 -350
  283. package/external/rapidjson/example/messagereader/messagereader.cpp +0 -105
  284. package/external/rapidjson/example/parsebyparts/parsebyparts.cpp +0 -176
  285. package/external/rapidjson/example/pretty/pretty.cpp +0 -30
  286. package/external/rapidjson/example/prettyauto/prettyauto.cpp +0 -56
  287. package/external/rapidjson/example/schemavalidator/schemavalidator.cpp +0 -78
  288. package/external/rapidjson/example/serialize/serialize.cpp +0 -173
  289. package/external/rapidjson/example/simpledom/simpledom.cpp +0 -29
  290. package/external/rapidjson/example/simplepullreader/simplepullreader.cpp +0 -53
  291. package/external/rapidjson/example/simplereader/simplereader.cpp +0 -42
  292. package/external/rapidjson/example/simplewriter/simplewriter.cpp +0 -36
  293. package/external/rapidjson/example/tutorial/tutorial.cpp +0 -151
  294. package/external/rapidjson/include/rapidjson/allocators.h +0 -284
  295. package/external/rapidjson/include/rapidjson/cursorstreamwrapper.h +0 -78
  296. package/external/rapidjson/include/rapidjson/document.h +0 -2646
  297. package/external/rapidjson/include/rapidjson/encodedstream.h +0 -299
  298. package/external/rapidjson/include/rapidjson/encodings.h +0 -716
  299. package/external/rapidjson/include/rapidjson/error/en.h +0 -74
  300. package/external/rapidjson/include/rapidjson/error/error.h +0 -161
  301. package/external/rapidjson/include/rapidjson/filereadstream.h +0 -99
  302. package/external/rapidjson/include/rapidjson/filewritestream.h +0 -104
  303. package/external/rapidjson/include/rapidjson/fwd.h +0 -151
  304. package/external/rapidjson/include/rapidjson/internal/biginteger.h +0 -290
  305. package/external/rapidjson/include/rapidjson/internal/diyfp.h +0 -271
  306. package/external/rapidjson/include/rapidjson/internal/dtoa.h +0 -245
  307. package/external/rapidjson/include/rapidjson/internal/ieee754.h +0 -78
  308. package/external/rapidjson/include/rapidjson/internal/itoa.h +0 -308
  309. package/external/rapidjson/include/rapidjson/internal/meta.h +0 -186
  310. package/external/rapidjson/include/rapidjson/internal/pow10.h +0 -55
  311. package/external/rapidjson/include/rapidjson/internal/regex.h +0 -732
  312. package/external/rapidjson/include/rapidjson/internal/stack.h +0 -231
  313. package/external/rapidjson/include/rapidjson/internal/strfunc.h +0 -69
  314. package/external/rapidjson/include/rapidjson/internal/strtod.h +0 -290
  315. package/external/rapidjson/include/rapidjson/internal/swap.h +0 -46
  316. package/external/rapidjson/include/rapidjson/istreamwrapper.h +0 -113
  317. package/external/rapidjson/include/rapidjson/memorybuffer.h +0 -70
  318. package/external/rapidjson/include/rapidjson/memorystream.h +0 -71
  319. package/external/rapidjson/include/rapidjson/msinttypes/inttypes.h +0 -316
  320. package/external/rapidjson/include/rapidjson/msinttypes/stdint.h +0 -300
  321. package/external/rapidjson/include/rapidjson/ostreamwrapper.h +0 -81
  322. package/external/rapidjson/include/rapidjson/pointer.h +0 -1357
  323. package/external/rapidjson/include/rapidjson/prettywriter.h +0 -277
  324. package/external/rapidjson/include/rapidjson/rapidjson.h +0 -654
  325. package/external/rapidjson/include/rapidjson/reader.h +0 -2230
  326. package/external/rapidjson/include/rapidjson/schema.h +0 -2494
  327. package/external/rapidjson/include/rapidjson/stream.h +0 -223
  328. package/external/rapidjson/include/rapidjson/stringbuffer.h +0 -121
  329. package/external/rapidjson/include/rapidjson/writer.h +0 -710
  330. package/external/rapidjson/include_dirs.js +0 -2
  331. package/external/rapidjson/library.json +0 -15
  332. package/external/rapidjson/license.txt +0 -57
  333. package/external/rapidjson/package.json +0 -24
  334. package/external/rapidjson/rapidjson.autopkg +0 -77
  335. package/external/rapidjson/readme.md +0 -160
  336. package/external/rapidjson/readme.zh-cn.md +0 -152
  337. package/external/rapidjson/test/CMakeLists.txt +0 -20
  338. package/external/rapidjson/test/perftest/CMakeLists.txt +0 -28
  339. package/external/rapidjson/test/perftest/misctest.cpp +0 -974
  340. package/external/rapidjson/test/perftest/perftest.cpp +0 -24
  341. package/external/rapidjson/test/perftest/perftest.h +0 -185
  342. package/external/rapidjson/test/perftest/platformtest.cpp +0 -166
  343. package/external/rapidjson/test/perftest/rapidjsontest.cpp +0 -472
  344. package/external/rapidjson/test/perftest/schematest.cpp +0 -223
  345. package/external/rapidjson/test/unittest/CMakeLists.txt +0 -92
  346. package/external/rapidjson/test/unittest/allocatorstest.cpp +0 -100
  347. package/external/rapidjson/test/unittest/bigintegertest.cpp +0 -138
  348. package/external/rapidjson/test/unittest/cursorstreamwrappertest.cpp +0 -115
  349. package/external/rapidjson/test/unittest/documenttest.cpp +0 -672
  350. package/external/rapidjson/test/unittest/dtoatest.cpp +0 -98
  351. package/external/rapidjson/test/unittest/encodedstreamtest.cpp +0 -313
  352. package/external/rapidjson/test/unittest/encodingstest.cpp +0 -451
  353. package/external/rapidjson/test/unittest/filestreamtest.cpp +0 -112
  354. package/external/rapidjson/test/unittest/fwdtest.cpp +0 -230
  355. package/external/rapidjson/test/unittest/istreamwrappertest.cpp +0 -181
  356. package/external/rapidjson/test/unittest/itoatest.cpp +0 -160
  357. package/external/rapidjson/test/unittest/jsoncheckertest.cpp +0 -143
  358. package/external/rapidjson/test/unittest/namespacetest.cpp +0 -70
  359. package/external/rapidjson/test/unittest/ostreamwrappertest.cpp +0 -92
  360. package/external/rapidjson/test/unittest/pointertest.cpp +0 -1529
  361. package/external/rapidjson/test/unittest/prettywritertest.cpp +0 -373
  362. package/external/rapidjson/test/unittest/readertest.cpp +0 -2190
  363. package/external/rapidjson/test/unittest/regextest.cpp +0 -638
  364. package/external/rapidjson/test/unittest/schematest.cpp +0 -2072
  365. package/external/rapidjson/test/unittest/simdtest.cpp +0 -219
  366. package/external/rapidjson/test/unittest/strfunctest.cpp +0 -30
  367. package/external/rapidjson/test/unittest/stringbuffertest.cpp +0 -192
  368. package/external/rapidjson/test/unittest/strtodtest.cpp +0 -132
  369. package/external/rapidjson/test/unittest/unittest.cpp +0 -51
  370. package/external/rapidjson/test/unittest/unittest.h +0 -140
  371. package/external/rapidjson/test/unittest/valuetest.cpp +0 -1851
  372. package/external/rapidjson/test/unittest/writertest.cpp +0 -598
  373. package/external/rapidjson/test/valgrind.supp +0 -17
  374. package/external/rapidjson/thirdparty/gtest/.travis.yml +0 -81
  375. package/external/rapidjson/thirdparty/gtest/BUILD.bazel +0 -175
  376. package/external/rapidjson/thirdparty/gtest/CMakeLists.txt +0 -33
  377. package/external/rapidjson/thirdparty/gtest/CONTRIBUTING.md +0 -160
  378. package/external/rapidjson/thirdparty/gtest/LICENSE +0 -28
  379. package/external/rapidjson/thirdparty/gtest/Makefile.am +0 -14
  380. package/external/rapidjson/thirdparty/gtest/README.md +0 -122
  381. package/external/rapidjson/thirdparty/gtest/WORKSPACE +0 -8
  382. package/external/rapidjson/thirdparty/gtest/appveyor.yml +0 -104
  383. package/external/rapidjson/thirdparty/gtest/ci/build-linux-autotools.sh +0 -44
  384. package/external/rapidjson/thirdparty/gtest/ci/build-linux-bazel.sh +0 -36
  385. package/external/rapidjson/thirdparty/gtest/ci/env-linux.sh +0 -41
  386. package/external/rapidjson/thirdparty/gtest/ci/env-osx.sh +0 -40
  387. package/external/rapidjson/thirdparty/gtest/ci/get-nprocessors.sh +0 -48
  388. package/external/rapidjson/thirdparty/gtest/ci/install-linux.sh +0 -49
  389. package/external/rapidjson/thirdparty/gtest/ci/install-osx.sh +0 -39
  390. package/external/rapidjson/thirdparty/gtest/ci/log-config.sh +0 -51
  391. package/external/rapidjson/thirdparty/gtest/ci/travis.sh +0 -44
  392. package/external/rapidjson/thirdparty/gtest/configure.ac +0 -16
  393. package/external/rapidjson/thirdparty/gtest/googlemock/CHANGES +0 -126
  394. package/external/rapidjson/thirdparty/gtest/googlemock/CMakeLists.txt +0 -242
  395. package/external/rapidjson/thirdparty/gtest/googlemock/CONTRIBUTORS +0 -40
  396. package/external/rapidjson/thirdparty/gtest/googlemock/LICENSE +0 -28
  397. package/external/rapidjson/thirdparty/gtest/googlemock/Makefile.am +0 -224
  398. package/external/rapidjson/thirdparty/gtest/googlemock/README.md +0 -344
  399. package/external/rapidjson/thirdparty/gtest/googlemock/build-aux/.keep +0 -0
  400. package/external/rapidjson/thirdparty/gtest/googlemock/cmake/gmock.pc.in +0 -9
  401. package/external/rapidjson/thirdparty/gtest/googlemock/cmake/gmock_main.pc.in +0 -9
  402. package/external/rapidjson/thirdparty/gtest/googlemock/configure.ac +0 -146
  403. package/external/rapidjson/thirdparty/gtest/googlemock/docs/CheatSheet.md +0 -564
  404. package/external/rapidjson/thirdparty/gtest/googlemock/docs/CookBook.md +0 -3660
  405. package/external/rapidjson/thirdparty/gtest/googlemock/docs/DesignDoc.md +0 -280
  406. package/external/rapidjson/thirdparty/gtest/googlemock/docs/Documentation.md +0 -15
  407. package/external/rapidjson/thirdparty/gtest/googlemock/docs/ForDummies.md +0 -447
  408. package/external/rapidjson/thirdparty/gtest/googlemock/docs/FrequentlyAskedQuestions.md +0 -627
  409. package/external/rapidjson/thirdparty/gtest/googlemock/docs/KnownIssues.md +0 -19
  410. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-actions.h +0 -1262
  411. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-cardinalities.h +0 -147
  412. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-actions.h +0 -2571
  413. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-actions.h.pump +0 -833
  414. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h +0 -1379
  415. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h.pump +0 -347
  416. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-matchers.h +0 -2258
  417. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-matchers.h.pump +0 -675
  418. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-nice-strict.h +0 -458
  419. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-nice-strict.h.pump +0 -178
  420. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-matchers.h +0 -5255
  421. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-more-actions.h +0 -246
  422. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-more-matchers.h +0 -91
  423. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-spec-builders.h +0 -1918
  424. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock.h +0 -95
  425. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h +0 -8
  426. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h.pump +0 -10
  427. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-matchers.h +0 -38
  428. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-port.h +0 -46
  429. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h +0 -286
  430. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump +0 -136
  431. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-internal-utils.h +0 -574
  432. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-port.h +0 -87
  433. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock.sln +0 -32
  434. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock.vcproj +0 -191
  435. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_config.vsprops +0 -15
  436. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_main.vcproj +0 -187
  437. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_test.vcproj +0 -201
  438. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock.sln +0 -46
  439. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock.vcxproj +0 -145
  440. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_config.props +0 -19
  441. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_main.vcxproj +0 -151
  442. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_test.vcxproj +0 -176
  443. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock.sln +0 -46
  444. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock.vcxproj +0 -145
  445. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_config.props +0 -19
  446. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_main.vcxproj +0 -151
  447. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_test.vcxproj +0 -176
  448. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/fuse_gmock_files.py +0 -240
  449. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/generator/LICENSE +0 -203
  450. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/generator/README +0 -34
  451. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/generator/README.cppclean +0 -115
  452. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/__init__.py +0 -0
  453. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/ast.py +0 -1733
  454. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/gmock_class.py +0 -227
  455. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/gmock_class_test.py +0 -448
  456. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/keywords.py +0 -59
  457. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/tokenize.py +0 -287
  458. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/utils.py +0 -41
  459. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/generator/gmock_gen.py +0 -31
  460. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/gmock-config.in +0 -303
  461. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/gmock_doctor.py +0 -640
  462. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/upload.py +0 -1387
  463. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/upload_gmock.py +0 -78
  464. package/external/rapidjson/thirdparty/gtest/googlemock/src/gmock-all.cc +0 -47
  465. package/external/rapidjson/thirdparty/gtest/googlemock/src/gmock-cardinalities.cc +0 -156
  466. package/external/rapidjson/thirdparty/gtest/googlemock/src/gmock-internal-utils.cc +0 -204
  467. package/external/rapidjson/thirdparty/gtest/googlemock/src/gmock-matchers.cc +0 -573
  468. package/external/rapidjson/thirdparty/gtest/googlemock/src/gmock-spec-builders.cc +0 -883
  469. package/external/rapidjson/thirdparty/gtest/googlemock/src/gmock.cc +0 -205
  470. package/external/rapidjson/thirdparty/gtest/googlemock/src/gmock_main.cc +0 -54
  471. package/external/rapidjson/thirdparty/gtest/googlemock/test/BUILD.bazel +0 -123
  472. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock-actions_test.cc +0 -1575
  473. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock-cardinalities_test.cc +0 -428
  474. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-actions_test.cc +0 -1230
  475. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-function-mockers_test.cc +0 -647
  476. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-internal-utils_test.cc +0 -129
  477. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-matchers_test.cc +0 -1341
  478. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock-internal-utils_test.cc +0 -718
  479. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock-matchers_test.cc +0 -6767
  480. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock-more-actions_test.cc +0 -710
  481. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock-nice-strict_test.cc +0 -511
  482. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock-port_test.cc +0 -43
  483. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock-spec-builders_test.cc +0 -2771
  484. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_all_test.cc +0 -51
  485. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_ex_test.cc +0 -81
  486. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_leak_test.py +0 -108
  487. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_leak_test_.cc +0 -100
  488. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_link2_test.cc +0 -40
  489. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_link_test.cc +0 -40
  490. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_link_test.h +0 -691
  491. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test.py +0 -183
  492. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test_.cc +0 -310
  493. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test_golden.txt +0 -317
  494. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_stress_test.cc +0 -323
  495. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_test.cc +0 -262
  496. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_test_utils.py +0 -110
  497. package/external/rapidjson/thirdparty/gtest/googletest/CHANGES +0 -157
  498. package/external/rapidjson/thirdparty/gtest/googletest/CMakeLists.txt +0 -312
  499. package/external/rapidjson/thirdparty/gtest/googletest/CONTRIBUTORS +0 -37
  500. package/external/rapidjson/thirdparty/gtest/googletest/LICENSE +0 -28
  501. package/external/rapidjson/thirdparty/gtest/googletest/Makefile.am +0 -339
  502. package/external/rapidjson/thirdparty/gtest/googletest/README.md +0 -341
  503. package/external/rapidjson/thirdparty/gtest/googletest/cmake/gtest.pc.in +0 -9
  504. package/external/rapidjson/thirdparty/gtest/googletest/cmake/gtest_main.pc.in +0 -10
  505. package/external/rapidjson/thirdparty/gtest/googletest/cmake/internal_utils.cmake +0 -280
  506. package/external/rapidjson/thirdparty/gtest/googletest/codegear/gtest.cbproj +0 -138
  507. package/external/rapidjson/thirdparty/gtest/googletest/codegear/gtest.groupproj +0 -54
  508. package/external/rapidjson/thirdparty/gtest/googletest/codegear/gtest_all.cc +0 -38
  509. package/external/rapidjson/thirdparty/gtest/googletest/codegear/gtest_link.cc +0 -40
  510. package/external/rapidjson/thirdparty/gtest/googletest/codegear/gtest_main.cbproj +0 -82
  511. package/external/rapidjson/thirdparty/gtest/googletest/codegear/gtest_unittest.cbproj +0 -88
  512. package/external/rapidjson/thirdparty/gtest/googletest/configure.ac +0 -68
  513. package/external/rapidjson/thirdparty/gtest/googletest/docs/Pkgconfig.md +0 -146
  514. package/external/rapidjson/thirdparty/gtest/googletest/docs/PumpManual.md +0 -177
  515. package/external/rapidjson/thirdparty/gtest/googletest/docs/XcodeGuide.md +0 -93
  516. package/external/rapidjson/thirdparty/gtest/googletest/docs/advanced.md +0 -2416
  517. package/external/rapidjson/thirdparty/gtest/googletest/docs/faq.md +0 -1092
  518. package/external/rapidjson/thirdparty/gtest/googletest/docs/primer.md +0 -536
  519. package/external/rapidjson/thirdparty/gtest/googletest/docs/samples.md +0 -14
  520. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-death-test.h +0 -342
  521. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-message.h +0 -249
  522. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-param-test.h +0 -1438
  523. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-param-test.h.pump +0 -501
  524. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-printers.h +0 -1082
  525. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-spi.h +0 -231
  526. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-test-part.h +0 -179
  527. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-typed-test.h +0 -264
  528. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest.h +0 -2332
  529. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest_pred_impl.h +0 -357
  530. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest_prod.h +0 -61
  531. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest-port.h +0 -70
  532. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest-printers.h +0 -42
  533. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest.h +0 -45
  534. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-death-test-internal.h +0 -275
  535. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-filepath.h +0 -205
  536. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-internal.h +0 -1277
  537. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-linked_ptr.h +0 -243
  538. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util-generated.h +0 -5139
  539. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util-generated.h.pump +0 -279
  540. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util.h +0 -723
  541. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-port-arch.h +0 -100
  542. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-port.h +0 -2687
  543. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-string.h +0 -167
  544. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-tuple.h +0 -1020
  545. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-tuple.h.pump +0 -347
  546. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-type-util.h +0 -3347
  547. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-type-util.h.pump +0 -313
  548. package/external/rapidjson/thirdparty/gtest/googletest/m4/acx_pthread.m4 +0 -363
  549. package/external/rapidjson/thirdparty/gtest/googletest/m4/gtest.m4 +0 -74
  550. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest-md.sln +0 -55
  551. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest-md.vcxproj +0 -149
  552. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest-md.vcxproj.filters +0 -18
  553. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest.sln +0 -55
  554. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest.vcxproj +0 -149
  555. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest.vcxproj.filters +0 -18
  556. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main-md.vcxproj +0 -154
  557. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main-md.vcxproj.filters +0 -18
  558. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main.vcxproj +0 -162
  559. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main.vcxproj.filters +0 -18
  560. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test-md.vcxproj +0 -199
  561. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test-md.vcxproj.filters +0 -26
  562. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test.vcxproj +0 -191
  563. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test.vcxproj.filters +0 -26
  564. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest-md.vcxproj +0 -188
  565. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest-md.vcxproj.filters +0 -18
  566. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest.vcxproj +0 -180
  567. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest.vcxproj.filters +0 -18
  568. package/external/rapidjson/thirdparty/gtest/googletest/samples/prime_tables.h +0 -127
  569. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample1.cc +0 -68
  570. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample1.h +0 -43
  571. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample10_unittest.cc +0 -140
  572. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample1_unittest.cc +0 -154
  573. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample2.cc +0 -56
  574. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample2.h +0 -85
  575. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample2_unittest.cc +0 -110
  576. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample3-inl.h +0 -172
  577. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample3_unittest.cc +0 -152
  578. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample4.cc +0 -46
  579. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample4.h +0 -53
  580. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample4_unittest.cc +0 -49
  581. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample5_unittest.cc +0 -199
  582. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample6_unittest.cc +0 -225
  583. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample7_unittest.cc +0 -118
  584. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample8_unittest.cc +0 -174
  585. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample9_unittest.cc +0 -157
  586. package/external/rapidjson/thirdparty/gtest/googletest/scripts/common.py +0 -83
  587. package/external/rapidjson/thirdparty/gtest/googletest/scripts/fuse_gtest_files.py +0 -253
  588. package/external/rapidjson/thirdparty/gtest/googletest/scripts/gen_gtest_pred_impl.py +0 -730
  589. package/external/rapidjson/thirdparty/gtest/googletest/scripts/gtest-config.in +0 -274
  590. package/external/rapidjson/thirdparty/gtest/googletest/scripts/pump.py +0 -855
  591. package/external/rapidjson/thirdparty/gtest/googletest/scripts/release_docs.py +0 -158
  592. package/external/rapidjson/thirdparty/gtest/googletest/scripts/upload.py +0 -1387
  593. package/external/rapidjson/thirdparty/gtest/googletest/scripts/upload_gtest.py +0 -78
  594. package/external/rapidjson/thirdparty/gtest/googletest/src/gtest-all.cc +0 -48
  595. package/external/rapidjson/thirdparty/gtest/googletest/src/gtest-death-test.cc +0 -1536
  596. package/external/rapidjson/thirdparty/gtest/googletest/src/gtest-filepath.cc +0 -385
  597. package/external/rapidjson/thirdparty/gtest/googletest/src/gtest-internal-inl.h +0 -1175
  598. package/external/rapidjson/thirdparty/gtest/googletest/src/gtest-port.cc +0 -1277
  599. package/external/rapidjson/thirdparty/gtest/googletest/src/gtest-printers.cc +0 -458
  600. package/external/rapidjson/thirdparty/gtest/googletest/src/gtest-test-part.cc +0 -102
  601. package/external/rapidjson/thirdparty/gtest/googletest/src/gtest-typed-test.cc +0 -119
  602. package/external/rapidjson/thirdparty/gtest/googletest/src/gtest.cc +0 -5846
  603. package/external/rapidjson/thirdparty/gtest/googletest/src/gtest_main.cc +0 -38
  604. package/external/rapidjson/thirdparty/gtest/googletest/test/BUILD.bazel +0 -396
  605. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-death-test_ex_test.cc +0 -93
  606. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-death-test_test.cc +0 -1424
  607. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-filepath_test.cc +0 -652
  608. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-linked_ptr_test.cc +0 -154
  609. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-listener_test.cc +0 -311
  610. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-message_test.cc +0 -159
  611. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-options_test.cc +0 -213
  612. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test2_test.cc +0 -61
  613. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test_test.cc +0 -1110
  614. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test_test.h +0 -53
  615. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-port_test.cc +0 -1303
  616. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-printers_test.cc +0 -1737
  617. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-test-part_test.cc +0 -208
  618. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-tuple_test.cc +0 -320
  619. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test2_test.cc +0 -45
  620. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test_test.cc +0 -380
  621. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test_test.h +0 -66
  622. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-unittest-api_test.cc +0 -341
  623. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_all_test.cc +0 -47
  624. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_assert_by_exception_test.cc +0 -119
  625. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_break_on_failure_unittest.py +0 -210
  626. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_break_on_failure_unittest_.cc +0 -87
  627. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_catch_exceptions_test.py +0 -235
  628. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_catch_exceptions_test_.cc +0 -311
  629. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_color_test.py +0 -129
  630. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_color_test_.cc +0 -63
  631. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_env_var_test.py +0 -119
  632. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_env_var_test_.cc +0 -124
  633. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_environment_test.cc +0 -189
  634. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_filter_unittest.py +0 -638
  635. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_filter_unittest_.cc +0 -138
  636. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_help_test.py +0 -172
  637. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_help_test_.cc +0 -46
  638. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_json_outfiles_test.py +0 -162
  639. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_json_output_unittest.py +0 -611
  640. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_json_test_utils.py +0 -60
  641. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_list_tests_unittest.py +0 -207
  642. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_list_tests_unittest_.cc +0 -157
  643. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_main_unittest.cc +0 -45
  644. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_no_test_unittest.cc +0 -56
  645. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test.py +0 -344
  646. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test_.cc +0 -1067
  647. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test_golden_lin.txt +0 -781
  648. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_pred_impl_unittest.cc +0 -2427
  649. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_premature_exit_test.cc +0 -127
  650. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_prod_test.cc +0 -57
  651. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_repeat_test.cc +0 -236
  652. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_shuffle_test.py +0 -325
  653. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_shuffle_test_.cc +0 -103
  654. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_sole_header_test.cc +0 -57
  655. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_stress_test.cc +0 -250
  656. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_test_utils.py +0 -318
  657. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_testbridge_test.py +0 -65
  658. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_testbridge_test_.cc +0 -44
  659. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_ex_test.cc +0 -92
  660. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_test.py +0 -171
  661. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_test_.cc +0 -72
  662. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_uninitialized_test.py +0 -69
  663. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_uninitialized_test_.cc +0 -43
  664. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_unittest.cc +0 -7797
  665. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfile1_test_.cc +0 -48
  666. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfile2_test_.cc +0 -48
  667. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfiles_test.py +0 -140
  668. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_output_unittest.py +0 -378
  669. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_output_unittest_.cc +0 -179
  670. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_test_utils.py +0 -196
  671. package/external/rapidjson/thirdparty/gtest/googletest/test/production.cc +0 -36
  672. package/external/rapidjson/thirdparty/gtest/googletest/test/production.h +0 -55
  673. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Config/DebugProject.xcconfig +0 -30
  674. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Config/FrameworkTarget.xcconfig +0 -17
  675. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Config/General.xcconfig +0 -41
  676. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Config/ReleaseProject.xcconfig +0 -32
  677. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Config/StaticLibraryTarget.xcconfig +0 -18
  678. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Config/TestTarget.xcconfig +0 -8
  679. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Resources/Info.plist +0 -30
  680. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/Info.plist +0 -28
  681. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/project.pbxproj +0 -457
  682. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/runtests.sh +0 -62
  683. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget.cc +0 -63
  684. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget.h +0 -59
  685. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget_test.cc +0 -68
  686. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Scripts/runtests.sh +0 -65
  687. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Scripts/versiongenerate.py +0 -100
  688. package/external/rapidjson/thirdparty/gtest/googletest/xcode/gtest.xcodeproj/project.pbxproj +0 -1182
  689. package/external/rapidjson/travis-doxygen.sh +0 -121
  690. package/include/.clang-format +0 -76
  691. package/include/eosio/abi.hpp +0 -286
  692. package/include/eosio/asset.hpp +0 -458
  693. package/include/eosio/bytes.hpp +0 -27
  694. package/include/eosio/chain_conversions.hpp +0 -450
  695. package/include/eosio/chain_types.hpp +0 -14
  696. package/include/eosio/check.hpp +0 -178
  697. package/include/eosio/convert.hpp +0 -95
  698. package/include/eosio/crypto.hpp +0 -147
  699. package/include/eosio/eosio_outcome.hpp +0 -41
  700. package/include/eosio/fixed_bytes.hpp +0 -246
  701. package/include/eosio/float.hpp +0 -35
  702. package/include/eosio/for_each_field.hpp +0 -48
  703. package/include/eosio/fpconv.c +0 -336
  704. package/include/eosio/fpconv.h +0 -41
  705. package/include/eosio/fpconv.license +0 -23
  706. package/include/eosio/from_bin.hpp +0 -272
  707. package/include/eosio/from_json.hpp +0 -737
  708. package/include/eosio/from_string.hpp +0 -28
  709. package/include/eosio/map_macro.h +0 -64
  710. package/include/eosio/murmur.hpp +0 -55
  711. package/include/eosio/name.hpp +0 -174
  712. package/include/eosio/opaque.hpp +0 -108
  713. package/include/eosio/operators.hpp +0 -71
  714. package/include/eosio/powers.h +0 -76
  715. package/include/eosio/reflection.hpp +0 -61
  716. package/include/eosio/ship_protocol.hpp +0 -850
  717. package/include/eosio/stream.hpp +0 -231
  718. package/include/eosio/symbol.hpp +0 -300
  719. package/include/eosio/time.hpp +0 -264
  720. package/include/eosio/to_bin.hpp +0 -189
  721. package/include/eosio/to_json.hpp +0 -279
  722. package/include/eosio/to_key.hpp +0 -298
  723. package/include/eosio/types.hpp +0 -97
  724. package/include/eosio/varint.hpp +0 -452
  725. package/include/outcome-basic.hpp +0 -6836
  726. package/src/abi.cpp +0 -297
  727. package/src/abieos.cpp +0 -263
  728. package/src/abieos.h +0 -76
  729. package/src/abieos.hpp +0 -1010
  730. package/src/abieos_exception.hpp +0 -89
  731. package/src/abieos_numeric.hpp +0 -94
  732. package/src/abieos_ripemd160.hpp +0 -417
  733. package/src/crypto.cpp +0 -215
  734. package/src/key_test.cpp +0 -218
  735. package/src/main.cpp +0 -242
  736. package/src/reflect_test.cpp +0 -28
  737. package/src/template_test.cpp +0 -240
  738. package/src/test.cpp +0 -940
  739. package/tools/CMakeLists.txt +0 -9
  740. package/tools/name.cpp +0 -86
@@ -1,2760 +0,0 @@
1
- #ifndef TZ_H
2
- #define TZ_H
3
-
4
- // The MIT License (MIT)
5
- //
6
- // Copyright (c) 2015, 2016, 2017 Howard Hinnant
7
- // Copyright (c) 2017 Jiangang Zhuang
8
- // Copyright (c) 2017 Aaron Bishop
9
- // Copyright (c) 2017 Tomasz Kamiński
10
- //
11
- // Permission is hereby granted, free of charge, to any person obtaining a copy
12
- // of this software and associated documentation files (the "Software"), to deal
13
- // in the Software without restriction, including without limitation the rights
14
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
- // copies of the Software, and to permit persons to whom the Software is
16
- // furnished to do so, subject to the following conditions:
17
- //
18
- // The above copyright notice and this permission notice shall be included in all
19
- // copies or substantial portions of the Software.
20
- //
21
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
- // SOFTWARE.
28
- //
29
- // Our apologies. When the previous paragraph was written, lowercase had not yet
30
- // been invented (that would involve another several millennia of evolution).
31
- // We did not mean to shout.
32
-
33
- // Get more recent database at http://www.iana.org/time-zones
34
-
35
- // The notion of "current timezone" is something the operating system is expected to "just
36
- // know". How it knows this is system specific. It's often a value set by the user at OS
37
- // installation time and recorded by the OS somewhere. On Linux and Mac systems the current
38
- // timezone name is obtained by looking at the name or contents of a particular file on
39
- // disk. On Windows the current timezone name comes from the registry. In either method,
40
- // there is no guarantee that the "native" current timezone name obtained will match any
41
- // of the "Standard" names in this library's "database". On Linux, the names usually do
42
- // seem to match so mapping functions to map from native to "Standard" are typically not
43
- // required. On Windows, the names are never "Standard" so mapping is always required.
44
- // Technically any OS may use the mapping process but currently only Windows does use it.
45
-
46
- #ifndef USE_OS_TZDB
47
- # define USE_OS_TZDB 0
48
- #endif
49
-
50
- #ifndef HAS_REMOTE_API
51
- # if USE_OS_TZDB == 0
52
- # ifdef _WIN32
53
- # define HAS_REMOTE_API 0
54
- # else
55
- # define HAS_REMOTE_API 1
56
- # endif
57
- # else // HAS_REMOTE_API makes no since when using the OS timezone database
58
- # define HAS_REMOTE_API 0
59
- # endif
60
- #endif
61
-
62
- #ifdef __clang__
63
- # pragma clang diagnostic push
64
- # pragma clang diagnostic ignored "-Wconstant-logical-operand"
65
- #endif
66
-
67
- static_assert(!(USE_OS_TZDB && HAS_REMOTE_API),
68
- "USE_OS_TZDB and HAS_REMOTE_API can not be used together");
69
-
70
- #ifdef __clang__
71
- # pragma clang diagnostic pop
72
- #endif
73
-
74
- #ifndef AUTO_DOWNLOAD
75
- # define AUTO_DOWNLOAD HAS_REMOTE_API
76
- #endif
77
-
78
- static_assert(HAS_REMOTE_API == 0 ? AUTO_DOWNLOAD == 0 : true,
79
- "AUTO_DOWNLOAD can not be turned on without HAS_REMOTE_API");
80
-
81
- #ifndef USE_SHELL_API
82
- # define USE_SHELL_API 1
83
- #endif
84
-
85
- #if USE_OS_TZDB
86
- # ifdef _WIN32
87
- # error "USE_OS_TZDB can not be used on Windows"
88
- # endif
89
- # ifndef MISSING_LEAP_SECONDS
90
- # ifdef __APPLE__
91
- # define MISSING_LEAP_SECONDS 1
92
- # else
93
- # define MISSING_LEAP_SECONDS 0
94
- # endif
95
- # endif
96
- #else
97
- # define MISSING_LEAP_SECONDS 0
98
- #endif
99
-
100
- #ifndef HAS_DEDUCTION_GUIDES
101
- # if __cplusplus >= 201703
102
- # define HAS_DEDUCTION_GUIDES 1
103
- # else
104
- # define HAS_DEDUCTION_GUIDES 0
105
- # endif
106
- #endif // HAS_DEDUCTION_GUIDES
107
-
108
- #include "date.h"
109
-
110
- #if defined(_MSC_VER) && (_MSC_VER < 1900)
111
- #include "tz_private.h"
112
- #endif
113
-
114
- #include <algorithm>
115
- #include <atomic>
116
- #include <cassert>
117
- #include <chrono>
118
- #include <istream>
119
- #include <locale>
120
- #include <memory>
121
- #include <mutex>
122
- #include <ostream>
123
- #include <sstream>
124
- #include <stdexcept>
125
- #include <string>
126
- #include <type_traits>
127
- #include <utility>
128
- #include <vector>
129
-
130
- #ifdef _WIN32
131
- # ifdef DATE_BUILD_DLL
132
- # define DATE_API __declspec(dllexport)
133
- # elif defined(DATE_USE_DLL)
134
- # define DATE_API __declspec(dllimport)
135
- # else
136
- # define DATE_API
137
- # endif
138
- #else
139
- # ifdef DATE_BUILD_DLL
140
- # define DATE_API __attribute__ ((visibility ("default")))
141
- # else
142
- # define DATE_API
143
- # endif
144
- #endif
145
-
146
- namespace date
147
- {
148
-
149
- enum class choose {earliest, latest};
150
-
151
- namespace detail
152
- {
153
- struct undocumented;
154
- }
155
-
156
- struct sys_info
157
- {
158
- sys_seconds begin;
159
- sys_seconds end;
160
- std::chrono::seconds offset;
161
- std::chrono::minutes save;
162
- std::string abbrev;
163
- };
164
-
165
- template<class CharT, class Traits>
166
- std::basic_ostream<CharT, Traits>&
167
- operator<<(std::basic_ostream<CharT, Traits>& os, const sys_info& r)
168
- {
169
- os << r.begin << '\n';
170
- os << r.end << '\n';
171
- os << make_time(r.offset) << "\n";
172
- os << make_time(r.save) << "\n";
173
- os << r.abbrev << '\n';
174
- return os;
175
- }
176
-
177
- struct local_info
178
- {
179
- enum {unique, nonexistent, ambiguous} result;
180
- sys_info first;
181
- sys_info second;
182
- };
183
-
184
- template<class CharT, class Traits>
185
- std::basic_ostream<CharT, Traits>&
186
- operator<<(std::basic_ostream<CharT, Traits>& os, const local_info& r)
187
- {
188
- if (r.result == local_info::nonexistent)
189
- os << "nonexistent between\n";
190
- else if (r.result == local_info::ambiguous)
191
- os << "ambiguous between\n";
192
- os << r.first;
193
- if (r.result != local_info::unique)
194
- {
195
- os << "and\n";
196
- os << r.second;
197
- }
198
- return os;
199
- }
200
-
201
- class nonexistent_local_time
202
- : public std::runtime_error
203
- {
204
- public:
205
- template <class Duration>
206
- nonexistent_local_time(local_time<Duration> tp, const local_info& i);
207
-
208
- private:
209
- template <class Duration>
210
- static
211
- std::string
212
- make_msg(local_time<Duration> tp, const local_info& i);
213
- };
214
-
215
- template <class Duration>
216
- inline
217
- nonexistent_local_time::nonexistent_local_time(local_time<Duration> tp,
218
- const local_info& i)
219
- : std::runtime_error(make_msg(tp, i))
220
- {
221
- }
222
-
223
- template <class Duration>
224
- std::string
225
- nonexistent_local_time::make_msg(local_time<Duration> tp, const local_info& i)
226
- {
227
- assert(i.result == local_info::nonexistent);
228
- std::ostringstream os;
229
- os << tp << " is in a gap between\n"
230
- << local_seconds{i.first.end.time_since_epoch()} + i.first.offset << ' '
231
- << i.first.abbrev << " and\n"
232
- << local_seconds{i.second.begin.time_since_epoch()} + i.second.offset << ' '
233
- << i.second.abbrev
234
- << " which are both equivalent to\n"
235
- << i.first.end << " UTC";
236
- return os.str();
237
- }
238
-
239
- class ambiguous_local_time
240
- : public std::runtime_error
241
- {
242
- public:
243
- template <class Duration>
244
- ambiguous_local_time(local_time<Duration> tp, const local_info& i);
245
-
246
- private:
247
- template <class Duration>
248
- static
249
- std::string
250
- make_msg(local_time<Duration> tp, const local_info& i);
251
- };
252
-
253
- template <class Duration>
254
- inline
255
- ambiguous_local_time::ambiguous_local_time(local_time<Duration> tp, const local_info& i)
256
- : std::runtime_error(make_msg(tp, i))
257
- {
258
- }
259
-
260
- template <class Duration>
261
- std::string
262
- ambiguous_local_time::make_msg(local_time<Duration> tp, const local_info& i)
263
- {
264
- assert(i.result == local_info::ambiguous);
265
- std::ostringstream os;
266
- os << tp << " is ambiguous. It could be\n"
267
- << tp << ' ' << i.first.abbrev << " == "
268
- << tp - i.first.offset << " UTC or\n"
269
- << tp << ' ' << i.second.abbrev << " == "
270
- << tp - i.second.offset << " UTC";
271
- return os.str();
272
- }
273
-
274
- class time_zone;
275
-
276
- #if HAS_STRING_VIEW
277
- DATE_API const time_zone* locate_zone(std::string_view tz_name);
278
- #else
279
- DATE_API const time_zone* locate_zone(const std::string& tz_name);
280
- #endif
281
-
282
- DATE_API const time_zone* current_zone();
283
-
284
- template <class T>
285
- struct zoned_traits
286
- {
287
- };
288
-
289
- template <>
290
- struct zoned_traits<const time_zone*>
291
- {
292
- static
293
- const time_zone*
294
- default_zone()
295
- {
296
- return date::locate_zone("Etc/UTC");
297
- }
298
-
299
- #if HAS_STRING_VIEW
300
-
301
- static
302
- const time_zone*
303
- locate_zone(std::string_view name)
304
- {
305
- return date::locate_zone(name);
306
- }
307
-
308
- #else // !HAS_STRING_VIEW
309
-
310
- static
311
- const time_zone*
312
- locate_zone(const std::string& name)
313
- {
314
- return date::locate_zone(name);
315
- }
316
-
317
- static
318
- const time_zone*
319
- locate_zone(const char* name)
320
- {
321
- return date::locate_zone(name);
322
- }
323
-
324
- #endif // !HAS_STRING_VIEW
325
- };
326
-
327
- template <class Duration, class TimeZonePtr>
328
- class zoned_time;
329
-
330
- template <class Duration1, class Duration2, class TimeZonePtr>
331
- bool
332
- operator==(const zoned_time<Duration1, TimeZonePtr>& x,
333
- const zoned_time<Duration2, TimeZonePtr>& y);
334
-
335
- template <class Duration, class TimeZonePtr = const time_zone*>
336
- class zoned_time
337
- {
338
- public:
339
- using duration = typename std::common_type<Duration, std::chrono::seconds>::type;
340
-
341
- private:
342
- TimeZonePtr zone_;
343
- sys_time<duration> tp_;
344
-
345
- public:
346
- #if !defined(_MSC_VER) || (_MSC_VER > 1900)
347
- template <class T = TimeZonePtr,
348
- class = decltype(zoned_traits<T>::default_zone())>
349
- #endif
350
- zoned_time();
351
-
352
- #if !defined(_MSC_VER) || (_MSC_VER > 1900)
353
- template <class T = TimeZonePtr,
354
- class = decltype(zoned_traits<T>::default_zone())>
355
- #endif
356
- zoned_time(const sys_time<Duration>& st);
357
- explicit zoned_time(TimeZonePtr z);
358
-
359
- #if HAS_STRING_VIEW
360
- template <class T = TimeZonePtr,
361
- class = typename std::enable_if
362
- <
363
- std::is_constructible
364
- <
365
- zoned_time,
366
- decltype(zoned_traits<T>::locate_zone(std::string_view()))
367
- >::value
368
- >::type>
369
- explicit zoned_time(std::string_view name);
370
- #else
371
- # if !defined(_MSC_VER) || (_MSC_VER > 1900)
372
- template <class T = TimeZonePtr,
373
- class = typename std::enable_if
374
- <
375
- std::is_constructible
376
- <
377
- zoned_time,
378
- decltype(zoned_traits<T>::locate_zone(std::string()))
379
- >::value
380
- >::type>
381
- # endif
382
- explicit zoned_time(const std::string& name);
383
- #endif
384
-
385
- template <class Duration2,
386
- class = typename std::enable_if
387
- <
388
- std::is_convertible<sys_time<Duration2>,
389
- sys_time<Duration>>::value
390
- >::type>
391
- zoned_time(const zoned_time<Duration2, TimeZonePtr>& zt) NOEXCEPT;
392
-
393
- zoned_time(TimeZonePtr z, const sys_time<Duration>& st);
394
-
395
- #if !defined(_MSC_VER) || (_MSC_VER > 1900)
396
- template <class T = TimeZonePtr,
397
- class = typename std::enable_if
398
- <
399
- std::is_convertible
400
- <
401
- decltype(std::declval<T&>()->to_sys(local_time<Duration>{})),
402
- sys_time<duration>
403
- >::value
404
- >::type>
405
- #endif
406
- zoned_time(TimeZonePtr z, const local_time<Duration>& tp);
407
-
408
- #if !defined(_MSC_VER) || (_MSC_VER > 1900)
409
- template <class T = TimeZonePtr,
410
- class = typename std::enable_if
411
- <
412
- std::is_convertible
413
- <
414
- decltype(std::declval<T&>()->to_sys(local_time<Duration>{},
415
- choose::earliest)),
416
- sys_time<duration>
417
- >::value
418
- >::type>
419
- #endif
420
- zoned_time(TimeZonePtr z, const local_time<Duration>& tp, choose c);
421
-
422
- template <class Duration2, class TimeZonePtr2,
423
- class = typename std::enable_if
424
- <
425
- std::is_convertible<sys_time<Duration2>,
426
- sys_time<Duration>>::value
427
- >::type>
428
- zoned_time(TimeZonePtr z, const zoned_time<Duration2, TimeZonePtr2>& zt);
429
-
430
- template <class Duration2, class TimeZonePtr2,
431
- class = typename std::enable_if
432
- <
433
- std::is_convertible<sys_time<Duration2>,
434
- sys_time<Duration>>::value
435
- >::type>
436
- zoned_time(TimeZonePtr z, const zoned_time<Duration2, TimeZonePtr2>& zt, choose);
437
-
438
- #if HAS_STRING_VIEW
439
-
440
- template <class T = TimeZonePtr,
441
- class = typename std::enable_if
442
- <
443
- std::is_constructible
444
- <
445
- zoned_time,
446
- decltype(zoned_traits<T>::locate_zone(std::string_view())),
447
- sys_time<Duration>
448
- >::value
449
- >::type>
450
- zoned_time(std::string_view name, const sys_time<Duration>& st);
451
-
452
- template <class T = TimeZonePtr,
453
- class = typename std::enable_if
454
- <
455
- std::is_constructible
456
- <
457
- zoned_time,
458
- decltype(zoned_traits<T>::locate_zone(std::string_view())),
459
- local_time<Duration>
460
- >::value
461
- >::type>
462
- zoned_time(std::string_view name, const local_time<Duration>& tp);
463
-
464
- template <class T = TimeZonePtr,
465
- class = typename std::enable_if
466
- <
467
- std::is_constructible
468
- <
469
- zoned_time,
470
- decltype(zoned_traits<T>::locate_zone(std::string_view())),
471
- local_time<Duration>,
472
- choose
473
- >::value
474
- >::type>
475
- zoned_time(std::string_view name, const local_time<Duration>& tp, choose c);
476
-
477
- template <class Duration2, class TimeZonePtr2, class T = TimeZonePtr,
478
- class = typename std::enable_if
479
- <
480
- std::is_convertible<sys_time<Duration2>,
481
- sys_time<Duration>>::value &&
482
- std::is_constructible
483
- <
484
- zoned_time,
485
- decltype(zoned_traits<T>::locate_zone(std::string_view())),
486
- zoned_time
487
- >::value
488
- >::type>
489
- zoned_time(std::string_view name, const zoned_time<Duration2, TimeZonePtr2>& zt);
490
-
491
- template <class Duration2, class TimeZonePtr2, class T = TimeZonePtr,
492
- class = typename std::enable_if
493
- <
494
- std::is_convertible<sys_time<Duration2>,
495
- sys_time<Duration>>::value &&
496
- std::is_constructible
497
- <
498
- zoned_time,
499
- decltype(zoned_traits<T>::locate_zone(std::string_view())),
500
- zoned_time,
501
- choose
502
- >::value
503
- >::type>
504
- zoned_time(std::string_view name, const zoned_time<Duration2, TimeZonePtr2>& zt, choose);
505
-
506
- #else // !HAS_STRING_VIEW
507
-
508
- #if !defined(_MSC_VER) || (_MSC_VER > 1900)
509
- template <class T = TimeZonePtr,
510
- class = typename std::enable_if
511
- <
512
- std::is_constructible
513
- <
514
- zoned_time,
515
- decltype(zoned_traits<T>::locate_zone(std::string())),
516
- sys_time<Duration>
517
- >::value
518
- >::type>
519
- #endif
520
- zoned_time(const std::string& name, const sys_time<Duration>& st);
521
-
522
- #if !defined(_MSC_VER) || (_MSC_VER > 1900)
523
- template <class T = TimeZonePtr,
524
- class = typename std::enable_if
525
- <
526
- std::is_constructible
527
- <
528
- zoned_time,
529
- decltype(zoned_traits<T>::locate_zone(std::string())),
530
- sys_time<Duration>
531
- >::value
532
- >::type>
533
- #endif
534
- zoned_time(const char* name, const sys_time<Duration>& st);
535
-
536
- #if !defined(_MSC_VER) || (_MSC_VER > 1900)
537
- template <class T = TimeZonePtr,
538
- class = typename std::enable_if
539
- <
540
- std::is_constructible
541
- <
542
- zoned_time,
543
- decltype(zoned_traits<T>::locate_zone(std::string())),
544
- local_time<Duration>
545
- >::value
546
- >::type>
547
- #endif
548
- zoned_time(const std::string& name, const local_time<Duration>& tp);
549
-
550
- #if !defined(_MSC_VER) || (_MSC_VER > 1900)
551
- template <class T = TimeZonePtr,
552
- class = typename std::enable_if
553
- <
554
- std::is_constructible
555
- <
556
- zoned_time,
557
- decltype(zoned_traits<T>::locate_zone(std::string())),
558
- local_time<Duration>
559
- >::value
560
- >::type>
561
- #endif
562
- zoned_time(const char* name, const local_time<Duration>& tp);
563
-
564
- #if !defined(_MSC_VER) || (_MSC_VER > 1900)
565
- template <class T = TimeZonePtr,
566
- class = typename std::enable_if
567
- <
568
- std::is_constructible
569
- <
570
- zoned_time,
571
- decltype(zoned_traits<T>::locate_zone(std::string())),
572
- local_time<Duration>,
573
- choose
574
- >::value
575
- >::type>
576
- #endif
577
- zoned_time(const std::string& name, const local_time<Duration>& tp, choose c);
578
-
579
- #if !defined(_MSC_VER) || (_MSC_VER > 1900)
580
- template <class T = TimeZonePtr,
581
- class = typename std::enable_if
582
- <
583
- std::is_constructible
584
- <
585
- zoned_time,
586
- decltype(zoned_traits<T>::locate_zone(std::string())),
587
- local_time<Duration>,
588
- choose
589
- >::value
590
- >::type>
591
- #endif
592
- zoned_time(const char* name, const local_time<Duration>& tp, choose c);
593
-
594
- #if !defined(_MSC_VER) || (_MSC_VER > 1900)
595
- template <class Duration2, class TimeZonePtr2, class T = TimeZonePtr,
596
- class = typename std::enable_if
597
- <
598
- std::is_convertible<sys_time<Duration2>,
599
- sys_time<Duration>>::value &&
600
- std::is_constructible
601
- <
602
- zoned_time,
603
- decltype(zoned_traits<T>::locate_zone(std::string())),
604
- zoned_time
605
- >::value
606
- >::type>
607
- #else
608
- template <class Duration2, class TimeZonePtr2>
609
- #endif
610
- zoned_time(const std::string& name, const zoned_time<Duration2, TimeZonePtr2>& zt);
611
-
612
- #if !defined(_MSC_VER) || (_MSC_VER > 1900)
613
- template <class Duration2, class TimeZonePtr2, class T = TimeZonePtr,
614
- class = typename std::enable_if
615
- <
616
- std::is_convertible<sys_time<Duration2>,
617
- sys_time<Duration>>::value &&
618
- std::is_constructible
619
- <
620
- zoned_time,
621
- decltype(zoned_traits<T>::locate_zone(std::string())),
622
- zoned_time
623
- >::value
624
- >::type>
625
- #else
626
- template <class Duration2, class TimeZonePtr2>
627
- #endif
628
- zoned_time(const char* name, const zoned_time<Duration2, TimeZonePtr2>& zt);
629
-
630
- #if !defined(_MSC_VER) || (_MSC_VER > 1900)
631
- template <class Duration2, class TimeZonePtr2, class T = TimeZonePtr,
632
- class = typename std::enable_if
633
- <
634
- std::is_convertible<sys_time<Duration2>,
635
- sys_time<Duration>>::value &&
636
- std::is_constructible
637
- <
638
- zoned_time,
639
- decltype(zoned_traits<T>::locate_zone(std::string())),
640
- zoned_time,
641
- choose
642
- >::value
643
- >::type>
644
- #else
645
- template <class Duration2, class TimeZonePtr2>
646
- #endif
647
- zoned_time(const std::string& name, const zoned_time<Duration2, TimeZonePtr2>& zt,
648
- choose);
649
-
650
- #if !defined(_MSC_VER) || (_MSC_VER > 1900)
651
- template <class Duration2, class TimeZonePtr2, class T = TimeZonePtr,
652
- class = typename std::enable_if
653
- <
654
- std::is_convertible<sys_time<Duration2>,
655
- sys_time<Duration>>::value &&
656
- std::is_constructible
657
- <
658
- zoned_time,
659
- decltype(zoned_traits<T>::locate_zone(std::string())),
660
- zoned_time,
661
- choose
662
- >::value
663
- >::type>
664
- #else
665
- template <class Duration2, class TimeZonePtr2>
666
- #endif
667
- zoned_time(const char* name, const zoned_time<Duration2, TimeZonePtr2>& zt,
668
- choose);
669
-
670
- #endif // !HAS_STRING_VIEW
671
-
672
- zoned_time& operator=(const sys_time<Duration>& st);
673
- zoned_time& operator=(const local_time<Duration>& ut);
674
-
675
- explicit operator sys_time<duration>() const;
676
- explicit operator local_time<duration>() const;
677
-
678
- TimeZonePtr get_time_zone() const;
679
- local_time<duration> get_local_time() const;
680
- sys_time<duration> get_sys_time() const;
681
- sys_info get_info() const;
682
-
683
- template <class Duration1, class Duration2, class TimeZonePtr1>
684
- friend
685
- bool
686
- operator==(const zoned_time<Duration1, TimeZonePtr1>& x,
687
- const zoned_time<Duration2, TimeZonePtr1>& y);
688
-
689
- template <class CharT, class Traits, class Duration1, class TimeZonePtr1>
690
- friend
691
- std::basic_ostream<CharT, Traits>&
692
- operator<<(std::basic_ostream<CharT, Traits>& os,
693
- const zoned_time<Duration1, TimeZonePtr1>& t);
694
-
695
- private:
696
- template <class D, class T> friend class zoned_time;
697
- };
698
-
699
- using zoned_seconds = zoned_time<std::chrono::seconds>;
700
-
701
- #if HAS_DEDUCTION_GUIDES
702
-
703
- zoned_time()
704
- -> zoned_time<std::chrono::seconds>;
705
-
706
- template <class Duration>
707
- zoned_time(sys_time<Duration>)
708
- -> zoned_time<std::common_type_t<Duration, std::chrono::seconds>>;
709
-
710
- template <class TimeZonePtrOrName>
711
- zoned_time(TimeZonePtrOrName)
712
- -> zoned_time<std::chrono::seconds,
713
- std::conditional_t
714
- <
715
- std::is_convertible<TimeZonePtrOrName, std::string_view>::value,
716
- time_zone const*,
717
- TimeZonePtrOrName
718
- >>;
719
-
720
- template <class TimeZonePtrOrName, class Duration>
721
- zoned_time(TimeZonePtrOrName, sys_time<Duration>)
722
- -> zoned_time<std::common_type_t<Duration, std::chrono::seconds>,
723
- std::conditional_t
724
- <
725
- std::is_convertible<TimeZonePtrOrName, std::string_view>::value,
726
- time_zone const*,
727
- TimeZonePtrOrName
728
- >>;
729
-
730
- template <class TimeZonePtrOrName, class Duration>
731
- zoned_time(TimeZonePtrOrName, local_time<Duration>, choose = choose::earliest)
732
- -> zoned_time<std::common_type_t<Duration, std::chrono::seconds>,
733
- std::conditional_t
734
- <
735
- std::is_convertible<TimeZonePtrOrName, std::string_view>::value,
736
- time_zone const*,
737
- TimeZonePtrOrName
738
- >>;
739
-
740
- template <class Duration, class TimeZonePtrOrName, class TimeZonePtr2>
741
- zoned_time(TimeZonePtrOrName, zoned_time<Duration, TimeZonePtr2>, choose = choose::earliest)
742
- -> zoned_time<std::common_type_t<Duration, std::chrono::seconds>,
743
- std::conditional_t
744
- <
745
- std::is_convertible<TimeZonePtrOrName, std::string_view>::value,
746
- time_zone const*,
747
- TimeZonePtrOrName
748
- >>;
749
-
750
- #endif // HAS_DEDUCTION_GUIDES
751
-
752
- template <class Duration1, class Duration2, class TimeZonePtr>
753
- inline
754
- bool
755
- operator==(const zoned_time<Duration1, TimeZonePtr>& x,
756
- const zoned_time<Duration2, TimeZonePtr>& y)
757
- {
758
- return x.zone_ == y.zone_ && x.tp_ == y.tp_;
759
- }
760
-
761
- template <class Duration1, class Duration2, class TimeZonePtr>
762
- inline
763
- bool
764
- operator!=(const zoned_time<Duration1, TimeZonePtr>& x,
765
- const zoned_time<Duration2, TimeZonePtr>& y)
766
- {
767
- return !(x == y);
768
- }
769
-
770
- #if !defined(_MSC_VER) || (_MSC_VER >= 1900)
771
-
772
- namespace detail
773
- {
774
- # if USE_OS_TZDB
775
- struct transition;
776
- struct expanded_ttinfo;
777
- # else // !USE_OS_TZDB
778
- struct zonelet;
779
- class Rule;
780
- # endif // !USE_OS_TZDB
781
- }
782
-
783
- #endif // !defined(_MSC_VER) || (_MSC_VER >= 1900)
784
-
785
- class time_zone
786
- {
787
- private:
788
- std::string name_;
789
- #if USE_OS_TZDB
790
- std::vector<detail::transition> transitions_;
791
- std::vector<detail::expanded_ttinfo> ttinfos_;
792
- #else // !USE_OS_TZDB
793
- std::vector<detail::zonelet> zonelets_;
794
- #endif // !USE_OS_TZDB
795
- std::unique_ptr<std::once_flag> adjusted_;
796
-
797
- public:
798
- #if !defined(_MSC_VER) || (_MSC_VER >= 1900)
799
- time_zone(time_zone&&) = default;
800
- time_zone& operator=(time_zone&&) = default;
801
- #else // defined(_MSC_VER) && (_MSC_VER < 1900)
802
- time_zone(time_zone&& src);
803
- time_zone& operator=(time_zone&& src);
804
- #endif // defined(_MSC_VER) && (_MSC_VER < 1900)
805
-
806
- DATE_API explicit time_zone(const std::string& s, detail::undocumented);
807
-
808
- const std::string& name() const NOEXCEPT;
809
-
810
- template <class Duration> sys_info get_info(sys_time<Duration> st) const;
811
- template <class Duration> local_info get_info(local_time<Duration> tp) const;
812
-
813
- template <class Duration>
814
- sys_time<typename std::common_type<Duration, std::chrono::seconds>::type>
815
- to_sys(local_time<Duration> tp) const;
816
-
817
- template <class Duration>
818
- sys_time<typename std::common_type<Duration, std::chrono::seconds>::type>
819
- to_sys(local_time<Duration> tp, choose z) const;
820
-
821
- template <class Duration>
822
- local_time<typename std::common_type<Duration, std::chrono::seconds>::type>
823
- to_local(sys_time<Duration> tp) const;
824
-
825
- friend bool operator==(const time_zone& x, const time_zone& y) NOEXCEPT;
826
- friend bool operator< (const time_zone& x, const time_zone& y) NOEXCEPT;
827
- friend DATE_API std::ostream& operator<<(std::ostream& os, const time_zone& z);
828
-
829
- #if !USE_OS_TZDB
830
- DATE_API void add(const std::string& s);
831
- #endif // !USE_OS_TZDB
832
-
833
- private:
834
- DATE_API sys_info get_info_impl(sys_seconds tp) const;
835
- DATE_API local_info get_info_impl(local_seconds tp) const;
836
-
837
- template <class Duration>
838
- sys_time<typename std::common_type<Duration, std::chrono::seconds>::type>
839
- to_sys_impl(local_time<Duration> tp, choose z, std::false_type) const;
840
- template <class Duration>
841
- sys_time<typename std::common_type<Duration, std::chrono::seconds>::type>
842
- to_sys_impl(local_time<Duration> tp, choose, std::true_type) const;
843
-
844
- #if USE_OS_TZDB
845
- DATE_API void init() const;
846
- DATE_API void init_impl();
847
- DATE_API sys_info
848
- load_sys_info(std::vector<detail::transition>::const_iterator i) const;
849
-
850
- template <class TimeType>
851
- DATE_API void
852
- load_data(std::istream& inf, std::int32_t tzh_leapcnt, std::int32_t tzh_timecnt,
853
- std::int32_t tzh_typecnt, std::int32_t tzh_charcnt);
854
- #else // !USE_OS_TZDB
855
- DATE_API sys_info get_info_impl(sys_seconds tp, int timezone) const;
856
- DATE_API void adjust_infos(const std::vector<detail::Rule>& rules);
857
- DATE_API void parse_info(std::istream& in);
858
- #endif // !USE_OS_TZDB
859
- };
860
-
861
- #if defined(_MSC_VER) && (_MSC_VER < 1900)
862
-
863
- inline
864
- time_zone::time_zone(time_zone&& src)
865
- : name_(std::move(src.name_))
866
- , zonelets_(std::move(src.zonelets_))
867
- , adjusted_(std::move(src.adjusted_))
868
- {}
869
-
870
- inline
871
- time_zone&
872
- time_zone::operator=(time_zone&& src)
873
- {
874
- name_ = std::move(src.name_);
875
- zonelets_ = std::move(src.zonelets_);
876
- adjusted_ = std::move(src.adjusted_);
877
- return *this;
878
- }
879
-
880
- #endif // defined(_MSC_VER) && (_MSC_VER < 1900)
881
-
882
- inline
883
- const std::string&
884
- time_zone::name() const NOEXCEPT
885
- {
886
- return name_;
887
- }
888
-
889
- template <class Duration>
890
- inline
891
- sys_info
892
- time_zone::get_info(sys_time<Duration> st) const
893
- {
894
- using namespace std::chrono;
895
- return get_info_impl(date::floor<seconds>(st));
896
- }
897
-
898
- template <class Duration>
899
- inline
900
- local_info
901
- time_zone::get_info(local_time<Duration> tp) const
902
- {
903
- using namespace std::chrono;
904
- return get_info_impl(date::floor<seconds>(tp));
905
- }
906
-
907
- template <class Duration>
908
- inline
909
- sys_time<typename std::common_type<Duration, std::chrono::seconds>::type>
910
- time_zone::to_sys(local_time<Duration> tp) const
911
- {
912
- return to_sys_impl(tp, choose{}, std::true_type{});
913
- }
914
-
915
- template <class Duration>
916
- inline
917
- sys_time<typename std::common_type<Duration, std::chrono::seconds>::type>
918
- time_zone::to_sys(local_time<Duration> tp, choose z) const
919
- {
920
- return to_sys_impl(tp, z, std::false_type{});
921
- }
922
-
923
- template <class Duration>
924
- inline
925
- local_time<typename std::common_type<Duration, std::chrono::seconds>::type>
926
- time_zone::to_local(sys_time<Duration> tp) const
927
- {
928
- using LT = local_time<typename std::common_type<Duration, std::chrono::seconds>::type>;
929
- auto i = get_info(tp);
930
- return LT{(tp + i.offset).time_since_epoch()};
931
- }
932
-
933
- inline bool operator==(const time_zone& x, const time_zone& y) NOEXCEPT {return x.name_ == y.name_;}
934
- inline bool operator< (const time_zone& x, const time_zone& y) NOEXCEPT {return x.name_ < y.name_;}
935
-
936
- inline bool operator!=(const time_zone& x, const time_zone& y) NOEXCEPT {return !(x == y);}
937
- inline bool operator> (const time_zone& x, const time_zone& y) NOEXCEPT {return y < x;}
938
- inline bool operator<=(const time_zone& x, const time_zone& y) NOEXCEPT {return !(y < x);}
939
- inline bool operator>=(const time_zone& x, const time_zone& y) NOEXCEPT {return !(x < y);}
940
-
941
- template <class Duration>
942
- sys_time<typename std::common_type<Duration, std::chrono::seconds>::type>
943
- time_zone::to_sys_impl(local_time<Duration> tp, choose z, std::false_type) const
944
- {
945
- using namespace date;
946
- using namespace std::chrono;
947
- auto i = get_info(tp);
948
- if (i.result == local_info::nonexistent)
949
- {
950
- return i.first.end;
951
- }
952
- else if (i.result == local_info::ambiguous)
953
- {
954
- if (z == choose::latest)
955
- return sys_time<Duration>{tp.time_since_epoch()} - i.second.offset;
956
- }
957
- return sys_time<Duration>{tp.time_since_epoch()} - i.first.offset;
958
- }
959
-
960
- template <class Duration>
961
- sys_time<typename std::common_type<Duration, std::chrono::seconds>::type>
962
- time_zone::to_sys_impl(local_time<Duration> tp, choose, std::true_type) const
963
- {
964
- using namespace date;
965
- using namespace std::chrono;
966
- auto i = get_info(tp);
967
- if (i.result == local_info::nonexistent)
968
- throw nonexistent_local_time(tp, i);
969
- else if (i.result == local_info::ambiguous)
970
- throw ambiguous_local_time(tp, i);
971
- return sys_time<Duration>{tp.time_since_epoch()} - i.first.offset;
972
- }
973
-
974
- #if !USE_OS_TZDB
975
-
976
- class link
977
- {
978
- private:
979
- std::string name_;
980
- std::string target_;
981
- public:
982
- DATE_API explicit link(const std::string& s);
983
-
984
- const std::string& name() const {return name_;}
985
- const std::string& target() const {return target_;}
986
-
987
- friend bool operator==(const link& x, const link& y) {return x.name_ == y.name_;}
988
- friend bool operator< (const link& x, const link& y) {return x.name_ < y.name_;}
989
-
990
- friend DATE_API std::ostream& operator<<(std::ostream& os, const link& x);
991
- };
992
-
993
- inline bool operator!=(const link& x, const link& y) {return !(x == y);}
994
- inline bool operator> (const link& x, const link& y) {return y < x;}
995
- inline bool operator<=(const link& x, const link& y) {return !(y < x);}
996
- inline bool operator>=(const link& x, const link& y) {return !(x < y);}
997
-
998
- #endif // !USE_OS_TZDB
999
-
1000
- #if !MISSING_LEAP_SECONDS
1001
-
1002
- class leap
1003
- {
1004
- private:
1005
- sys_seconds date_;
1006
-
1007
- public:
1008
- #if USE_OS_TZDB
1009
- DATE_API explicit leap(const sys_seconds& s, detail::undocumented);
1010
- #else
1011
- DATE_API explicit leap(const std::string& s, detail::undocumented);
1012
- #endif
1013
-
1014
- sys_seconds date() const {return date_;}
1015
-
1016
- friend bool operator==(const leap& x, const leap& y) {return x.date_ == y.date_;}
1017
- friend bool operator< (const leap& x, const leap& y) {return x.date_ < y.date_;}
1018
-
1019
- template <class Duration>
1020
- friend
1021
- bool
1022
- operator==(const leap& x, const sys_time<Duration>& y)
1023
- {
1024
- return x.date_ == y;
1025
- }
1026
-
1027
- template <class Duration>
1028
- friend
1029
- bool
1030
- operator< (const leap& x, const sys_time<Duration>& y)
1031
- {
1032
- return x.date_ < y;
1033
- }
1034
-
1035
- template <class Duration>
1036
- friend
1037
- bool
1038
- operator< (const sys_time<Duration>& x, const leap& y)
1039
- {
1040
- return x < y.date_;
1041
- }
1042
-
1043
- friend DATE_API std::ostream& operator<<(std::ostream& os, const leap& x);
1044
- };
1045
-
1046
- inline bool operator!=(const leap& x, const leap& y) {return !(x == y);}
1047
- inline bool operator> (const leap& x, const leap& y) {return y < x;}
1048
- inline bool operator<=(const leap& x, const leap& y) {return !(y < x);}
1049
- inline bool operator>=(const leap& x, const leap& y) {return !(x < y);}
1050
-
1051
- template <class Duration>
1052
- inline
1053
- bool
1054
- operator==(const sys_time<Duration>& x, const leap& y)
1055
- {
1056
- return y == x;
1057
- }
1058
-
1059
- template <class Duration>
1060
- inline
1061
- bool
1062
- operator!=(const leap& x, const sys_time<Duration>& y)
1063
- {
1064
- return !(x == y);
1065
- }
1066
-
1067
- template <class Duration>
1068
- inline
1069
- bool
1070
- operator!=(const sys_time<Duration>& x, const leap& y)
1071
- {
1072
- return !(x == y);
1073
- }
1074
-
1075
- template <class Duration>
1076
- inline
1077
- bool
1078
- operator> (const leap& x, const sys_time<Duration>& y)
1079
- {
1080
- return y < x;
1081
- }
1082
-
1083
- template <class Duration>
1084
- inline
1085
- bool
1086
- operator> (const sys_time<Duration>& x, const leap& y)
1087
- {
1088
- return y < x;
1089
- }
1090
-
1091
- template <class Duration>
1092
- inline
1093
- bool
1094
- operator<=(const leap& x, const sys_time<Duration>& y)
1095
- {
1096
- return !(y < x);
1097
- }
1098
-
1099
- template <class Duration>
1100
- inline
1101
- bool
1102
- operator<=(const sys_time<Duration>& x, const leap& y)
1103
- {
1104
- return !(y < x);
1105
- }
1106
-
1107
- template <class Duration>
1108
- inline
1109
- bool
1110
- operator>=(const leap& x, const sys_time<Duration>& y)
1111
- {
1112
- return !(x < y);
1113
- }
1114
-
1115
- template <class Duration>
1116
- inline
1117
- bool
1118
- operator>=(const sys_time<Duration>& x, const leap& y)
1119
- {
1120
- return !(x < y);
1121
- }
1122
-
1123
- #endif // !MISSING_LEAP_SECONDS
1124
-
1125
- #ifdef _WIN32
1126
-
1127
- namespace detail
1128
- {
1129
-
1130
- // The time zone mapping is modelled after this data file:
1131
- // http://unicode.org/repos/cldr/trunk/common/supplemental/windowsZones.xml
1132
- // and the field names match the element names from the mapZone element
1133
- // of windowsZones.xml.
1134
- // The website displays this file here:
1135
- // http://www.unicode.org/cldr/charts/latest/supplemental/zone_tzid.html
1136
- // The html view is sorted before being displayed but is otherwise the same
1137
- // There is a mapping between the os centric view (in this case windows)
1138
- // the html displays uses and the generic view the xml file.
1139
- // That mapping is this:
1140
- // display column "windows" -> xml field "other".
1141
- // display column "region" -> xml field "territory".
1142
- // display column "tzid" -> xml field "type".
1143
- // This structure uses the generic terminology because it could be
1144
- // used to to support other os/native name conversions, not just windows,
1145
- // and using the same generic names helps retain the connection to the
1146
- // origin of the data that we are using.
1147
- struct timezone_mapping
1148
- {
1149
- timezone_mapping(const char* other, const char* territory, const char* type)
1150
- : other(other), territory(territory), type(type)
1151
- {
1152
- }
1153
- timezone_mapping() = default;
1154
- std::string other;
1155
- std::string territory;
1156
- std::string type;
1157
- };
1158
-
1159
- } // detail
1160
-
1161
- #endif // _WIN32
1162
-
1163
- struct tzdb
1164
- {
1165
- std::string version = "unknown";
1166
- std::vector<time_zone> zones;
1167
- #if !USE_OS_TZDB
1168
- std::vector<link> links;
1169
- #endif
1170
- #if !MISSING_LEAP_SECONDS
1171
- std::vector<leap> leaps;
1172
- #endif
1173
- #if !USE_OS_TZDB
1174
- std::vector<detail::Rule> rules;
1175
- #endif
1176
- #ifdef _WIN32
1177
- std::vector<detail::timezone_mapping> mappings;
1178
- #endif
1179
- tzdb* next = nullptr;
1180
-
1181
- tzdb() = default;
1182
- #if !defined(_MSC_VER) || (_MSC_VER >= 1900)
1183
- tzdb(tzdb&&) = default;
1184
- tzdb& operator=(tzdb&&) = default;
1185
- #else // defined(_MSC_VER) && (_MSC_VER < 1900)
1186
- tzdb(tzdb&& src)
1187
- : version(std::move(src.version))
1188
- , zones(std::move(src.zones))
1189
- , links(std::move(src.links))
1190
- , leaps(std::move(src.leaps))
1191
- , rules(std::move(src.rules))
1192
- , mappings(std::move(src.mappings))
1193
- {}
1194
-
1195
- tzdb& operator=(tzdb&& src)
1196
- {
1197
- version = std::move(src.version);
1198
- zones = std::move(src.zones);
1199
- links = std::move(src.links);
1200
- leaps = std::move(src.leaps);
1201
- rules = std::move(src.rules);
1202
- mappings = std::move(src.mappings);
1203
- return *this;
1204
- }
1205
- #endif // defined(_MSC_VER) && (_MSC_VER < 1900)
1206
-
1207
- #if HAS_STRING_VIEW
1208
- const time_zone* locate_zone(std::string_view tz_name) const;
1209
- #else
1210
- const time_zone* locate_zone(const std::string& tz_name) const;
1211
- #endif
1212
- const time_zone* current_zone() const;
1213
- };
1214
-
1215
- using TZ_DB = tzdb;
1216
-
1217
- DATE_API std::ostream&
1218
- operator<<(std::ostream& os, const tzdb& db);
1219
-
1220
- DATE_API const tzdb& get_tzdb();
1221
-
1222
- class tzdb_list
1223
- {
1224
- std::atomic<tzdb*> head_{nullptr};
1225
-
1226
- public:
1227
- ~tzdb_list();
1228
- tzdb_list() = default;
1229
- tzdb_list(tzdb_list&& x) noexcept;
1230
-
1231
- const tzdb& front() const noexcept {return *head_;}
1232
- tzdb& front() noexcept {return *head_;}
1233
-
1234
- class const_iterator;
1235
-
1236
- const_iterator begin() const noexcept;
1237
- const_iterator end() const noexcept;
1238
-
1239
- const_iterator cbegin() const noexcept;
1240
- const_iterator cend() const noexcept;
1241
-
1242
- const_iterator erase_after(const_iterator p) noexcept;
1243
-
1244
- struct undocumented_helper;
1245
- private:
1246
- void push_front(tzdb* tzdb) noexcept;
1247
- };
1248
-
1249
- class tzdb_list::const_iterator
1250
- {
1251
- tzdb* p_ = nullptr;
1252
-
1253
- explicit const_iterator(tzdb* p) noexcept : p_{p} {}
1254
- public:
1255
- const_iterator() = default;
1256
-
1257
- using iterator_category = std::forward_iterator_tag;
1258
- using value_type = tzdb;
1259
- using reference = const value_type&;
1260
- using pointer = const value_type*;
1261
- using difference_type = std::ptrdiff_t;
1262
-
1263
- reference operator*() const noexcept {return *p_;}
1264
- pointer operator->() const noexcept {return p_;}
1265
-
1266
- const_iterator& operator++() noexcept {p_ = p_->next; return *this;}
1267
- const_iterator operator++(int) noexcept {auto t = *this; ++(*this); return t;}
1268
-
1269
- friend
1270
- bool
1271
- operator==(const const_iterator& x, const const_iterator& y) noexcept
1272
- {return x.p_ == y.p_;}
1273
-
1274
- friend
1275
- bool
1276
- operator!=(const const_iterator& x, const const_iterator& y) noexcept
1277
- {return !(x == y);}
1278
-
1279
- friend class tzdb_list;
1280
- };
1281
-
1282
- inline
1283
- tzdb_list::const_iterator
1284
- tzdb_list::begin() const noexcept
1285
- {
1286
- return const_iterator{head_};
1287
- }
1288
-
1289
- inline
1290
- tzdb_list::const_iterator
1291
- tzdb_list::end() const noexcept
1292
- {
1293
- return const_iterator{nullptr};
1294
- }
1295
-
1296
- inline
1297
- tzdb_list::const_iterator
1298
- tzdb_list::cbegin() const noexcept
1299
- {
1300
- return begin();
1301
- }
1302
-
1303
- inline
1304
- tzdb_list::const_iterator
1305
- tzdb_list::cend() const noexcept
1306
- {
1307
- return end();
1308
- }
1309
-
1310
- DATE_API tzdb_list& get_tzdb_list();
1311
-
1312
- #if !USE_OS_TZDB
1313
-
1314
- DATE_API const tzdb& reload_tzdb();
1315
- DATE_API void set_install(const std::string& install);
1316
-
1317
- #endif // !USE_OS_TZDB
1318
-
1319
- #if HAS_REMOTE_API
1320
-
1321
- DATE_API std::string remote_version();
1322
- DATE_API bool remote_download(const std::string& version);
1323
- DATE_API bool remote_install(const std::string& version);
1324
-
1325
- #endif
1326
-
1327
- // zoned_time
1328
-
1329
- namespace detail
1330
- {
1331
-
1332
- template <class T>
1333
- inline
1334
- T*
1335
- to_raw_pointer(T* p) noexcept
1336
- {
1337
- return p;
1338
- }
1339
-
1340
- template <class Pointer>
1341
- inline
1342
- auto
1343
- to_raw_pointer(Pointer p) noexcept
1344
- -> decltype(detail::to_raw_pointer(p.operator->()))
1345
- {
1346
- return detail::to_raw_pointer(p.operator->());
1347
- }
1348
-
1349
- } // namespace detail
1350
-
1351
- template <class Duration, class TimeZonePtr>
1352
- #if !defined(_MSC_VER) || (_MSC_VER > 1900)
1353
- template <class T, class>
1354
- #endif
1355
- inline
1356
- zoned_time<Duration, TimeZonePtr>::zoned_time()
1357
- : zone_(zoned_traits<TimeZonePtr>::default_zone())
1358
- {}
1359
-
1360
- template <class Duration, class TimeZonePtr>
1361
- #if !defined(_MSC_VER) || (_MSC_VER > 1900)
1362
- template <class T, class>
1363
- #endif
1364
- inline
1365
- zoned_time<Duration, TimeZonePtr>::zoned_time(const sys_time<Duration>& st)
1366
- : zone_(zoned_traits<TimeZonePtr>::default_zone())
1367
- , tp_(st)
1368
- {}
1369
-
1370
- template <class Duration, class TimeZonePtr>
1371
- inline
1372
- zoned_time<Duration, TimeZonePtr>::zoned_time(TimeZonePtr z)
1373
- : zone_(std::move(z))
1374
- {assert(detail::to_raw_pointer(zone_) != nullptr);}
1375
-
1376
- #if HAS_STRING_VIEW
1377
-
1378
- template <class Duration, class TimeZonePtr>
1379
- template <class T, class>
1380
- inline
1381
- zoned_time<Duration, TimeZonePtr>::zoned_time(std::string_view name)
1382
- : zoned_time(zoned_traits<TimeZonePtr>::locate_zone(name))
1383
- {}
1384
-
1385
- #else // !HAS_STRING_VIEW
1386
-
1387
- template <class Duration, class TimeZonePtr>
1388
- #if !defined(_MSC_VER) || (_MSC_VER > 1900)
1389
- template <class T, class>
1390
- #endif
1391
- inline
1392
- zoned_time<Duration, TimeZonePtr>::zoned_time(const std::string& name)
1393
- : zoned_time(zoned_traits<TimeZonePtr>::locate_zone(name))
1394
- {}
1395
-
1396
- #endif // !HAS_STRING_VIEW
1397
-
1398
- template <class Duration, class TimeZonePtr>
1399
- template <class Duration2, class>
1400
- inline
1401
- zoned_time<Duration, TimeZonePtr>::zoned_time(const zoned_time<Duration2, TimeZonePtr>& zt) NOEXCEPT
1402
- : zone_(zt.zone_)
1403
- , tp_(zt.tp_)
1404
- {}
1405
-
1406
- template <class Duration, class TimeZonePtr>
1407
- inline
1408
- zoned_time<Duration, TimeZonePtr>::zoned_time(TimeZonePtr z, const sys_time<Duration>& st)
1409
- : zone_(std::move(z))
1410
- , tp_(st)
1411
- {}
1412
-
1413
- template <class Duration, class TimeZonePtr>
1414
- #if !defined(_MSC_VER) || (_MSC_VER > 1900)
1415
- template <class T, class>
1416
- #endif
1417
- inline
1418
- zoned_time<Duration, TimeZonePtr>::zoned_time(TimeZonePtr z, const local_time<Duration>& t)
1419
- : zone_(std::move(z))
1420
- , tp_(zone_->to_sys(t))
1421
- {}
1422
-
1423
- template <class Duration, class TimeZonePtr>
1424
- #if !defined(_MSC_VER) || (_MSC_VER > 1900)
1425
- template <class T, class>
1426
- #endif
1427
- inline
1428
- zoned_time<Duration, TimeZonePtr>::zoned_time(TimeZonePtr z, const local_time<Duration>& t,
1429
- choose c)
1430
- : zone_(std::move(z))
1431
- , tp_(zone_->to_sys(t, c))
1432
- {}
1433
-
1434
- template <class Duration, class TimeZonePtr>
1435
- template <class Duration2, class TimeZonePtr2, class>
1436
- inline
1437
- zoned_time<Duration, TimeZonePtr>::zoned_time(TimeZonePtr z,
1438
- const zoned_time<Duration2, TimeZonePtr2>& zt)
1439
- : zone_(std::move(z))
1440
- , tp_(zt.tp_)
1441
- {}
1442
-
1443
- template <class Duration, class TimeZonePtr>
1444
- template <class Duration2, class TimeZonePtr2, class>
1445
- inline
1446
- zoned_time<Duration, TimeZonePtr>::zoned_time(TimeZonePtr z,
1447
- const zoned_time<Duration2, TimeZonePtr2>& zt, choose)
1448
- : zoned_time(std::move(z), zt)
1449
- {}
1450
-
1451
- #if HAS_STRING_VIEW
1452
-
1453
- template <class Duration, class TimeZonePtr>
1454
- template <class T, class>
1455
- inline
1456
- zoned_time<Duration, TimeZonePtr>::zoned_time(std::string_view name,
1457
- const sys_time<Duration>& st)
1458
- : zoned_time(zoned_traits<TimeZonePtr>::locate_zone(name), st)
1459
- {}
1460
-
1461
- template <class Duration, class TimeZonePtr>
1462
- template <class T, class>
1463
- inline
1464
- zoned_time<Duration, TimeZonePtr>::zoned_time(std::string_view name,
1465
- const local_time<Duration>& t)
1466
- : zoned_time(zoned_traits<TimeZonePtr>::locate_zone(name), t)
1467
- {}
1468
-
1469
- template <class Duration, class TimeZonePtr>
1470
- template <class T, class>
1471
- inline
1472
- zoned_time<Duration, TimeZonePtr>::zoned_time(std::string_view name,
1473
- const local_time<Duration>& t, choose c)
1474
- : zoned_time(zoned_traits<TimeZonePtr>::locate_zone(name), t, c)
1475
- {}
1476
-
1477
- template <class Duration, class TimeZonePtr>
1478
- template <class Duration2, class TimeZonePtr2, class, class>
1479
- inline
1480
- zoned_time<Duration, TimeZonePtr>::zoned_time(std::string_view name,
1481
- const zoned_time<Duration2, TimeZonePtr2>& zt)
1482
- : zoned_time(zoned_traits<TimeZonePtr>::locate_zone(name), zt)
1483
- {}
1484
-
1485
- template <class Duration, class TimeZonePtr>
1486
- template <class Duration2, class TimeZonePtr2, class, class>
1487
- inline
1488
- zoned_time<Duration, TimeZonePtr>::zoned_time(std::string_view name,
1489
- const zoned_time<Duration2, TimeZonePtr2>& zt,
1490
- choose c)
1491
- : zoned_time(zoned_traits<TimeZonePtr>::locate_zone(name), zt, c)
1492
- {}
1493
-
1494
- #else // !HAS_STRING_VIEW
1495
-
1496
- template <class Duration, class TimeZonePtr>
1497
- #if !defined(_MSC_VER) || (_MSC_VER > 1900)
1498
- template <class T, class>
1499
- #endif
1500
- inline
1501
- zoned_time<Duration, TimeZonePtr>::zoned_time(const std::string& name,
1502
- const sys_time<Duration>& st)
1503
- : zoned_time(zoned_traits<TimeZonePtr>::locate_zone(name), st)
1504
- {}
1505
-
1506
- template <class Duration, class TimeZonePtr>
1507
- #if !defined(_MSC_VER) || (_MSC_VER > 1900)
1508
- template <class T, class>
1509
- #endif
1510
- inline
1511
- zoned_time<Duration, TimeZonePtr>::zoned_time(const char* name,
1512
- const sys_time<Duration>& st)
1513
- : zoned_time(zoned_traits<TimeZonePtr>::locate_zone(name), st)
1514
- {}
1515
-
1516
- template <class Duration, class TimeZonePtr>
1517
- #if !defined(_MSC_VER) || (_MSC_VER > 1900)
1518
- template <class T, class>
1519
- #endif
1520
- inline
1521
- zoned_time<Duration, TimeZonePtr>::zoned_time(const std::string& name,
1522
- const local_time<Duration>& t)
1523
- : zoned_time(zoned_traits<TimeZonePtr>::locate_zone(name), t)
1524
- {}
1525
-
1526
- template <class Duration, class TimeZonePtr>
1527
- #if !defined(_MSC_VER) || (_MSC_VER > 1900)
1528
- template <class T, class>
1529
- #endif
1530
- inline
1531
- zoned_time<Duration, TimeZonePtr>::zoned_time(const char* name,
1532
- const local_time<Duration>& t)
1533
- : zoned_time(zoned_traits<TimeZonePtr>::locate_zone(name), t)
1534
- {}
1535
-
1536
- template <class Duration, class TimeZonePtr>
1537
- #if !defined(_MSC_VER) || (_MSC_VER > 1900)
1538
- template <class T, class>
1539
- #endif
1540
- inline
1541
- zoned_time<Duration, TimeZonePtr>::zoned_time(const std::string& name,
1542
- const local_time<Duration>& t, choose c)
1543
- : zoned_time(zoned_traits<TimeZonePtr>::locate_zone(name), t, c)
1544
- {}
1545
-
1546
- template <class Duration, class TimeZonePtr>
1547
- #if !defined(_MSC_VER) || (_MSC_VER > 1900)
1548
- template <class T, class>
1549
- #endif
1550
- inline
1551
- zoned_time<Duration, TimeZonePtr>::zoned_time(const char* name,
1552
- const local_time<Duration>& t, choose c)
1553
- : zoned_time(zoned_traits<TimeZonePtr>::locate_zone(name), t, c)
1554
- {}
1555
-
1556
- template <class Duration, class TimeZonePtr>
1557
- #if !defined(_MSC_VER) || (_MSC_VER > 1900)
1558
- template <class Duration2, class TimeZonePtr2, class, class>
1559
- #else
1560
- template <class Duration2, class TimeZonePtr2>
1561
- #endif
1562
- inline
1563
- zoned_time<Duration, TimeZonePtr>::zoned_time(const std::string& name,
1564
- const zoned_time<Duration2, TimeZonePtr2>& zt)
1565
- : zoned_time(zoned_traits<TimeZonePtr>::locate_zone(name), zt)
1566
- {}
1567
-
1568
- template <class Duration, class TimeZonePtr>
1569
- #if !defined(_MSC_VER) || (_MSC_VER > 1900)
1570
- template <class Duration2, class TimeZonePtr2, class, class>
1571
- #else
1572
- template <class Duration2, class TimeZonePtr2>
1573
- #endif
1574
- inline
1575
- zoned_time<Duration, TimeZonePtr>::zoned_time(const char* name,
1576
- const zoned_time<Duration2, TimeZonePtr2>& zt)
1577
- : zoned_time(zoned_traits<TimeZonePtr>::locate_zone(name), zt)
1578
- {}
1579
-
1580
- template <class Duration, class TimeZonePtr>
1581
- #if !defined(_MSC_VER) || (_MSC_VER > 1900)
1582
- template <class Duration2, class TimeZonePtr2, class, class>
1583
- #else
1584
- template <class Duration2, class TimeZonePtr2>
1585
- #endif
1586
- inline
1587
- zoned_time<Duration, TimeZonePtr>::zoned_time(const std::string& name,
1588
- const zoned_time<Duration2, TimeZonePtr2>& zt,
1589
- choose c)
1590
- : zoned_time(zoned_traits<TimeZonePtr>::locate_zone(name), zt, c)
1591
- {}
1592
-
1593
- template <class Duration, class TimeZonePtr>
1594
- #if !defined(_MSC_VER) || (_MSC_VER > 1900)
1595
- template <class Duration2, class TimeZonePtr2, class, class>
1596
- #else
1597
- template <class Duration2, class TimeZonePtr2>
1598
- #endif
1599
- inline
1600
- zoned_time<Duration, TimeZonePtr>::zoned_time(const char* name,
1601
- const zoned_time<Duration2, TimeZonePtr2>& zt,
1602
- choose c)
1603
- : zoned_time(zoned_traits<TimeZonePtr>::locate_zone(name), zt, c)
1604
- {}
1605
-
1606
- #endif // HAS_STRING_VIEW
1607
-
1608
- template <class Duration, class TimeZonePtr>
1609
- inline
1610
- zoned_time<Duration, TimeZonePtr>&
1611
- zoned_time<Duration, TimeZonePtr>::operator=(const sys_time<Duration>& st)
1612
- {
1613
- tp_ = st;
1614
- return *this;
1615
- }
1616
-
1617
- template <class Duration, class TimeZonePtr>
1618
- inline
1619
- zoned_time<Duration, TimeZonePtr>&
1620
- zoned_time<Duration, TimeZonePtr>::operator=(const local_time<Duration>& ut)
1621
- {
1622
- tp_ = zone_->to_sys(ut);
1623
- return *this;
1624
- }
1625
-
1626
- template <class Duration, class TimeZonePtr>
1627
- inline
1628
- zoned_time<Duration, TimeZonePtr>::operator local_time<typename zoned_time<Duration, TimeZonePtr>::duration>() const
1629
- {
1630
- return get_local_time();
1631
- }
1632
-
1633
- template <class Duration, class TimeZonePtr>
1634
- inline
1635
- zoned_time<Duration, TimeZonePtr>::operator sys_time<typename zoned_time<Duration, TimeZonePtr>::duration>() const
1636
- {
1637
- return get_sys_time();
1638
- }
1639
-
1640
- template <class Duration, class TimeZonePtr>
1641
- inline
1642
- TimeZonePtr
1643
- zoned_time<Duration, TimeZonePtr>::get_time_zone() const
1644
- {
1645
- return zone_;
1646
- }
1647
-
1648
- template <class Duration, class TimeZonePtr>
1649
- inline
1650
- local_time<typename zoned_time<Duration, TimeZonePtr>::duration>
1651
- zoned_time<Duration, TimeZonePtr>::get_local_time() const
1652
- {
1653
- return zone_->to_local(tp_);
1654
- }
1655
-
1656
- template <class Duration, class TimeZonePtr>
1657
- inline
1658
- sys_time<typename zoned_time<Duration, TimeZonePtr>::duration>
1659
- zoned_time<Duration, TimeZonePtr>::get_sys_time() const
1660
- {
1661
- return tp_;
1662
- }
1663
-
1664
- template <class Duration, class TimeZonePtr>
1665
- inline
1666
- sys_info
1667
- zoned_time<Duration, TimeZonePtr>::get_info() const
1668
- {
1669
- return zone_->get_info(tp_);
1670
- }
1671
-
1672
- // make_zoned_time
1673
-
1674
- inline
1675
- zoned_time<std::chrono::seconds>
1676
- make_zoned()
1677
- {
1678
- return zoned_time<std::chrono::seconds>();
1679
- }
1680
-
1681
- template <class Duration>
1682
- inline
1683
- zoned_time<typename std::common_type<Duration, std::chrono::seconds>::type>
1684
- make_zoned(const sys_time<Duration>& tp)
1685
- {
1686
- return zoned_time<typename std::common_type<Duration, std::chrono::seconds>::type>(tp);
1687
- }
1688
-
1689
- template <class TimeZonePtr
1690
- #if !defined(_MSC_VER) || (_MSC_VER > 1900)
1691
- , class = typename std::enable_if
1692
- <
1693
- std::is_class
1694
- <
1695
- typename std::decay
1696
- <
1697
- decltype(*detail::to_raw_pointer(std::declval<TimeZonePtr&>()))
1698
- >::type
1699
- >{}
1700
- >::type
1701
- #endif
1702
- >
1703
- inline
1704
- zoned_time<std::chrono::seconds, TimeZonePtr>
1705
- make_zoned(TimeZonePtr z)
1706
- {
1707
- return zoned_time<std::chrono::seconds, TimeZonePtr>(std::move(z));
1708
- }
1709
-
1710
- inline
1711
- zoned_seconds
1712
- make_zoned(const std::string& name)
1713
- {
1714
- return zoned_seconds(name);
1715
- }
1716
-
1717
- template <class Duration, class TimeZonePtr
1718
- #if !defined(_MSC_VER) || (_MSC_VER > 1900)
1719
- , class = typename std::enable_if
1720
- <
1721
- std::is_class<typename std::decay<decltype(*std::declval<TimeZonePtr&>())>::type>{}
1722
- >::type
1723
- #endif
1724
- >
1725
- inline
1726
- zoned_time<typename std::common_type<Duration, std::chrono::seconds>::type, TimeZonePtr>
1727
- make_zoned(TimeZonePtr zone, const local_time<Duration>& tp)
1728
- {
1729
- return zoned_time<typename std::common_type<Duration, std::chrono::seconds>::type,
1730
- TimeZonePtr>(std::move(zone), tp);
1731
- }
1732
-
1733
- template <class Duration, class TimeZonePtr
1734
- #if !defined(_MSC_VER) || (_MSC_VER > 1900)
1735
- , class = typename std::enable_if
1736
- <
1737
- std::is_class<typename std::decay<decltype(*std::declval<TimeZonePtr&>())>::type>{}
1738
- >::type
1739
- #endif
1740
- >
1741
- inline
1742
- zoned_time<typename std::common_type<Duration, std::chrono::seconds>::type, TimeZonePtr>
1743
- make_zoned(TimeZonePtr zone, const local_time<Duration>& tp, choose c)
1744
- {
1745
- return zoned_time<typename std::common_type<Duration, std::chrono::seconds>::type,
1746
- TimeZonePtr>(std::move(zone), tp, c);
1747
- }
1748
-
1749
- template <class Duration>
1750
- inline
1751
- zoned_time<typename std::common_type<Duration, std::chrono::seconds>::type>
1752
- make_zoned(const std::string& name, const local_time<Duration>& tp)
1753
- {
1754
- return zoned_time<typename std::common_type<Duration,
1755
- std::chrono::seconds>::type>(name, tp);
1756
- }
1757
-
1758
- template <class Duration>
1759
- inline
1760
- zoned_time<typename std::common_type<Duration, std::chrono::seconds>::type>
1761
- make_zoned(const std::string& name, const local_time<Duration>& tp, choose c)
1762
- {
1763
- return zoned_time<typename std::common_type<Duration,
1764
- std::chrono::seconds>::type>(name, tp, c);
1765
- }
1766
-
1767
- template <class Duration, class TimeZonePtr>
1768
- inline
1769
- zoned_time<Duration, TimeZonePtr>
1770
- make_zoned(TimeZonePtr zone, const zoned_time<Duration, TimeZonePtr>& zt)
1771
- {
1772
- return zoned_time<Duration, TimeZonePtr>(std::move(zone), zt);
1773
- }
1774
-
1775
- template <class Duration, class TimeZonePtr>
1776
- inline
1777
- zoned_time<Duration, TimeZonePtr>
1778
- make_zoned(const std::string& name, const zoned_time<Duration, TimeZonePtr>& zt)
1779
- {
1780
- return zoned_time<Duration, TimeZonePtr>(name, zt);
1781
- }
1782
-
1783
- template <class Duration, class TimeZonePtr>
1784
- inline
1785
- zoned_time<Duration, TimeZonePtr>
1786
- make_zoned(TimeZonePtr zone, const zoned_time<Duration, TimeZonePtr>& zt, choose c)
1787
- {
1788
- return zoned_time<Duration, TimeZonePtr>(std::move(zone), zt, c);
1789
- }
1790
-
1791
- template <class Duration, class TimeZonePtr>
1792
- inline
1793
- zoned_time<Duration, TimeZonePtr>
1794
- make_zoned(const std::string& name, const zoned_time<Duration, TimeZonePtr>& zt, choose c)
1795
- {
1796
- return zoned_time<Duration, TimeZonePtr>(name, zt, c);
1797
- }
1798
-
1799
- template <class Duration, class TimeZonePtr
1800
- #if !defined(_MSC_VER) || (_MSC_VER > 1900)
1801
- , class = typename std::enable_if
1802
- <
1803
- std::is_class<typename std::decay<decltype(*std::declval<TimeZonePtr&>())>::type>{}
1804
- >::type
1805
- #endif
1806
- >
1807
- inline
1808
- zoned_time<typename std::common_type<Duration, std::chrono::seconds>::type, TimeZonePtr>
1809
- make_zoned(TimeZonePtr zone, const sys_time<Duration>& st)
1810
- {
1811
- return zoned_time<typename std::common_type<Duration, std::chrono::seconds>::type,
1812
- TimeZonePtr>(std::move(zone), st);
1813
- }
1814
-
1815
- template <class Duration>
1816
- inline
1817
- zoned_time<typename std::common_type<Duration, std::chrono::seconds>::type>
1818
- make_zoned(const std::string& name, const sys_time<Duration>& st)
1819
- {
1820
- return zoned_time<typename std::common_type<Duration,
1821
- std::chrono::seconds>::type>(name, st);
1822
- }
1823
-
1824
- template <class CharT, class Traits, class Duration, class TimeZonePtr>
1825
- std::basic_ostream<CharT, Traits>&
1826
- to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
1827
- const zoned_time<Duration, TimeZonePtr>& tp)
1828
- {
1829
- using duration = typename zoned_time<Duration, TimeZonePtr>::duration;
1830
- using LT = local_time<duration>;
1831
- auto const st = tp.get_sys_time();
1832
- auto const info = tp.get_time_zone()->get_info(st);
1833
- return to_stream(os, fmt, LT{(st+info.offset).time_since_epoch()},
1834
- &info.abbrev, &info.offset);
1835
- }
1836
-
1837
- template <class CharT, class Traits, class Duration, class TimeZonePtr>
1838
- inline
1839
- std::basic_ostream<CharT, Traits>&
1840
- operator<<(std::basic_ostream<CharT, Traits>& os, const zoned_time<Duration, TimeZonePtr>& t)
1841
- {
1842
- const CharT fmt[] = {'%', 'F', ' ', '%', 'T', ' ', '%', 'Z', CharT{}};
1843
- return to_stream(os, fmt, t);
1844
- }
1845
-
1846
- #if !MISSING_LEAP_SECONDS
1847
-
1848
- class utc_clock
1849
- {
1850
- public:
1851
- using duration = std::chrono::system_clock::duration;
1852
- using rep = duration::rep;
1853
- using period = duration::period;
1854
- using time_point = std::chrono::time_point<utc_clock>;
1855
- static CONSTDATA bool is_steady = false;
1856
-
1857
- static time_point now();
1858
-
1859
- template<typename Duration>
1860
- static
1861
- std::chrono::time_point<std::chrono::system_clock, typename std::common_type<Duration, std::chrono::seconds>::type>
1862
- to_sys(const std::chrono::time_point<utc_clock, Duration>&);
1863
-
1864
- template<typename Duration>
1865
- static
1866
- std::chrono::time_point<utc_clock, typename std::common_type<Duration, std::chrono::seconds>::type>
1867
- from_sys(const std::chrono::time_point<std::chrono::system_clock, Duration>&);
1868
-
1869
- template<typename Duration>
1870
- static
1871
- std::chrono::time_point<local_t, typename std::common_type<Duration, std::chrono::seconds>::type>
1872
- to_local(const std::chrono::time_point<utc_clock, Duration>&);
1873
-
1874
- template<typename Duration>
1875
- static
1876
- std::chrono::time_point<utc_clock, typename std::common_type<Duration, std::chrono::seconds>::type>
1877
- from_local(const std::chrono::time_point<local_t, Duration>&);
1878
- };
1879
-
1880
- template <class Duration>
1881
- using utc_time = std::chrono::time_point<utc_clock, Duration>;
1882
-
1883
- using utc_seconds = utc_time<std::chrono::seconds>;
1884
-
1885
- template <class Duration>
1886
- utc_time<typename std::common_type<Duration, std::chrono::seconds>::type>
1887
- utc_clock::from_sys(const sys_time<Duration>& st)
1888
- {
1889
- using namespace std::chrono;
1890
- using CD = typename std::common_type<Duration, seconds>::type;
1891
- auto const& leaps = get_tzdb().leaps;
1892
- auto const lt = std::upper_bound(leaps.begin(), leaps.end(), st);
1893
- return utc_time<CD>{st.time_since_epoch() + seconds{lt-leaps.begin()}};
1894
- }
1895
-
1896
- // Return pair<is_leap_second, seconds{number_of_leap_seconds_since_1970}>
1897
- // first is true if ut is during a leap second insertion, otherwise false.
1898
- // If ut is during a leap second insertion, that leap second is included in the count
1899
- template <class Duration>
1900
- std::pair<bool, std::chrono::seconds>
1901
- is_leap_second(date::utc_time<Duration> const& ut)
1902
- {
1903
- using namespace date;
1904
- using namespace std::chrono;
1905
- using duration = typename std::common_type<Duration, seconds>::type;
1906
- auto const& leaps = get_tzdb().leaps;
1907
- auto tp = sys_time<duration>{ut.time_since_epoch()};
1908
- auto const lt = std::upper_bound(leaps.begin(), leaps.end(), tp);
1909
- auto ds = seconds{lt-leaps.begin()};
1910
- tp -= ds;
1911
- auto ls = false;
1912
- if (lt > leaps.begin())
1913
- {
1914
- if (tp < lt[-1])
1915
- {
1916
- if (tp >= lt[-1].date() - seconds{1})
1917
- ls = true;
1918
- else
1919
- --ds;
1920
- }
1921
- }
1922
- return {ls, ds};
1923
- }
1924
-
1925
- template <class Duration>
1926
- sys_time<typename std::common_type<Duration, std::chrono::seconds>::type>
1927
- utc_clock::to_sys(const utc_time<Duration>& ut)
1928
- {
1929
- using namespace std::chrono;
1930
- using CD = typename std::common_type<Duration, seconds>::type;
1931
- auto ls = is_leap_second(ut);
1932
- auto tp = sys_time<CD>{ut.time_since_epoch() - ls.second};
1933
- if (ls.first)
1934
- tp = floor<seconds>(tp) + seconds{1} - CD{1};
1935
- return tp;
1936
- }
1937
-
1938
- inline
1939
- utc_clock::time_point
1940
- utc_clock::now()
1941
- {
1942
- using namespace std::chrono;
1943
- return from_sys(system_clock::now());
1944
- }
1945
-
1946
- template <class Duration>
1947
- utc_time<typename std::common_type<Duration, std::chrono::seconds>::type>
1948
- utc_clock::from_local(const local_time<Duration>& st)
1949
- {
1950
- return from_sys(sys_time<Duration>{st.time_since_epoch()});
1951
- }
1952
-
1953
- template <class Duration>
1954
- local_time<typename std::common_type<Duration, std::chrono::seconds>::type>
1955
- utc_clock::to_local(const utc_time<Duration>& ut)
1956
- {
1957
- using CD = typename std::common_type<Duration, std::chrono::seconds>::type;
1958
- return local_time<CD>{to_sys(ut).time_since_epoch()};
1959
- }
1960
-
1961
- template <class CharT, class Traits, class Duration>
1962
- std::basic_ostream<CharT, Traits>&
1963
- to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
1964
- const utc_time<Duration>& t)
1965
- {
1966
- using namespace std::chrono;
1967
- using CT = typename std::common_type<Duration, seconds>::type;
1968
- const std::string abbrev("UTC");
1969
- CONSTDATA seconds offset{0};
1970
- auto ls = is_leap_second(t);
1971
- auto tp = sys_time<CT>{t.time_since_epoch() - ls.second};
1972
- auto const sd = floor<days>(tp);
1973
- year_month_day ymd = sd;
1974
- auto time = make_time(tp - sys_seconds{sd});
1975
- time.seconds() += seconds{ls.first};
1976
- fields<CT> fds{ymd, time};
1977
- return to_stream(os, fmt, fds, &abbrev, &offset);
1978
- }
1979
-
1980
- template <class CharT, class Traits, class Duration>
1981
- std::basic_ostream<CharT, Traits>&
1982
- operator<<(std::basic_ostream<CharT, Traits>& os, const utc_time<Duration>& t)
1983
- {
1984
- const CharT fmt[] = {'%', 'F', ' ', '%', 'T', CharT{}};
1985
- return to_stream(os, fmt, t);
1986
- }
1987
-
1988
- template <class Duration, class CharT, class Traits, class Alloc = std::allocator<CharT>>
1989
- std::basic_istream<CharT, Traits>&
1990
- from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
1991
- utc_time<Duration>& tp, std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
1992
- std::chrono::minutes* offset = nullptr)
1993
- {
1994
- using namespace std::chrono;
1995
- using CT = typename std::common_type<Duration, seconds>::type;
1996
- minutes offset_local{};
1997
- auto offptr = offset ? offset : &offset_local;
1998
- fields<CT> fds{};
1999
- fds.has_tod = true;
2000
- from_stream(is, fmt, fds, abbrev, offptr);
2001
- if (!fds.ymd.ok())
2002
- is.setstate(std::ios::failbit);
2003
- if (!is.fail())
2004
- {
2005
- bool is_60_sec = fds.tod.seconds() == seconds{60};
2006
- if (is_60_sec)
2007
- fds.tod.seconds() -= seconds{1};
2008
- auto tmp = utc_clock::from_sys(sys_days(fds.ymd) - *offptr + fds.tod.to_duration());
2009
- if (is_60_sec)
2010
- tmp += seconds{1};
2011
- if (is_60_sec != is_leap_second(tmp).first || !fds.tod.in_conventional_range())
2012
- {
2013
- is.setstate(std::ios::failbit);
2014
- return is;
2015
- }
2016
- tp = time_point_cast<Duration>(tmp);
2017
- }
2018
- return is;
2019
- }
2020
-
2021
- // tai_clock
2022
-
2023
- class tai_clock
2024
- {
2025
- public:
2026
- using duration = std::chrono::system_clock::duration;
2027
- using rep = duration::rep;
2028
- using period = duration::period;
2029
- using time_point = std::chrono::time_point<tai_clock>;
2030
- static const bool is_steady = false;
2031
-
2032
- static time_point now();
2033
-
2034
- template<typename Duration>
2035
- static
2036
- std::chrono::time_point<utc_clock, typename std::common_type<Duration, std::chrono::seconds>::type>
2037
- to_utc(const std::chrono::time_point<tai_clock, Duration>&) NOEXCEPT;
2038
-
2039
- template<typename Duration>
2040
- static
2041
- std::chrono::time_point<tai_clock, typename std::common_type<Duration, std::chrono::seconds>::type>
2042
- from_utc(const std::chrono::time_point<utc_clock, Duration>&) NOEXCEPT;
2043
-
2044
- template<typename Duration>
2045
- static
2046
- std::chrono::time_point<local_t, typename std::common_type<Duration, date::days>::type>
2047
- to_local(const std::chrono::time_point<tai_clock, Duration>&) NOEXCEPT;
2048
-
2049
- template<typename Duration>
2050
- static
2051
- std::chrono::time_point<tai_clock, typename std::common_type<Duration, date::days>::type>
2052
- from_local(const std::chrono::time_point<local_t, Duration>&) NOEXCEPT;
2053
- };
2054
-
2055
- template <class Duration>
2056
- using tai_time = std::chrono::time_point<tai_clock, Duration>;
2057
-
2058
- using tai_seconds = tai_time<std::chrono::seconds>;
2059
-
2060
- template <class Duration>
2061
- inline
2062
- utc_time<typename std::common_type<Duration, std::chrono::seconds>::type>
2063
- tai_clock::to_utc(const tai_time<Duration>& t) NOEXCEPT
2064
- {
2065
- using namespace std::chrono;
2066
- using CD = typename std::common_type<Duration, seconds>::type;
2067
- return utc_time<CD>{t.time_since_epoch()} -
2068
- (sys_days(year{1970}/January/1) - sys_days(year{1958}/January/1) + seconds{10});
2069
- }
2070
-
2071
- template <class Duration>
2072
- inline
2073
- tai_time<typename std::common_type<Duration, std::chrono::seconds>::type>
2074
- tai_clock::from_utc(const utc_time<Duration>& t) NOEXCEPT
2075
- {
2076
- using namespace std::chrono;
2077
- using CD = typename std::common_type<Duration, seconds>::type;
2078
- return tai_time<CD>{t.time_since_epoch()} +
2079
- (sys_days(year{1970}/January/1) - sys_days(year{1958}/January/1) + seconds{10});
2080
- }
2081
-
2082
- inline
2083
- tai_clock::time_point
2084
- tai_clock::now()
2085
- {
2086
- using namespace std::chrono;
2087
- return from_utc(utc_clock::now());
2088
- }
2089
-
2090
- template <class Duration>
2091
- inline
2092
- local_time<typename std::common_type<Duration, date::days>::type>
2093
- tai_clock::to_local(const tai_time<Duration>& t) NOEXCEPT
2094
- {
2095
- using CD = typename std::common_type<Duration, date::days>::type;
2096
- return local_time<CD>{t.time_since_epoch()} -
2097
- (local_days(year{1970}/January/1) - local_days(year{1958}/January/1));
2098
- }
2099
-
2100
- template <class Duration>
2101
- inline
2102
- tai_time<typename std::common_type<Duration, date::days>::type>
2103
- tai_clock::from_local(const local_time<Duration>& t) NOEXCEPT
2104
- {
2105
- using CD = typename std::common_type<Duration, date::days>::type;
2106
- return tai_time<CD>{t.time_since_epoch()} +
2107
- (local_days(year{1970}/January/1) - local_days(year{1958}/January/1));
2108
- }
2109
-
2110
- template <class CharT, class Traits, class Duration>
2111
- std::basic_ostream<CharT, Traits>&
2112
- to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
2113
- const tai_time<Duration>& t)
2114
- {
2115
- const std::string abbrev("TAI");
2116
- CONSTDATA std::chrono::seconds offset{0};
2117
- return to_stream(os, fmt, tai_clock::to_local(t), &abbrev, &offset);
2118
- }
2119
-
2120
- template <class CharT, class Traits, class Duration>
2121
- std::basic_ostream<CharT, Traits>&
2122
- operator<<(std::basic_ostream<CharT, Traits>& os, const tai_time<Duration>& t)
2123
- {
2124
- const CharT fmt[] = {'%', 'F', ' ', '%', 'T', CharT{}};
2125
- return to_stream(os, fmt, t);
2126
- }
2127
-
2128
- template <class Duration, class CharT, class Traits, class Alloc = std::allocator<CharT>>
2129
- std::basic_istream<CharT, Traits>&
2130
- from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
2131
- tai_time<Duration>& tp,
2132
- std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
2133
- std::chrono::minutes* offset = nullptr)
2134
- {
2135
- local_time<Duration> lp;
2136
- from_stream(is, fmt, lp, abbrev, offset);
2137
- if (!is.fail())
2138
- tp = tai_clock::from_local(lp);
2139
- return is;
2140
- }
2141
-
2142
- // gps_clock
2143
-
2144
- class gps_clock
2145
- {
2146
- public:
2147
- using duration = std::chrono::system_clock::duration;
2148
- using rep = duration::rep;
2149
- using period = duration::period;
2150
- using time_point = std::chrono::time_point<gps_clock>;
2151
- static const bool is_steady = false;
2152
-
2153
- static time_point now();
2154
-
2155
- template<typename Duration>
2156
- static
2157
- std::chrono::time_point<utc_clock, typename std::common_type<Duration, std::chrono::seconds>::type>
2158
- to_utc(const std::chrono::time_point<gps_clock, Duration>&) NOEXCEPT;
2159
-
2160
- template<typename Duration>
2161
- static
2162
- std::chrono::time_point<gps_clock, typename std::common_type<Duration, std::chrono::seconds>::type>
2163
- from_utc(const std::chrono::time_point<utc_clock, Duration>&) NOEXCEPT;
2164
-
2165
- template<typename Duration>
2166
- static
2167
- std::chrono::time_point<local_t, typename std::common_type<Duration, date::days>::type>
2168
- to_local(const std::chrono::time_point<gps_clock, Duration>&) NOEXCEPT;
2169
-
2170
- template<typename Duration>
2171
- static
2172
- std::chrono::time_point<gps_clock, typename std::common_type<Duration, date::days>::type>
2173
- from_local(const std::chrono::time_point<local_t, Duration>&) NOEXCEPT;
2174
- };
2175
-
2176
- template <class Duration>
2177
- using gps_time = std::chrono::time_point<gps_clock, Duration>;
2178
-
2179
- using gps_seconds = gps_time<std::chrono::seconds>;
2180
-
2181
- template <class Duration>
2182
- inline
2183
- utc_time<typename std::common_type<Duration, std::chrono::seconds>::type>
2184
- gps_clock::to_utc(const gps_time<Duration>& t) NOEXCEPT
2185
- {
2186
- using namespace std::chrono;
2187
- using CD = typename std::common_type<Duration, seconds>::type;
2188
- return utc_time<CD>{t.time_since_epoch()} +
2189
- (sys_days(year{1980}/January/Sunday[1]) - sys_days(year{1970}/January/1) +
2190
- seconds{9});
2191
- }
2192
-
2193
- template <class Duration>
2194
- inline
2195
- gps_time<typename std::common_type<Duration, std::chrono::seconds>::type>
2196
- gps_clock::from_utc(const utc_time<Duration>& t) NOEXCEPT
2197
- {
2198
- using namespace std::chrono;
2199
- using CD = typename std::common_type<Duration, seconds>::type;
2200
- return gps_time<CD>{t.time_since_epoch()} -
2201
- (sys_days(year{1980}/January/Sunday[1]) - sys_days(year{1970}/January/1) +
2202
- seconds{9});
2203
- }
2204
-
2205
- inline
2206
- gps_clock::time_point
2207
- gps_clock::now()
2208
- {
2209
- using namespace std::chrono;
2210
- return from_utc(utc_clock::now());
2211
- }
2212
-
2213
- template <class Duration>
2214
- inline
2215
- local_time<typename std::common_type<Duration, date::days>::type>
2216
- gps_clock::to_local(const gps_time<Duration>& t) NOEXCEPT
2217
- {
2218
- using CD = typename std::common_type<Duration, date::days>::type;
2219
- return local_time<CD>{t.time_since_epoch()} +
2220
- (local_days(year{1980}/January/Sunday[1]) - local_days(year{1970}/January/1));
2221
- }
2222
-
2223
- template <class Duration>
2224
- inline
2225
- gps_time<typename std::common_type<Duration, date::days>::type>
2226
- gps_clock::from_local(const local_time<Duration>& t) NOEXCEPT
2227
- {
2228
- using CD = typename std::common_type<Duration, date::days>::type;
2229
- return gps_time<CD>{t.time_since_epoch()} -
2230
- (local_days(year{1980}/January/Sunday[1]) - local_days(year{1970}/January/1));
2231
- }
2232
-
2233
-
2234
- template <class CharT, class Traits, class Duration>
2235
- std::basic_ostream<CharT, Traits>&
2236
- to_stream(std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
2237
- const gps_time<Duration>& t)
2238
- {
2239
- const std::string abbrev("GPS");
2240
- CONSTDATA std::chrono::seconds offset{0};
2241
- return to_stream(os, fmt, gps_clock::to_local(t), &abbrev, &offset);
2242
- }
2243
-
2244
- template <class CharT, class Traits, class Duration>
2245
- std::basic_ostream<CharT, Traits>&
2246
- operator<<(std::basic_ostream<CharT, Traits>& os, const gps_time<Duration>& t)
2247
- {
2248
- const CharT fmt[] = {'%', 'F', ' ', '%', 'T', CharT{}};
2249
- return to_stream(os, fmt, t);
2250
- }
2251
-
2252
- template <class Duration, class CharT, class Traits, class Alloc = std::allocator<CharT>>
2253
- std::basic_istream<CharT, Traits>&
2254
- from_stream(std::basic_istream<CharT, Traits>& is, const CharT* fmt,
2255
- gps_time<Duration>& tp,
2256
- std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
2257
- std::chrono::minutes* offset = nullptr)
2258
- {
2259
- local_time<Duration> lp;
2260
- from_stream(is, fmt, lp, abbrev, offset);
2261
- if (!is.fail())
2262
- tp = gps_clock::from_local(lp);
2263
- return is;
2264
- }
2265
-
2266
- // clock_time_conversion
2267
-
2268
- template <class DstClock, class SrcClock>
2269
- struct clock_time_conversion
2270
- {};
2271
-
2272
- template <>
2273
- struct clock_time_conversion<std::chrono::system_clock, std::chrono::system_clock>
2274
- {
2275
- template <class Duration>
2276
- sys_time<Duration>
2277
- operator()(const sys_time<Duration>& st) const
2278
- {
2279
- return st;
2280
- }
2281
- };
2282
-
2283
- template <>
2284
- struct clock_time_conversion<utc_clock, utc_clock>
2285
- {
2286
- template <class Duration>
2287
- utc_time<Duration>
2288
- operator()(const utc_time<Duration>& ut) const
2289
- {
2290
- return ut;
2291
- }
2292
- };
2293
-
2294
- template<>
2295
- struct clock_time_conversion<local_t, local_t>
2296
- {
2297
- template <class Duration>
2298
- local_time<Duration>
2299
- operator()(const local_time<Duration>& lt) const
2300
- {
2301
- return lt;
2302
- }
2303
- };
2304
-
2305
- template <>
2306
- struct clock_time_conversion<utc_clock, std::chrono::system_clock>
2307
- {
2308
- template <class Duration>
2309
- utc_time<typename std::common_type<Duration, std::chrono::seconds>::type>
2310
- operator()(const sys_time<Duration>& st) const
2311
- {
2312
- return utc_clock::from_sys(st);
2313
- }
2314
- };
2315
-
2316
- template <>
2317
- struct clock_time_conversion<std::chrono::system_clock, utc_clock>
2318
- {
2319
- template <class Duration>
2320
- sys_time<typename std::common_type<Duration, std::chrono::seconds>::type>
2321
- operator()(const utc_time<Duration>& ut) const
2322
- {
2323
- return utc_clock::to_sys(ut);
2324
- }
2325
- };
2326
-
2327
- template<>
2328
- struct clock_time_conversion<local_t, std::chrono::system_clock>
2329
- {
2330
- template <class Duration>
2331
- local_time<Duration>
2332
- operator()(const sys_time<Duration>& st) const
2333
- {
2334
- return local_time<Duration>{st.time_since_epoch()};
2335
- }
2336
- };
2337
-
2338
- template<>
2339
- struct clock_time_conversion<std::chrono::system_clock, local_t>
2340
- {
2341
- template <class Duration>
2342
- sys_time<Duration>
2343
- operator()(const local_time<Duration>& lt) const
2344
- {
2345
- return sys_time<Duration>{lt.time_since_epoch()};
2346
- }
2347
- };
2348
-
2349
- template<>
2350
- struct clock_time_conversion<utc_clock, local_t>
2351
- {
2352
- template <class Duration>
2353
- utc_time<typename std::common_type<Duration, std::chrono::seconds>::type>
2354
- operator()(const local_time<Duration>& lt) const
2355
- {
2356
- return utc_clock::from_local(lt);
2357
- }
2358
- };
2359
-
2360
- template<>
2361
- struct clock_time_conversion<local_t, utc_clock>
2362
- {
2363
- template <class Duration>
2364
- local_time<typename std::common_type<Duration, std::chrono::seconds>::type>
2365
- operator()(const utc_time<Duration>& ut) const
2366
- {
2367
- return utc_clock::to_local(ut);
2368
- }
2369
- };
2370
-
2371
- template<typename Clock>
2372
- struct clock_time_conversion<Clock, Clock>
2373
- {
2374
- template <class Duration>
2375
- std::chrono::time_point<Clock, Duration>
2376
- operator()(const std::chrono::time_point<Clock, Duration>& tp) const
2377
- {
2378
- return tp;
2379
- }
2380
- };
2381
-
2382
- namespace ctc_detail
2383
- {
2384
-
2385
- template <class Clock, class Duration>
2386
- using time_point = std::chrono::time_point<Clock, Duration>;
2387
-
2388
- using std::declval;
2389
- using std::chrono::system_clock;
2390
-
2391
- //Check if TimePoint is time for given clock,
2392
- //if not emits hard error
2393
- template <class Clock, class TimePoint>
2394
- struct return_clock_time
2395
- {
2396
- using clock_time_point = time_point<Clock, typename TimePoint::duration>;
2397
- using type = TimePoint;
2398
-
2399
- static_assert(std::is_same<TimePoint, clock_time_point>::value,
2400
- "time point with appropariate clock shall be returned");
2401
- };
2402
-
2403
- // Check if Clock has to_sys method accepting TimePoint with given duration const& and
2404
- // returning sys_time. If so has nested type member equal to return type to_sys.
2405
- template <class Clock, class Duration, class = void>
2406
- struct return_to_sys
2407
- {};
2408
-
2409
- template <class Clock, class Duration>
2410
- struct return_to_sys
2411
- <
2412
- Clock, Duration,
2413
- decltype(Clock::to_sys(declval<time_point<Clock, Duration> const&>()), void())
2414
- >
2415
- : return_clock_time
2416
- <
2417
- system_clock,
2418
- decltype(Clock::to_sys(declval<time_point<Clock, Duration> const&>()))
2419
- >
2420
- {};
2421
-
2422
- // Similiar to above
2423
- template <class Clock, class Duration, class = void>
2424
- struct return_from_sys
2425
- {};
2426
-
2427
- template <class Clock, class Duration>
2428
- struct return_from_sys
2429
- <
2430
- Clock, Duration,
2431
- decltype(Clock::from_sys(declval<time_point<system_clock, Duration> const&>()),
2432
- void())
2433
- >
2434
- : return_clock_time
2435
- <
2436
- Clock,
2437
- decltype(Clock::from_sys(declval<time_point<system_clock, Duration> const&>()))
2438
- >
2439
- {};
2440
-
2441
- // Similiar to above
2442
- template <class Clock, class Duration, class = void>
2443
- struct return_to_utc
2444
- {};
2445
-
2446
- template <class Clock, class Duration>
2447
- struct return_to_utc
2448
- <
2449
- Clock, Duration,
2450
- decltype(Clock::to_utc(declval<time_point<Clock, Duration> const&>()), void())
2451
- >
2452
- : return_clock_time
2453
- <
2454
- utc_clock,
2455
- decltype(Clock::to_utc(declval<time_point<Clock, Duration> const&>()))>
2456
- {};
2457
-
2458
- // Similiar to above
2459
- template <class Clock, class Duration, class = void>
2460
- struct return_from_utc
2461
- {};
2462
-
2463
- template <class Clock, class Duration>
2464
- struct return_from_utc
2465
- <
2466
- Clock, Duration,
2467
- decltype(Clock::from_utc(declval<time_point<utc_clock, Duration> const&>()),
2468
- void())
2469
- >
2470
- : return_clock_time
2471
- <
2472
- Clock,
2473
- decltype(Clock::from_utc(declval<time_point<utc_clock, Duration> const&>()))
2474
- >
2475
- {};
2476
-
2477
- // Similiar to above
2478
- template<typename Clock, typename Duration, typename = void>
2479
- struct return_to_local
2480
- {};
2481
-
2482
- template<typename Clock, typename Duration>
2483
- struct return_to_local
2484
- <
2485
- Clock, Duration,
2486
- decltype(Clock::to_local(declval<time_point<Clock, Duration> const&>()),
2487
- void())
2488
- >
2489
- : return_clock_time
2490
- <
2491
- local_t,
2492
- decltype(Clock::to_local(declval<time_point<Clock, Duration> const&>()))
2493
- >
2494
- {};
2495
-
2496
- // Similiar to above
2497
- template<typename Clock, typename Duration, typename = void>
2498
- struct return_from_local
2499
- {};
2500
-
2501
- template<typename Clock, typename Duration>
2502
- struct return_from_local
2503
- <
2504
- Clock, Duration,
2505
- decltype(Clock::from_local(declval<time_point<local_t, Duration> const&>()),
2506
- void())
2507
- >
2508
- : return_clock_time
2509
- <
2510
- Clock,
2511
- decltype(Clock::from_local(declval<time_point<local_t, Duration> const&>()))
2512
- >
2513
- {};
2514
-
2515
- } // namespace ctc_detail
2516
-
2517
- template <class SrcClock>
2518
- struct clock_time_conversion<std::chrono::system_clock, SrcClock>
2519
- {
2520
- template <class Duration>
2521
- typename ctc_detail::return_to_sys<SrcClock, Duration>::type
2522
- operator()(const std::chrono::time_point<SrcClock, Duration>& tp) const
2523
- {
2524
- return SrcClock::to_sys(tp);
2525
- }
2526
- };
2527
-
2528
- template <class DstClock>
2529
- struct clock_time_conversion<DstClock, std::chrono::system_clock>
2530
- {
2531
- template <class Duration>
2532
- typename ctc_detail::return_from_sys<DstClock, Duration>::type
2533
- operator()(const sys_time<Duration>& st) const
2534
- {
2535
- return DstClock::from_sys(st);
2536
- }
2537
- };
2538
-
2539
- template <class SrcClock>
2540
- struct clock_time_conversion<utc_clock, SrcClock>
2541
- {
2542
- template <class Duration>
2543
- typename ctc_detail::return_to_utc<SrcClock, Duration>::type
2544
- operator()(const std::chrono::time_point<SrcClock, Duration>& tp) const
2545
- {
2546
- return SrcClock::to_utc(tp);
2547
- }
2548
- };
2549
-
2550
- template <class DstClock>
2551
- struct clock_time_conversion<DstClock, utc_clock>
2552
- {
2553
- template <class Duration>
2554
- typename ctc_detail::return_from_utc<DstClock, Duration>::type
2555
- operator()(const utc_time<Duration>& ut) const
2556
- {
2557
- return DstClock::from_utc(ut);
2558
- }
2559
- };
2560
-
2561
- template<typename SrcClock>
2562
- struct clock_time_conversion<local_t, SrcClock>
2563
- {
2564
- template <class Duration>
2565
- typename ctc_detail::return_to_local<SrcClock, Duration>::type
2566
- operator()(const std::chrono::time_point<SrcClock, Duration>& tp) const
2567
- {
2568
- return SrcClock::to_local(tp);
2569
- }
2570
- };
2571
-
2572
- template<typename DstClock>
2573
- struct clock_time_conversion<DstClock, local_t>
2574
- {
2575
- template <class Duration>
2576
- typename ctc_detail::return_from_local<DstClock, Duration>::type
2577
- operator()(const local_time<Duration>& lt) const
2578
- {
2579
- return DstClock::from_local(lt);
2580
- }
2581
- };
2582
-
2583
- namespace clock_cast_detail
2584
- {
2585
-
2586
- template <class Clock, class Duration>
2587
- using time_point = std::chrono::time_point<Clock, Duration>;
2588
- using std::chrono::system_clock;
2589
-
2590
- template <class DstClock, class SrcClock, class Duration>
2591
- auto
2592
- conv_clock(const time_point<SrcClock, Duration>& t)
2593
- -> decltype(std::declval<clock_time_conversion<DstClock, SrcClock>>()(t))
2594
- {
2595
- return clock_time_conversion<DstClock, SrcClock>{}(t);
2596
- }
2597
-
2598
- //direct trait conversion, 1st candidate
2599
- template <class DstClock, class SrcClock, class Duration>
2600
- auto
2601
- cc_impl(const time_point<SrcClock, Duration>& t, const time_point<SrcClock, Duration>*)
2602
- -> decltype(conv_clock<DstClock>(t))
2603
- {
2604
- return conv_clock<DstClock>(t);
2605
- }
2606
-
2607
- //conversion through sys, 2nd candidate
2608
- template <class DstClock, class SrcClock, class Duration>
2609
- auto
2610
- cc_impl(const time_point<SrcClock, Duration>& t, const void*)
2611
- -> decltype(conv_clock<DstClock>(conv_clock<system_clock>(t)))
2612
- {
2613
- return conv_clock<DstClock>(conv_clock<system_clock>(t));
2614
- }
2615
-
2616
- //conversion through utc, 2nd candidate
2617
- template <class DstClock, class SrcClock, class Duration>
2618
- auto
2619
- cc_impl(const time_point<SrcClock, Duration>& t, const void*)
2620
- -> decltype(0, // MSVC_WORKAROUND
2621
- conv_clock<DstClock>(conv_clock<utc_clock>(t)))
2622
- {
2623
- return conv_clock<DstClock>(conv_clock<utc_clock>(t));
2624
- }
2625
-
2626
- //conversion through sys and utc, 3rd candidate
2627
- template <class DstClock, class SrcClock, class Duration>
2628
- auto
2629
- cc_impl(const time_point<SrcClock, Duration>& t, ...)
2630
- -> decltype(conv_clock<DstClock>(conv_clock<utc_clock>(conv_clock<system_clock>(t))))
2631
- {
2632
- return conv_clock<DstClock>(conv_clock<utc_clock>(conv_clock<system_clock>(t)));
2633
- }
2634
-
2635
- //conversion through utc and sys, 3rd candidate
2636
- template <class DstClock, class SrcClock, class Duration>
2637
- auto
2638
- cc_impl(const time_point<SrcClock, Duration>& t, ...)
2639
- -> decltype(0, // MSVC_WORKAROUND
2640
- conv_clock<DstClock>(conv_clock<system_clock>(conv_clock<utc_clock>(t))))
2641
- {
2642
- return conv_clock<DstClock>(conv_clock<system_clock>(conv_clock<utc_clock>(t)));
2643
- }
2644
-
2645
- } // namespace clock_cast_detail
2646
-
2647
- template <class DstClock, class SrcClock, class Duration>
2648
- auto
2649
- clock_cast(const std::chrono::time_point<SrcClock, Duration>& tp)
2650
- -> decltype(clock_cast_detail::cc_impl<DstClock>(tp, &tp))
2651
- {
2652
- return clock_cast_detail::cc_impl<DstClock>(tp, &tp);
2653
- }
2654
-
2655
- // Deprecated API
2656
-
2657
- template <class Duration>
2658
- inline
2659
- sys_time<typename std::common_type<Duration, std::chrono::seconds>::type>
2660
- to_sys_time(const utc_time<Duration>& t)
2661
- {
2662
- return utc_clock::to_sys(t);
2663
- }
2664
-
2665
- template <class Duration>
2666
- inline
2667
- sys_time<typename std::common_type<Duration, std::chrono::seconds>::type>
2668
- to_sys_time(const tai_time<Duration>& t)
2669
- {
2670
- return utc_clock::to_sys(tai_clock::to_utc(t));
2671
- }
2672
-
2673
- template <class Duration>
2674
- inline
2675
- sys_time<typename std::common_type<Duration, std::chrono::seconds>::type>
2676
- to_sys_time(const gps_time<Duration>& t)
2677
- {
2678
- return utc_clock::to_sys(gps_clock::to_utc(t));
2679
- }
2680
-
2681
-
2682
- template <class Duration>
2683
- inline
2684
- utc_time<typename std::common_type<Duration, std::chrono::seconds>::type>
2685
- to_utc_time(const sys_time<Duration>& t)
2686
- {
2687
- return utc_clock::from_sys(t);
2688
- }
2689
-
2690
- template <class Duration>
2691
- inline
2692
- utc_time<typename std::common_type<Duration, std::chrono::seconds>::type>
2693
- to_utc_time(const tai_time<Duration>& t)
2694
- {
2695
- return tai_clock::to_utc(t);
2696
- }
2697
-
2698
- template <class Duration>
2699
- inline
2700
- utc_time<typename std::common_type<Duration, std::chrono::seconds>::type>
2701
- to_utc_time(const gps_time<Duration>& t)
2702
- {
2703
- return gps_clock::to_utc(t);
2704
- }
2705
-
2706
-
2707
- template <class Duration>
2708
- inline
2709
- tai_time<typename std::common_type<Duration, std::chrono::seconds>::type>
2710
- to_tai_time(const sys_time<Duration>& t)
2711
- {
2712
- return tai_clock::from_utc(utc_clock::from_sys(t));
2713
- }
2714
-
2715
- template <class Duration>
2716
- inline
2717
- tai_time<typename std::common_type<Duration, std::chrono::seconds>::type>
2718
- to_tai_time(const utc_time<Duration>& t)
2719
- {
2720
- return tai_clock::from_utc(t);
2721
- }
2722
-
2723
- template <class Duration>
2724
- inline
2725
- tai_time<typename std::common_type<Duration, std::chrono::seconds>::type>
2726
- to_tai_time(const gps_time<Duration>& t)
2727
- {
2728
- return tai_clock::from_utc(gps_clock::to_utc(t));
2729
- }
2730
-
2731
-
2732
- template <class Duration>
2733
- inline
2734
- gps_time<typename std::common_type<Duration, std::chrono::seconds>::type>
2735
- to_gps_time(const sys_time<Duration>& t)
2736
- {
2737
- return gps_clock::from_utc(utc_clock::from_sys(t));
2738
- }
2739
-
2740
- template <class Duration>
2741
- inline
2742
- gps_time<typename std::common_type<Duration, std::chrono::seconds>::type>
2743
- to_gps_time(const utc_time<Duration>& t)
2744
- {
2745
- return gps_clock::from_utc(t);
2746
- }
2747
-
2748
- template <class Duration>
2749
- inline
2750
- gps_time<typename std::common_type<Duration, std::chrono::seconds>::type>
2751
- to_gps_time(const tai_time<Duration>& t)
2752
- {
2753
- return gps_clock::from_utc(tai_clock::to_utc(t));
2754
- }
2755
-
2756
- #endif // !MISSING_LEAP_SECONDS
2757
-
2758
- } // namespace date
2759
-
2760
- #endif // TZ_H