passenger 6.0.15 → 6.0.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (292) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +46 -2
  3. data/build/integration_tests.rb +6 -6
  4. data/build/ruby_tests.rb +1 -1
  5. data/build/test_basics.rb +0 -1
  6. data/src/agent/Core/Config.h +1 -1
  7. data/src/agent/Core/Controller/Config.h +1 -1
  8. data/src/agent/Core/SpawningKit/PipeWatcher.h +18 -3
  9. data/src/agent/Watchdog/Config.h +1 -1
  10. data/src/cxx_supportlib/Constants.h +1 -1
  11. data/src/cxx_supportlib/vendor-modified/boost/align/aligned_alloc.hpp +1 -1
  12. data/src/cxx_supportlib/vendor-modified/boost/array.hpp +1 -1
  13. data/src/cxx_supportlib/vendor-modified/boost/asio/any_completion_executor.hpp +344 -0
  14. data/src/cxx_supportlib/vendor-modified/boost/asio/any_completion_handler.hpp +686 -0
  15. data/src/cxx_supportlib/vendor-modified/boost/asio/any_io_executor.hpp +56 -0
  16. data/src/cxx_supportlib/vendor-modified/boost/asio/associated_allocator.hpp +81 -25
  17. data/src/cxx_supportlib/vendor-modified/boost/asio/associated_cancellation_slot.hpp +68 -8
  18. data/src/cxx_supportlib/vendor-modified/boost/asio/associated_executor.hpp +46 -11
  19. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_datagram_socket.hpp +4 -4
  20. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_deadline_timer.hpp +2 -2
  21. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_file.hpp +1 -1
  22. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_random_access_file.hpp +2 -2
  23. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_raw_socket.hpp +4 -4
  24. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_readable_pipe.hpp +2 -2
  25. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_seq_packet_socket.hpp +2 -2
  26. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_serial_port.hpp +3 -3
  27. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_signal_set.hpp +2 -2
  28. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_socket.hpp +3 -3
  29. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_socket_acceptor.hpp +4 -4
  30. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_stream_file.hpp +2 -2
  31. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_stream_socket.hpp +2 -2
  32. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_waitable_timer.hpp +2 -2
  33. data/src/cxx_supportlib/vendor-modified/boost/asio/basic_writable_pipe.hpp +2 -2
  34. data/src/cxx_supportlib/vendor-modified/boost/asio/bind_allocator.hpp +13 -3
  35. data/src/cxx_supportlib/vendor-modified/boost/asio/bind_cancellation_slot.hpp +14 -3
  36. data/src/cxx_supportlib/vendor-modified/boost/asio/bind_executor.hpp +13 -3
  37. data/src/cxx_supportlib/vendor-modified/boost/asio/compose.hpp +30 -305
  38. data/src/cxx_supportlib/vendor-modified/boost/asio/consign.hpp +90 -0
  39. data/src/cxx_supportlib/vendor-modified/boost/asio/defer.hpp +17 -18
  40. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/bind_handler.hpp +98 -24
  41. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/composed_work.hpp +330 -0
  42. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/config.hpp +81 -15
  43. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/handler_alloc_helpers.hpp +4 -4
  44. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/handler_work.hpp +19 -11
  45. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/descriptor_ops.ipp +37 -0
  46. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/handler_tracking.ipp +3 -1
  47. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/select_reactor.ipp +1 -1
  48. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/socket_ops.ipp +10 -2
  49. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/impl/strand_executor_service.hpp +14 -1
  50. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/memory.hpp +18 -0
  51. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/utility.hpp +1 -2
  52. data/src/cxx_supportlib/vendor-modified/boost/asio/detail/work_dispatcher.hpp +7 -3
  53. data/src/cxx_supportlib/vendor-modified/boost/asio/dispatch.hpp +4 -14
  54. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/allocator.hpp +22 -3
  55. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/any_executor.hpp +447 -142
  56. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/blocking.hpp +57 -8
  57. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/blocking_adaptation.hpp +51 -6
  58. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/bulk_execute.hpp +5 -0
  59. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/bulk_guarantee.hpp +41 -4
  60. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/connect.hpp +5 -0
  61. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/context.hpp +13 -2
  62. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/context_as.hpp +13 -2
  63. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/detail/as_operation.hpp +4 -0
  64. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/execute.hpp +9 -2
  65. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/executor.hpp +11 -1
  66. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/mapping.hpp +52 -8
  67. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/occupancy.hpp +13 -2
  68. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/operation_state.hpp +5 -0
  69. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/outstanding_work.hpp +39 -6
  70. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/receiver.hpp +5 -0
  71. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/relationship.hpp +39 -6
  72. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/schedule.hpp +5 -0
  73. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/scheduler.hpp +5 -0
  74. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/sender.hpp +5 -0
  75. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/set_done.hpp +5 -0
  76. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/set_error.hpp +5 -0
  77. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/set_value.hpp +5 -0
  78. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/start.hpp +5 -0
  79. data/src/cxx_supportlib/vendor-modified/boost/asio/execution/submit.hpp +5 -0
  80. data/src/cxx_supportlib/vendor-modified/boost/asio/executor_work_guard.hpp +6 -9
  81. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/basic_channel.hpp +3 -3
  82. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/basic_concurrent_channel.hpp +3 -3
  83. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/channel_traits.hpp +70 -0
  84. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/co_composed.hpp +146 -0
  85. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/coro.hpp +35 -5
  86. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/channel_handler.hpp +13 -3
  87. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/channel_operation.hpp +7 -0
  88. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/channel_service.hpp +180 -0
  89. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/coro_completion_handler.hpp +171 -0
  90. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/coro_promise_allocator.hpp +89 -66
  91. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/partial_promise.hpp +66 -45
  92. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/as_single.hpp +13 -3
  93. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/co_composed.hpp +1134 -0
  94. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/coro.hpp +130 -106
  95. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/parallel_group.hpp +377 -3
  96. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/promise.hpp +168 -29
  97. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/use_coro.hpp +149 -203
  98. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/impl/use_promise.hpp +68 -0
  99. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/parallel_group.hpp +256 -0
  100. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/promise.hpp +76 -80
  101. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/use_coro.hpp +40 -14
  102. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/use_promise.hpp +113 -0
  103. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/any_completion_executor.ipp +132 -0
  104. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/any_io_executor.ipp +12 -0
  105. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/append.hpp +12 -3
  106. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/as_tuple.hpp +12 -3
  107. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/buffered_read_stream.hpp +25 -6
  108. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/buffered_write_stream.hpp +25 -6
  109. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/co_spawn.hpp +34 -45
  110. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/connect.hpp +28 -6
  111. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/consign.hpp +204 -0
  112. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/defer.hpp +33 -1
  113. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/deferred.hpp +13 -3
  114. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/dispatch.hpp +21 -9
  115. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/handler_alloc_hook.ipp +1 -1
  116. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/post.hpp +33 -1
  117. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/prepend.hpp +12 -3
  118. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/read.hpp +40 -9
  119. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/read_at.hpp +27 -6
  120. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/read_until.hpp +104 -24
  121. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/redirect_error.hpp +12 -3
  122. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/spawn.hpp +70 -15
  123. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/src.hpp +1 -0
  124. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/use_future.hpp +25 -0
  125. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/write.hpp +38 -30
  126. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/write_at.hpp +27 -6
  127. data/src/cxx_supportlib/vendor-modified/boost/asio/io_context.hpp +0 -13
  128. data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/network_v4.ipp +3 -1
  129. data/src/cxx_supportlib/vendor-modified/boost/asio/ip/impl/network_v6.ipp +3 -1
  130. data/src/cxx_supportlib/vendor-modified/boost/asio/posix/basic_descriptor.hpp +2 -2
  131. data/src/cxx_supportlib/vendor-modified/boost/asio/posix/basic_stream_descriptor.hpp +2 -2
  132. data/src/cxx_supportlib/vendor-modified/boost/asio/post.hpp +17 -18
  133. data/src/cxx_supportlib/vendor-modified/boost/asio/spawn.hpp +3 -1
  134. data/src/cxx_supportlib/vendor-modified/boost/asio/ssl/detail/io.hpp +13 -3
  135. data/src/cxx_supportlib/vendor-modified/boost/asio/strand.hpp +11 -7
  136. data/src/cxx_supportlib/vendor-modified/boost/asio/system_executor.hpp +0 -13
  137. data/src/cxx_supportlib/vendor-modified/boost/asio/thread_pool.hpp +23 -18
  138. data/src/cxx_supportlib/vendor-modified/boost/asio/version.hpp +1 -1
  139. data/src/cxx_supportlib/vendor-modified/boost/asio/windows/basic_object_handle.hpp +2 -2
  140. data/src/cxx_supportlib/vendor-modified/boost/asio/windows/basic_overlapped_handle.hpp +1 -1
  141. data/src/cxx_supportlib/vendor-modified/boost/asio/windows/basic_random_access_handle.hpp +2 -2
  142. data/src/cxx_supportlib/vendor-modified/boost/asio/windows/basic_stream_handle.hpp +2 -2
  143. data/src/cxx_supportlib/vendor-modified/boost/asio.hpp +4 -0
  144. data/src/cxx_supportlib/vendor-modified/boost/bind/bind.hpp +1 -1
  145. data/src/cxx_supportlib/vendor-modified/boost/chrono/config.hpp +1 -0
  146. data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/inlined/mac/chrono.hpp +4 -4
  147. data/src/cxx_supportlib/vendor-modified/boost/chrono/detail/scan_keyword.hpp +4 -2
  148. data/src/cxx_supportlib/vendor-modified/boost/chrono/duration.hpp +2 -2
  149. data/src/cxx_supportlib/vendor-modified/boost/chrono/io/duration_io.hpp +3 -3
  150. data/src/cxx_supportlib/vendor-modified/boost/chrono/io/duration_put.hpp +5 -5
  151. data/src/cxx_supportlib/vendor-modified/boost/chrono/io/duration_units.hpp +2 -2
  152. data/src/cxx_supportlib/vendor-modified/boost/chrono/io/time_point_io.hpp +2 -2
  153. data/src/cxx_supportlib/vendor-modified/boost/chrono/io/utility/ios_base_state_ptr.hpp +7 -7
  154. data/src/cxx_supportlib/vendor-modified/boost/chrono/time_point.hpp +1 -1
  155. data/src/cxx_supportlib/vendor-modified/boost/circular_buffer/details.hpp +5 -1
  156. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/clang.hpp +10 -3
  157. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/clang_version.hpp +9 -3
  158. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/gcc.hpp +9 -3
  159. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/sunpro_cc.hpp +6 -0
  160. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/visualc.hpp +8 -0
  161. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/xlcpp.hpp +4 -0
  162. data/src/cxx_supportlib/vendor-modified/boost/config/detail/suffix.hpp +33 -0
  163. data/src/cxx_supportlib/vendor-modified/boost/config/header_deprecated.hpp +1 -1
  164. data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/libcpp.hpp +9 -0
  165. data/src/cxx_supportlib/vendor-modified/boost/config/stdlib/libstdcpp3.hpp +4 -2
  166. data/src/cxx_supportlib/vendor-modified/boost/container/allocator.hpp +1 -1
  167. data/src/cxx_supportlib/vendor-modified/boost/container/container_fwd.hpp +29 -0
  168. data/src/cxx_supportlib/vendor-modified/boost/container/deque.hpp +13 -13
  169. data/src/cxx_supportlib/vendor-modified/boost/container/detail/advanced_insert_int.hpp +80 -95
  170. data/src/cxx_supportlib/vendor-modified/boost/container/detail/config_begin.hpp +10 -0
  171. data/src/cxx_supportlib/vendor-modified/boost/container/detail/config_end.hpp +3 -0
  172. data/src/cxx_supportlib/vendor-modified/boost/container/detail/copy_move_algo.hpp +738 -34
  173. data/src/cxx_supportlib/vendor-modified/boost/container/detail/destroyers.hpp +38 -10
  174. data/src/cxx_supportlib/vendor-modified/boost/container/detail/flat_tree.hpp +1 -0
  175. data/src/cxx_supportlib/vendor-modified/boost/container/detail/iterator.hpp +2 -0
  176. data/src/cxx_supportlib/vendor-modified/boost/container/detail/workaround.hpp +3 -4
  177. data/src/cxx_supportlib/vendor-modified/boost/container/devector.hpp +1150 -1213
  178. data/src/cxx_supportlib/vendor-modified/boost/container/node_allocator.hpp +1 -1
  179. data/src/cxx_supportlib/vendor-modified/boost/container/options.hpp +104 -12
  180. data/src/cxx_supportlib/vendor-modified/boost/container/stable_vector.hpp +1 -0
  181. data/src/cxx_supportlib/vendor-modified/boost/container/string.hpp +11 -1
  182. data/src/cxx_supportlib/vendor-modified/boost/container/vector.hpp +31 -331
  183. data/src/cxx_supportlib/vendor-modified/boost/container_hash/detail/hash_mix.hpp +113 -0
  184. data/src/cxx_supportlib/vendor-modified/boost/container_hash/detail/hash_range.hpp +173 -0
  185. data/src/cxx_supportlib/vendor-modified/boost/container_hash/detail/hash_tuple.hpp +133 -0
  186. data/src/cxx_supportlib/vendor-modified/boost/container_hash/hash.hpp +461 -566
  187. data/src/cxx_supportlib/vendor-modified/boost/container_hash/hash_fwd.hpp +24 -24
  188. data/src/cxx_supportlib/vendor-modified/boost/container_hash/is_contiguous_range.hpp +91 -0
  189. data/src/cxx_supportlib/vendor-modified/boost/container_hash/is_described_class.hpp +38 -0
  190. data/src/cxx_supportlib/vendor-modified/boost/container_hash/is_range.hpp +73 -0
  191. data/src/cxx_supportlib/vendor-modified/boost/container_hash/is_unordered_range.hpp +39 -0
  192. data/src/cxx_supportlib/vendor-modified/boost/core/bit.hpp +32 -4
  193. data/src/cxx_supportlib/vendor-modified/boost/core/detail/string_view.hpp +16 -0
  194. data/src/cxx_supportlib/vendor-modified/boost/core/empty_value.hpp +16 -16
  195. data/src/cxx_supportlib/vendor-modified/boost/core/fclose_deleter.hpp +46 -0
  196. data/src/cxx_supportlib/vendor-modified/boost/date_time/date.hpp +1 -1
  197. data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/formatters.hpp +3 -3
  198. data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/formatters_limited.hpp +3 -3
  199. data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/greg_date.hpp +12 -13
  200. data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian/parsers.hpp +2 -2
  201. data/src/cxx_supportlib/vendor-modified/boost/date_time/gregorian_calendar.ipp +2 -2
  202. data/src/cxx_supportlib/vendor-modified/boost/date_time/iso_format.hpp +13 -13
  203. data/src/cxx_supportlib/vendor-modified/boost/date_time/local_time/local_date_time.hpp +2 -2
  204. data/src/cxx_supportlib/vendor-modified/boost/date_time/posix_time/time_formatters.hpp +4 -4
  205. data/src/cxx_supportlib/vendor-modified/boost/date_time/posix_time/time_formatters_limited.hpp +2 -2
  206. data/src/cxx_supportlib/vendor-modified/boost/date_time/special_values_parser.hpp +1 -1
  207. data/src/cxx_supportlib/vendor-modified/boost/date_time/time_facet.hpp +1 -1
  208. data/src/cxx_supportlib/vendor-modified/boost/date_time/time_parsing.hpp +2 -2
  209. data/src/cxx_supportlib/vendor-modified/boost/describe/bases.hpp +50 -0
  210. data/src/cxx_supportlib/vendor-modified/boost/describe/detail/config.hpp +40 -0
  211. data/src/cxx_supportlib/vendor-modified/boost/describe/detail/cx_streq.hpp +30 -0
  212. data/src/cxx_supportlib/vendor-modified/boost/describe/detail/void_t.hpp +32 -0
  213. data/src/cxx_supportlib/vendor-modified/boost/describe/members.hpp +159 -0
  214. data/src/cxx_supportlib/vendor-modified/boost/describe/modifiers.hpp +33 -0
  215. data/src/cxx_supportlib/vendor-modified/boost/intrusive/avltree_algorithms.hpp +9 -9
  216. data/src/cxx_supportlib/vendor-modified/boost/intrusive/bstree_algorithms.hpp +45 -45
  217. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/any_node_and_algorithms.hpp +8 -8
  218. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/bstree_algorithms_base.hpp +37 -38
  219. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/iterator.hpp +16 -0
  220. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/workaround.hpp +1 -1
  221. data/src/cxx_supportlib/vendor-modified/boost/intrusive/hashtable.hpp +145 -90
  222. data/src/cxx_supportlib/vendor-modified/boost/intrusive/pack_options.hpp +2 -0
  223. data/src/cxx_supportlib/vendor-modified/boost/intrusive/rbtree_algorithms.hpp +7 -7
  224. data/src/cxx_supportlib/vendor-modified/boost/intrusive/sgtree_algorithms.hpp +5 -5
  225. data/src/cxx_supportlib/vendor-modified/boost/intrusive/splaytree_algorithms.hpp +11 -9
  226. data/src/cxx_supportlib/vendor-modified/boost/intrusive/treap_algorithms.hpp +7 -7
  227. data/src/cxx_supportlib/vendor-modified/boost/iterator/iterator_facade.hpp +106 -25
  228. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/converter_lexical_streams.hpp +1 -1
  229. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/converter_numeric.hpp +8 -5
  230. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/lcast_unsigned_converters.hpp +1 -1
  231. data/src/cxx_supportlib/vendor-modified/boost/move/algo/detail/adaptive_sort_merge.hpp +4 -2
  232. data/src/cxx_supportlib/vendor-modified/boost/move/algo/detail/pdqsort.hpp +2 -1
  233. data/src/cxx_supportlib/vendor-modified/boost/move/detail/type_traits.hpp +8 -4
  234. data/src/cxx_supportlib/vendor-modified/boost/mp11/bind.hpp +111 -0
  235. data/src/cxx_supportlib/vendor-modified/boost/mp11/version.hpp +1 -1
  236. data/src/cxx_supportlib/vendor-modified/boost/numeric/conversion/detail/int_float_mixture.hpp +5 -5
  237. data/src/cxx_supportlib/vendor-modified/boost/numeric/conversion/detail/sign_mixture.hpp +5 -5
  238. data/src/cxx_supportlib/vendor-modified/boost/numeric/conversion/detail/udt_builtin_mixture.hpp +5 -5
  239. data/src/cxx_supportlib/vendor-modified/boost/preprocessor/variadic/has_opt.hpp +6 -2
  240. data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/detail/spinlock_gcc_atomic.hpp +11 -2
  241. data/src/cxx_supportlib/vendor-modified/boost/smart_ptr/intrusive_ptr.hpp +1 -1
  242. data/src/cxx_supportlib/vendor-modified/boost/system/detail/config.hpp +7 -1
  243. data/src/cxx_supportlib/vendor-modified/boost/system/detail/error_category.hpp +2 -2
  244. data/src/cxx_supportlib/vendor-modified/boost/system/detail/error_category_impl.hpp +10 -1
  245. data/src/cxx_supportlib/vendor-modified/boost/system/detail/error_code.hpp +38 -43
  246. data/src/cxx_supportlib/vendor-modified/boost/system/detail/error_condition.hpp +52 -0
  247. data/src/cxx_supportlib/vendor-modified/boost/throw_exception.hpp +1 -1
  248. data/src/cxx_supportlib/vendor-modified/boost/type_traits/detail/is_function_ptr_helper.hpp +27 -27
  249. data/src/cxx_supportlib/vendor-modified/boost/type_traits/detail/is_mem_fun_pointer_impl.hpp +27 -27
  250. data/src/cxx_supportlib/vendor-modified/boost/type_traits/intrinsics.hpp +22 -8
  251. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/fca.hpp +37 -7
  252. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/foa.hpp +1921 -0
  253. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/implementation.hpp +66 -82
  254. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/prime_fmod.hpp +6 -0
  255. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/type_traits.hpp +109 -0
  256. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/xmx.hpp +75 -0
  257. data/src/cxx_supportlib/vendor-modified/boost/unordered/hash_traits.hpp +45 -0
  258. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_map.hpp +732 -0
  259. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_map_fwd.hpp +49 -0
  260. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_set.hpp +586 -0
  261. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_set_fwd.hpp +49 -0
  262. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_map.hpp +166 -66
  263. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_set.hpp +145 -28
  264. data/src/cxx_supportlib/vendor-modified/boost/version.hpp +2 -2
  265. data/src/cxx_supportlib/vendor-modified/jsoncpp/json-forwards.h +143 -261
  266. data/src/cxx_supportlib/vendor-modified/jsoncpp/json.h +763 -947
  267. data/src/cxx_supportlib/vendor-modified/jsoncpp/jsoncpp.cpp +1477 -1487
  268. data/src/cxx_supportlib/vendor-modified/websocketpp/websocketpp/common/md5.hpp +1 -1
  269. data/src/ruby_native_extension/extconf.rb +1 -1
  270. data/src/ruby_supportlib/phusion_passenger/packaging.rb +1 -0
  271. data/src/ruby_supportlib/phusion_passenger/platform_info/apache.rb +3 -2
  272. data/src/ruby_supportlib/phusion_passenger/platform_info/binary_compatibility.rb +1 -1
  273. data/src/ruby_supportlib/phusion_passenger/platform_info/operating_system.rb +5 -5
  274. data/src/ruby_supportlib/phusion_passenger.rb +5 -5
  275. metadata +36 -19
  276. data/src/cxx_supportlib/vendor-modified/boost/align/align.hpp +0 -19
  277. data/src/cxx_supportlib/vendor-modified/boost/align/alignment_of.hpp +0 -54
  278. data/src/cxx_supportlib/vendor-modified/boost/align/alignment_of_forward.hpp +0 -20
  279. data/src/cxx_supportlib/vendor-modified/boost/align/detail/align_cxx11.hpp +0 -21
  280. data/src/cxx_supportlib/vendor-modified/boost/align/detail/aligned_alloc.hpp +0 -52
  281. data/src/cxx_supportlib/vendor-modified/boost/align/detail/alignment_of.hpp +0 -31
  282. data/src/cxx_supportlib/vendor-modified/boost/align/detail/alignment_of_cxx11.hpp +0 -23
  283. data/src/cxx_supportlib/vendor-modified/boost/align/detail/element_type.hpp +0 -91
  284. data/src/cxx_supportlib/vendor-modified/boost/align/detail/integral_constant.hpp +0 -53
  285. data/src/cxx_supportlib/vendor-modified/boost/align/detail/min_size.hpp +0 -26
  286. data/src/cxx_supportlib/vendor-modified/boost/asio/experimental/detail/completion_handler_erasure.hpp +0 -196
  287. data/src/cxx_supportlib/vendor-modified/boost/asio/impl/compose.hpp +0 -709
  288. data/src/cxx_supportlib/vendor-modified/boost/container_hash/detail/float_functions.hpp +0 -336
  289. data/src/cxx_supportlib/vendor-modified/boost/container_hash/detail/hash_float.hpp +0 -271
  290. data/src/cxx_supportlib/vendor-modified/boost/container_hash/detail/limits.hpp +0 -62
  291. data/src/cxx_supportlib/vendor-modified/boost/container_hash/extensions.hpp +0 -361
  292. data/src/cxx_supportlib/vendor-modified/boost/detail/container_fwd.hpp +0 -157
@@ -1,4 +1,4 @@
1
- /// Json-cpp amalgamated header (http://jsoncpp.sourceforge.net/).
1
+ /// Json-cpp amalgated header (http://jsoncpp.sourceforge.net/).
2
2
  /// It is intended to be used with #include "json/json.h"
3
3
 
4
4
  // //////////////////////////////////////////////////////////////////////
@@ -10,13 +10,13 @@ The JsonCpp library's source code, including accompanying documentation,
10
10
  tests and demonstration applications, are licensed under the following
11
11
  conditions...
12
12
 
13
- Baptiste Lepilleur and The JsonCpp Authors explicitly disclaim copyright in all
13
+ The JsonCpp Authors explicitly disclaim copyright in all
14
14
  jurisdictions which recognize such a disclaimer. In such jurisdictions,
15
15
  this software is released into the Public Domain.
16
16
 
17
17
  In jurisdictions which do not recognize Public Domain property (e.g. Germany as of
18
- 2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur and
19
- The JsonCpp Authors, and is released under the terms of the MIT License (see below).
18
+ 2010), this software is Copyright (c) 2007-2010 by The JsonCpp Authors, and is
19
+ released under the terms of the MIT License (see below).
20
20
 
21
21
  In jurisdictions which recognize Public Domain property, the user of this
22
22
  software may choose to accept it either as 1) Public Domain, 2) under the
@@ -31,7 +31,7 @@ described in clear, concise terms at:
31
31
  The full text of the MIT License follows:
32
32
 
33
33
  ========================================================================
34
- Copyright (c) 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
34
+ Copyright (c) 2007-2010 The JsonCpp Authors
35
35
 
36
36
  Permission is hereby granted, free of charge, to any person
37
37
  obtaining a copy of this software and associated documentation
@@ -72,9 +72,9 @@ license you like.
72
72
 
73
73
 
74
74
 
75
- #ifndef JSON_AMALGAMATED_H_INCLUDED
76
- # define JSON_AMALGAMATED_H_INCLUDED
77
- /// If defined, indicates that the source file is amalgamated
75
+ #ifndef JSON_AMALGATED_H_INCLUDED
76
+ # define JSON_AMALGATED_H_INCLUDED
77
+ /// If defined, indicates that the source file is amalgated
78
78
  /// to prevent private header inclusion.
79
79
  #define JSON_IS_AMALGAMATION
80
80
 
@@ -82,25 +82,17 @@ license you like.
82
82
  // Beginning of content of file: include/json/version.h
83
83
  // //////////////////////////////////////////////////////////////////////
84
84
 
85
+ // DO NOT EDIT. This file (and "version") is generated by CMake.
86
+ // Run CMake configure step to update it.
85
87
  #ifndef JSON_VERSION_H_INCLUDED
86
- #define JSON_VERSION_H_INCLUDED
87
-
88
- // Note: version must be updated in three places when doing a release. This
89
- // annoying process ensures that amalgamate, CMake, and meson all report the
90
- // correct version.
91
- // 1. /meson.build
92
- // 2. /include/json/version.h
93
- // 3. /CMakeLists.txt
94
- // IMPORTANT: also update the SOVERSION!!
95
-
96
- #define JSONCPP_VERSION_STRING "1.9.5"
97
- #define JSONCPP_VERSION_MAJOR 1
98
- #define JSONCPP_VERSION_MINOR 9
99
- #define JSONCPP_VERSION_PATCH 5
100
- #define JSONCPP_VERSION_QUALIFIER
101
- #define JSONCPP_VERSION_HEXA \
102
- ((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | \
103
- (JSONCPP_VERSION_PATCH << 8))
88
+ # define JSON_VERSION_H_INCLUDED
89
+
90
+ # define JSONCPP_VERSION_STRING "1.8.1"
91
+ # define JSONCPP_VERSION_MAJOR 1
92
+ # define JSONCPP_VERSION_MINOR 8
93
+ # define JSONCPP_VERSION_PATCH 1
94
+ # define JSONCPP_VERSION_QUALIFIER
95
+ # define JSONCPP_VERSION_HEXA ((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | (JSONCPP_VERSION_PATCH << 8))
104
96
 
105
97
  #ifdef JSONCPP_USING_SECURE_MEMORY
106
98
  #undef JSONCPP_USING_SECURE_MEMORY
@@ -120,129 +112,30 @@ license you like.
120
112
 
121
113
 
122
114
 
123
- // //////////////////////////////////////////////////////////////////////
124
- // Beginning of content of file: include/json/allocator.h
125
- // //////////////////////////////////////////////////////////////////////
126
-
127
- // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
128
- // Distributed under MIT license, or public domain if desired and
129
- // recognized in your jurisdiction.
130
- // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
131
-
132
- #ifndef JSON_ALLOCATOR_H_INCLUDED
133
- #define JSON_ALLOCATOR_H_INCLUDED
134
-
135
- #include <cstring>
136
- #include <memory>
137
-
138
- #pragma pack(push, 8)
139
-
140
- namespace Passenger {
141
- namespace Json {
142
- template <typename T> class SecureAllocator {
143
- public:
144
- // Type definitions
145
- using value_type = T;
146
- using pointer = T*;
147
- using const_pointer = const T*;
148
- using reference = T&;
149
- using const_reference = const T&;
150
- using size_type = std::size_t;
151
- using difference_type = std::ptrdiff_t;
152
-
153
- /**
154
- * Allocate memory for N items using the standard allocator.
155
- */
156
- pointer allocate(size_type n) {
157
- // allocate using "global operator new"
158
- return static_cast<pointer>(::operator new(n * sizeof(T)));
159
- }
160
-
161
- /**
162
- * Release memory which was allocated for N items at pointer P.
163
- *
164
- * The memory block is filled with zeroes before being released.
165
- */
166
- void deallocate(pointer p, size_type n) {
167
- // memset_s is used because memset may be optimized away by the compiler
168
- memset_s(p, n * sizeof(T), 0, n * sizeof(T));
169
- // free using "global operator delete"
170
- ::operator delete(p);
171
- }
172
-
173
- /**
174
- * Construct an item in-place at pointer P.
175
- */
176
- template <typename... Args> void construct(pointer p, Args&&... args) {
177
- // construct using "placement new" and "perfect forwarding"
178
- ::new (static_cast<void*>(p)) T(std::forward<Args>(args)...);
179
- }
180
-
181
- size_type max_size() const { return size_t(-1) / sizeof(T); }
182
-
183
- pointer address(reference x) const { return std::addressof(x); }
184
-
185
- const_pointer address(const_reference x) const { return std::addressof(x); }
186
-
187
- /**
188
- * Destroy an item in-place at pointer P.
189
- */
190
- void destroy(pointer p) {
191
- // destroy using "explicit destructor"
192
- p->~T();
193
- }
194
-
195
- // Boilerplate
196
- SecureAllocator() {}
197
- template <typename U> SecureAllocator(const SecureAllocator<U>&) {}
198
- template <typename U> struct rebind { using other = SecureAllocator<U>; };
199
- };
200
-
201
- template <typename T, typename U>
202
- bool operator==(const SecureAllocator<T>&, const SecureAllocator<U>&) {
203
- return true;
204
- }
205
-
206
- template <typename T, typename U>
207
- bool operator!=(const SecureAllocator<T>&, const SecureAllocator<U>&) {
208
- return false;
209
- }
210
-
211
- } // namespace Json
212
- } // namespace Passenger
213
-
214
- #pragma pack(pop)
215
-
216
- #endif // JSON_ALLOCATOR_H_INCLUDED
217
-
218
- // //////////////////////////////////////////////////////////////////////
219
- // End of content of file: include/json/allocator.h
220
- // //////////////////////////////////////////////////////////////////////
221
-
222
-
223
-
224
-
225
-
226
-
227
115
  // //////////////////////////////////////////////////////////////////////
228
116
  // Beginning of content of file: include/json/config.h
229
117
  // //////////////////////////////////////////////////////////////////////
230
118
 
231
- // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
119
+ // Copyright 2007-2010 Baptiste Lepilleur
232
120
  // Distributed under MIT license, or public domain if desired and
233
121
  // recognized in your jurisdiction.
234
122
  // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
235
123
 
236
124
  #ifndef JSON_CONFIG_H_INCLUDED
237
125
  #define JSON_CONFIG_H_INCLUDED
238
- #include <cstddef>
239
- #include <cstdint>
240
- #include <istream>
241
- #include <memory>
242
- #include <ostream>
243
- #include <sstream>
244
- #include <string>
245
- #include <type_traits>
126
+ #include <stddef.h>
127
+ #include <string> //typedef String
128
+ #include <stdint.h> //typedef int64_t, uint64_t
129
+
130
+ /// If defined, indicates that json library is embedded in CppTL library.
131
+ //# define JSON_IN_CPPTL 1
132
+
133
+ /// If defined, indicates that json may leverage CppTL library
134
+ //# define JSON_USE_CPPTL 1
135
+ /// If defined, indicates that cpptl vector based map should be used instead of
136
+ /// std::map
137
+ /// as Value container.
138
+ //# define JSON_USE_CPPTL_SMALLMAP 1
246
139
 
247
140
  // If non-zero, the library uses exceptions to report bad input instead of C
248
141
  // assertion macros. The default is to use exceptions.
@@ -250,134 +143,163 @@ bool operator!=(const SecureAllocator<T>&, const SecureAllocator<U>&) {
250
143
  #define JSON_USE_EXCEPTION 1
251
144
  #endif
252
145
 
253
- // Temporary, tracked for removal with issue #982.
254
- #ifndef JSON_USE_NULLREF
255
- #define JSON_USE_NULLREF 1
256
- #endif
257
-
258
- /// If defined, indicates that the source file is amalgamated
146
+ /// If defined, indicates that the source file is amalgated
259
147
  /// to prevent private header inclusion.
260
- /// Remarks: it is automatically defined in the generated amalgamated header.
148
+ /// Remarks: it is automatically defined in the generated amalgated header.
261
149
  // #define JSON_IS_AMALGAMATION
262
150
 
263
- // Export macros for DLL visibility
264
- #if defined(JSON_DLL_BUILD)
151
+ #ifdef JSON_IN_CPPTL
152
+ #include <cpptl/config.h>
153
+ #ifndef JSON_USE_CPPTL
154
+ #define JSON_USE_CPPTL 1
155
+ #endif
156
+ #endif
157
+
158
+ #ifdef JSON_IN_CPPTL
159
+ #define JSON_API CPPTL_API
160
+ #elif defined(JSON_DLL_BUILD)
265
161
  #if defined(_MSC_VER) || defined(__MINGW32__)
266
162
  #define JSON_API __declspec(dllexport)
267
163
  #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
268
- #elif defined(__GNUC__) || defined(__clang__)
269
- #define JSON_API __attribute__((visibility("default")))
270
164
  #endif // if defined(_MSC_VER)
271
-
272
165
  #elif defined(JSON_DLL)
273
166
  #if defined(_MSC_VER) || defined(__MINGW32__)
274
167
  #define JSON_API __declspec(dllimport)
275
168
  #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
276
169
  #endif // if defined(_MSC_VER)
277
- #endif // ifdef JSON_DLL_BUILD
278
-
170
+ #endif // ifdef JSON_IN_CPPTL
279
171
  #if !defined(JSON_API)
280
172
  #define JSON_API
281
173
  #endif
282
174
 
283
- #if defined(_MSC_VER) && _MSC_VER < 1800
284
- #error \
285
- "ERROR: Visual Studio 12 (2013) with _MSC_VER=1800 is the oldest supported compiler with sufficient C++11 capabilities"
286
- #endif
287
-
288
- #if defined(_MSC_VER) && _MSC_VER < 1900
289
- // As recommended at
290
- // https://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-2010
291
- extern JSON_API int msvc_pre1900_c99_snprintf(char* outBuf, size_t size,
292
- const char* format, ...);
293
- #define jsoncpp_snprintf msvc_pre1900_c99_snprintf
294
- #else
295
- #define jsoncpp_snprintf std::snprintf
296
- #endif
297
-
298
175
  // If JSON_NO_INT64 is defined, then Json only support C++ "int" type for
299
176
  // integer
300
177
  // Storages, and 64 bits integer support is disabled.
301
178
  // #define JSON_NO_INT64 1
302
179
 
303
- // JSONCPP_OVERRIDE is maintained for backwards compatibility of external tools.
304
- // C++11 should be used directly in JSONCPP.
305
- #define JSONCPP_OVERRIDE override
180
+ #if defined(_MSC_VER) // MSVC
181
+ # if _MSC_VER <= 1200 // MSVC 6
182
+ // Microsoft Visual Studio 6 only support conversion from __int64 to double
183
+ // (no conversion from unsigned __int64).
184
+ # define JSON_USE_INT64_DOUBLE_CONVERSION 1
185
+ // Disable warning 4786 for VS6 caused by STL (identifier was truncated to '255'
186
+ // characters in the debug information)
187
+ // All projects I've ever seen with VS6 were using this globally (not bothering
188
+ // with pragma push/pop).
189
+ # pragma warning(disable : 4786)
190
+ # endif // MSVC 6
191
+
192
+ # if _MSC_VER >= 1500 // MSVC 2008
193
+ /// Indicates that the following function is deprecated.
194
+ # define JSONCPP_DEPRECATED(message) __declspec(deprecated(message))
195
+ # endif
196
+
197
+ #endif // defined(_MSC_VER)
198
+
199
+ // In c++11 the override keyword allows you to explicity define that a function
200
+ // is intended to override the base-class version. This makes the code more
201
+ // managable and fixes a set of common hard-to-find bugs.
202
+ #if __cplusplus >= 201103L
203
+ # define JSONCPP_OVERRIDE override
204
+ # define JSONCPP_NOEXCEPT noexcept
205
+ #elif defined(_MSC_VER) && _MSC_VER > 1600 && _MSC_VER < 1900
206
+ # define JSONCPP_OVERRIDE override
207
+ # define JSONCPP_NOEXCEPT throw()
208
+ #elif defined(_MSC_VER) && _MSC_VER >= 1900
209
+ # define JSONCPP_OVERRIDE override
210
+ # define JSONCPP_NOEXCEPT noexcept
211
+ #else
212
+ # define JSONCPP_OVERRIDE
213
+ # define JSONCPP_NOEXCEPT throw()
214
+ #endif
215
+
216
+ #ifndef JSON_HAS_RVALUE_REFERENCES
217
+
218
+ #if defined(_MSC_VER) && _MSC_VER >= 1600 // MSVC >= 2010
219
+ #define JSON_HAS_RVALUE_REFERENCES 1
220
+ #endif // MSVC >= 2010
306
221
 
307
222
  #ifdef __clang__
308
- #if __has_extension(attribute_deprecated_with_message)
309
- #define JSONCPP_DEPRECATED(message) __attribute__((deprecated(message)))
223
+ #if __has_feature(cxx_rvalue_references)
224
+ #define JSON_HAS_RVALUE_REFERENCES 1
225
+ #endif // has_feature
226
+
227
+ #elif defined __GNUC__ // not clang (gcc comes later since clang emulates gcc)
228
+ #if defined(__GXX_EXPERIMENTAL_CXX0X__) || (__cplusplus >= 201103L)
229
+ #define JSON_HAS_RVALUE_REFERENCES 1
230
+ #endif // GXX_EXPERIMENTAL
231
+
232
+ #endif // __clang__ || __GNUC__
233
+
234
+ #endif // not defined JSON_HAS_RVALUE_REFERENCES
235
+
236
+ #ifndef JSON_HAS_RVALUE_REFERENCES
237
+ #define JSON_HAS_RVALUE_REFERENCES 0
310
238
  #endif
311
- #elif defined(__GNUC__) // not clang (gcc comes later since clang emulates gcc)
312
- #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
313
- #define JSONCPP_DEPRECATED(message) __attribute__((deprecated(message)))
314
- #elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
315
- #define JSONCPP_DEPRECATED(message) __attribute__((__deprecated__))
316
- #endif // GNUC version
317
- #elif defined(_MSC_VER) // MSVC (after clang because clang on Windows emulates
318
- // MSVC)
319
- #define JSONCPP_DEPRECATED(message) __declspec(deprecated(message))
320
- #endif // __clang__ || __GNUC__ || _MSC_VER
239
+
240
+ #ifdef __clang__
241
+ #elif defined __GNUC__ // not clang (gcc comes later since clang emulates gcc)
242
+ # if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
243
+ # define JSONCPP_DEPRECATED(message) __attribute__ ((deprecated(message)))
244
+ # elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
245
+ # define JSONCPP_DEPRECATED(message) __attribute__((__deprecated__))
246
+ # endif // GNUC version
247
+ #endif // __clang__ || __GNUC__
321
248
 
322
249
  #if !defined(JSONCPP_DEPRECATED)
323
250
  #define JSONCPP_DEPRECATED(message)
324
251
  #endif // if !defined(JSONCPP_DEPRECATED)
325
252
 
326
- #if defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 6))
327
- #define JSON_USE_INT64_DOUBLE_CONVERSION 1
253
+ #if __GNUC__ >= 6
254
+ # define JSON_USE_INT64_DOUBLE_CONVERSION 1
328
255
  #endif
329
256
 
330
257
  #if !defined(JSON_IS_AMALGAMATION)
331
258
 
332
- #include "allocator.h"
333
- #include "version.h"
259
+ # include "version.h"
260
+
261
+ # if JSONCPP_USING_SECURE_MEMORY
262
+ # include "allocator.h" //typedef Allocator
263
+ # endif
334
264
 
335
265
  #endif // if !defined(JSON_IS_AMALGAMATION)
336
266
 
337
267
  namespace Passenger {
338
268
  namespace Json {
339
- using Int = int;
340
- using UInt = unsigned int;
269
+ typedef int Int;
270
+ typedef unsigned int UInt;
341
271
  #if defined(JSON_NO_INT64)
342
- using LargestInt = int;
343
- using LargestUInt = unsigned int;
272
+ typedef int LargestInt;
273
+ typedef unsigned int LargestUInt;
344
274
  #undef JSON_HAS_INT64
345
275
  #else // if defined(JSON_NO_INT64)
346
276
  // For Microsoft Visual use specific types as long long is not supported
347
277
  #if defined(_MSC_VER) // Microsoft Visual Studio
348
- using Int64 = __int64;
349
- using UInt64 = unsigned __int64;
278
+ typedef __int64 Int64;
279
+ typedef unsigned __int64 UInt64;
350
280
  #else // if defined(_MSC_VER) // Other platforms, use long long
351
- using Int64 = int64_t;
352
- using UInt64 = uint64_t;
353
- #endif // if defined(_MSC_VER)
354
- using LargestInt = Int64;
355
- using LargestUInt = UInt64;
281
+ typedef int64_t Int64;
282
+ typedef uint64_t UInt64;
283
+ #endif // if defined(_MSC_VER)
284
+ typedef Int64 LargestInt;
285
+ typedef UInt64 LargestUInt;
356
286
  #define JSON_HAS_INT64
357
287
  #endif // if defined(JSON_NO_INT64)
358
-
359
- template <typename T>
360
- using Allocator =
361
- typename std::conditional<JSONCPP_USING_SECURE_MEMORY, SecureAllocator<T>,
362
- std::allocator<T>>::type;
363
- using String = std::basic_string<char, std::char_traits<char>, Allocator<char>>;
364
- using IStringStream =
365
- std::basic_istringstream<String::value_type, String::traits_type,
366
- String::allocator_type>;
367
- using OStringStream =
368
- std::basic_ostringstream<String::value_type, String::traits_type,
369
- String::allocator_type>;
370
- using IStream = std::istream;
371
- using OStream = std::ostream;
372
- } // namespace Json
373
- } // namespace Passenger
374
-
375
- // Legacy names (formerly macros).
376
- using JSONCPP_STRING = Passenger::Json::String;
377
- using JSONCPP_ISTRINGSTREAM = Passenger::Json::IStringStream;
378
- using JSONCPP_OSTRINGSTREAM = Passenger::Json::OStringStream;
379
- using JSONCPP_ISTREAM = Passenger::Json::IStream;
380
- using JSONCPP_OSTREAM = Passenger::Json::OStream;
288
+ #if JSONCPP_USING_SECURE_MEMORY
289
+ #define JSONCPP_STRING std::basic_string<char, std::char_traits<char>, Json::SecureAllocator<char> >
290
+ #define JSONCPP_OSTRINGSTREAM std::basic_ostringstream<char, std::char_traits<char>, Json::SecureAllocator<char> >
291
+ #define JSONCPP_OSTREAM std::basic_ostream<char, std::char_traits<char>>
292
+ #define JSONCPP_ISTRINGSTREAM std::basic_istringstream<char, std::char_traits<char>, Json::SecureAllocator<char> >
293
+ #define JSONCPP_ISTREAM std::istream
294
+ #else
295
+ #define JSONCPP_STRING std::string
296
+ #define JSONCPP_OSTRINGSTREAM std::ostringstream
297
+ #define JSONCPP_OSTREAM std::ostream
298
+ #define JSONCPP_ISTRINGSTREAM std::istringstream
299
+ #define JSONCPP_ISTREAM std::istream
300
+ #endif // if JSONCPP_USING_SECURE_MEMORY
301
+ } // end namespace Json
302
+ } // end namespace Passenger
381
303
 
382
304
  #endif // JSON_CONFIG_H_INCLUDED
383
305
 
@@ -394,7 +316,7 @@ using JSONCPP_OSTREAM = Passenger::Json::OStream;
394
316
  // Beginning of content of file: include/json/forwards.h
395
317
  // //////////////////////////////////////////////////////////////////////
396
318
 
397
- // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
319
+ // Copyright 2007-2010 Baptiste Lepilleur
398
320
  // Distributed under MIT license, or public domain if desired and
399
321
  // recognized in your jurisdiction.
400
322
  // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
@@ -410,23 +332,17 @@ namespace Passenger {
410
332
  namespace Json {
411
333
 
412
334
  // writer.h
413
- class StreamWriter;
414
- class StreamWriterBuilder;
415
- class Writer;
416
335
  class FastWriter;
417
336
  class StyledWriter;
418
- class StyledStreamWriter;
419
337
 
420
338
  // reader.h
421
339
  class Reader;
422
- class CharReader;
423
- class CharReaderBuilder;
424
340
 
425
- // json_features.h
341
+ // features.h
426
342
  class Features;
427
343
 
428
344
  // value.h
429
- using ArrayIndex = unsigned int;
345
+ typedef unsigned int ArrayIndex;
430
346
  class StaticString;
431
347
  class Path;
432
348
  class PathArgument;
@@ -450,16 +366,16 @@ class ValueConstIterator;
450
366
 
451
367
 
452
368
  // //////////////////////////////////////////////////////////////////////
453
- // Beginning of content of file: include/json/json_features.h
369
+ // Beginning of content of file: include/json/features.h
454
370
  // //////////////////////////////////////////////////////////////////////
455
371
 
456
- // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
372
+ // Copyright 2007-2010 Baptiste Lepilleur
457
373
  // Distributed under MIT license, or public domain if desired and
458
374
  // recognized in your jurisdiction.
459
375
  // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
460
376
 
461
- #ifndef JSON_FEATURES_H_INCLUDED
462
- #define JSON_FEATURES_H_INCLUDED
377
+ #ifndef CPPTL_JSON_FEATURES_H_INCLUDED
378
+ #define CPPTL_JSON_FEATURES_H_INCLUDED
463
379
 
464
380
  #if !defined(JSON_IS_AMALGAMATION)
465
381
  #include "forwards.h"
@@ -497,17 +413,17 @@ public:
497
413
  Features();
498
414
 
499
415
  /// \c true if comments are allowed. Default: \c true.
500
- bool allowComments_{true};
416
+ bool allowComments_;
501
417
 
502
418
  /// \c true if root must be either an array or an object value. Default: \c
503
419
  /// false.
504
- bool strictRoot_{false};
420
+ bool strictRoot_;
505
421
 
506
422
  /// \c true if dropped null placeholders are allowed. Default: \c false.
507
- bool allowDroppedNullPlaceholders_{false};
423
+ bool allowDroppedNullPlaceholders_;
508
424
 
509
425
  /// \c true if numeric object key are allowed. Default: \c false.
510
- bool allowNumericKeys_{false};
426
+ bool allowNumericKeys_;
511
427
  };
512
428
 
513
429
  } // namespace Json
@@ -515,10 +431,10 @@ public:
515
431
 
516
432
  #pragma pack(pop)
517
433
 
518
- #endif // JSON_FEATURES_H_INCLUDED
434
+ #endif // CPPTL_JSON_FEATURES_H_INCLUDED
519
435
 
520
436
  // //////////////////////////////////////////////////////////////////////
521
- // End of content of file: include/json/json_features.h
437
+ // End of content of file: include/json/features.h
522
438
  // //////////////////////////////////////////////////////////////////////
523
439
 
524
440
 
@@ -530,59 +446,48 @@ public:
530
446
  // Beginning of content of file: include/json/value.h
531
447
  // //////////////////////////////////////////////////////////////////////
532
448
 
533
- // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
449
+ // Copyright 2007-2010 Baptiste Lepilleur
534
450
  // Distributed under MIT license, or public domain if desired and
535
451
  // recognized in your jurisdiction.
536
452
  // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
537
453
 
538
- #ifndef JSON_H_INCLUDED
539
- #define JSON_H_INCLUDED
454
+ #ifndef CPPTL_JSON_H_INCLUDED
455
+ #define CPPTL_JSON_H_INCLUDED
540
456
 
541
457
  #if !defined(JSON_IS_AMALGAMATION)
542
458
  #include "forwards.h"
543
459
  #endif // if !defined(JSON_IS_AMALGAMATION)
460
+ #include <string>
461
+ #include <vector>
462
+ #include <exception>
544
463
 
545
- // Conditional NORETURN attribute on the throw functions would:
546
- // a) suppress false positives from static code analysis
547
- // b) possibly improve optimization opportunities.
548
- #if !defined(JSONCPP_NORETURN)
549
- #if defined(_MSC_VER) && _MSC_VER == 1800
550
- #define JSONCPP_NORETURN __declspec(noreturn)
464
+ #ifndef JSON_USE_CPPTL_SMALLMAP
465
+ #include <map>
551
466
  #else
552
- #define JSONCPP_NORETURN [[noreturn]]
467
+ #include <cpptl/smallmap.h>
553
468
  #endif
469
+ #ifdef JSON_USE_CPPTL
470
+ #include <cpptl/forwards.h>
554
471
  #endif
555
472
 
556
- // Support for '= delete' with template declarations was a late addition
557
- // to the c++11 standard and is rejected by clang 3.8 and Apple clang 8.2
558
- // even though these declare themselves to be c++11 compilers.
559
- #if !defined(JSONCPP_TEMPLATE_DELETE)
560
- #if defined(__clang__) && defined(__apple_build_version__)
561
- #if __apple_build_version__ <= 8000042
562
- #define JSONCPP_TEMPLATE_DELETE
563
- #endif
564
- #elif defined(__clang__)
565
- #if __clang_major__ == 3 && __clang_minor__ <= 8
566
- #define JSONCPP_TEMPLATE_DELETE
567
- #endif
568
- #endif
569
- #if !defined(JSONCPP_TEMPLATE_DELETE)
570
- #define JSONCPP_TEMPLATE_DELETE = delete
571
- #endif
473
+ //Conditional NORETURN attribute on the throw functions would:
474
+ // a) suppress false positives from static code analysis
475
+ // b) possibly improve optimization opportunities.
476
+ #if !defined(JSONCPP_NORETURN)
477
+ # if defined(_MSC_VER)
478
+ # define JSONCPP_NORETURN __declspec(noreturn)
479
+ # elif defined(__GNUC__)
480
+ # define JSONCPP_NORETURN __attribute__ ((__noreturn__))
481
+ # else
482
+ # define JSONCPP_NORETURN
483
+ # endif
572
484
  #endif
573
485
 
574
- #include <array>
575
- #include <exception>
576
- #include <map>
577
- #include <memory>
578
- #include <string>
579
- #include <vector>
580
-
581
486
  // Disable warning C4251: <data member>: <type> needs to have dll-interface to
582
487
  // be used by...
583
488
  #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
584
489
  #pragma warning(push)
585
- #pragma warning(disable : 4251 4275)
490
+ #pragma warning(disable : 4251)
586
491
  #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
587
492
 
588
493
  #pragma pack(push, 8)
@@ -592,19 +497,17 @@ public:
592
497
  namespace Passenger {
593
498
  namespace Json {
594
499
 
595
- #if JSON_USE_EXCEPTION
596
500
  /** Base class for all exceptions we throw.
597
501
  *
598
502
  * We use nothing but these internally. Of course, STL can throw others.
599
503
  */
600
504
  class JSON_API Exception : public std::exception {
601
505
  public:
602
- Exception(String msg);
603
- ~Exception() noexcept override;
604
- char const* what() const noexcept override;
605
-
506
+ Exception(JSONCPP_STRING const& msg);
507
+ ~Exception() JSONCPP_NOEXCEPT JSONCPP_OVERRIDE;
508
+ char const* what() const JSONCPP_NOEXCEPT JSONCPP_OVERRIDE;
606
509
  protected:
607
- String msg_;
510
+ JSONCPP_STRING msg_;
608
511
  };
609
512
 
610
513
  /** Exceptions which the user cannot easily avoid.
@@ -615,7 +518,7 @@ protected:
615
518
  */
616
519
  class JSON_API RuntimeError : public Exception {
617
520
  public:
618
- RuntimeError(String const& msg);
521
+ RuntimeError(JSONCPP_STRING const& msg);
619
522
  };
620
523
 
621
524
  /** Exceptions thrown by JSON_ASSERT/JSON_FAIL macros.
@@ -626,14 +529,13 @@ public:
626
529
  */
627
530
  class JSON_API LogicError : public Exception {
628
531
  public:
629
- LogicError(String const& msg);
532
+ LogicError(JSONCPP_STRING const& msg);
630
533
  };
631
- #endif
632
534
 
633
535
  /// used internally
634
- JSONCPP_NORETURN void throwRuntimeError(String const& msg);
536
+ JSONCPP_NORETURN void throwRuntimeError(JSONCPP_STRING const& msg);
635
537
  /// used internally
636
- JSONCPP_NORETURN void throwLogicError(String const& msg);
538
+ JSONCPP_NORETURN void throwLogicError(JSONCPP_STRING const& msg);
637
539
 
638
540
  /** \brief Type of the value held by a Value object.
639
541
  */
@@ -656,16 +558,14 @@ enum CommentPlacement {
656
558
  numberOfCommentPlacement
657
559
  };
658
560
 
659
- /** \brief Type of precision for formatting of real values.
660
- */
661
- enum PrecisionType {
662
- significantDigits = 0, ///< we set max number of significant digits in string
663
- decimalPlaces ///< we set max number of digits after "." in string
664
- };
561
+ //# ifdef JSON_USE_CPPTL
562
+ // typedef CppTL::AnyEnumerator<const char *> EnumMemberNames;
563
+ // typedef CppTL::AnyEnumerator<const Value &> EnumValues;
564
+ //# endif
665
565
 
666
566
  /** \brief Lightweight wrapper to tag static string.
667
567
  *
668
- * Value constructor and objectValue member assignment takes advantage of the
568
+ * Value constructor and objectValue member assignement takes advantage of the
669
569
  * StaticString and avoid the cost of string duplication when storing the
670
570
  * string or the member name.
671
571
  *
@@ -714,7 +614,7 @@ private:
714
614
  * The get() methods can be used to obtain default value in the case the
715
615
  * required element does not exist.
716
616
  *
717
- * It is possible to iterate over the list of member keys of an object using
617
+ * It is possible to iterate over the list of a #objectValue values using
718
618
  * the getMemberNames() method.
719
619
  *
720
620
  * \note #Value string-length fit in size_t, but keys must be < 2^30.
@@ -725,86 +625,68 @@ private:
725
625
  */
726
626
  class JSON_API Value {
727
627
  friend class ValueIteratorBase;
728
-
729
628
  public:
730
- using Members = std::vector<String>;
731
- using iterator = ValueIterator;
732
- using const_iterator = ValueConstIterator;
733
- using UInt = Json::UInt;
734
- using Int = Json::Int;
629
+ typedef std::vector<JSONCPP_STRING> Members;
630
+ typedef ValueIterator iterator;
631
+ typedef ValueConstIterator const_iterator;
632
+ typedef Json::UInt UInt;
633
+ typedef Json::Int Int;
735
634
  #if defined(JSON_HAS_INT64)
736
- using UInt64 = Json::UInt64;
737
- using Int64 = Json::Int64;
635
+ typedef Json::UInt64 UInt64;
636
+ typedef Json::Int64 Int64;
738
637
  #endif // defined(JSON_HAS_INT64)
739
- using LargestInt = Json::LargestInt;
740
- using LargestUInt = Json::LargestUInt;
741
- using ArrayIndex = Json::ArrayIndex;
638
+ typedef Json::LargestInt LargestInt;
639
+ typedef Json::LargestUInt LargestUInt;
640
+ typedef Json::ArrayIndex ArrayIndex;
742
641
 
743
- // Required for boost integration, e. g. BOOST_TEST
744
- using value_type = std::string;
745
-
746
- #if JSON_USE_NULLREF
747
- // Binary compatibility kludges, do not use.
748
- static const Value& null;
749
- static const Value& nullRef;
750
- #endif
751
-
752
- // null and nullRef are deprecated, use this instead.
753
- static Value const& nullSingleton();
642
+ static const Value& null; ///< We regret this reference to a global instance; prefer the simpler Value().
643
+ static const Value& nullRef; ///< just a kludge for binary-compatibility; same as null
644
+ static Value const& nullSingleton(); ///< Prefer this to null or nullRef.
754
645
 
755
646
  /// Minimum signed integer value that can be stored in a Json::Value.
756
- static constexpr LargestInt minLargestInt =
757
- LargestInt(~(LargestUInt(-1) / 2));
647
+ static const LargestInt minLargestInt;
758
648
  /// Maximum signed integer value that can be stored in a Json::Value.
759
- static constexpr LargestInt maxLargestInt = LargestInt(LargestUInt(-1) / 2);
649
+ static const LargestInt maxLargestInt;
760
650
  /// Maximum unsigned integer value that can be stored in a Json::Value.
761
- static constexpr LargestUInt maxLargestUInt = LargestUInt(-1);
651
+ static const LargestUInt maxLargestUInt;
762
652
 
763
653
  /// Minimum signed int value that can be stored in a Json::Value.
764
- static constexpr Int minInt = Int(~(UInt(-1) / 2));
654
+ static const Int minInt;
765
655
  /// Maximum signed int value that can be stored in a Json::Value.
766
- static constexpr Int maxInt = Int(UInt(-1) / 2);
656
+ static const Int maxInt;
767
657
  /// Maximum unsigned int value that can be stored in a Json::Value.
768
- static constexpr UInt maxUInt = UInt(-1);
658
+ static const UInt maxUInt;
769
659
 
770
660
  #if defined(JSON_HAS_INT64)
771
661
  /// Minimum signed 64 bits int value that can be stored in a Json::Value.
772
- static constexpr Int64 minInt64 = Int64(~(UInt64(-1) / 2));
662
+ static const Int64 minInt64;
773
663
  /// Maximum signed 64 bits int value that can be stored in a Json::Value.
774
- static constexpr Int64 maxInt64 = Int64(UInt64(-1) / 2);
664
+ static const Int64 maxInt64;
775
665
  /// Maximum unsigned 64 bits int value that can be stored in a Json::Value.
776
- static constexpr UInt64 maxUInt64 = UInt64(-1);
666
+ static const UInt64 maxUInt64;
777
667
  #endif // defined(JSON_HAS_INT64)
778
- /// Default precision for real value for string representation.
779
- static constexpr UInt defaultRealPrecision = 17;
780
- // The constant is hard-coded because some compiler have trouble
781
- // converting Value::maxUInt64 to a double correctly (AIX/xlC).
782
- // Assumes that UInt64 is a 64 bits integer.
783
- static constexpr double maxUInt64AsDouble = 18446744073709551615.0;
784
- // Workaround for bug in the NVIDIAs CUDA 9.1 nvcc compiler
785
- // when using gcc and clang backend compilers. CZString
786
- // cannot be defined as private. See issue #486
787
- #ifdef __NVCC__
788
- public:
789
- #else
668
+
790
669
  private:
791
- #endif
792
670
  #ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
793
671
  class CZString {
794
672
  public:
795
- enum DuplicationPolicy { noDuplication = 0, duplicate, duplicateOnCopy };
673
+ enum DuplicationPolicy {
674
+ noDuplication = 0,
675
+ duplicate,
676
+ duplicateOnCopy
677
+ };
796
678
  CZString(ArrayIndex index);
797
679
  CZString(char const* str, unsigned length, DuplicationPolicy allocate);
798
680
  CZString(CZString const& other);
799
- CZString(CZString&& other) noexcept;
681
+ #if JSON_HAS_RVALUE_REFERENCES
682
+ CZString(CZString&& other);
683
+ #endif
800
684
  ~CZString();
801
- CZString& operator=(const CZString& other);
802
- CZString& operator=(CZString&& other) noexcept;
803
-
685
+ CZString& operator=(CZString other);
804
686
  bool operator<(CZString const& other) const;
805
687
  bool operator==(CZString const& other) const;
806
688
  ArrayIndex index() const;
807
- // const char* c_str() const; ///< \deprecated
689
+ //const char* c_str() const; ///< \deprecated
808
690
  char const* data() const;
809
691
  unsigned length() const;
810
692
  bool isStaticString() const;
@@ -813,11 +695,11 @@ private:
813
695
  void swap(CZString& other);
814
696
 
815
697
  struct StringStorage {
816
- unsigned policy_ : 2;
817
- unsigned length_ : 30; // 1GB max
698
+ unsigned policy_: 2;
699
+ unsigned length_: 30; // 1GB max
818
700
  };
819
701
 
820
- char const* cstr_; // actually, a prefixed string, unless policy is noDup
702
+ char const* cstr_; // actually, a prefixed string, unless policy is noDup
821
703
  union {
822
704
  ArrayIndex index_;
823
705
  StringStorage storage_;
@@ -825,26 +707,29 @@ private:
825
707
  };
826
708
 
827
709
  public:
710
+ #ifndef JSON_USE_CPPTL_SMALLMAP
828
711
  typedef std::map<CZString, Value> ObjectValues;
712
+ #else
713
+ typedef CppTL::SmallMap<CZString, Value> ObjectValues;
714
+ #endif // ifndef JSON_USE_CPPTL_SMALLMAP
829
715
  #endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
830
716
 
831
717
  public:
832
- /**
833
- * \brief Create a default Value of the given type.
834
- *
835
- * This is a very useful constructor.
836
- * To create an empty array, pass arrayValue.
837
- * To create an empty object, pass objectValue.
838
- * Another Value can then be set to this one by assignment.
839
- * This is useful since clear() and resize() will not alter types.
840
- *
841
- * Examples:
842
- * \code
843
- * Json::Value null_value; // null
844
- * Json::Value arr_value(Json::arrayValue); // []
845
- * Json::Value obj_value(Json::objectValue); // {}
846
- * \endcode
847
- */
718
+ /** \brief Create a default Value of the given type.
719
+
720
+ This is a very useful constructor.
721
+ To create an empty array, pass arrayValue.
722
+ To create an empty object, pass objectValue.
723
+ Another Value can then be set to this one by assignment.
724
+ This is useful since clear() and resize() will not alter types.
725
+
726
+ Examples:
727
+ \code
728
+ Json::Value null_value; // null
729
+ Json::Value arr_value(Json::arrayValue); // []
730
+ Json::Value obj_value(Json::objectValue); // {}
731
+ \endcode
732
+ */
848
733
  Value(ValueType type = nullValue);
849
734
  Value(Int value);
850
735
  Value(UInt value);
@@ -855,46 +740,43 @@ public:
855
740
  Value(double value);
856
741
  Value(const char* value); ///< Copy til first 0. (NULL causes to seg-fault.)
857
742
  Value(const char* begin, const char* end); ///< Copy all, incl zeroes.
858
- /**
859
- * \brief Constructs a value from a static string.
860
- *
743
+ /** \brief Constructs a value from a static string.
744
+
861
745
  * Like other value string constructor but do not duplicate the string for
862
- * internal storage. The given string must remain alive after the call to
863
- * this constructor.
864
- *
746
+ * internal storage. The given string must remain alive after the call to this
747
+ * constructor.
865
748
  * \note This works only for null-terminated strings. (We cannot change the
866
- * size of this class, so we have nowhere to store the length, which might be
867
- * computed later for various operations.)
749
+ * size of this class, so we have nowhere to store the length,
750
+ * which might be computed later for various operations.)
868
751
  *
869
752
  * Example of usage:
870
- * \code
871
- * static StaticString foo("some text");
872
- * Json::Value aValue(foo);
873
- * \endcode
753
+ * \code
754
+ * static StaticString foo("some text");
755
+ * Json::Value aValue(foo);
756
+ * \endcode
874
757
  */
875
758
  Value(const StaticString& value);
876
- Value(const String& value);
759
+ Value(const JSONCPP_STRING& value); ///< Copy data() til size(). Embedded zeroes too.
760
+ #ifdef JSON_USE_CPPTL
761
+ Value(const CppTL::ConstString& value);
762
+ #endif
877
763
  Value(bool value);
878
- Value(std::nullptr_t ptr) = delete;
764
+ /// Deep copy.
879
765
  Value(const Value& other);
880
- Value(Value&& other) noexcept;
766
+ #if JSON_HAS_RVALUE_REFERENCES
767
+ /// Move constructor
768
+ Value(Value&& other);
769
+ #endif
881
770
  virtual ~Value();
882
771
 
883
- /// \note Overwrite existing comments. To preserve comments, use
884
- /// #swapPayload().
885
- Value& operator=(const Value& other);
886
- Value& operator=(Value&& other) noexcept;
887
-
772
+ /// Deep copy, then swap(other).
773
+ /// \note Over-write existing comments. To preserve comments, use #swapPayload().
774
+ Value& operator=(Value other);
888
775
  /// Swap everything.
889
776
  void swap(Value& other);
890
777
  /// Swap values but leave comments and source offsets in place.
891
778
  void swapPayload(Value& other);
892
779
 
893
- /// copy everything.
894
- void copy(const Value& other);
895
- /// copy values but leave comments and source offsets in place.
896
- void copyPayload(const Value& other);
897
-
898
780
  ValueType type() const;
899
781
 
900
782
  /// Compare payload only, not comments etc.
@@ -908,14 +790,17 @@ public:
908
790
 
909
791
  const char* asCString() const; ///< Embedded zeroes could cause you trouble!
910
792
  #if JSONCPP_USING_SECURE_MEMORY
911
- unsigned getCStringLength() const; // Allows you to understand the length of
912
- // the CString
793
+ unsigned getCStringLength() const; //Allows you to understand the length of the CString
913
794
  #endif
914
- String asString() const; ///< Embedded zeroes are possible.
795
+ JSONCPP_STRING asString() const; ///< Embedded zeroes are possible.
915
796
  /** Get raw char* of string-value.
916
797
  * \return false if !string. (Seg-fault if str or end are NULL.)
917
798
  */
918
- bool getString(char const** begin, char const** end) const;
799
+ bool getString(
800
+ char const** begin, char const** end) const;
801
+ #ifdef JSON_USE_CPPTL
802
+ CppTL::ConstString asConstString() const;
803
+ #endif
919
804
  Int asInt() const;
920
805
  UInt asUInt() const;
921
806
  #if defined(JSON_HAS_INT64)
@@ -941,10 +826,6 @@ public:
941
826
  bool isArray() const;
942
827
  bool isObject() const;
943
828
 
944
- /// The `as<T>` and `is<T>` member function templates and specializations.
945
- template <typename T> T as() const JSONCPP_TEMPLATE_DELETE;
946
- template <typename T> bool is() const JSONCPP_TEMPLATE_DELETE;
947
-
948
829
  bool isConvertibleTo(ValueType other) const;
949
830
 
950
831
  /// Number of values in array or object
@@ -954,41 +835,50 @@ public:
954
835
  /// otherwise, false.
955
836
  bool empty() const;
956
837
 
957
- /// Return !isNull()
958
- explicit operator bool() const;
838
+ /// Return isNull()
839
+ bool operator!() const;
959
840
 
960
841
  /// Remove all object members and array elements.
961
842
  /// \pre type() is arrayValue, objectValue, or nullValue
962
843
  /// \post type() is unchanged
963
844
  void clear();
964
845
 
965
- /// Resize the array to newSize elements.
846
+ /// Resize the array to size elements.
966
847
  /// New elements are initialized to null.
967
848
  /// May only be called on nullValue or arrayValue.
968
849
  /// \pre type() is arrayValue or nullValue
969
850
  /// \post type() is arrayValue
970
- void resize(ArrayIndex newSize);
851
+ void resize(ArrayIndex size);
971
852
 
972
- //@{
973
- /// Access an array element (zero based index). If the array contains less
974
- /// than index element, then null value are inserted in the array so that
975
- /// its size is index+1.
853
+ /// Access an array element (zero based index ).
854
+ /// If the array contains less than index element, then null value are
855
+ /// inserted
856
+ /// in the array so that its size is index+1.
976
857
  /// (You may need to say 'value[0u]' to get your compiler to distinguish
977
- /// this from the operator[] which takes a string.)
858
+ /// this from the operator[] which takes a string.)
978
859
  Value& operator[](ArrayIndex index);
860
+
861
+ /// Access an array element (zero based index ).
862
+ /// If the array contains less than index element, then null value are
863
+ /// inserted
864
+ /// in the array so that its size is index+1.
865
+ /// (You may need to say 'value[0u]' to get your compiler to distinguish
866
+ /// this from the operator[] which takes a string.)
979
867
  Value& operator[](int index);
980
- //@}
981
868
 
982
- //@{
983
- /// Access an array element (zero based index).
869
+ /// Access an array element (zero based index )
984
870
  /// (You may need to say 'value[0u]' to get your compiler to distinguish
985
- /// this from the operator[] which takes a string.)
871
+ /// this from the operator[] which takes a string.)
986
872
  const Value& operator[](ArrayIndex index) const;
873
+
874
+ /// Access an array element (zero based index )
875
+ /// (You may need to say 'value[0u]' to get your compiler to distinguish
876
+ /// this from the operator[] which takes a string.)
987
877
  const Value& operator[](int index) const;
988
- //@}
989
878
 
990
879
  /// If the array contains at least index+1 elements, returns the element
991
- /// value, otherwise returns defaultValue.
880
+ /// value,
881
+ /// otherwise returns defaultValue.
992
882
  Value get(ArrayIndex index, const Value& defaultValue) const;
993
883
  /// Return true if index < size().
994
884
  bool isValidIndex(ArrayIndex index) const;
@@ -996,51 +886,57 @@ public:
996
886
  ///
997
887
  /// Equivalent to jsonvalue[jsonvalue.size()] = value;
998
888
  Value& append(const Value& value);
999
- Value& append(Value&& value);
1000
-
1001
- /// \brief Insert value in array at specific index
1002
- bool insert(ArrayIndex index, const Value& newValue);
1003
- bool insert(ArrayIndex index, Value&& newValue);
1004
889
 
1005
890
  /// Access an object value by name, create a null member if it does not exist.
1006
891
  /// \note Because of our implementation, keys are limited to 2^30 -1 chars.
1007
- /// Exceeding that will cause an exception.
892
+ /// Exceeding that will cause an exception.
1008
893
  Value& operator[](const char* key);
1009
894
  /// Access an object value by name, returns null if there is no member with
1010
895
  /// that name.
1011
896
  const Value& operator[](const char* key) const;
1012
897
  /// Access an object value by name, create a null member if it does not exist.
1013
898
  /// \param key may contain embedded nulls.
1014
- Value& operator[](const String& key);
899
+ Value& operator[](const JSONCPP_STRING& key);
1015
900
  /// Access an object value by name, returns null if there is no member with
1016
901
  /// that name.
1017
902
  /// \param key may contain embedded nulls.
1018
- const Value& operator[](const String& key) const;
903
+ const Value& operator[](const JSONCPP_STRING& key) const;
1019
904
  /** \brief Access an object value by name, create a null member if it does not
1020
- * exist.
1021
- *
1022
- * If the object has no entry for that name, then the member name used to
1023
- * store the new entry is not duplicated.
905
+ exist.
906
+
907
+ * If the object has no entry for that name, then the member name used to store
908
+ * the new entry is not duplicated.
1024
909
  * Example of use:
1025
- * \code
1026
- * Json::Value object;
1027
- * static const StaticString code("code");
1028
- * object[code] = 1234;
1029
- * \endcode
910
+ * \code
911
+ * Json::Value object;
912
+ * static const StaticString code("code");
913
+ * object[code] = 1234;
914
+ * \endcode
1030
915
  */
1031
916
  Value& operator[](const StaticString& key);
917
+ #ifdef JSON_USE_CPPTL
918
+ /// Access an object value by name, create a null member if it does not exist.
919
+ Value& operator[](const CppTL::ConstString& key);
920
+ /// Access an object value by name, returns null if there is no member with
921
+ /// that name.
922
+ const Value& operator[](const CppTL::ConstString& key) const;
923
+ #endif
1032
924
  /// Return the member named key if it exist, defaultValue otherwise.
1033
925
  /// \note deep copy
1034
926
  Value get(const char* key, const Value& defaultValue) const;
1035
927
  /// Return the member named key if it exist, defaultValue otherwise.
1036
928
  /// \note deep copy
1037
929
  /// \note key may contain embedded nulls.
1038
- Value get(const char* begin, const char* end,
1039
- const Value& defaultValue) const;
930
+ Value get(const char* begin, const char* end, const Value& defaultValue) const;
1040
931
  /// Return the member named key if it exist, defaultValue otherwise.
1041
932
  /// \note deep copy
1042
933
  /// \param key may contain embedded nulls.
1043
- Value get(const String& key, const Value& defaultValue) const;
934
+ Value get(const JSONCPP_STRING& key, const Value& defaultValue) const;
935
+ #ifdef JSON_USE_CPPTL
936
+ /// Return the member named key if it exist, defaultValue otherwise.
937
+ /// \note deep copy
938
+ Value get(const CppTL::ConstString& key, const Value& defaultValue) const;
939
+ #endif
1044
940
  /// Most general and efficient version of isMember()const, get()const,
1045
941
  /// and operator[]const
1046
942
  /// \note As stated elsewhere, behavior is undefined if (end-begin) >= 2^30
@@ -1048,44 +944,51 @@ public:
1048
944
  /// Most general and efficient version of object-mutators.
1049
945
  /// \note As stated elsewhere, behavior is undefined if (end-begin) >= 2^30
1050
946
  /// \return non-zero, but JSON_ASSERT if this is neither object nor nullValue.
1051
- Value* demand(char const* begin, char const* end);
947
+ Value const* demand(char const* begin, char const* end);
1052
948
  /// \brief Remove and return the named member.
1053
949
  ///
1054
950
  /// Do nothing if it did not exist.
951
+ /// \return the removed Value, or null.
1055
952
  /// \pre type() is objectValue or nullValue
1056
953
  /// \post type() is unchanged
1057
- void removeMember(const char* key);
954
+ /// \deprecated
955
+ Value removeMember(const char* key);
1058
956
  /// Same as removeMember(const char*)
1059
957
  /// \param key may contain embedded nulls.
1060
- void removeMember(const String& key);
958
+ /// \deprecated
959
+ Value removeMember(const JSONCPP_STRING& key);
1061
960
  /// Same as removeMember(const char* begin, const char* end, Value* removed),
1062
961
  /// but 'key' is null-terminated.
1063
962
  bool removeMember(const char* key, Value* removed);
1064
963
  /** \brief Remove the named map member.
1065
- *
1066
- * Update 'removed' iff removed.
1067
- * \param key may contain embedded nulls.
1068
- * \return true iff removed (no exceptions)
1069
- */
1070
- bool removeMember(String const& key, Value* removed);
1071
- /// Same as removeMember(String const& key, Value* removed)
964
+
965
+ Update 'removed' iff removed.
966
+ \param key may contain embedded nulls.
967
+ \return true iff removed (no exceptions)
968
+ */
969
+ bool removeMember(JSONCPP_STRING const& key, Value* removed);
970
+ /// Same as removeMember(JSONCPP_STRING const& key, Value* removed)
1072
971
  bool removeMember(const char* begin, const char* end, Value* removed);
1073
972
  /** \brief Remove the indexed array element.
1074
- *
1075
- * O(n) expensive operations.
1076
- * Update 'removed' iff removed.
1077
- * \return true if removed (no exceptions)
1078
- */
1079
- bool removeIndex(ArrayIndex index, Value* removed);
973
+
974
+ O(n) expensive operations.
975
+ Update 'removed' iff removed.
976
+ \return true iff removed (no exceptions)
977
+ */
978
+ bool removeIndex(ArrayIndex i, Value* removed);
1080
979
 
1081
980
  /// Return true if the object has a member named key.
1082
981
  /// \note 'key' must be null-terminated.
1083
982
  bool isMember(const char* key) const;
1084
983
  /// Return true if the object has a member named key.
1085
984
  /// \param key may contain embedded nulls.
1086
- bool isMember(const String& key) const;
1087
- /// Same as isMember(String const& key)const
985
+ bool isMember(const JSONCPP_STRING& key) const;
986
+ /// Same as isMember(JSONCPP_STRING const& key)const
1088
987
  bool isMember(const char* begin, const char* end) const;
988
+ #ifdef JSON_USE_CPPTL
989
+ /// Return true if the object has a member named key.
990
+ bool isMember(const CppTL::ConstString& key) const;
991
+ #endif
1089
992
 
1090
993
  /// \brief Return a list of the member names.
1091
994
  ///
@@ -1094,22 +997,23 @@ public:
1094
997
  /// \post if type() was nullValue, it remains nullValue
1095
998
  Members getMemberNames() const;
1096
999
 
1000
+ //# ifdef JSON_USE_CPPTL
1001
+ // EnumMemberNames enumMemberNames() const;
1002
+ // EnumValues enumValues() const;
1003
+ //# endif
1004
+
1097
1005
  /// \deprecated Always pass len.
1098
- JSONCPP_DEPRECATED("Use setComment(String const&) instead.")
1099
- void setComment(const char* comment, CommentPlacement placement) {
1100
- setComment(String(comment, strlen(comment)), placement);
1101
- }
1006
+ JSONCPP_DEPRECATED("Use setComment(JSONCPP_STRING const&) instead.")
1007
+ void setComment(const char* comment, CommentPlacement placement);
1102
1008
  /// Comments must be //... or /* ... */
1103
- void setComment(const char* comment, size_t len, CommentPlacement placement) {
1104
- setComment(String(comment, len), placement);
1105
- }
1009
+ void setComment(const char* comment, size_t len, CommentPlacement placement);
1106
1010
  /// Comments must be //... or /* ... */
1107
- void setComment(String comment, CommentPlacement placement);
1011
+ void setComment(const JSONCPP_STRING& comment, CommentPlacement placement);
1108
1012
  bool hasComment(CommentPlacement placement) const;
1109
1013
  /// Include delimiters and embedded newlines.
1110
- String getComment(CommentPlacement placement) const;
1014
+ JSONCPP_STRING getComment(CommentPlacement placement) const;
1111
1015
 
1112
- String toStyledString() const;
1016
+ JSONCPP_STRING toStyledString() const;
1113
1017
 
1114
1018
  const_iterator begin() const;
1115
1019
  const_iterator end() const;
@@ -1125,20 +1029,20 @@ public:
1125
1029
  ptrdiff_t getOffsetLimit() const;
1126
1030
 
1127
1031
  private:
1128
- void setType(ValueType v) {
1129
- bits_.value_type_ = static_cast<unsigned char>(v);
1130
- }
1131
- bool isAllocated() const { return bits_.allocated_; }
1132
- void setIsAllocated(bool v) { bits_.allocated_ = v; }
1133
-
1134
1032
  void initBasic(ValueType type, bool allocated = false);
1135
- void dupPayload(const Value& other);
1136
- void releasePayload();
1137
- void dupMeta(const Value& other);
1138
1033
 
1139
1034
  Value& resolveReference(const char* key);
1140
1035
  Value& resolveReference(const char* key, const char* end);
1141
1036
 
1037
+ struct CommentInfo {
1038
+ CommentInfo();
1039
+ ~CommentInfo();
1040
+
1041
+ void setComment(const char* text, size_t len);
1042
+
1043
+ char* comment_;
1044
+ };
1045
+
1142
1046
  // struct MemberNamesTransform
1143
1047
  //{
1144
1048
  // typedef const char *result_type;
@@ -1153,33 +1057,13 @@ private:
1153
1057
  LargestUInt uint_;
1154
1058
  double real_;
1155
1059
  bool bool_;
1156
- char* string_; // if allocated_, ptr to { unsigned, char[] }.
1060
+ char* string_; // actually ptr to unsigned, followed by str, unless !allocated_
1157
1061
  ObjectValues* map_;
1158
1062
  } value_;
1159
-
1160
- struct {
1161
- // Really a ValueType, but types should agree for bitfield packing.
1162
- unsigned int value_type_ : 8;
1163
- // Unless allocated_, string_ must be null-terminated.
1164
- unsigned int allocated_ : 1;
1165
- } bits_;
1166
-
1167
- class Comments {
1168
- public:
1169
- Comments() = default;
1170
- Comments(const Comments& that);
1171
- Comments(Comments&& that) noexcept;
1172
- Comments& operator=(const Comments& that);
1173
- Comments& operator=(Comments&& that) noexcept;
1174
- bool has(CommentPlacement slot) const;
1175
- String get(CommentPlacement slot) const;
1176
- void set(CommentPlacement slot, String comment);
1177
-
1178
- private:
1179
- using Array = std::array<String, numberOfCommentPlacement>;
1180
- std::unique_ptr<Array> ptr_;
1181
- };
1182
- Comments comments_;
1063
+ ValueType type_ : 8;
1064
+ unsigned int allocated_ : 1; // Notes: if declared as bool, bitfield is useless.
1065
+ // If not allocated_, string_ must be null-terminated.
1066
+ CommentInfo* comments_;
1183
1067
 
1184
1068
  // [start, limit) byte offsets in the source JSON text from which this Value
1185
1069
  // was extracted.
@@ -1187,36 +1071,6 @@ private:
1187
1071
  ptrdiff_t limit_;
1188
1072
  };
1189
1073
 
1190
- template <> inline bool Value::as<bool>() const { return asBool(); }
1191
- template <> inline bool Value::is<bool>() const { return isBool(); }
1192
-
1193
- template <> inline Int Value::as<Int>() const { return asInt(); }
1194
- template <> inline bool Value::is<Int>() const { return isInt(); }
1195
-
1196
- template <> inline UInt Value::as<UInt>() const { return asUInt(); }
1197
- template <> inline bool Value::is<UInt>() const { return isUInt(); }
1198
-
1199
- #if defined(JSON_HAS_INT64)
1200
- template <> inline Int64 Value::as<Int64>() const { return asInt64(); }
1201
- template <> inline bool Value::is<Int64>() const { return isInt64(); }
1202
-
1203
- template <> inline UInt64 Value::as<UInt64>() const { return asUInt64(); }
1204
- template <> inline bool Value::is<UInt64>() const { return isUInt64(); }
1205
- #endif
1206
-
1207
- template <> inline double Value::as<double>() const { return asDouble(); }
1208
- template <> inline bool Value::is<double>() const { return isDouble(); }
1209
-
1210
- template <> inline String Value::as<String>() const { return asString(); }
1211
- template <> inline bool Value::is<String>() const { return isString(); }
1212
-
1213
- /// These `as` specializations are type conversions, and do not have a
1214
- /// corresponding `is`.
1215
- template <> inline float Value::as<float>() const { return asFloat(); }
1216
- template <> inline const char* Value::as<const char*>() const {
1217
- return asCString();
1218
- }
1219
-
1220
1074
  /** \brief Experimental and untested: represents an element of the "path" to
1221
1075
  * access a node.
1222
1076
  */
@@ -1227,13 +1081,17 @@ public:
1227
1081
  PathArgument();
1228
1082
  PathArgument(ArrayIndex index);
1229
1083
  PathArgument(const char* key);
1230
- PathArgument(String key);
1084
+ PathArgument(const JSONCPP_STRING& key);
1231
1085
 
1232
1086
  private:
1233
- enum Kind { kindNone = 0, kindIndex, kindKey };
1234
- String key_;
1235
- ArrayIndex index_{};
1236
- Kind kind_{kindNone};
1087
+ enum Kind {
1088
+ kindNone = 0,
1089
+ kindIndex,
1090
+ kindKey
1091
+ };
1092
+ JSONCPP_STRING key_;
1093
+ ArrayIndex index_;
1094
+ Kind kind_;
1237
1095
  };
1238
1096
 
1239
1097
  /** \brief Experimental and untested: represents a "path" to access a node.
@@ -1245,11 +1103,12 @@ private:
1245
1103
  * - ".name1.name2.name3"
1246
1104
  * - ".[0][1][2].name1[3]"
1247
1105
  * - ".%" => member name is provided as parameter
1248
- * - ".[%]" => index is provided as parameter
1106
+ * - ".[%]" => index is provied as parameter
1249
1107
  */
1250
1108
  class JSON_API Path {
1251
1109
  public:
1252
- Path(const String& path, const PathArgument& a1 = PathArgument(),
1110
+ Path(const JSONCPP_STRING& path,
1111
+ const PathArgument& a1 = PathArgument(),
1253
1112
  const PathArgument& a2 = PathArgument(),
1254
1113
  const PathArgument& a3 = PathArgument(),
1255
1114
  const PathArgument& a4 = PathArgument(),
@@ -1262,13 +1121,15 @@ public:
1262
1121
  Value& make(Value& root) const;
1263
1122
 
1264
1123
  private:
1265
- using InArgs = std::vector<const PathArgument*>;
1266
- using Args = std::vector<PathArgument>;
1124
+ typedef std::vector<const PathArgument*> InArgs;
1125
+ typedef std::vector<PathArgument> Args;
1267
1126
 
1268
- void makePath(const String& path, const InArgs& in);
1269
- void addPathInArg(const String& path, const InArgs& in,
1270
- InArgs::const_iterator& itInArg, PathArgument::Kind kind);
1271
- static void invalidPath(const String& path, int location);
1127
+ void makePath(const JSONCPP_STRING& path, const InArgs& in);
1128
+ void addPathInArg(const JSONCPP_STRING& path,
1129
+ const InArgs& in,
1130
+ InArgs::const_iterator& itInArg,
1131
+ PathArgument::Kind kind);
1132
+ void invalidPath(const JSONCPP_STRING& path, int location);
1272
1133
 
1273
1134
  Args args_;
1274
1135
  };
@@ -1278,10 +1139,10 @@ private:
1278
1139
  */
1279
1140
  class JSON_API ValueIteratorBase {
1280
1141
  public:
1281
- using iterator_category = std::bidirectional_iterator_tag;
1282
- using size_t = unsigned int;
1283
- using difference_type = int;
1284
- using SelfType = ValueIteratorBase;
1142
+ typedef std::bidirectional_iterator_tag iterator_category;
1143
+ typedef unsigned int size_t;
1144
+ typedef int difference_type;
1145
+ typedef ValueIteratorBase SelfType;
1285
1146
 
1286
1147
  bool operator==(const SelfType& other) const { return isEqual(other); }
1287
1148
 
@@ -1295,19 +1156,17 @@ public:
1295
1156
  /// Value.
1296
1157
  Value key() const;
1297
1158
 
1298
- /// Return the index of the referenced Value, or -1 if it is not an
1299
- /// arrayValue.
1159
+ /// Return the index of the referenced Value, or -1 if it is not an arrayValue.
1300
1160
  UInt index() const;
1301
1161
 
1302
1162
  /// Return the member name of the referenced Value, or "" if it is not an
1303
1163
  /// objectValue.
1304
1164
  /// \note Avoid `c_str()` on result, as embedded zeroes are possible.
1305
- String name() const;
1165
+ JSONCPP_STRING name() const;
1306
1166
 
1307
1167
  /// Return the member name of the referenced Value. "" if it is not an
1308
1168
  /// objectValue.
1309
- /// \deprecated This cannot be used for UTF-8 strings, since there can be
1310
- /// embedded nulls.
1169
+ /// \deprecated This cannot be used for UTF-8 strings, since there can be embedded nulls.
1311
1170
  JSONCPP_DEPRECATED("Use `key = name();` instead.")
1312
1171
  char const* memberName() const;
1313
1172
  /// Return the member name of the referenced Value, or NULL if it is not an
@@ -1316,14 +1175,7 @@ public:
1316
1175
  char const* memberName(char const** end) const;
1317
1176
 
1318
1177
  protected:
1319
- /*! Internal utility functions to assist with implementing
1320
- * other iterator functions. The const and non-const versions
1321
- * of the "deref" protected methods expose the protected
1322
- * current_ member variable in a way that can often be
1323
- * optimized away by the compiler.
1324
- */
1325
- const Value& deref() const;
1326
- Value& deref();
1178
+ Value& deref() const;
1327
1179
 
1328
1180
  void increment();
1329
1181
 
@@ -1338,7 +1190,7 @@ protected:
1338
1190
  private:
1339
1191
  Value::ObjectValues::iterator current_;
1340
1192
  // Indicates that iterator is for a null value.
1341
- bool isNull_{true};
1193
+ bool isNull_;
1342
1194
 
1343
1195
  public:
1344
1196
  // For some reason, BORLAND needs these at the end, rather
@@ -1354,21 +1206,20 @@ class JSON_API ValueConstIterator : public ValueIteratorBase {
1354
1206
  friend class Value;
1355
1207
 
1356
1208
  public:
1357
- using value_type = const Value;
1358
- // typedef unsigned int size_t;
1359
- // typedef int difference_type;
1360
- using reference = const Value&;
1361
- using pointer = const Value*;
1362
- using SelfType = ValueConstIterator;
1209
+ typedef const Value value_type;
1210
+ //typedef unsigned int size_t;
1211
+ //typedef int difference_type;
1212
+ typedef const Value& reference;
1213
+ typedef const Value* pointer;
1214
+ typedef ValueConstIterator SelfType;
1363
1215
 
1364
1216
  ValueConstIterator();
1365
1217
  ValueConstIterator(ValueIterator const& other);
1366
1218
 
1367
1219
  private:
1368
- /*! \internal Use by Value to create an iterator.
1369
- */
1220
+ /*! \internal Use by Value to create an iterator.
1221
+ */
1370
1222
  explicit ValueConstIterator(const Value::ObjectValues::iterator& current);
1371
-
1372
1223
  public:
1373
1224
  SelfType& operator=(const ValueIteratorBase& other);
1374
1225
 
@@ -1405,22 +1256,21 @@ class JSON_API ValueIterator : public ValueIteratorBase {
1405
1256
  friend class Value;
1406
1257
 
1407
1258
  public:
1408
- using value_type = Value;
1409
- using size_t = unsigned int;
1410
- using difference_type = int;
1411
- using reference = Value&;
1412
- using pointer = Value*;
1413
- using SelfType = ValueIterator;
1259
+ typedef Value value_type;
1260
+ typedef unsigned int size_t;
1261
+ typedef int difference_type;
1262
+ typedef Value& reference;
1263
+ typedef Value* pointer;
1264
+ typedef ValueIterator SelfType;
1414
1265
 
1415
1266
  ValueIterator();
1416
1267
  explicit ValueIterator(const ValueConstIterator& other);
1417
1268
  ValueIterator(const ValueIterator& other);
1418
1269
 
1419
1270
  private:
1420
- /*! \internal Use by Value to create an iterator.
1421
- */
1271
+ /*! \internal Use by Value to create an iterator.
1272
+ */
1422
1273
  explicit ValueIterator(const Value::ObjectValues::iterator& current);
1423
-
1424
1274
  public:
1425
1275
  SelfType& operator=(const SelfType& other);
1426
1276
 
@@ -1446,27 +1296,28 @@ public:
1446
1296
  return *this;
1447
1297
  }
1448
1298
 
1449
- /*! The return value of non-const iterators can be
1450
- * changed, so the these functions are not const
1451
- * because the returned references/pointers can be used
1452
- * to change state of the base class.
1453
- */
1454
- reference operator*() const { return const_cast<reference>(deref()); }
1455
- pointer operator->() const { return const_cast<pointer>(&deref()); }
1456
- };
1299
+ reference operator*() const { return deref(); }
1457
1300
 
1458
- inline void swap(Value& a, Value& b) { a.swap(b); }
1301
+ pointer operator->() const { return &deref(); }
1302
+ };
1459
1303
 
1460
1304
  } // namespace Json
1461
1305
  } // namespace Passenger
1462
1306
 
1307
+
1308
+ namespace std {
1309
+ /// Specialize std::swap() for Json::Value.
1310
+ template<>
1311
+ inline void swap(Passenger::Json::Value& a, Passenger::Json::Value& b) { a.swap(b); }
1312
+ }
1313
+
1463
1314
  #pragma pack(pop)
1464
1315
 
1465
1316
  #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1466
1317
  #pragma warning(pop)
1467
1318
  #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1468
1319
 
1469
- #endif // JSON_H_INCLUDED
1320
+ #endif // CPPTL_JSON_H_INCLUDED
1470
1321
 
1471
1322
  // //////////////////////////////////////////////////////////////////////
1472
1323
  // End of content of file: include/json/value.h
@@ -1481,23 +1332,23 @@ inline void swap(Value& a, Value& b) { a.swap(b); }
1481
1332
  // Beginning of content of file: include/json/reader.h
1482
1333
  // //////////////////////////////////////////////////////////////////////
1483
1334
 
1484
- // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
1335
+ // Copyright 2007-2010 Baptiste Lepilleur
1485
1336
  // Distributed under MIT license, or public domain if desired and
1486
1337
  // recognized in your jurisdiction.
1487
1338
  // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
1488
1339
 
1489
- #ifndef JSON_READER_H_INCLUDED
1490
- #define JSON_READER_H_INCLUDED
1340
+ #ifndef CPPTL_JSON_READER_H_INCLUDED
1341
+ #define CPPTL_JSON_READER_H_INCLUDED
1491
1342
 
1492
1343
  #if !defined(JSON_IS_AMALGAMATION)
1493
- #include "json_features.h"
1344
+ #include "features.h"
1494
1345
  #include "value.h"
1495
1346
  #endif // if !defined(JSON_IS_AMALGAMATION)
1496
1347
  #include <deque>
1497
1348
  #include <iosfwd>
1498
- #include <istream>
1499
1349
  #include <stack>
1500
1350
  #include <string>
1351
+ #include <istream>
1501
1352
 
1502
1353
  // Disable warning C4251: <data member>: <type> needs to have dll-interface to
1503
1354
  // be used by...
@@ -1512,129 +1363,132 @@ namespace Passenger {
1512
1363
  namespace Json {
1513
1364
 
1514
1365
  /** \brief Unserialize a <a HREF="http://www.json.org">JSON</a> document into a
1515
- * Value.
1366
+ *Value.
1516
1367
  *
1517
1368
  * \deprecated Use CharReader and CharReaderBuilder.
1518
1369
  */
1519
-
1520
1370
  class JSON_API Reader {
1521
1371
  public:
1522
- using Char = char;
1523
- using Location = const Char*;
1372
+ typedef char Char;
1373
+ typedef const Char* Location;
1524
1374
 
1525
1375
  /** \brief An error tagged with where in the JSON text it was encountered.
1526
1376
  *
1527
1377
  * The offsets give the [start, limit) range of bytes within the text. Note
1528
1378
  * that this is bytes, not codepoints.
1379
+ *
1529
1380
  */
1530
1381
  struct StructuredError {
1531
1382
  ptrdiff_t offset_start;
1532
1383
  ptrdiff_t offset_limit;
1533
- String message;
1384
+ JSONCPP_STRING message;
1534
1385
  };
1535
1386
 
1536
- /** \brief Constructs a Reader allowing all features for parsing.
1537
- * \deprecated Use CharReader and CharReaderBuilder.
1387
+ /** \brief Constructs a Reader allowing all features
1388
+ * for parsing.
1538
1389
  */
1539
1390
  Reader();
1540
1391
 
1541
- /** \brief Constructs a Reader allowing the specified feature set for parsing.
1542
- * \deprecated Use CharReader and CharReaderBuilder.
1392
+ /** \brief Constructs a Reader allowing the specified feature set
1393
+ * for parsing.
1543
1394
  */
1544
1395
  Reader(const Features& features);
1545
1396
 
1546
1397
  /** \brief Read a Value from a <a HREF="http://www.json.org">JSON</a>
1547
1398
  * document.
1548
- *
1549
- * \param document UTF-8 encoded string containing the document
1550
- * to read.
1551
- * \param[out] root Contains the root value of the document if it
1552
- * was successfully parsed.
1553
- * \param collectComments \c true to collect comment and allow writing
1554
- * them back during serialization, \c false to
1555
- * discard comments. This parameter is ignored
1556
- * if Features::allowComments_ is \c false.
1399
+ * \param document UTF-8 encoded string containing the document to read.
1400
+ * \param root [out] Contains the root value of the document if it was
1401
+ * successfully parsed.
1402
+ * \param collectComments \c true to collect comment and allow writing them
1403
+ * back during
1404
+ * serialization, \c false to discard comments.
1405
+ * This parameter is ignored if
1406
+ * Features::allowComments_
1407
+ * is \c false.
1557
1408
  * \return \c true if the document was successfully parsed, \c false if an
1558
1409
  * error occurred.
1559
1410
  */
1560
- bool parse(const std::string& document, Value& root,
1561
- bool collectComments = true);
1411
+ bool
1412
+ parse(const std::string& document, Value& root, bool collectComments = true);
1562
1413
 
1563
1414
  /** \brief Read a Value from a <a HREF="http://www.json.org">JSON</a>
1564
- * document.
1565
- *
1566
- * \param beginDoc Pointer on the beginning of the UTF-8 encoded
1567
- * string of the document to read.
1568
- * \param endDoc Pointer on the end of the UTF-8 encoded string
1569
- * of the document to read. Must be >= beginDoc.
1570
- * \param[out] root Contains the root value of the document if it
1571
- * was successfully parsed.
1572
- * \param collectComments \c true to collect comment and allow writing
1573
- * them back during serialization, \c false to
1574
- * discard comments. This parameter is ignored
1575
- * if Features::allowComments_ is \c false.
1415
+ document.
1416
+ * \param beginDoc Pointer on the beginning of the UTF-8 encoded string of the
1417
+ document to read.
1418
+ * \param endDoc Pointer on the end of the UTF-8 encoded string of the
1419
+ document to read.
1420
+ * Must be >= beginDoc.
1421
+ * \param root [out] Contains the root value of the document if it was
1422
+ * successfully parsed.
1423
+ * \param collectComments \c true to collect comment and allow writing them
1424
+ back during
1425
+ * serialization, \c false to discard comments.
1426
+ * This parameter is ignored if
1427
+ Features::allowComments_
1428
+ * is \c false.
1576
1429
  * \return \c true if the document was successfully parsed, \c false if an
1577
- * error occurred.
1430
+ error occurred.
1578
1431
  */
1579
- bool parse(const char* beginDoc, const char* endDoc, Value& root,
1432
+ bool parse(const char* beginDoc,
1433
+ const char* endDoc,
1434
+ Value& root,
1580
1435
  bool collectComments = true);
1581
1436
 
1582
1437
  /// \brief Parse from input stream.
1583
1438
  /// \see Json::operator>>(std::istream&, Json::Value&).
1584
- bool parse(IStream& is, Value& root, bool collectComments = true);
1439
+ bool parse(JSONCPP_ISTREAM& is, Value& root, bool collectComments = true);
1585
1440
 
1586
1441
  /** \brief Returns a user friendly string that list errors in the parsed
1587
1442
  * document.
1588
- *
1589
- * \return Formatted error message with the list of errors with their
1590
- * location in the parsed document. An empty string is returned if no error
1591
- * occurred during parsing.
1443
+ * \return Formatted error message with the list of errors with their location
1444
+ * in
1445
+ * the parsed document. An empty string is returned if no error
1446
+ * occurred
1447
+ * during parsing.
1592
1448
  * \deprecated Use getFormattedErrorMessages() instead (typo fix).
1593
1449
  */
1594
1450
  JSONCPP_DEPRECATED("Use getFormattedErrorMessages() instead.")
1595
- String getFormatedErrorMessages() const;
1451
+ JSONCPP_STRING getFormatedErrorMessages() const;
1596
1452
 
1597
1453
  /** \brief Returns a user friendly string that list errors in the parsed
1598
1454
  * document.
1599
- *
1600
- * \return Formatted error message with the list of errors with their
1601
- * location in the parsed document. An empty string is returned if no error
1602
- * occurred during parsing.
1455
+ * \return Formatted error message with the list of errors with their location
1456
+ * in
1457
+ * the parsed document. An empty string is returned if no error
1458
+ * occurred
1459
+ * during parsing.
1603
1460
  */
1604
- String getFormattedErrorMessages() const;
1461
+ JSONCPP_STRING getFormattedErrorMessages() const;
1605
1462
 
1606
- /** \brief Returns a vector of structured errors encountered while parsing.
1607
- *
1463
+ /** \brief Returns a vector of structured erros encounted while parsing.
1608
1464
  * \return A (possibly empty) vector of StructuredError objects. Currently
1609
- * only one error can be returned, but the caller should tolerate multiple
1610
- * errors. This can occur if the parser recovers from a non-fatal parse
1611
- * error and then encounters additional errors.
1465
+ * only one error can be returned, but the caller should tolerate
1466
+ * multiple
1467
+ * errors. This can occur if the parser recovers from a non-fatal
1468
+ * parse error and then encounters additional errors.
1612
1469
  */
1613
1470
  std::vector<StructuredError> getStructuredErrors() const;
1614
1471
 
1615
1472
  /** \brief Add a semantic error message.
1616
- *
1617
- * \param value JSON Value location associated with the error
1473
+ * \param value JSON Value location associated with the error
1618
1474
  * \param message The error message.
1619
- * \return \c true if the error was successfully added, \c false if the Value
1620
- * offset exceeds the document size.
1475
+ * \return \c true if the error was successfully added, \c false if the
1476
+ * Value offset exceeds the document size.
1621
1477
  */
1622
- bool pushError(const Value& value, const String& message);
1478
+ bool pushError(const Value& value, const JSONCPP_STRING& message);
1623
1479
 
1624
1480
  /** \brief Add a semantic error message with extra context.
1625
- *
1626
- * \param value JSON Value location associated with the error
1481
+ * \param value JSON Value location associated with the error
1627
1482
  * \param message The error message.
1628
- * \param extra Additional JSON Value location to contextualize the error
1483
+ * \param extra Additional JSON Value location to contextualize the error
1629
1484
  * \return \c true if the error was successfully added, \c false if either
1630
1485
  * Value offset exceeds the document size.
1631
1486
  */
1632
- bool pushError(const Value& value, const String& message, const Value& extra);
1487
+ bool pushError(const Value& value, const JSONCPP_STRING& message, const Value& extra);
1633
1488
 
1634
1489
  /** \brief Return whether there are any errors.
1635
- *
1636
- * \return \c true if there are no errors to report \c false if errors have
1637
- * occurred.
1490
+ * \return \c true if there are no errors to report \c false if
1491
+ * errors have occurred.
1638
1492
  */
1639
1493
  bool good() const;
1640
1494
 
@@ -1666,15 +1520,15 @@ private:
1666
1520
  class ErrorInfo {
1667
1521
  public:
1668
1522
  Token token_;
1669
- String message_;
1523
+ JSONCPP_STRING message_;
1670
1524
  Location extra_;
1671
1525
  };
1672
1526
 
1673
- using Errors = std::deque<ErrorInfo>;
1527
+ typedef std::deque<ErrorInfo> Errors;
1674
1528
 
1675
1529
  bool readToken(Token& token);
1676
1530
  void skipSpaces();
1677
- bool match(const Char* pattern, int patternLength);
1531
+ bool match(Location pattern, int patternLength);
1678
1532
  bool readComment();
1679
1533
  bool readCStyleComment();
1680
1534
  bool readCppStyleComment();
@@ -1686,141 +1540,140 @@ private:
1686
1540
  bool decodeNumber(Token& token);
1687
1541
  bool decodeNumber(Token& token, Value& decoded);
1688
1542
  bool decodeString(Token& token);
1689
- bool decodeString(Token& token, String& decoded);
1543
+ bool decodeString(Token& token, JSONCPP_STRING& decoded);
1690
1544
  bool decodeDouble(Token& token);
1691
1545
  bool decodeDouble(Token& token, Value& decoded);
1692
- bool decodeUnicodeCodePoint(Token& token, Location& current, Location end,
1546
+ bool decodeUnicodeCodePoint(Token& token,
1547
+ Location& current,
1548
+ Location end,
1693
1549
  unsigned int& unicode);
1694
- bool decodeUnicodeEscapeSequence(Token& token, Location& current,
1695
- Location end, unsigned int& unicode);
1696
- bool addError(const String& message, Token& token, Location extra = nullptr);
1550
+ bool decodeUnicodeEscapeSequence(Token& token,
1551
+ Location& current,
1552
+ Location end,
1553
+ unsigned int& unicode);
1554
+ bool addError(const JSONCPP_STRING& message, Token& token, Location extra = 0);
1697
1555
  bool recoverFromError(TokenType skipUntilToken);
1698
- bool addErrorAndRecover(const String& message, Token& token,
1556
+ bool addErrorAndRecover(const JSONCPP_STRING& message,
1557
+ Token& token,
1699
1558
  TokenType skipUntilToken);
1700
1559
  void skipUntilSpace();
1701
1560
  Value& currentValue();
1702
1561
  Char getNextChar();
1703
- void getLocationLineAndColumn(Location location, int& line,
1704
- int& column) const;
1705
- String getLocationLineAndColumn(Location location) const;
1562
+ void
1563
+ getLocationLineAndColumn(Location location, int& line, int& column) const;
1564
+ JSONCPP_STRING getLocationLineAndColumn(Location location) const;
1706
1565
  void addComment(Location begin, Location end, CommentPlacement placement);
1707
1566
  void skipCommentTokens(Token& token);
1708
1567
 
1709
- static bool containsNewLine(Location begin, Location end);
1710
- static String normalizeEOL(Location begin, Location end);
1711
-
1712
- using Nodes = std::stack<Value*>;
1568
+ typedef std::stack<Value*> Nodes;
1713
1569
  Nodes nodes_;
1714
1570
  Errors errors_;
1715
- String document_;
1716
- Location begin_{};
1717
- Location end_{};
1718
- Location current_{};
1719
- Location lastValueEnd_{};
1720
- Value* lastValue_{};
1721
- String commentsBefore_;
1571
+ JSONCPP_STRING document_;
1572
+ Location begin_;
1573
+ Location end_;
1574
+ Location current_;
1575
+ Location lastValueEnd_;
1576
+ Value* lastValue_;
1577
+ JSONCPP_STRING commentsBefore_;
1722
1578
  Features features_;
1723
- bool collectComments_{};
1724
- }; // Reader
1579
+ bool collectComments_;
1580
+ }; // Reader
1725
1581
 
1726
1582
  /** Interface for reading JSON from a char array.
1727
1583
  */
1728
1584
  class JSON_API CharReader {
1729
1585
  public:
1730
- virtual ~CharReader() = default;
1586
+ virtual ~CharReader() {}
1731
1587
  /** \brief Read a Value from a <a HREF="http://www.json.org">JSON</a>
1732
- * document. The document must be a UTF-8 encoded string containing the
1733
- * document to read.
1588
+ document.
1589
+ * The document must be a UTF-8 encoded string containing the document to read.
1734
1590
  *
1735
- * \param beginDoc Pointer on the beginning of the UTF-8 encoded string
1736
- * of the document to read.
1737
- * \param endDoc Pointer on the end of the UTF-8 encoded string of the
1738
- * document to read. Must be >= beginDoc.
1739
- * \param[out] root Contains the root value of the document if it was
1740
- * successfully parsed.
1741
- * \param[out] errs Formatted error messages (if not NULL) a user
1742
- * friendly string that lists errors in the parsed
1743
- * document.
1591
+ * \param beginDoc Pointer on the beginning of the UTF-8 encoded string of the
1592
+ document to read.
1593
+ * \param endDoc Pointer on the end of the UTF-8 encoded string of the
1594
+ document to read.
1595
+ * Must be >= beginDoc.
1596
+ * \param root [out] Contains the root value of the document if it was
1597
+ * successfully parsed.
1598
+ * \param errs [out] Formatted error messages (if not NULL)
1599
+ * a user friendly string that lists errors in the parsed
1600
+ * document.
1744
1601
  * \return \c true if the document was successfully parsed, \c false if an
1745
- * error occurred.
1602
+ error occurred.
1746
1603
  */
1747
- virtual bool parse(char const* beginDoc, char const* endDoc, Value* root,
1748
- String* errs) = 0;
1604
+ virtual bool parse(
1605
+ char const* beginDoc, char const* endDoc,
1606
+ Value* root, JSONCPP_STRING* errs) = 0;
1749
1607
 
1750
1608
  class JSON_API Factory {
1751
1609
  public:
1752
- virtual ~Factory() = default;
1610
+ virtual ~Factory() {}
1753
1611
  /** \brief Allocate a CharReader via operator new().
1754
1612
  * \throw std::exception if something goes wrong (e.g. invalid settings)
1755
1613
  */
1756
1614
  virtual CharReader* newCharReader() const = 0;
1757
- }; // Factory
1758
- }; // CharReader
1615
+ }; // Factory
1616
+ }; // CharReader
1759
1617
 
1760
1618
  /** \brief Build a CharReader implementation.
1761
- *
1762
- * Usage:
1763
- * \code
1764
- * using namespace Json;
1765
- * CharReaderBuilder builder;
1766
- * builder["collectComments"] = false;
1767
- * Value value;
1768
- * String errs;
1769
- * bool ok = parseFromStream(builder, std::cin, &value, &errs);
1770
- * \endcode
1771
- */
1619
+
1620
+ Usage:
1621
+ \code
1622
+ using namespace Passenger;
1623
+ using namespace Json;
1624
+ CharReaderBuilder builder;
1625
+ builder["collectComments"] = false;
1626
+ Value value;
1627
+ JSONCPP_STRING errs;
1628
+ bool ok = parseFromStream(builder, std::cin, &value, &errs);
1629
+ \endcode
1630
+ */
1772
1631
  class JSON_API CharReaderBuilder : public CharReader::Factory {
1773
1632
  public:
1774
1633
  // Note: We use a Json::Value so that we can add data-members to this class
1775
1634
  // without a major version bump.
1776
1635
  /** Configuration of this builder.
1777
- * These are case-sensitive.
1778
- * Available settings (case-sensitive):
1779
- * - `"collectComments": false or true`
1780
- * - true to collect comment and allow writing them back during
1781
- * serialization, false to discard comments. This parameter is ignored
1782
- * if allowComments is false.
1783
- * - `"allowComments": false or true`
1784
- * - true if comments are allowed.
1785
- * - `"allowTrailingCommas": false or true`
1786
- * - true if trailing commas in objects and arrays are allowed.
1787
- * - `"strictRoot": false or true`
1788
- * - true if root must be either an array or an object value
1789
- * - `"allowDroppedNullPlaceholders": false or true`
1790
- * - true if dropped null placeholders are allowed. (See
1791
- * StreamWriterBuilder.)
1792
- * - `"allowNumericKeys": false or true`
1793
- * - true if numeric object keys are allowed.
1794
- * - `"allowSingleQuotes": false or true`
1795
- * - true if '' are allowed for strings (both keys and values)
1796
- * - `"stackLimit": integer`
1797
- * - Exceeding stackLimit (recursive depth of `readValue()`) will cause an
1798
- * exception.
1799
- * - This is a security issue (seg-faults caused by deeply nested JSON), so
1800
- * the default is low.
1801
- * - `"failIfExtra": false or true`
1802
- * - If true, `parse()` returns false when extra non-whitespace trails the
1803
- * JSON value in the input string.
1804
- * - `"rejectDupKeys": false or true`
1805
- * - If true, `parse()` returns false when a key is duplicated within an
1806
- * object.
1807
- * - `"allowSpecialFloats": false or true`
1808
- * - If true, special float values (NaNs and infinities) are allowed and
1809
- * their values are lossfree restorable.
1810
- * - `"skipBom": false or true`
1811
- * - If true, if the input starts with the Unicode byte order mark (BOM),
1812
- * it is skipped.
1813
- *
1814
- * You can examine 'settings_` yourself to see the defaults. You can also
1815
- * write and read them just like any JSON Value.
1816
- * \sa setDefaults()
1817
- */
1636
+ These are case-sensitive.
1637
+ Available settings (case-sensitive):
1638
+ - `"collectComments": false or true`
1639
+ - true to collect comment and allow writing them
1640
+ back during serialization, false to discard comments.
1641
+ This parameter is ignored if allowComments is false.
1642
+ - `"allowComments": false or true`
1643
+ - true if comments are allowed.
1644
+ - `"strictRoot": false or true`
1645
+ - true if root must be either an array or an object value
1646
+ - `"allowDroppedNullPlaceholders": false or true`
1647
+ - true if dropped null placeholders are allowed. (See StreamWriterBuilder.)
1648
+ - `"allowNumericKeys": false or true`
1649
+ - true if numeric object keys are allowed.
1650
+ - `"allowSingleQuotes": false or true`
1651
+ - true if '' are allowed for strings (both keys and values)
1652
+ - `"stackLimit": integer`
1653
+ - Exceeding stackLimit (recursive depth of `readValue()`) will
1654
+ cause an exception.
1655
+ - This is a security issue (seg-faults caused by deeply nested JSON),
1656
+ so the default is low.
1657
+ - `"failIfExtra": false or true`
1658
+ - If true, `parse()` returns false when extra non-whitespace trails
1659
+ the JSON value in the input string.
1660
+ - `"rejectDupKeys": false or true`
1661
+ - If true, `parse()` returns false when a key is duplicated within an object.
1662
+ - `"allowSpecialFloats": false or true`
1663
+ - If true, special float values (NaNs and infinities) are allowed
1664
+ and their values are lossfree restorable.
1665
+
1666
+ You can examine 'settings_` yourself
1667
+ to see the defaults. You can also write and read them just like any
1668
+ JSON Value.
1669
+ \sa setDefaults()
1670
+ */
1818
1671
  Json::Value settings_;
1819
1672
 
1820
1673
  CharReaderBuilder();
1821
- ~CharReaderBuilder() override;
1674
+ ~CharReaderBuilder() JSONCPP_OVERRIDE;
1822
1675
 
1823
- CharReader* newCharReader() const override;
1676
+ CharReader* newCharReader() const JSONCPP_OVERRIDE;
1824
1677
 
1825
1678
  /** \return true if 'settings' are legal and consistent;
1826
1679
  * otherwise, indicate bad settings via 'invalid'.
@@ -1829,7 +1682,7 @@ public:
1829
1682
 
1830
1683
  /** A simple way to update a specific setting.
1831
1684
  */
1832
- Value& operator[](const String& key);
1685
+ Value& operator[](JSONCPP_STRING key);
1833
1686
 
1834
1687
  /** Called by ctor, but you can use this to reset settings_.
1835
1688
  * \pre 'settings' != NULL (but Json::null is fine)
@@ -1846,37 +1699,39 @@ public:
1846
1699
  };
1847
1700
 
1848
1701
  /** Consume entire stream and use its begin/end.
1849
- * Someday we might have a real StreamReader, but for now this
1850
- * is convenient.
1851
- */
1852
- bool JSON_API parseFromStream(CharReader::Factory const&, IStream&, Value* root,
1853
- String* errs);
1702
+ * Someday we might have a real StreamReader, but for now this
1703
+ * is convenient.
1704
+ */
1705
+ bool JSON_API parseFromStream(
1706
+ CharReader::Factory const&,
1707
+ JSONCPP_ISTREAM&,
1708
+ Value* root, std::string* errs);
1854
1709
 
1855
1710
  /** \brief Read from 'sin' into 'root'.
1856
- *
1857
- * Always keep comments from the input JSON.
1858
- *
1859
- * This can be used to read a file into a particular sub-object.
1860
- * For example:
1861
- * \code
1862
- * Json::Value root;
1863
- * cin >> root["dir"]["file"];
1864
- * cout << root;
1865
- * \endcode
1866
- * Result:
1867
- * \verbatim
1868
- * {
1869
- * "dir": {
1870
- * "file": {
1871
- * // The input stream JSON would be nested here.
1872
- * }
1873
- * }
1874
- * }
1875
- * \endverbatim
1876
- * \throw std::exception on parse error.
1877
- * \see Json::operator<<()
1878
- */
1879
- JSON_API IStream& operator>>(IStream&, Value&);
1711
+
1712
+ Always keep comments from the input JSON.
1713
+
1714
+ This can be used to read a file into a particular sub-object.
1715
+ For example:
1716
+ \code
1717
+ Json::Value root;
1718
+ cin >> root["dir"]["file"];
1719
+ cout << root;
1720
+ \endcode
1721
+ Result:
1722
+ \verbatim
1723
+ {
1724
+ "dir": {
1725
+ "file": {
1726
+ // The input stream JSON would be nested here.
1727
+ }
1728
+ }
1729
+ }
1730
+ \endverbatim
1731
+ \throw std::exception on parse error.
1732
+ \see Json::operator<<()
1733
+ */
1734
+ JSON_API JSONCPP_ISTREAM& operator>>(JSONCPP_ISTREAM&, Value&);
1880
1735
 
1881
1736
  } // namespace Json
1882
1737
  } // namespace Passenger
@@ -1887,7 +1742,7 @@ JSON_API IStream& operator>>(IStream&, Value&);
1887
1742
  #pragma warning(pop)
1888
1743
  #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1889
1744
 
1890
- #endif // JSON_READER_H_INCLUDED
1745
+ #endif // CPPTL_JSON_READER_H_INCLUDED
1891
1746
 
1892
1747
  // //////////////////////////////////////////////////////////////////////
1893
1748
  // End of content of file: include/json/reader.h
@@ -1902,7 +1757,7 @@ JSON_API IStream& operator>>(IStream&, Value&);
1902
1757
  // Beginning of content of file: include/json/writer.h
1903
1758
  // //////////////////////////////////////////////////////////////////////
1904
1759
 
1905
- // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
1760
+ // Copyright 2007-2010 Baptiste Lepilleur
1906
1761
  // Distributed under MIT license, or public domain if desired and
1907
1762
  // recognized in your jurisdiction.
1908
1763
  // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
@@ -1913,13 +1768,13 @@ JSON_API IStream& operator>>(IStream&, Value&);
1913
1768
  #if !defined(JSON_IS_AMALGAMATION)
1914
1769
  #include "value.h"
1915
1770
  #endif // if !defined(JSON_IS_AMALGAMATION)
1916
- #include <ostream>
1917
- #include <string>
1918
1771
  #include <vector>
1772
+ #include <string>
1773
+ #include <ostream>
1919
1774
 
1920
1775
  // Disable warning C4251: <data member>: <type> needs to have dll-interface to
1921
1776
  // be used by...
1922
- #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) && defined(_MSC_VER)
1777
+ #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1923
1778
  #pragma warning(push)
1924
1779
  #pragma warning(disable : 4251)
1925
1780
  #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
@@ -1932,31 +1787,32 @@ namespace Json {
1932
1787
  class Value;
1933
1788
 
1934
1789
  /**
1935
- *
1936
- * Usage:
1937
- * \code
1938
- * using namespace Json;
1939
- * void writeToStdout(StreamWriter::Factory const& factory, Value const& value)
1940
- * { std::unique_ptr<StreamWriter> const writer( factory.newStreamWriter());
1941
- * writer->write(value, &std::cout);
1942
- * std::cout << std::endl; // add lf and flush
1943
- * }
1944
- * \endcode
1945
- */
1790
+
1791
+ Usage:
1792
+ \code
1793
+ using namespace Passenger;
1794
+ using namespace Json;
1795
+ void writeToStdout(StreamWriter::Factory const& factory, Value const& value) {
1796
+ std::unique_ptr<StreamWriter> const writer(
1797
+ factory.newStreamWriter());
1798
+ writer->write(value, &std::cout);
1799
+ std::cout << std::endl; // add lf and flush
1800
+ }
1801
+ \endcode
1802
+ */
1946
1803
  class JSON_API StreamWriter {
1947
1804
  protected:
1948
- OStream* sout_; // not owned; will not delete
1805
+ JSONCPP_OSTREAM* sout_; // not owned; will not delete
1949
1806
  public:
1950
1807
  StreamWriter();
1951
1808
  virtual ~StreamWriter();
1952
1809
  /** Write Value into document as configured in sub-class.
1953
- * Do not take ownership of sout, but maintain a reference during function.
1954
- * \pre sout != NULL
1955
- * \return zero on success (For now, we always return zero, so check the
1956
- * stream instead.) \throw std::exception possibly, depending on
1957
- * configuration
1810
+ Do not take ownership of sout, but maintain a reference during function.
1811
+ \pre sout != NULL
1812
+ \return zero on success (For now, we always return zero, so check the stream instead.)
1813
+ \throw std::exception possibly, depending on configuration
1958
1814
  */
1959
- virtual int write(Value const& root, OStream* sout) = 0;
1815
+ virtual int write(Value const& root, JSONCPP_OSTREAM* sout) = 0;
1960
1816
 
1961
1817
  /** \brief A simple abstract factory.
1962
1818
  */
@@ -1967,71 +1823,65 @@ public:
1967
1823
  * \throw std::exception if something goes wrong (e.g. invalid settings)
1968
1824
  */
1969
1825
  virtual StreamWriter* newStreamWriter() const = 0;
1970
- }; // Factory
1971
- }; // StreamWriter
1826
+ }; // Factory
1827
+ }; // StreamWriter
1972
1828
 
1973
1829
  /** \brief Write into stringstream, then return string, for convenience.
1974
1830
  * A StreamWriter will be created from the factory, used, and then deleted.
1975
1831
  */
1976
- String JSON_API writeString(StreamWriter::Factory const& factory,
1977
- Value const& root);
1832
+ JSONCPP_STRING JSON_API writeString(StreamWriter::Factory const& factory, Value const& root);
1833
+
1978
1834
 
1979
1835
  /** \brief Build a StreamWriter implementation.
1980
1836
 
1981
- * Usage:
1982
- * \code
1983
- * using namespace Json;
1984
- * Value value = ...;
1985
- * StreamWriterBuilder builder;
1986
- * builder["commentStyle"] = "None";
1987
- * builder["indentation"] = " "; // or whatever you like
1988
- * std::unique_ptr<Json::StreamWriter> writer(
1989
- * builder.newStreamWriter());
1990
- * writer->write(value, &std::cout);
1991
- * std::cout << std::endl; // add lf and flush
1992
- * \endcode
1837
+ Usage:
1838
+ \code
1839
+ using namespace Passenger;
1840
+ using namespace Json;
1841
+ Value value = ...;
1842
+ StreamWriterBuilder builder;
1843
+ builder["commentStyle"] = "None";
1844
+ builder["indentation"] = " "; // or whatever you like
1845
+ std::unique_ptr<Json::StreamWriter> writer(
1846
+ builder.newStreamWriter());
1847
+ writer->write(value, &std::cout);
1848
+ std::cout << std::endl; // add lf and flush
1849
+ \endcode
1993
1850
  */
1994
1851
  class JSON_API StreamWriterBuilder : public StreamWriter::Factory {
1995
1852
  public:
1996
1853
  // Note: We use a Json::Value so that we can add data-members to this class
1997
1854
  // without a major version bump.
1998
1855
  /** Configuration of this builder.
1999
- * Available settings (case-sensitive):
2000
- * - "commentStyle": "None" or "All"
2001
- * - "indentation": "<anything>".
2002
- * - Setting this to an empty string also omits newline characters.
2003
- * - "enableYAMLCompatibility": false or true
2004
- * - slightly change the whitespace around colons
2005
- * - "dropNullPlaceholders": false or true
2006
- * - Drop the "null" string from the writer's output for nullValues.
2007
- * Strictly speaking, this is not valid JSON. But when the output is being
2008
- * fed to a browser's JavaScript, it makes for smaller output and the
2009
- * browser can handle the output just fine.
2010
- * - "useSpecialFloats": false or true
2011
- * - If true, outputs non-finite floating point values in the following way:
2012
- * NaN values as "NaN", positive infinity as "Infinity", and negative
2013
- * infinity as "-Infinity".
2014
- * - "precision": int
2015
- * - Number of precision digits for formatting of real values.
2016
- * - "precisionType": "significant"(default) or "decimal"
2017
- * - Type of precision for formatting of real values.
2018
- * - "emitUTF8": false or true
2019
- * - If true, outputs raw UTF8 strings instead of escaping them.
2020
-
2021
- * You can examine 'settings_` yourself
2022
- * to see the defaults. You can also write and read them just like any
2023
- * JSON Value.
2024
- * \sa setDefaults()
2025
- */
1856
+ Available settings (case-sensitive):
1857
+ - "commentStyle": "None" or "All"
1858
+ - "indentation": "<anything>"
1859
+ - "enableYAMLCompatibility": false or true
1860
+ - slightly change the whitespace around colons
1861
+ - "dropNullPlaceholders": false or true
1862
+ - Drop the "null" string from the writer's output for nullValues.
1863
+ Strictly speaking, this is not valid JSON. But when the output is being
1864
+ fed to a browser's Javascript, it makes for smaller output and the
1865
+ browser can handle the output just fine.
1866
+ - "useSpecialFloats": false or true
1867
+ - If true, outputs non-finite floating point values in the following way:
1868
+ NaN values as "NaN", positive infinity as "Infinity", and negative infinity
1869
+ as "-Infinity".
1870
+
1871
+ You can examine 'settings_` yourself
1872
+ to see the defaults. You can also write and read them just like any
1873
+ JSON Value.
1874
+ \sa setDefaults()
1875
+ */
2026
1876
  Json::Value settings_;
2027
1877
 
2028
1878
  StreamWriterBuilder();
2029
- ~StreamWriterBuilder() override;
1879
+ ~StreamWriterBuilder() JSONCPP_OVERRIDE;
2030
1880
 
2031
1881
  /**
2032
1882
  * \throw std::exception if something goes wrong (e.g. invalid settings)
2033
1883
  */
2034
- StreamWriter* newStreamWriter() const override;
1884
+ StreamWriter* newStreamWriter() const JSONCPP_OVERRIDE;
2035
1885
 
2036
1886
  /** \return true if 'settings' are legal and consistent;
2037
1887
  * otherwise, indicate bad settings via 'invalid'.
@@ -2039,7 +1889,7 @@ public:
2039
1889
  bool validate(Json::Value* invalid) const;
2040
1890
  /** A simple way to update a specific setting.
2041
1891
  */
2042
- Value& operator[](const String& key);
1892
+ Value& operator[](JSONCPP_STRING key);
2043
1893
 
2044
1894
  /** Called by ctor, but you can use this to reset settings_.
2045
1895
  * \pre 'settings' != NULL (but Json::null is fine)
@@ -2056,7 +1906,7 @@ class JSON_API Writer {
2056
1906
  public:
2057
1907
  virtual ~Writer();
2058
1908
 
2059
- virtual String write(const Value& root) = 0;
1909
+ virtual JSONCPP_STRING write(const Value& root) = 0;
2060
1910
  };
2061
1911
 
2062
1912
  /** \brief Outputs a Value in <a HREF="http://www.json.org">JSON</a> format
@@ -2064,25 +1914,21 @@ public:
2064
1914
  *
2065
1915
  * The JSON document is written in a single line. It is not intended for 'human'
2066
1916
  *consumption,
2067
- * but may be useful to support feature such as RPC where bandwidth is limited.
1917
+ * but may be usefull to support feature such as RPC where bandwith is limited.
2068
1918
  * \sa Reader, Value
2069
1919
  * \deprecated Use StreamWriterBuilder.
2070
1920
  */
2071
- #if defined(_MSC_VER)
2072
- #pragma warning(push)
2073
- #pragma warning(disable : 4996) // Deriving from deprecated class
2074
- #endif
2075
- class JSON_API FastWriter
2076
- : public Writer {
1921
+ class JSON_API FastWriter : public Writer {
1922
+
2077
1923
  public:
2078
1924
  FastWriter();
2079
- ~FastWriter() override = default;
1925
+ ~FastWriter() JSONCPP_OVERRIDE {}
2080
1926
 
2081
1927
  void enableYAMLCompatibility();
2082
1928
 
2083
1929
  /** \brief Drop the "null" string from the writer's output for nullValues.
2084
1930
  * Strictly speaking, this is not valid JSON. But when the output is being
2085
- * fed to a browser's JavaScript, it makes for smaller output and the
1931
+ * fed to a browser's Javascript, it makes for smaller output and the
2086
1932
  * browser can handle the output just fine.
2087
1933
  */
2088
1934
  void dropNullPlaceholders();
@@ -2090,19 +1936,16 @@ public:
2090
1936
  void omitEndingLineFeed();
2091
1937
 
2092
1938
  public: // overridden from Writer
2093
- String write(const Value& root) override;
1939
+ JSONCPP_STRING write(const Value& root) JSONCPP_OVERRIDE;
2094
1940
 
2095
1941
  private:
2096
1942
  void writeValue(const Value& value);
2097
1943
 
2098
- String document_;
2099
- bool yamlCompatibilityEnabled_{false};
2100
- bool dropNullPlaceholders_{false};
2101
- bool omitEndingLineFeed_{false};
1944
+ JSONCPP_STRING document_;
1945
+ bool yamlCompatiblityEnabled_;
1946
+ bool dropNullPlaceholders_;
1947
+ bool omitEndingLineFeed_;
2102
1948
  };
2103
- #if defined(_MSC_VER)
2104
- #pragma warning(pop)
2105
- #endif
2106
1949
 
2107
1950
  /** \brief Writes a Value in <a HREF="http://www.json.org">JSON</a> format in a
2108
1951
  *human friendly way.
@@ -2128,49 +1971,41 @@ private:
2128
1971
  * \sa Reader, Value, Value::setComment()
2129
1972
  * \deprecated Use StreamWriterBuilder.
2130
1973
  */
2131
- #if defined(_MSC_VER)
2132
- #pragma warning(push)
2133
- #pragma warning(disable : 4996) // Deriving from deprecated class
2134
- #endif
2135
- class JSON_API
2136
- StyledWriter : public Writer {
1974
+ class JSON_API StyledWriter : public Writer {
2137
1975
  public:
2138
1976
  StyledWriter();
2139
- ~StyledWriter() override = default;
1977
+ ~StyledWriter() JSONCPP_OVERRIDE {}
2140
1978
 
2141
1979
  public: // overridden from Writer
2142
1980
  /** \brief Serialize a Value in <a HREF="http://www.json.org">JSON</a> format.
2143
1981
  * \param root Value to serialize.
2144
1982
  * \return String containing the JSON document that represents the root value.
2145
1983
  */
2146
- String write(const Value& root) override;
1984
+ JSONCPP_STRING write(const Value& root) JSONCPP_OVERRIDE;
2147
1985
 
2148
1986
  private:
2149
1987
  void writeValue(const Value& value);
2150
1988
  void writeArrayValue(const Value& value);
2151
- bool isMultilineArray(const Value& value);
2152
- void pushValue(const String& value);
1989
+ bool isMultineArray(const Value& value);
1990
+ void pushValue(const JSONCPP_STRING& value);
2153
1991
  void writeIndent();
2154
- void writeWithIndent(const String& value);
1992
+ void writeWithIndent(const JSONCPP_STRING& value);
2155
1993
  void indent();
2156
1994
  void unindent();
2157
1995
  void writeCommentBeforeValue(const Value& root);
2158
1996
  void writeCommentAfterValueOnSameLine(const Value& root);
2159
- static bool hasCommentForValue(const Value& value);
2160
- static String normalizeEOL(const String& text);
1997
+ bool hasCommentForValue(const Value& value);
1998
+ static JSONCPP_STRING normalizeEOL(const JSONCPP_STRING& text);
2161
1999
 
2162
- using ChildValues = std::vector<String>;
2000
+ typedef std::vector<JSONCPP_STRING> ChildValues;
2163
2001
 
2164
2002
  ChildValues childValues_;
2165
- String document_;
2166
- String indentString_;
2167
- unsigned int rightMargin_{74};
2168
- unsigned int indentSize_{3};
2169
- bool addChildValues_{false};
2003
+ JSONCPP_STRING document_;
2004
+ JSONCPP_STRING indentString_;
2005
+ unsigned int rightMargin_;
2006
+ unsigned int indentSize_;
2007
+ bool addChildValues_;
2170
2008
  };
2171
- #if defined(_MSC_VER)
2172
- #pragma warning(pop)
2173
- #endif
2174
2009
 
2175
2010
  /** \brief Writes a Value in <a HREF="http://www.json.org">JSON</a> format in a
2176
2011
  human friendly way,
@@ -2194,21 +2029,14 @@ private:
2194
2029
  * If the Value have comments then they are outputed according to their
2195
2030
  #CommentPlacement.
2196
2031
  *
2032
+ * \param indentation Each level will be indented by this amount extra.
2197
2033
  * \sa Reader, Value, Value::setComment()
2198
2034
  * \deprecated Use StreamWriterBuilder.
2199
2035
  */
2200
- #if defined(_MSC_VER)
2201
- #pragma warning(push)
2202
- #pragma warning(disable : 4996) // Deriving from deprecated class
2203
- #endif
2204
- class JSON_API
2205
- StyledStreamWriter {
2036
+ class JSON_API StyledStreamWriter {
2206
2037
  public:
2207
- /**
2208
- * \param indentation Each level will be indented by this amount extra.
2209
- */
2210
- StyledStreamWriter(String indentation = "\t");
2211
- ~StyledStreamWriter() = default;
2038
+ StyledStreamWriter(JSONCPP_STRING indentation = "\t");
2039
+ ~StyledStreamWriter() {}
2212
2040
 
2213
2041
  public:
2214
2042
  /** \brief Serialize a Value in <a HREF="http://www.json.org">JSON</a> format.
@@ -2217,51 +2045,46 @@ public:
2217
2045
  * \note There is no point in deriving from Writer, since write() should not
2218
2046
  * return a value.
2219
2047
  */
2220
- void write(OStream& out, const Value& root);
2048
+ void write(JSONCPP_OSTREAM& out, const Value& root);
2221
2049
 
2222
2050
  private:
2223
2051
  void writeValue(const Value& value);
2224
2052
  void writeArrayValue(const Value& value);
2225
- bool isMultilineArray(const Value& value);
2226
- void pushValue(const String& value);
2053
+ bool isMultineArray(const Value& value);
2054
+ void pushValue(const JSONCPP_STRING& value);
2227
2055
  void writeIndent();
2228
- void writeWithIndent(const String& value);
2056
+ void writeWithIndent(const JSONCPP_STRING& value);
2229
2057
  void indent();
2230
2058
  void unindent();
2231
2059
  void writeCommentBeforeValue(const Value& root);
2232
2060
  void writeCommentAfterValueOnSameLine(const Value& root);
2233
- static bool hasCommentForValue(const Value& value);
2234
- static String normalizeEOL(const String& text);
2061
+ bool hasCommentForValue(const Value& value);
2062
+ static JSONCPP_STRING normalizeEOL(const JSONCPP_STRING& text);
2235
2063
 
2236
- using ChildValues = std::vector<String>;
2064
+ typedef std::vector<JSONCPP_STRING> ChildValues;
2237
2065
 
2238
2066
  ChildValues childValues_;
2239
- OStream* document_;
2240
- String indentString_;
2241
- unsigned int rightMargin_{74};
2242
- String indentation_;
2067
+ JSONCPP_OSTREAM* document_;
2068
+ JSONCPP_STRING indentString_;
2069
+ unsigned int rightMargin_;
2070
+ JSONCPP_STRING indentation_;
2243
2071
  bool addChildValues_ : 1;
2244
2072
  bool indented_ : 1;
2245
2073
  };
2246
- #if defined(_MSC_VER)
2247
- #pragma warning(pop)
2248
- #endif
2249
2074
 
2250
2075
  #if defined(JSON_HAS_INT64)
2251
- String JSON_API valueToString(Int value);
2252
- String JSON_API valueToString(UInt value);
2076
+ JSONCPP_STRING JSON_API valueToString(Int value);
2077
+ JSONCPP_STRING JSON_API valueToString(UInt value);
2253
2078
  #endif // if defined(JSON_HAS_INT64)
2254
- String JSON_API valueToString(LargestInt value);
2255
- String JSON_API valueToString(LargestUInt value);
2256
- String JSON_API valueToString(
2257
- double value, unsigned int precision = Value::defaultRealPrecision,
2258
- PrecisionType precisionType = PrecisionType::significantDigits);
2259
- String JSON_API valueToString(bool value);
2260
- String JSON_API valueToQuotedString(const char* value);
2079
+ JSONCPP_STRING JSON_API valueToString(LargestInt value);
2080
+ JSONCPP_STRING JSON_API valueToString(LargestUInt value);
2081
+ JSONCPP_STRING JSON_API valueToString(double value);
2082
+ JSONCPP_STRING JSON_API valueToString(bool value);
2083
+ JSONCPP_STRING JSON_API valueToQuotedString(const char* value);
2261
2084
 
2262
2085
  /// \brief Output using the StyledStreamWriter.
2263
2086
  /// \see Json::operator>>()
2264
- JSON_API OStream& operator<<(OStream&, const Value& root);
2087
+ JSON_API JSONCPP_OSTREAM& operator<<(JSONCPP_OSTREAM&, const Value& root);
2265
2088
 
2266
2089
  } // namespace Json
2267
2090
  } // namespace Passenger
@@ -2287,15 +2110,15 @@ JSON_API OStream& operator<<(OStream&, const Value& root);
2287
2110
  // Beginning of content of file: include/json/assertions.h
2288
2111
  // //////////////////////////////////////////////////////////////////////
2289
2112
 
2290
- // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
2113
+ // Copyright 2007-2010 Baptiste Lepilleur
2291
2114
  // Distributed under MIT license, or public domain if desired and
2292
2115
  // recognized in your jurisdiction.
2293
2116
  // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
2294
2117
 
2295
- #ifndef JSON_ASSERTIONS_H_INCLUDED
2296
- #define JSON_ASSERTIONS_H_INCLUDED
2118
+ #ifndef CPPTL_JSON_ASSERTIONS_H_INCLUDED
2119
+ #define CPPTL_JSON_ASSERTIONS_H_INCLUDED
2297
2120
 
2298
- #include <cstdlib>
2121
+ #include <stdlib.h>
2299
2122
  #include <sstream>
2300
2123
 
2301
2124
  #if !defined(JSON_IS_AMALGAMATION)
@@ -2309,45 +2132,38 @@ JSON_API OStream& operator<<(OStream&, const Value& root);
2309
2132
  #if JSON_USE_EXCEPTION
2310
2133
 
2311
2134
  // @todo <= add detail about condition in exception
2312
- #define JSON_ASSERT(condition) \
2313
- do { \
2314
- if (!(condition)) { \
2315
- Json::throwLogicError("assert json failed"); \
2316
- } \
2317
- } while (0)
2318
-
2319
- #define JSON_FAIL_MESSAGE(message) \
2320
- do { \
2321
- OStringStream oss; \
2322
- oss << message; \
2135
+ # define JSON_ASSERT(condition) \
2136
+ {if (!(condition)) {Json::throwLogicError( "assert json failed" );}}
2137
+
2138
+ # define JSON_FAIL_MESSAGE(message) \
2139
+ { \
2140
+ JSONCPP_OSTRINGSTREAM oss; oss << message; \
2323
2141
  Json::throwLogicError(oss.str()); \
2324
2142
  abort(); \
2325
- } while (0)
2143
+ }
2326
2144
 
2327
2145
  #else // JSON_USE_EXCEPTION
2328
2146
 
2329
- #define JSON_ASSERT(condition) assert(condition)
2147
+ # define JSON_ASSERT(condition) assert(condition)
2330
2148
 
2331
2149
  // The call to assert() will show the failure message in debug builds. In
2332
2150
  // release builds we abort, for a core-dump or debugger.
2333
- #define JSON_FAIL_MESSAGE(message) \
2151
+ # define JSON_FAIL_MESSAGE(message) \
2334
2152
  { \
2335
- OStringStream oss; \
2336
- oss << message; \
2153
+ JSONCPP_OSTRINGSTREAM oss; oss << message; \
2337
2154
  assert(false && oss.str().c_str()); \
2338
2155
  abort(); \
2339
2156
  }
2340
2157
 
2158
+
2341
2159
  #endif
2342
2160
 
2343
2161
  #define JSON_ASSERT_MESSAGE(condition, message) \
2344
- do { \
2345
- if (!(condition)) { \
2346
- JSON_FAIL_MESSAGE(message); \
2347
- } \
2348
- } while (0)
2162
+ if (!(condition)) { \
2163
+ JSON_FAIL_MESSAGE(message); \
2164
+ }
2349
2165
 
2350
- #endif // JSON_ASSERTIONS_H_INCLUDED
2166
+ #endif // CPPTL_JSON_ASSERTIONS_H_INCLUDED
2351
2167
 
2352
2168
  // //////////////////////////////////////////////////////////////////////
2353
2169
  // End of content of file: include/json/assertions.h
@@ -2357,4 +2173,4 @@ JSON_API OStream& operator<<(OStream&, const Value& root);
2357
2173
 
2358
2174
 
2359
2175
 
2360
- #endif //ifndef JSON_AMALGAMATED_H_INCLUDED
2176
+ #endif //ifndef JSON_AMALGATED_H_INCLUDED