passenger 6.2.0 → 6.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (898) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +69 -15
  3. data/CONTRIBUTING.md +7 -311
  4. data/CONTRIBUTORS +1 -0
  5. data/LICENSE +1 -1
  6. data/README.md +1 -1
  7. data/Rakefile +1 -1
  8. data/bin/passenger +1 -1
  9. data/bin/passenger-config +1 -1
  10. data/bin/passenger-install-apache2-module +1 -1
  11. data/bin/passenger-install-nginx-module +4 -9
  12. data/bin/passenger-memory-stats +1 -1
  13. data/bin/passenger-status +1 -1
  14. data/build/agent.rb +13 -15
  15. data/build/apache2.rb +13 -16
  16. data/build/basics.rb +10 -13
  17. data/build/common_library.rb +5 -9
  18. data/build/cxx_tests.rb +39 -12
  19. data/build/integration_tests.rb +5 -2
  20. data/build/misc.rb +1 -1
  21. data/build/nginx.rb +1 -1
  22. data/build/node_tests.rb +1 -1
  23. data/build/oxt_tests.rb +6 -8
  24. data/build/packaging.rb +1 -1
  25. data/build/ruby_extension.rb +1 -1
  26. data/build/ruby_tests.rb +1 -1
  27. data/build/schema_printer.rb +13 -15
  28. data/build/support/cplusplus.rb +61 -69
  29. data/build/support/cxx_dependency_map.rb +5 -64
  30. data/build/support/general.rb +1 -1
  31. data/build/support/vendor/cxx_hinted_parser/LICENSE.md +1 -1
  32. data/build/support/vendor/cxx_hinted_parser/lib/cxx_hinted_parser/parser.rb +1 -1
  33. data/build/support/vendor/cxx_hinted_parser/lib/cxx_hinted_parser.rb +1 -1
  34. data/build/support/vendor/cxxcodebuilder/LICENSE.md +1 -1
  35. data/build/support/vendor/cxxcodebuilder/lib/cxxcodebuilder/builder.rb +1 -1
  36. data/build/support/vendor/cxxcodebuilder/lib/cxxcodebuilder/initializer_builder.rb +1 -1
  37. data/build/support/vendor/cxxcodebuilder/lib/cxxcodebuilder.rb +1 -1
  38. data/build/test_basics.rb +1 -1
  39. data/dev/copy_boost_headers +1 -1
  40. data/dev/index_cxx_dependencies.rb +5 -1
  41. data/dev/libev-changes.patch +108 -0
  42. data/dev/nginx_version_sha256 +1 -1
  43. data/dev/ruby_server.rb +1 -6
  44. data/dev/upgrading_libuv.sh +16 -0
  45. data/doc/BasicArchitectureOverview.md +55 -0
  46. data/doc/BuildCaching.md +23 -0
  47. data/doc/BuildSystem.md +49 -0
  48. data/doc/DebuggingAndStressTesting.md +2 -0
  49. data/doc/DesignAspects/LimitedGemDependencies.md +1 -0
  50. data/doc/DevEnvironmentSetup.md +46 -0
  51. data/doc/DevHandbook.md +28 -0
  52. data/doc/Packaging.md +1 -1
  53. data/doc/RunningTests.md +88 -0
  54. data/doc/{TempFileHandling.md → SecureTempFileHandling.md} +1 -1
  55. data/doc/{CxxTestingGuide.md → WritingCxxTests.md} +1 -20
  56. data/src/agent/AgentMain.cpp +1 -1
  57. data/src/agent/Core/ApiServer.h +1 -1
  58. data/src/agent/Core/ApplicationPool/AbstractSession.h +1 -1
  59. data/src/agent/Core/ApplicationPool/BasicGroupInfo.h +1 -1
  60. data/src/agent/Core/ApplicationPool/BasicProcessInfo.h +1 -1
  61. data/src/agent/Core/ApplicationPool/Common.h +1 -1
  62. data/src/agent/Core/ApplicationPool/Context.h +1 -1
  63. data/src/agent/Core/ApplicationPool/Group/InitializationAndShutdown.cpp +1 -1
  64. data/src/agent/Core/ApplicationPool/Group/InternalUtils.cpp +1 -1
  65. data/src/agent/Core/ApplicationPool/Group/LifetimeAndBasics.cpp +1 -1
  66. data/src/agent/Core/ApplicationPool/Group/Miscellaneous.cpp +1 -1
  67. data/src/agent/Core/ApplicationPool/Group/OutOfBandWork.cpp +1 -1
  68. data/src/agent/Core/ApplicationPool/Group/ProcessListManagement.cpp +1 -1
  69. data/src/agent/Core/ApplicationPool/Group/SessionManagement.cpp +1 -1
  70. data/src/agent/Core/ApplicationPool/Group/SpawningAndRestarting.cpp +1 -1
  71. data/src/agent/Core/ApplicationPool/Group/StateInspection.cpp +1 -1
  72. data/src/agent/Core/ApplicationPool/Group/Verification.cpp +1 -1
  73. data/src/agent/Core/ApplicationPool/Group.h +1 -1
  74. data/src/agent/Core/ApplicationPool/Implementation.cpp +1 -1
  75. data/src/agent/Core/ApplicationPool/Options.h +1 -1
  76. data/src/agent/Core/ApplicationPool/Pool/AnalyticsCollection.cpp +1 -1
  77. data/src/agent/Core/ApplicationPool/Pool/GarbageCollection.cpp +1 -1
  78. data/src/agent/Core/ApplicationPool/Pool/GeneralUtils.cpp +1 -1
  79. data/src/agent/Core/ApplicationPool/Pool/GroupUtils.cpp +1 -1
  80. data/src/agent/Core/ApplicationPool/Pool/InitializationAndShutdown.cpp +1 -1
  81. data/src/agent/Core/ApplicationPool/Pool/Miscellaneous.cpp +1 -1
  82. data/src/agent/Core/ApplicationPool/Pool/ProcessUtils.cpp +1 -1
  83. data/src/agent/Core/ApplicationPool/Pool/StateInspection.cpp +1 -1
  84. data/src/agent/Core/ApplicationPool/Pool.h +1 -1
  85. data/src/agent/Core/ApplicationPool/Process.cpp +1 -1
  86. data/src/agent/Core/ApplicationPool/Process.h +1 -1
  87. data/src/agent/Core/ApplicationPool/Session.h +1 -1
  88. data/src/agent/Core/ApplicationPool/Socket.h +1 -1
  89. data/src/agent/Core/ApplicationPool/TestSession.h +1 -1
  90. data/src/agent/Core/Config.h +3 -2
  91. data/src/agent/Core/ConfigChange.cpp +1 -1
  92. data/src/agent/Core/ConfigChange.h +1 -1
  93. data/src/agent/Core/Controller/AppResponse.h +1 -1
  94. data/src/agent/Core/Controller/BufferBody.cpp +1 -1
  95. data/src/agent/Core/Controller/CheckoutSession.cpp +8 -5
  96. data/src/agent/Core/Controller/Client.h +1 -1
  97. data/src/agent/Core/Controller/Config.cpp +1 -1
  98. data/src/agent/Core/Controller/Config.h +2 -2
  99. data/src/agent/Core/Controller/ForwardResponse.cpp +2 -2
  100. data/src/agent/Core/Controller/Hooks.cpp +12 -9
  101. data/src/agent/Core/Controller/Implementation.cpp +1 -1
  102. data/src/agent/Core/Controller/InitRequest.cpp +1 -1
  103. data/src/agent/Core/Controller/InitializationAndShutdown.cpp +1 -1
  104. data/src/agent/Core/Controller/InternalUtils.cpp +1 -1
  105. data/src/agent/Core/Controller/Miscellaneous.cpp +1 -1
  106. data/src/agent/Core/Controller/Request.h +1 -1
  107. data/src/agent/Core/Controller/SendRequest.cpp +1 -1
  108. data/src/agent/Core/Controller/StateInspection.cpp +1 -1
  109. data/src/agent/Core/Controller/TurboCaching.h +1 -1
  110. data/src/agent/Core/Controller.h +1 -1
  111. data/src/agent/Core/CoreMain.cpp +1 -1
  112. data/src/agent/Core/OptionParser.h +1 -1
  113. data/src/agent/Core/ResponseCache.h +1 -1
  114. data/src/agent/Core/SecurityUpdateChecker.h +1 -1
  115. data/src/agent/Core/SpawningKit/Config/AutoGeneratedCode.h +1 -1
  116. data/src/agent/Core/SpawningKit/Config/AutoGeneratedCode.h.cxxcodebuilder +1 -1
  117. data/src/agent/Core/SpawningKit/Config.h +1 -1
  118. data/src/agent/Core/SpawningKit/Context.h +1 -1
  119. data/src/agent/Core/SpawningKit/DirectSpawner.h +1 -1
  120. data/src/agent/Core/SpawningKit/DummySpawner.h +1 -1
  121. data/src/agent/Core/SpawningKit/ErrorRenderer.h +1 -1
  122. data/src/agent/Core/SpawningKit/Exceptions.h +63 -2
  123. data/src/agent/Core/SpawningKit/Factory.h +1 -1
  124. data/src/agent/Core/SpawningKit/Handshake/BackgroundIOCapturer.h +1 -1
  125. data/src/agent/Core/SpawningKit/Handshake/Perform.h +3 -2
  126. data/src/agent/Core/SpawningKit/Handshake/Prepare.h +1 -1
  127. data/src/agent/Core/SpawningKit/Handshake/Session.h +1 -1
  128. data/src/agent/Core/SpawningKit/Handshake/WorkDir.h +1 -1
  129. data/src/agent/Core/SpawningKit/Journey.h +1 -1
  130. data/src/agent/Core/SpawningKit/PipeWatcher.h +1 -1
  131. data/src/agent/Core/SpawningKit/README.md +3 -3
  132. data/src/agent/Core/SpawningKit/Result/AutoGeneratedCode.h +1 -1
  133. data/src/agent/Core/SpawningKit/Result/AutoGeneratedCode.h.cxxcodebuilder +1 -1
  134. data/src/agent/Core/SpawningKit/Result.h +1 -1
  135. data/src/agent/Core/SpawningKit/SmartSpawner.h +17 -17
  136. data/src/agent/Core/SpawningKit/Spawner.h +1 -1
  137. data/src/agent/Core/SpawningKit/UserSwitchingRules.h +1 -1
  138. data/src/agent/Core/TelemetryCollector.h +1 -1
  139. data/src/agent/ExecHelper/ExecHelperMain.cpp +1 -1
  140. data/src/agent/FileReadHelper/FileReadHelperMain.cpp +1 -1
  141. data/src/agent/MainFunctions.h +1 -1
  142. data/src/agent/Shared/ApiAccountUtils.h +4 -3
  143. data/src/agent/Shared/ApiServerUtils.h +2 -3
  144. data/src/agent/Shared/ApplicationPoolApiKey.h +1 -1
  145. data/src/agent/Shared/Fundamentals/AbortHandler.cpp +1 -1
  146. data/src/agent/Shared/Fundamentals/AbortHandler.h +1 -1
  147. data/src/agent/Shared/Fundamentals/Initialization.cpp +1 -1
  148. data/src/agent/Shared/Fundamentals/Initialization.h +1 -1
  149. data/src/agent/Shared/Fundamentals/Utils.cpp +1 -1
  150. data/src/agent/Shared/Fundamentals/Utils.h +1 -1
  151. data/src/agent/SpawnEnvSetupper/SpawnEnvSetupperMain.cpp +1 -1
  152. data/src/agent/SystemMetrics/SystemMetricsMain.cpp +1 -1
  153. data/src/agent/TempDirToucher/TempDirToucherMain.cpp +1 -1
  154. data/src/agent/Watchdog/ApiServer.h +7 -6
  155. data/src/agent/Watchdog/Config.h +2 -2
  156. data/src/apache2_module/Bucket.cpp +1 -1
  157. data/src/apache2_module/Bucket.h +1 -1
  158. data/src/apache2_module/CBindings.cpp +1 -1
  159. data/src/apache2_module/Config.cpp +1 -1
  160. data/src/apache2_module/Config.h +1 -1
  161. data/src/apache2_module/ConfigGeneral/AutoGeneratedDefinitions.cpp +104 -104
  162. data/src/apache2_module/ConfigGeneral/AutoGeneratedDefinitions.cpp.cxxcodebuilder +2 -2
  163. data/src/apache2_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.cpp +1 -1
  164. data/src/apache2_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.cpp.cxxcodebuilder +1 -1
  165. data/src/apache2_module/ConfigGeneral/AutoGeneratedSetterFuncs.cpp +1 -1
  166. data/src/apache2_module/ConfigGeneral/AutoGeneratedSetterFuncs.cpp.cxxcodebuilder +1 -1
  167. data/src/apache2_module/ConfigGeneral/Common.h +1 -1
  168. data/src/apache2_module/ConfigGeneral/ManifestGeneration.h +1 -1
  169. data/src/apache2_module/ConfigGeneral/SetterFuncs.h +1 -1
  170. data/src/apache2_module/DirConfig/AutoGeneratedCreateFunction.cpp +1 -1
  171. data/src/apache2_module/DirConfig/AutoGeneratedCreateFunction.cpp.cxxcodebuilder +1 -1
  172. data/src/apache2_module/DirConfig/AutoGeneratedHeaderSerialization.cpp +1 -1
  173. data/src/apache2_module/DirConfig/AutoGeneratedHeaderSerialization.cpp.cxxcodebuilder +1 -1
  174. data/src/apache2_module/DirConfig/AutoGeneratedManifestGeneration.cpp +1 -1
  175. data/src/apache2_module/DirConfig/AutoGeneratedManifestGeneration.cpp.cxxcodebuilder +1 -1
  176. data/src/apache2_module/DirConfig/AutoGeneratedMergeFunction.cpp +1 -1
  177. data/src/apache2_module/DirConfig/AutoGeneratedMergeFunction.cpp.cxxcodebuilder +1 -1
  178. data/src/apache2_module/DirConfig/AutoGeneratedStruct.h +1 -1
  179. data/src/apache2_module/DirConfig/AutoGeneratedStruct.h.cxxcodebuilder +1 -1
  180. data/src/apache2_module/DirectoryMapper.h +1 -1
  181. data/src/apache2_module/Hooks.cpp +21 -2
  182. data/src/apache2_module/Hooks.h +1 -1
  183. data/src/apache2_module/ServerConfig/AutoGeneratedManifestGeneration.cpp +1 -1
  184. data/src/apache2_module/ServerConfig/AutoGeneratedManifestGeneration.cpp.cxxcodebuilder +1 -1
  185. data/src/apache2_module/ServerConfig/AutoGeneratedStruct.h +1 -1
  186. data/src/apache2_module/ServerConfig/AutoGeneratedStruct.h.cxxcodebuilder +1 -1
  187. data/src/apache2_module/Utils.h +15 -1
  188. data/src/apache2_module/mod_passenger.c +1 -1
  189. data/src/cxx_supportlib/Algorithms/Hasher.cpp +1 -1
  190. data/src/cxx_supportlib/Algorithms/Hasher.h +1 -1
  191. data/src/cxx_supportlib/Algorithms/MovingAverage.h +1 -1
  192. data/src/cxx_supportlib/AppLocalConfigFileUtils.h +1 -1
  193. data/src/cxx_supportlib/AppTypeDetector/CBindings.cpp +1 -1
  194. data/src/cxx_supportlib/AppTypeDetector/CBindings.h +1 -1
  195. data/src/cxx_supportlib/AppTypeDetector/Detector.h +1 -1
  196. data/src/cxx_supportlib/BackgroundEventLoop.cpp +1 -1
  197. data/src/cxx_supportlib/BackgroundEventLoop.h +1 -1
  198. data/src/cxx_supportlib/ConfigKit/AsyncUtils.h +1 -1
  199. data/src/cxx_supportlib/ConfigKit/Common.h +1 -1
  200. data/src/cxx_supportlib/ConfigKit/ConfigKit.h +1 -1
  201. data/src/cxx_supportlib/ConfigKit/DummyTranslator.h +1 -1
  202. data/src/cxx_supportlib/ConfigKit/IN_PRACTICE.md +1 -3
  203. data/src/cxx_supportlib/ConfigKit/PrefixTranslator.h +3 -3
  204. data/src/cxx_supportlib/ConfigKit/Schema.h +1 -1
  205. data/src/cxx_supportlib/ConfigKit/SchemaUtils.h +1 -1
  206. data/src/cxx_supportlib/ConfigKit/Store.h +1 -1
  207. data/src/cxx_supportlib/ConfigKit/SubComponentUtils.h +1 -1
  208. data/src/cxx_supportlib/ConfigKit/TableTranslator.h +1 -1
  209. data/src/cxx_supportlib/ConfigKit/Translator.h +1 -1
  210. data/src/cxx_supportlib/ConfigKit/Utils.h +1 -1
  211. data/src/cxx_supportlib/Constants.h +2 -2
  212. data/src/cxx_supportlib/Constants.h.cxxcodebuilder +1 -1
  213. data/src/cxx_supportlib/DataStructures/HashedStaticString.h +1 -1
  214. data/src/cxx_supportlib/DataStructures/LString.cpp +1 -1
  215. data/src/cxx_supportlib/DataStructures/LString.h +1 -1
  216. data/src/cxx_supportlib/DataStructures/StringKeyTable.h +1 -1
  217. data/src/cxx_supportlib/DataStructures/StringMap.h +1 -1
  218. data/src/cxx_supportlib/Exceptions.cpp +1 -1
  219. data/src/cxx_supportlib/Exceptions.h +1 -1
  220. data/src/cxx_supportlib/FileDescriptor.h +1 -1
  221. data/src/cxx_supportlib/FileTools/FileManip.cpp +28 -4
  222. data/src/cxx_supportlib/FileTools/FileManip.h +1 -1
  223. data/src/cxx_supportlib/FileTools/PathManip.cpp +1 -1
  224. data/src/cxx_supportlib/FileTools/PathManip.h +1 -1
  225. data/src/cxx_supportlib/FileTools/PathManipCBindings.cpp +1 -1
  226. data/src/cxx_supportlib/FileTools/PathManipCBindings.h +1 -1
  227. data/src/cxx_supportlib/FileTools/PathSecurityCheck.cpp +1 -1
  228. data/src/cxx_supportlib/FileTools/PathSecurityCheck.h +1 -1
  229. data/src/cxx_supportlib/Hooks.h +1 -1
  230. data/src/cxx_supportlib/IOTools/BufferedIO.h +1 -1
  231. data/src/cxx_supportlib/IOTools/IOUtils.cpp +10 -10
  232. data/src/cxx_supportlib/IOTools/IOUtils.h +1 -1
  233. data/src/cxx_supportlib/IOTools/MessageIO.h +1 -1
  234. data/src/cxx_supportlib/IOTools/MessageSerialization.h +1 -1
  235. data/src/cxx_supportlib/InstanceDirectory.h +31 -4
  236. data/src/cxx_supportlib/Integrations/LibevJsonUtils.h +1 -1
  237. data/src/cxx_supportlib/JsonTools/Autocast.h +1 -1
  238. data/src/cxx_supportlib/JsonTools/CBindings.cpp +1 -1
  239. data/src/cxx_supportlib/JsonTools/CBindings.h +1 -1
  240. data/src/cxx_supportlib/JsonTools/JsonUtils.h +1 -1
  241. data/src/cxx_supportlib/LoggingKit/Assert.h +1 -1
  242. data/src/cxx_supportlib/LoggingKit/Config.h +2 -1
  243. data/src/cxx_supportlib/LoggingKit/Context.h +1 -1
  244. data/src/cxx_supportlib/LoggingKit/Forward.h +1 -1
  245. data/src/cxx_supportlib/LoggingKit/Implementation.cpp +11 -1
  246. data/src/cxx_supportlib/LoggingKit/Logging.h +1 -1
  247. data/src/cxx_supportlib/LoggingKit/LoggingKit.h +1 -1
  248. data/src/cxx_supportlib/LveLoggingDecorator.h +1 -1
  249. data/src/cxx_supportlib/MemoryKit/mbuf.cpp +1 -1
  250. data/src/cxx_supportlib/MemoryKit/mbuf.h +1 -1
  251. data/src/cxx_supportlib/MemoryKit/palloc.cpp +1 -1
  252. data/src/cxx_supportlib/MemoryKit/palloc.h +1 -1
  253. data/src/cxx_supportlib/ProcessManagement/Ruby.cpp +1 -1
  254. data/src/cxx_supportlib/ProcessManagement/Ruby.h +1 -1
  255. data/src/cxx_supportlib/ProcessManagement/Spawn.cpp +1 -1
  256. data/src/cxx_supportlib/ProcessManagement/Spawn.h +1 -1
  257. data/src/cxx_supportlib/ProcessManagement/Utils.cpp +1 -1
  258. data/src/cxx_supportlib/ProcessManagement/Utils.h +1 -1
  259. data/src/cxx_supportlib/RandomGenerator.h +1 -1
  260. data/src/cxx_supportlib/ResourceLocator.h +1 -1
  261. data/src/cxx_supportlib/SafeLibev.h +1 -1
  262. data/src/cxx_supportlib/SecurityKit/Crypto.cpp +9 -27
  263. data/src/cxx_supportlib/SecurityKit/Crypto.h +2 -2
  264. data/src/cxx_supportlib/SecurityKit/MemZeroGuard.h +1 -1
  265. data/src/cxx_supportlib/ServerKit/AcceptLoadBalancer.h +1 -1
  266. data/src/cxx_supportlib/ServerKit/Channel.h +1 -1
  267. data/src/cxx_supportlib/ServerKit/Client.h +1 -1
  268. data/src/cxx_supportlib/ServerKit/ClientRef.h +1 -1
  269. data/src/cxx_supportlib/ServerKit/Config.h +1 -1
  270. data/src/cxx_supportlib/ServerKit/Context.h +1 -1
  271. data/src/cxx_supportlib/ServerKit/CookieUtils.h +1 -1
  272. data/src/cxx_supportlib/ServerKit/Errors.h +2 -2
  273. data/src/cxx_supportlib/ServerKit/FdSinkChannel.h +1 -1
  274. data/src/cxx_supportlib/ServerKit/FdSourceChannel.h +1 -1
  275. data/src/cxx_supportlib/ServerKit/FileBufferedChannel.h +54 -2
  276. data/src/cxx_supportlib/ServerKit/FileBufferedFdSinkChannel.h +1 -1
  277. data/src/cxx_supportlib/ServerKit/HeaderTable.h +1 -1
  278. data/src/cxx_supportlib/ServerKit/Hooks.h +1 -1
  279. data/src/cxx_supportlib/ServerKit/HttpChunkedBodyParser.h +1 -1
  280. data/src/cxx_supportlib/ServerKit/HttpChunkedBodyParserState.h +1 -1
  281. data/src/cxx_supportlib/ServerKit/HttpClient.h +1 -1
  282. data/src/cxx_supportlib/ServerKit/HttpHeaderParser.h +2 -2
  283. data/src/cxx_supportlib/ServerKit/HttpHeaderParserState.h +2 -2
  284. data/src/cxx_supportlib/ServerKit/HttpRequest.h +2 -2
  285. data/src/cxx_supportlib/ServerKit/HttpRequestRef.h +1 -1
  286. data/src/cxx_supportlib/ServerKit/HttpServer.h +1 -1
  287. data/src/cxx_supportlib/ServerKit/Implementation.cpp +1 -1
  288. data/src/cxx_supportlib/ServerKit/Server.h +4 -2
  289. data/src/cxx_supportlib/ServerKit/llerrors.h +3 -3
  290. data/src/cxx_supportlib/ServerKit/llversion.h +1 -1
  291. data/src/cxx_supportlib/StaticString.h +1 -1
  292. data/src/cxx_supportlib/StrIntTools/DateParsing.h +1 -1
  293. data/src/cxx_supportlib/StrIntTools/StrIntUtils.cpp +1 -1
  294. data/src/cxx_supportlib/StrIntTools/StrIntUtils.h +1 -1
  295. data/src/cxx_supportlib/StrIntTools/StrIntUtilsNoStrictAliasing.cpp +1 -1
  296. data/src/cxx_supportlib/StrIntTools/StringScanning.h +1 -1
  297. data/src/cxx_supportlib/StrIntTools/Template.h +1 -1
  298. data/src/cxx_supportlib/SystemTools/ContainerHelpers.h +1 -1
  299. data/src/cxx_supportlib/SystemTools/ProcessMetricsCollector.h +1 -1
  300. data/src/cxx_supportlib/SystemTools/SystemMetricsCollector.h +1 -1
  301. data/src/cxx_supportlib/SystemTools/SystemTime.cpp +1 -1
  302. data/src/cxx_supportlib/SystemTools/SystemTime.h +1 -1
  303. data/src/cxx_supportlib/SystemTools/UserDatabase.cpp +1 -1
  304. data/src/cxx_supportlib/SystemTools/UserDatabase.h +1 -1
  305. data/src/cxx_supportlib/Utils/AnsiColorConstants.h +1 -1
  306. data/src/cxx_supportlib/Utils/AsyncSignalSafeUtils.h +1 -1
  307. data/src/cxx_supportlib/Utils/BlockingQueue.h +1 -1
  308. data/src/cxx_supportlib/Utils/CachedFileStat.cpp +1 -1
  309. data/src/cxx_supportlib/Utils/CachedFileStat.h +1 -1
  310. data/src/cxx_supportlib/Utils/CachedFileStat.hpp +1 -1
  311. data/src/cxx_supportlib/Utils/ClassUtils.h +1 -1
  312. data/src/cxx_supportlib/Utils/Curl.h +1 -1
  313. data/src/cxx_supportlib/Utils/FastStringStream.h +1 -1
  314. data/src/cxx_supportlib/Utils/FileChangeChecker.h +1 -1
  315. data/src/cxx_supportlib/Utils/HttpConstants.h +1 -1
  316. data/src/cxx_supportlib/Utils/IniFile.h +1 -1
  317. data/src/cxx_supportlib/Utils/MessagePassing.h +1 -1
  318. data/src/cxx_supportlib/Utils/OptionParsing.h +1 -1
  319. data/src/cxx_supportlib/Utils/ReleaseableScopedPointer.h +1 -1
  320. data/src/cxx_supportlib/Utils/ScopeGuard.h +1 -1
  321. data/src/cxx_supportlib/Utils/SpeedMeter.h +1 -1
  322. data/src/cxx_supportlib/Utils/Timer.h +1 -1
  323. data/src/cxx_supportlib/Utils/VariantMap.h +1 -1
  324. data/src/cxx_supportlib/Utils.cpp +1 -1
  325. data/src/cxx_supportlib/Utils.h +1 -1
  326. data/src/cxx_supportlib/WatchdogLauncher.cpp +1 -1
  327. data/src/cxx_supportlib/WatchdogLauncher.h +1 -1
  328. data/src/cxx_supportlib/WrapperRegistry/CBindings.cpp +1 -1
  329. data/src/cxx_supportlib/WrapperRegistry/CBindings.h +1 -1
  330. data/src/cxx_supportlib/WrapperRegistry/Entry.h +1 -1
  331. data/src/cxx_supportlib/WrapperRegistry/Registry.h +1 -1
  332. data/src/cxx_supportlib/oxt/backtrace.hpp +1 -1
  333. data/src/cxx_supportlib/oxt/detail/backtrace_disabled.hpp +1 -1
  334. data/src/cxx_supportlib/oxt/detail/backtrace_enabled.hpp +1 -1
  335. data/src/cxx_supportlib/oxt/detail/context.hpp +1 -1
  336. data/src/cxx_supportlib/oxt/detail/tracable_exception_disabled.hpp +1 -1
  337. data/src/cxx_supportlib/oxt/detail/tracable_exception_enabled.hpp +1 -1
  338. data/src/cxx_supportlib/oxt/dynamic_thread_group.hpp +1 -1
  339. data/src/cxx_supportlib/oxt/implementation.cpp +1 -1
  340. data/src/cxx_supportlib/oxt/initialize.hpp +1 -1
  341. data/src/cxx_supportlib/oxt/macros.hpp +1 -1
  342. data/src/cxx_supportlib/oxt/spin_lock.hpp +1 -1
  343. data/src/cxx_supportlib/oxt/system_calls.cpp +1 -1
  344. data/src/cxx_supportlib/oxt/system_calls.hpp +1 -1
  345. data/src/cxx_supportlib/oxt/thread.hpp +1 -1
  346. data/src/cxx_supportlib/oxt/tracable_exception.hpp +1 -1
  347. data/src/cxx_supportlib/vendor-copy/adhoc_lve.h +1 -1
  348. data/src/cxx_supportlib/vendor-copy/libuv/AUTHORS +353 -3
  349. data/src/cxx_supportlib/vendor-copy/libuv/ChangeLog +3981 -2
  350. data/src/cxx_supportlib/vendor-copy/libuv/LICENSE +1 -28
  351. data/src/cxx_supportlib/vendor-copy/libuv/LICENSE-docs +396 -0
  352. data/src/cxx_supportlib/vendor-copy/libuv/LICENSE-extra +36 -0
  353. data/src/cxx_supportlib/vendor-copy/libuv/Makefile.am +275 -58
  354. data/src/cxx_supportlib/vendor-copy/libuv/Makefile.in +4380 -2125
  355. data/src/cxx_supportlib/vendor-copy/libuv/aclocal.m4 +425 -221
  356. data/src/cxx_supportlib/vendor-copy/libuv/ar-lib +30 -10
  357. data/src/cxx_supportlib/vendor-copy/libuv/compile +31 -14
  358. data/src/cxx_supportlib/vendor-copy/libuv/config.guess +1084 -690
  359. data/src/cxx_supportlib/vendor-copy/libuv/config.sub +1844 -1297
  360. data/src/cxx_supportlib/vendor-copy/libuv/configure +6935 -3664
  361. data/src/cxx_supportlib/vendor-copy/libuv/configure.ac +43 -19
  362. data/src/cxx_supportlib/vendor-copy/libuv/depcomp +12 -11
  363. data/src/cxx_supportlib/vendor-copy/libuv/include/{uv-darwin.h → uv/darwin.h} +3 -3
  364. data/src/cxx_supportlib/vendor-copy/libuv/include/{uv-errno.h → uv/errno.h} +119 -60
  365. data/src/cxx_supportlib/vendor-copy/libuv/include/{uv-linux.h → uv/linux.h} +1 -1
  366. data/src/cxx_supportlib/vendor-copy/libuv/include/uv/os390.h +33 -0
  367. data/src/cxx_supportlib/vendor-copy/libuv/include/uv/posix.h +31 -0
  368. data/src/cxx_supportlib/vendor-copy/libuv/include/{uv-threadpool.h → uv/threadpool.h} +1 -1
  369. data/src/cxx_supportlib/vendor-copy/libuv/include/{tree.h → uv/tree.h} +3 -250
  370. data/src/cxx_supportlib/vendor-copy/libuv/include/{uv-unix.h → uv/unix.h} +186 -60
  371. data/src/cxx_supportlib/vendor-copy/libuv/include/{uv-version.h → uv/version.h} +3 -3
  372. data/src/cxx_supportlib/vendor-copy/libuv/include/uv/win.h +703 -0
  373. data/src/cxx_supportlib/vendor-copy/libuv/include/uv.h +528 -40
  374. data/src/cxx_supportlib/vendor-copy/libuv/install-sh +110 -70
  375. data/src/cxx_supportlib/vendor-copy/libuv/libuv-static.pc.in +12 -0
  376. data/src/cxx_supportlib/vendor-copy/libuv/libuv.pc.in +4 -2
  377. data/src/cxx_supportlib/vendor-copy/libuv/ltmain.sh +995 -619
  378. data/src/cxx_supportlib/vendor-copy/libuv/m4/ax_pthread.m4 +485 -0
  379. data/src/cxx_supportlib/vendor-copy/libuv/m4/libtool.m4 +438 -289
  380. data/src/cxx_supportlib/vendor-copy/libuv/m4/libuv-check-flags.m4 +21 -4
  381. data/src/cxx_supportlib/vendor-copy/libuv/m4/libuv-check-versions.m4 +7 -0
  382. data/src/cxx_supportlib/vendor-copy/libuv/m4/ltoptions.m4 +69 -39
  383. data/src/cxx_supportlib/vendor-copy/libuv/m4/ltsugar.m4 +1 -1
  384. data/src/cxx_supportlib/vendor-copy/libuv/m4/ltversion.m4 +7 -6
  385. data/src/cxx_supportlib/vendor-copy/libuv/m4/lt~obsolete.m4 +2 -2
  386. data/src/cxx_supportlib/vendor-copy/libuv/missing +55 -34
  387. data/src/cxx_supportlib/vendor-copy/libuv/src/fs-poll.c +52 -20
  388. data/src/cxx_supportlib/vendor-copy/libuv/src/idna.c +560 -0
  389. data/src/cxx_supportlib/vendor-copy/libuv/src/idna.h +31 -0
  390. data/src/cxx_supportlib/vendor-copy/libuv/src/inet.c +5 -16
  391. data/src/cxx_supportlib/vendor-copy/libuv/src/queue.h +68 -86
  392. data/src/cxx_supportlib/vendor-copy/libuv/src/random.c +123 -0
  393. data/src/cxx_supportlib/vendor-copy/libuv/src/strscpy.c +38 -0
  394. data/src/cxx_supportlib/vendor-copy/libuv/src/strscpy.h +39 -0
  395. data/src/cxx_supportlib/vendor-copy/libuv/src/strtok.c +52 -0
  396. data/src/cxx_supportlib/vendor-copy/libuv/src/strtok.h +27 -0
  397. data/src/cxx_supportlib/vendor-copy/libuv/src/thread-common.c +175 -0
  398. data/src/cxx_supportlib/vendor-copy/libuv/src/threadpool.c +172 -57
  399. data/src/cxx_supportlib/vendor-copy/libuv/src/{unix/timer.c → timer.c} +57 -29
  400. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/aix-common.c +89 -0
  401. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/aix.c +418 -256
  402. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/async.c +168 -129
  403. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/bsd-ifaddrs.c +163 -0
  404. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/bsd-proctitle.c +99 -0
  405. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/core.c +1312 -378
  406. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/cygwin.c +93 -0
  407. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/darwin-proctitle.c +18 -32
  408. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/darwin-stub.h +97 -0
  409. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/darwin-syscalls.h +17 -0
  410. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/darwin.c +41 -139
  411. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/dl.c +1 -1
  412. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/freebsd.c +75 -235
  413. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/fs.c +1308 -299
  414. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/fsevents.c +150 -148
  415. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/getaddrinfo.c +58 -8
  416. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/getnameinfo.c +3 -2
  417. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/haiku.c +172 -0
  418. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/hurd.c +172 -0
  419. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/ibmi.c +542 -0
  420. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/internal.h +297 -106
  421. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/kqueue.c +325 -94
  422. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/linux.c +2708 -0
  423. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/loop-watcher.c +11 -11
  424. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/loop.c +105 -24
  425. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/netbsd.c +51 -157
  426. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/no-fsevents.c +42 -0
  427. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/no-proctitle.c +45 -0
  428. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/openbsd.c +42 -183
  429. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/os390-proctitle.c +136 -0
  430. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/os390-syscalls.c +536 -0
  431. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/os390-syscalls.h +75 -0
  432. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/os390.c +1070 -0
  433. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/pipe.c +324 -55
  434. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/poll.c +58 -11
  435. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/posix-hrtime.c +36 -0
  436. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/posix-poll.c +385 -0
  437. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/process.c +795 -248
  438. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/procfs-exepath.c +45 -0
  439. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/proctitle.c +77 -22
  440. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/qnx.c +142 -0
  441. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/random-devurandom.c +93 -0
  442. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/random-getentropy.c +57 -0
  443. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/random-getrandom.c +86 -0
  444. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/random-sysctl-linux.c +99 -0
  445. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/signal.c +147 -39
  446. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/stream.c +426 -474
  447. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/sunos.c +240 -98
  448. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/sysinfo-loadavg.c +36 -0
  449. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/sysinfo-memory.c +42 -0
  450. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/tcp.c +402 -91
  451. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/thread.c +497 -145
  452. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/tty.c +269 -45
  453. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/udp.c +695 -165
  454. data/src/cxx_supportlib/vendor-copy/libuv/src/uv-common.c +463 -61
  455. data/src/cxx_supportlib/vendor-copy/libuv/src/uv-common.h +248 -44
  456. data/src/cxx_supportlib/vendor-copy/libuv/src/uv-data-getter-setters.c +119 -0
  457. data/src/cxx_supportlib/vendor-copy/libuv/tsansupp.txt +2 -0
  458. data/src/cxx_supportlib/{ServerKit/llhttp_api.c → vendor-copy/llhttp/api.c} +30 -23
  459. data/src/cxx_supportlib/{ServerKit → vendor-copy/llhttp}/llhttp.c +1756 -1645
  460. data/src/cxx_supportlib/{ServerKit → vendor-copy/llhttp}/llhttp.h +35 -13
  461. data/src/cxx_supportlib/vendor-modified/boost/algorithm/string/classification.hpp +19 -0
  462. data/src/cxx_supportlib/vendor-modified/boost/algorithm/string/formatter.hpp +1 -1
  463. data/src/cxx_supportlib/vendor-modified/boost/algorithm/string/trim_all.hpp +0 -2
  464. data/src/cxx_supportlib/vendor-modified/boost/assert.hpp +20 -13
  465. data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/core_arch_ops_gcc_x86.hpp +2 -2
  466. data/src/cxx_supportlib/vendor-modified/boost/atomic/thread_pause.hpp +4 -0
  467. data/src/cxx_supportlib/vendor-modified/boost/bind/mem_fn.hpp +1 -1
  468. data/src/cxx_supportlib/vendor-modified/boost/circular_buffer/debug.hpp +4 -0
  469. data/src/cxx_supportlib/vendor-modified/boost/config/assert_cxx03.hpp +1 -1
  470. data/src/cxx_supportlib/vendor-modified/boost/config/assert_cxx11.hpp +1 -1
  471. data/src/cxx_supportlib/vendor-modified/boost/config/assert_cxx14.hpp +1 -1
  472. data/src/cxx_supportlib/vendor-modified/boost/config/assert_cxx17.hpp +1 -1
  473. data/src/cxx_supportlib/vendor-modified/boost/config/assert_cxx20.hpp +1 -1
  474. data/src/cxx_supportlib/vendor-modified/boost/config/assert_cxx23.hpp +1 -1
  475. data/src/cxx_supportlib/vendor-modified/boost/config/auto_link.hpp +6 -1
  476. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/clang_version.hpp +10 -1
  477. data/src/cxx_supportlib/vendor-modified/boost/config/compiler/visualc.hpp +5 -3
  478. data/src/cxx_supportlib/vendor-modified/boost/config/detail/cxx_composite.hpp +1 -1
  479. data/src/cxx_supportlib/vendor-modified/boost/config/workaround.hpp +5 -0
  480. data/src/cxx_supportlib/vendor-modified/boost/container/adaptive_pool.hpp +57 -53
  481. data/src/cxx_supportlib/vendor-modified/boost/container/allocator.hpp +10 -10
  482. data/src/cxx_supportlib/vendor-modified/boost/container/allocator_traits.hpp +34 -2
  483. data/src/cxx_supportlib/vendor-modified/boost/container/container_fwd.hpp +14 -2
  484. data/src/cxx_supportlib/vendor-modified/boost/container/deque.hpp +176 -2287
  485. data/src/cxx_supportlib/vendor-modified/boost/container/detail/adaptive_node_pool.hpp +13 -9
  486. data/src/cxx_supportlib/vendor-modified/boost/container/detail/adaptive_node_pool_impl.hpp +186 -70
  487. data/src/cxx_supportlib/vendor-modified/boost/container/detail/algorithm.hpp +2 -2
  488. data/src/cxx_supportlib/vendor-modified/boost/container/detail/aligned_allocation.hpp +149 -0
  489. data/src/cxx_supportlib/vendor-modified/boost/container/detail/alloc_helpers.hpp +35 -0
  490. data/src/cxx_supportlib/vendor-modified/boost/container/detail/alloc_lib.h +1 -0
  491. data/src/cxx_supportlib/vendor-modified/boost/container/detail/bit_utilities.hpp +133 -0
  492. data/src/cxx_supportlib/vendor-modified/boost/container/detail/compare_functors.hpp +18 -3
  493. data/src/cxx_supportlib/vendor-modified/boost/container/detail/config_begin.hpp +5 -0
  494. data/src/cxx_supportlib/vendor-modified/boost/container/detail/config_end.hpp +4 -0
  495. data/src/cxx_supportlib/vendor-modified/boost/container/detail/container_rebind.hpp +1 -1
  496. data/src/cxx_supportlib/vendor-modified/boost/container/detail/copy_move_algo.hpp +20 -10
  497. data/src/cxx_supportlib/vendor-modified/boost/container/detail/deque_impl.hpp +2744 -0
  498. data/src/cxx_supportlib/vendor-modified/boost/container/detail/dispatch_uses_allocator.hpp +202 -104
  499. data/src/cxx_supportlib/vendor-modified/boost/container/detail/dlmalloc.hpp +5 -4
  500. data/src/cxx_supportlib/vendor-modified/boost/container/detail/flat_tree.hpp +161 -85
  501. data/src/cxx_supportlib/vendor-modified/boost/container/detail/is_constructible.hpp +180 -0
  502. data/src/cxx_supportlib/vendor-modified/boost/container/detail/iterators.hpp +3 -2
  503. data/src/cxx_supportlib/vendor-modified/boost/container/detail/math_functions.hpp +12 -0
  504. data/src/cxx_supportlib/vendor-modified/boost/container/detail/mpl.hpp +16 -0
  505. data/src/cxx_supportlib/vendor-modified/boost/container/detail/mutex.hpp +1 -1
  506. data/src/cxx_supportlib/vendor-modified/boost/container/detail/next_capacity.hpp +9 -1
  507. data/src/cxx_supportlib/vendor-modified/boost/container/detail/node_pool.hpp +18 -14
  508. data/src/cxx_supportlib/vendor-modified/boost/container/detail/node_pool_impl.hpp +256 -41
  509. data/src/cxx_supportlib/vendor-modified/boost/container/detail/operator_new_helpers.hpp +75 -24
  510. data/src/cxx_supportlib/vendor-modified/boost/container/detail/pair.hpp +1 -56
  511. data/src/cxx_supportlib/vendor-modified/boost/container/detail/placement_new.hpp +16 -3
  512. data/src/cxx_supportlib/vendor-modified/boost/container/detail/pool_common_alloc.hpp +1 -7
  513. data/src/cxx_supportlib/vendor-modified/boost/container/detail/range_utils.hpp +196 -0
  514. data/src/cxx_supportlib/vendor-modified/boost/container/detail/std_fwd.hpp +33 -1
  515. data/src/cxx_supportlib/vendor-modified/boost/container/detail/tree.hpp +124 -69
  516. data/src/cxx_supportlib/vendor-modified/boost/container/detail/workaround.hpp +109 -7
  517. data/src/cxx_supportlib/vendor-modified/boost/container/devector.hpp +168 -162
  518. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/nest.hpp +2978 -0
  519. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/pmr/nest.hpp +45 -0
  520. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_all_of.hpp +43 -0
  521. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_any_of.hpp +42 -0
  522. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_copy.hpp +229 -0
  523. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_copy_if.hpp +270 -0
  524. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_copy_n.hpp +308 -0
  525. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_count.hpp +101 -0
  526. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_count_if.hpp +100 -0
  527. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_equal.hpp +268 -0
  528. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_fill.hpp +101 -0
  529. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_fill_n.hpp +171 -0
  530. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_find.hpp +110 -0
  531. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_find_if.hpp +110 -0
  532. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_find_if_not.hpp +43 -0
  533. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_find_last.hpp +179 -0
  534. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_find_last_if.hpp +179 -0
  535. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_find_last_if_not.hpp +43 -0
  536. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_for_each.hpp +92 -0
  537. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_generate.hpp +90 -0
  538. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_generate_n.hpp +162 -0
  539. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_is_partitioned.hpp +46 -0
  540. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_is_sorted.hpp +49 -0
  541. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_is_sorted_until.hpp +169 -0
  542. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_iterator_traits.hpp +382 -0
  543. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_merge.hpp +428 -0
  544. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_mismatch.hpp +350 -0
  545. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_none_of.hpp +98 -0
  546. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_partition.hpp +296 -0
  547. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_partition_copy.hpp +105 -0
  548. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_partition_point.hpp +116 -0
  549. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_remove.hpp +57 -0
  550. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_remove_copy.hpp +207 -0
  551. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_remove_copy_if.hpp +223 -0
  552. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_remove_if.hpp +57 -0
  553. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_replace.hpp +90 -0
  554. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_replace_if.hpp +90 -0
  555. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_reverse.hpp +245 -0
  556. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_reverse_copy.hpp +229 -0
  557. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_search.hpp +211 -0
  558. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_search_n.hpp +476 -0
  559. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_set_difference.hpp +300 -0
  560. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_set_intersection.hpp +287 -0
  561. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_set_symmetric_difference.hpp +306 -0
  562. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_set_union.hpp +294 -0
  563. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_stable_partition.hpp +153 -0
  564. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_swap_ranges.hpp +92 -0
  565. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_transform.hpp +93 -0
  566. data/src/cxx_supportlib/vendor-modified/boost/container/experimental/wrapped_iterator.hpp +142 -0
  567. data/src/cxx_supportlib/vendor-modified/boost/container/flat_map.hpp +642 -417
  568. data/src/cxx_supportlib/vendor-modified/boost/container/flat_set.hpp +141 -30
  569. data/src/cxx_supportlib/vendor-modified/boost/container/hub.hpp +2426 -0
  570. data/src/cxx_supportlib/vendor-modified/boost/container/list.hpp +65 -57
  571. data/src/cxx_supportlib/vendor-modified/boost/container/map.hpp +247 -68
  572. data/src/cxx_supportlib/vendor-modified/boost/container/new_allocator.hpp +7 -0
  573. data/src/cxx_supportlib/vendor-modified/boost/container/node_allocator.hpp +39 -33
  574. data/src/cxx_supportlib/vendor-modified/boost/container/options.hpp +156 -23
  575. data/src/cxx_supportlib/vendor-modified/boost/container/pmr/global_resource.hpp +3 -3
  576. data/src/cxx_supportlib/vendor-modified/boost/container/pmr/hub.hpp +43 -0
  577. data/src/cxx_supportlib/vendor-modified/boost/container/pmr/memory_resource.hpp +5 -3
  578. data/src/cxx_supportlib/vendor-modified/boost/container/pmr/monotonic_buffer_resource.hpp +1 -0
  579. data/src/cxx_supportlib/vendor-modified/boost/container/pmr/polymorphic_allocator.hpp +1 -1
  580. data/src/cxx_supportlib/vendor-modified/boost/container/pmr/resource_adaptor.hpp +4 -0
  581. data/src/cxx_supportlib/vendor-modified/boost/container/pmr/segtor.hpp +45 -0
  582. data/src/cxx_supportlib/vendor-modified/boost/container/scoped_allocator.hpp +5 -4
  583. data/src/cxx_supportlib/vendor-modified/boost/container/segtor.hpp +905 -0
  584. data/src/cxx_supportlib/vendor-modified/boost/container/set.hpp +148 -35
  585. data/src/cxx_supportlib/vendor-modified/boost/container/slist.hpp +59 -52
  586. data/src/cxx_supportlib/vendor-modified/boost/container/small_vector.hpp +632 -5
  587. data/src/cxx_supportlib/vendor-modified/boost/container/stable_vector.hpp +66 -60
  588. data/src/cxx_supportlib/vendor-modified/boost/container/static_vector.hpp +46 -1
  589. data/src/cxx_supportlib/vendor-modified/boost/container/string.hpp +612 -317
  590. data/src/cxx_supportlib/vendor-modified/boost/container/uses_allocator.hpp +54 -111
  591. data/src/cxx_supportlib/vendor-modified/boost/container/uses_allocator_construction.hpp +100 -0
  592. data/src/cxx_supportlib/vendor-modified/boost/container/uses_allocator_fwd.hpp +1 -3
  593. data/src/cxx_supportlib/vendor-modified/boost/container/vector.hpp +233 -116
  594. data/src/cxx_supportlib/vendor-modified/boost/container_hash/hash.hpp +5 -1
  595. data/src/cxx_supportlib/vendor-modified/boost/core/lightweight_test.hpp +17 -10
  596. data/src/cxx_supportlib/vendor-modified/boost/date_time/period.hpp +1 -3
  597. data/src/cxx_supportlib/vendor-modified/boost/describe/detail/config.hpp +16 -0
  598. data/src/cxx_supportlib/vendor-modified/boost/exception/detail/encoder.hpp +114 -0
  599. data/src/cxx_supportlib/vendor-modified/boost/exception/detail/error_info_impl.hpp +4 -0
  600. data/src/cxx_supportlib/vendor-modified/boost/exception/detail/requires_cxx11.hpp +1 -1
  601. data/src/cxx_supportlib/vendor-modified/boost/exception/detail/type_info.hpp +211 -1
  602. data/src/cxx_supportlib/vendor-modified/boost/exception/diagnostic_information.hpp +59 -0
  603. data/src/cxx_supportlib/vendor-modified/boost/exception/exception.hpp +6 -0
  604. data/src/cxx_supportlib/vendor-modified/boost/exception/info.hpp +34 -0
  605. data/src/cxx_supportlib/vendor-modified/boost/intrusive/avltree.hpp +0 -1
  606. data/src/cxx_supportlib/vendor-modified/boost/intrusive/bstree.hpp +12 -3
  607. data/src/cxx_supportlib/vendor-modified/boost/intrusive/derivation_value_traits.hpp +1 -1
  608. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/ebo_functor_holder.hpp +29 -174
  609. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/generic_hook.hpp +18 -2
  610. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/key_nodeptr_comp.hpp +0 -1
  611. data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/workaround.hpp +4 -5
  612. data/src/cxx_supportlib/vendor-modified/boost/intrusive/hashtable.hpp +20 -11
  613. data/src/cxx_supportlib/vendor-modified/boost/intrusive/list.hpp +42 -14
  614. data/src/cxx_supportlib/vendor-modified/boost/intrusive/slist.hpp +58 -22
  615. data/src/cxx_supportlib/vendor-modified/boost/intrusive/unordered_set.hpp +3 -1
  616. data/src/cxx_supportlib/vendor-modified/boost/iterator/advance.hpp +5 -1
  617. data/src/cxx_supportlib/vendor-modified/boost/iterator/distance.hpp +8 -2
  618. data/src/cxx_supportlib/vendor-modified/boost/iterator/is_iterator.hpp +9 -0
  619. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/bad_lexical_cast.hpp +11 -1
  620. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/buffer_view.hpp +9 -1
  621. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/config.hpp +22 -0
  622. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/converter_lexical.hpp +15 -7
  623. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/converter_lexical_streams.hpp +23 -11
  624. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/converter_numeric.hpp +11 -1
  625. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/inf_nan.hpp +9 -1
  626. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/is_character.hpp +11 -2
  627. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/lcast_basic_unlockedbuf.hpp +10 -1
  628. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/lcast_char_constants.hpp +8 -1
  629. data/src/cxx_supportlib/vendor-modified/boost/{detail → lexical_cast/detail}/lcast_precision.hpp +13 -1
  630. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/lcast_unsigned_converters.hpp +11 -1
  631. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/widest_char.hpp +10 -2
  632. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/try_lexical_convert.hpp +15 -2
  633. data/src/cxx_supportlib/vendor-modified/boost/lexical_cast.hpp +11 -1
  634. data/src/cxx_supportlib/vendor-modified/boost/libs/thread/src/pthread/once_atomic.cpp +1 -1
  635. data/src/cxx_supportlib/vendor-modified/boost/libs/thread/src/pthread/thread.cpp +48 -46
  636. data/src/cxx_supportlib/vendor-modified/boost/move/detail/meta_utils.hpp +23 -0
  637. data/src/cxx_supportlib/vendor-modified/boost/move/detail/move_helpers.hpp +24 -24
  638. data/src/cxx_supportlib/vendor-modified/boost/move/detail/nsec_clock.hpp +12 -4
  639. data/src/cxx_supportlib/vendor-modified/boost/move/detail/type_traits.hpp +76 -0
  640. data/src/cxx_supportlib/vendor-modified/boost/move/detail/workaround.hpp +1 -1
  641. data/src/cxx_supportlib/vendor-modified/boost/move/traits.hpp +11 -0
  642. data/src/cxx_supportlib/vendor-modified/boost/mp11/algorithm.hpp +58 -37
  643. data/src/cxx_supportlib/vendor-modified/boost/mp11/detail/mp_copy_if.hpp +1 -2
  644. data/src/cxx_supportlib/vendor-modified/boost/mp11/detail/mp_map_find.hpp +17 -9
  645. data/src/cxx_supportlib/vendor-modified/boost/mp11/detail/mp_remove_if.hpp +1 -2
  646. data/src/cxx_supportlib/vendor-modified/boost/mp11/integer_sequence.hpp +6 -0
  647. data/src/cxx_supportlib/vendor-modified/boost/mp11/version.hpp +1 -1
  648. data/src/cxx_supportlib/vendor-modified/boost/none_t.hpp +6 -1
  649. data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_common_defs.hpp +188 -0
  650. data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_factory_support.hpp +0 -6
  651. data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_hash.hpp +1 -1
  652. data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_nonmember_interface.hpp +117 -0
  653. data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_reference_spec.hpp +108 -83
  654. data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_relops.hpp +39 -39
  655. data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_select_implementation.hpp +37 -0
  656. data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_swap.hpp +1 -1
  657. data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_trivially_copyable_base.hpp +8 -8
  658. data/src/cxx_supportlib/vendor-modified/boost/optional/detail/union_optional.hpp +724 -0
  659. data/src/cxx_supportlib/vendor-modified/boost/optional/optional.hpp +93 -220
  660. data/src/cxx_supportlib/vendor-modified/boost/optional/optional_fwd.hpp +14 -4
  661. data/src/cxx_supportlib/vendor-modified/boost/optional/optional_io.hpp +1 -1
  662. data/src/cxx_supportlib/vendor-modified/boost/random/binomial_distribution.hpp +1 -1
  663. data/src/cxx_supportlib/vendor-modified/boost/random/uniform_int_distribution.hpp +1 -1
  664. data/src/cxx_supportlib/vendor-modified/boost/rational.hpp +1 -1
  665. data/src/cxx_supportlib/vendor-modified/boost/static_assert.hpp +4 -6
  666. data/src/cxx_supportlib/vendor-modified/boost/system/api_config.hpp +1 -1
  667. data/src/cxx_supportlib/vendor-modified/boost/system/detail/config.hpp +16 -0
  668. data/src/cxx_supportlib/vendor-modified/boost/system/detail/error_category.hpp +13 -13
  669. data/src/cxx_supportlib/vendor-modified/boost/system/detail/error_category_impl.hpp +5 -5
  670. data/src/cxx_supportlib/vendor-modified/boost/thread/concurrent_queues/detail/sync_deque_base.hpp +3 -2
  671. data/src/cxx_supportlib/vendor-modified/boost/thread/concurrent_queues/detail/sync_queue_base.hpp +3 -2
  672. data/src/cxx_supportlib/vendor-modified/boost/thread/detail/thread.hpp +2 -1
  673. data/src/cxx_supportlib/vendor-modified/boost/thread/experimental/parallel/v2/task_region.hpp +1 -1
  674. data/src/cxx_supportlib/vendor-modified/boost/thread/future.hpp +30 -28
  675. data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/once.hpp +6 -3
  676. data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/once_atomic.hpp +5 -1
  677. data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/pthread_helpers.hpp +1 -0
  678. data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/shared_mutex.hpp +16 -16
  679. data/src/cxx_supportlib/vendor-modified/boost/thread/v2/shared_mutex.hpp +26 -26
  680. data/src/cxx_supportlib/vendor-modified/boost/unordered/concurrent_flat_map.hpp +196 -6
  681. data/src/cxx_supportlib/vendor-modified/boost/unordered/concurrent_flat_set.hpp +191 -6
  682. data/src/cxx_supportlib/vendor-modified/boost/unordered/concurrent_node_map.hpp +196 -5
  683. data/src/cxx_supportlib/vendor-modified/boost/unordered/concurrent_node_set.hpp +192 -5
  684. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/foa/concurrent_table.hpp +3 -3
  685. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/foa/core.hpp +2 -2
  686. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/foa/table.hpp +3 -3
  687. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/implementation.hpp +52 -16
  688. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/ranges_support.hpp +104 -0
  689. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/type_traits.hpp +1 -14
  690. data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/unordered_printers.hpp +10 -4
  691. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_map.hpp +121 -3
  692. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_set.hpp +118 -3
  693. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_map.hpp +338 -1
  694. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_node_map.hpp +121 -3
  695. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_node_set.hpp +118 -3
  696. data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_set.hpp +333 -1
  697. data/src/cxx_supportlib/vendor-modified/boost/version.hpp +2 -2
  698. data/src/cxx_supportlib/vendor-modified/jsoncpp/json-forwards.h +276 -143
  699. data/src/cxx_supportlib/vendor-modified/jsoncpp/json.h +1262 -771
  700. data/src/cxx_supportlib/vendor-modified/jsoncpp/jsoncpp.cpp +1704 -1586
  701. data/src/cxx_supportlib/vendor-modified/libev/Changes +109 -0
  702. data/src/cxx_supportlib/vendor-modified/libev/Makefile.am +2 -1
  703. data/src/cxx_supportlib/vendor-modified/libev/Makefile.in +47 -33
  704. data/src/cxx_supportlib/vendor-modified/libev/README +2 -1
  705. data/src/cxx_supportlib/vendor-modified/libev/aclocal.m4 +1653 -1224
  706. data/src/cxx_supportlib/vendor-modified/libev/config.guess +376 -316
  707. data/src/cxx_supportlib/vendor-modified/libev/config.h.in +13 -2
  708. data/src/cxx_supportlib/vendor-modified/libev/config.sub +156 -154
  709. data/src/cxx_supportlib/vendor-modified/libev/configure +1431 -940
  710. data/src/cxx_supportlib/vendor-modified/libev/configure.ac +3 -3
  711. data/src/cxx_supportlib/vendor-modified/libev/depcomp +5 -5
  712. data/src/cxx_supportlib/vendor-modified/libev/ev++.h +109 -107
  713. data/src/cxx_supportlib/vendor-modified/libev/ev.c +807 -319
  714. data/src/cxx_supportlib/vendor-modified/libev/ev.h +111 -105
  715. data/src/cxx_supportlib/vendor-modified/libev/ev_epoll.c +42 -29
  716. data/src/cxx_supportlib/vendor-modified/libev/ev_iouring.c +694 -0
  717. data/src/cxx_supportlib/vendor-modified/libev/ev_kqueue.c +15 -9
  718. data/src/cxx_supportlib/vendor-modified/libev/ev_linuxaio.c +620 -0
  719. data/src/cxx_supportlib/vendor-modified/libev/ev_poll.c +19 -14
  720. data/src/cxx_supportlib/vendor-modified/libev/ev_port.c +8 -5
  721. data/src/cxx_supportlib/vendor-modified/libev/ev_select.c +6 -6
  722. data/src/cxx_supportlib/vendor-modified/libev/ev_vars.h +48 -3
  723. data/src/cxx_supportlib/vendor-modified/libev/ev_win32.c +2 -2
  724. data/src/cxx_supportlib/vendor-modified/libev/ev_wrap.h +72 -0
  725. data/src/cxx_supportlib/vendor-modified/libev/install-sh +23 -13
  726. data/src/cxx_supportlib/vendor-modified/libev/libev.m4 +6 -1
  727. data/src/cxx_supportlib/vendor-modified/libev/ltmain.sh +3581 -1993
  728. data/src/cxx_supportlib/vendor-modified/libev/missing +8 -8
  729. data/src/cxx_supportlib/vendor-modified/libev/mkinstalldirs +3 -3
  730. data/src/cxx_supportlib/vendor-modified/modp_b64_strict_aliasing.cpp +1 -1
  731. data/src/helper-scripts/backtrace-sanitizer.rb +1 -1
  732. data/src/helper-scripts/crash-watch.rb +1 -1
  733. data/src/helper-scripts/download_binaries/extconf.rb +1 -1
  734. data/src/helper-scripts/meteor-loader.rb +1 -1
  735. data/src/helper-scripts/node-loader.js +1 -1
  736. data/src/helper-scripts/prespawn +1 -1
  737. data/src/helper-scripts/rack-loader.rb +1 -1
  738. data/src/helper-scripts/rack-preloader.rb +1 -1
  739. data/src/helper-scripts/wsgi-loader.py +1 -1
  740. data/src/nginx_module/ConfigGeneral/AutoGeneratedDefinitions.c +1 -1
  741. data/src/nginx_module/ConfigGeneral/AutoGeneratedDefinitions.c.cxxcodebuilder +1 -1
  742. data/src/nginx_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.c +1 -1
  743. data/src/nginx_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.c.cxxcodebuilder +1 -1
  744. data/src/nginx_module/ConfigGeneral/AutoGeneratedSetterFuncs.c +1 -1
  745. data/src/nginx_module/ConfigGeneral/AutoGeneratedSetterFuncs.c.cxxcodebuilder +1 -1
  746. data/src/nginx_module/Configuration.c +1 -1
  747. data/src/nginx_module/Configuration.h +1 -1
  748. data/src/nginx_module/ContentHandler.c +36 -1
  749. data/src/nginx_module/ContentHandler.h +1 -1
  750. data/src/nginx_module/LocationConfig/AutoGeneratedCreateFunction.c +1 -1
  751. data/src/nginx_module/LocationConfig/AutoGeneratedCreateFunction.c.cxxcodebuilder +1 -1
  752. data/src/nginx_module/LocationConfig/AutoGeneratedHeaderSerialization.c +1 -1
  753. data/src/nginx_module/LocationConfig/AutoGeneratedHeaderSerialization.c.cxxcodebuilder +1 -1
  754. data/src/nginx_module/LocationConfig/AutoGeneratedManifestGeneration.c +1 -1
  755. data/src/nginx_module/LocationConfig/AutoGeneratedManifestGeneration.c.cxxcodebuilder +1 -1
  756. data/src/nginx_module/LocationConfig/AutoGeneratedMergeFunction.c +1 -1
  757. data/src/nginx_module/LocationConfig/AutoGeneratedMergeFunction.c.cxxcodebuilder +1 -1
  758. data/src/nginx_module/LocationConfig/AutoGeneratedStruct.h +1 -1
  759. data/src/nginx_module/LocationConfig/AutoGeneratedStruct.h.cxxcodebuilder +1 -1
  760. data/src/nginx_module/MainConfig/AutoGeneratedCreateFunction.c +1 -1
  761. data/src/nginx_module/MainConfig/AutoGeneratedCreateFunction.c.cxxcodebuilder +1 -1
  762. data/src/nginx_module/MainConfig/AutoGeneratedManifestGeneration.c +1 -1
  763. data/src/nginx_module/MainConfig/AutoGeneratedManifestGeneration.c.cxxcodebuilder +1 -1
  764. data/src/nginx_module/MainConfig/AutoGeneratedStruct.h +1 -1
  765. data/src/nginx_module/MainConfig/AutoGeneratedStruct.h.cxxcodebuilder +1 -1
  766. data/src/nginx_module/StaticContentHandler.c +1 -1
  767. data/src/nginx_module/StaticContentHandler.h +1 -1
  768. data/src/nginx_module/ngx_http_passenger_module.c +1 -1
  769. data/src/nginx_module/ngx_http_passenger_module.h +1 -1
  770. data/src/nodejs_supportlib/phusion_passenger/line_reader.js +1 -1
  771. data/src/ruby_native_extension/extconf.rb +1 -1
  772. data/src/ruby_native_extension/passenger_native_support.c +1 -1
  773. data/src/ruby_supportlib/phusion_passenger/abstract_installer.rb +1 -1
  774. data/src/ruby_supportlib/phusion_passenger/admin_tools/instance.rb +1 -1
  775. data/src/ruby_supportlib/phusion_passenger/admin_tools/instance_registry.rb +1 -1
  776. data/src/ruby_supportlib/phusion_passenger/admin_tools/memory_stats.rb +2 -12
  777. data/src/ruby_supportlib/phusion_passenger/admin_tools.rb +1 -1
  778. data/src/ruby_supportlib/phusion_passenger/apache2/config_options.rb +1 -1
  779. data/src/ruby_supportlib/phusion_passenger/apache2/config_utils.rb +1 -1
  780. data/src/ruby_supportlib/phusion_passenger/common_library.rb +14 -16
  781. data/src/ruby_supportlib/phusion_passenger/config/about_command.rb +1 -1
  782. data/src/ruby_supportlib/phusion_passenger/config/agent_compiler.rb +1 -1
  783. data/src/ruby_supportlib/phusion_passenger/config/api_call_command.rb +1 -1
  784. data/src/ruby_supportlib/phusion_passenger/config/build_native_support_command.rb +1 -1
  785. data/src/ruby_supportlib/phusion_passenger/config/command.rb +1 -1
  786. data/src/ruby_supportlib/phusion_passenger/config/compile_agent_command.rb +1 -1
  787. data/src/ruby_supportlib/phusion_passenger/config/compile_nginx_engine_command.rb +1 -1
  788. data/src/ruby_supportlib/phusion_passenger/config/detach_process_command.rb +1 -1
  789. data/src/ruby_supportlib/phusion_passenger/config/download_agent_command.rb +1 -1
  790. data/src/ruby_supportlib/phusion_passenger/config/download_nginx_engine_command.rb +1 -1
  791. data/src/ruby_supportlib/phusion_passenger/config/install_agent_command.rb +1 -1
  792. data/src/ruby_supportlib/phusion_passenger/config/install_standalone_runtime_command.rb +1 -1
  793. data/src/ruby_supportlib/phusion_passenger/config/installation_utils.rb +1 -1
  794. data/src/ruby_supportlib/phusion_passenger/config/list_instances_command.rb +1 -1
  795. data/src/ruby_supportlib/phusion_passenger/config/main.rb +1 -1
  796. data/src/ruby_supportlib/phusion_passenger/config/nginx_engine_compiler.rb +3 -2
  797. data/src/ruby_supportlib/phusion_passenger/config/reopen_logs_command.rb +6 -1
  798. data/src/ruby_supportlib/phusion_passenger/config/restart_app_command.rb +1 -1
  799. data/src/ruby_supportlib/phusion_passenger/config/system_metrics_command.rb +1 -1
  800. data/src/ruby_supportlib/phusion_passenger/config/system_properties_command.rb +1 -1
  801. data/src/ruby_supportlib/phusion_passenger/config/utils.rb +1 -1
  802. data/src/ruby_supportlib/phusion_passenger/config/validate_install_command.rb +1 -1
  803. data/src/ruby_supportlib/phusion_passenger/console_text_template.rb +1 -1
  804. data/src/ruby_supportlib/phusion_passenger/constants.rb +1 -1
  805. data/src/ruby_supportlib/phusion_passenger/debug_logging.rb +1 -1
  806. data/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb +1 -1
  807. data/src/ruby_supportlib/phusion_passenger/message_channel.rb +1 -1
  808. data/src/ruby_supportlib/phusion_passenger/message_client.rb +1 -1
  809. data/src/ruby_supportlib/phusion_passenger/native_support.rb +1 -1
  810. data/src/ruby_supportlib/phusion_passenger/nginx/config_options.rb +1 -1
  811. data/src/ruby_supportlib/phusion_passenger/packaging.rb +4 -3
  812. data/src/ruby_supportlib/phusion_passenger/platform_info/apache.rb +1 -1
  813. data/src/ruby_supportlib/phusion_passenger/platform_info/apache_detector.rb +1 -1
  814. data/src/ruby_supportlib/phusion_passenger/platform_info/binary_compatibility.rb +1 -1
  815. data/src/ruby_supportlib/phusion_passenger/platform_info/compiler.rb +195 -11
  816. data/src/ruby_supportlib/phusion_passenger/platform_info/crypto.rb +1 -1
  817. data/src/ruby_supportlib/phusion_passenger/platform_info/curl.rb +1 -1
  818. data/src/ruby_supportlib/phusion_passenger/platform_info/cxx_portability.rb +1 -1
  819. data/src/ruby_supportlib/phusion_passenger/platform_info/linux.rb +1 -1
  820. data/src/ruby_supportlib/phusion_passenger/platform_info/networking.rb +1 -1
  821. data/src/ruby_supportlib/phusion_passenger/platform_info/openssl.rb +1 -1
  822. data/src/ruby_supportlib/phusion_passenger/platform_info/operating_system.rb +1 -1
  823. data/src/ruby_supportlib/phusion_passenger/platform_info/pcre.rb +1 -1
  824. data/src/ruby_supportlib/phusion_passenger/platform_info/ruby.rb +1 -1
  825. data/src/ruby_supportlib/phusion_passenger/platform_info/zlib.rb +1 -1
  826. data/src/ruby_supportlib/phusion_passenger/platform_info.rb +1 -1
  827. data/src/ruby_supportlib/phusion_passenger/plugin.rb +1 -1
  828. data/src/ruby_supportlib/phusion_passenger/preloader_shared_helpers.rb +1 -1
  829. data/src/ruby_supportlib/phusion_passenger/public_api.rb +1 -1
  830. data/src/ruby_supportlib/phusion_passenger/rack/handler.rb +1 -1
  831. data/src/ruby_supportlib/phusion_passenger/rack/out_of_band_gc.rb +1 -1
  832. data/src/ruby_supportlib/phusion_passenger/rack/thread_handler_extension.rb +1 -1
  833. data/src/ruby_supportlib/phusion_passenger/rack_handler.rb +1 -1
  834. data/src/ruby_supportlib/phusion_passenger/request_handler/thread_handler.rb +2 -7
  835. data/src/ruby_supportlib/phusion_passenger/request_handler.rb +1 -1
  836. data/src/ruby_supportlib/phusion_passenger/ruby_core_enhancements.rb +1 -1
  837. data/src/ruby_supportlib/phusion_passenger/ruby_core_io_enhancements.rb +1 -1
  838. data/src/ruby_supportlib/phusion_passenger/simple_benchmarking.rb +1 -1
  839. data/src/ruby_supportlib/phusion_passenger/standalone/app_finder.rb +1 -1
  840. data/src/ruby_supportlib/phusion_passenger/standalone/command.rb +1 -1
  841. data/src/ruby_supportlib/phusion_passenger/standalone/config_options_list.rb +1 -1
  842. data/src/ruby_supportlib/phusion_passenger/standalone/config_utils.rb +1 -1
  843. data/src/ruby_supportlib/phusion_passenger/standalone/control_utils.rb +1 -1
  844. data/src/ruby_supportlib/phusion_passenger/standalone/main.rb +1 -1
  845. data/src/ruby_supportlib/phusion_passenger/standalone/start_command/builtin_engine.rb +2 -2
  846. data/src/ruby_supportlib/phusion_passenger/standalone/start_command/nginx_engine.rb +4 -8
  847. data/src/ruby_supportlib/phusion_passenger/standalone/start_command.rb +1 -1
  848. data/src/ruby_supportlib/phusion_passenger/standalone/status_command.rb +1 -1
  849. data/src/ruby_supportlib/phusion_passenger/standalone/stop_command.rb +1 -1
  850. data/src/ruby_supportlib/phusion_passenger/standalone/version_command.rb +1 -1
  851. data/src/ruby_supportlib/phusion_passenger/utils/ansi_colors.rb +1 -1
  852. data/src/ruby_supportlib/phusion_passenger/utils/download.rb +1 -1
  853. data/src/ruby_supportlib/phusion_passenger/utils/file_system_watcher.rb +1 -1
  854. data/src/ruby_supportlib/phusion_passenger/utils/hosts_file_parser.rb +1 -1
  855. data/src/ruby_supportlib/phusion_passenger/utils/json.rb +25 -2
  856. data/src/ruby_supportlib/phusion_passenger/utils/lock.rb +1 -1
  857. data/src/ruby_supportlib/phusion_passenger/utils/native_support_utils.rb +1 -1
  858. data/src/ruby_supportlib/phusion_passenger/utils/progress_bar.rb +1 -1
  859. data/src/ruby_supportlib/phusion_passenger/utils/strscan.rb +1 -1
  860. data/src/ruby_supportlib/phusion_passenger/utils/terminal_choice_menu.rb +1 -1
  861. data/src/ruby_supportlib/phusion_passenger/utils/unseekable_socket.rb +3 -13
  862. data/src/ruby_supportlib/phusion_passenger/utils.rb +1 -1
  863. data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/app.rb +1 -1
  864. data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/base.rb +1 -1
  865. data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/gdb_controller.rb +1 -1
  866. data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/lldb_controller.rb +1 -1
  867. data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/utils.rb +1 -1
  868. data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/version.rb +1 -1
  869. data/src/ruby_supportlib/phusion_passenger/vendor/daemon_controller/lock_file.rb +8 -6
  870. data/src/ruby_supportlib/phusion_passenger/vendor/daemon_controller/spawn.rb +4 -3
  871. data/src/ruby_supportlib/phusion_passenger/vendor/daemon_controller/version.rb +6 -4
  872. data/src/ruby_supportlib/phusion_passenger/vendor/daemon_controller.rb +406 -579
  873. data/src/ruby_supportlib/phusion_passenger.rb +8 -8
  874. data/src/schema_printer/SchemaPrinterMain.cpp +1 -1
  875. data/src/schema_printer/SchemaPrinterMain.cpp.cxxcodebuilder +1 -1
  876. metadata +140 -38
  877. data/doc/DeveloperQuickstart.md +0 -70
  878. data/src/README.md +0 -7
  879. data/src/cxx_supportlib/vendor-copy/libuv/README.md +0 -245
  880. data/src/cxx_supportlib/vendor-copy/libuv/checksparse.sh +0 -234
  881. data/src/cxx_supportlib/vendor-copy/libuv/common.gypi +0 -210
  882. data/src/cxx_supportlib/vendor-copy/libuv/gyp_uv.py +0 -93
  883. data/src/cxx_supportlib/vendor-copy/libuv/include/android-ifaddrs.h +0 -54
  884. data/src/cxx_supportlib/vendor-copy/libuv/include/pthread-fixes.h +0 -72
  885. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/android-ifaddrs.c +0 -703
  886. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/atomic-ops.h +0 -77
  887. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/linux-core.c +0 -899
  888. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/linux-inotify.c +0 -285
  889. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/linux-syscalls.c +0 -471
  890. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/linux-syscalls.h +0 -158
  891. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/pthread-fixes.c +0 -104
  892. data/src/cxx_supportlib/vendor-copy/libuv/src/unix/spinlock.h +0 -53
  893. data/src/cxx_supportlib/vendor-copy/libuv/uv.gyp +0 -508
  894. data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_utility.hpp +0 -41
  895. /data/src/cxx_supportlib/vendor-copy/libuv/include/{uv-aix.h → uv/aix.h} +0 -0
  896. /data/src/cxx_supportlib/vendor-copy/libuv/include/{uv-bsd.h → uv/bsd.h} +0 -0
  897. /data/src/cxx_supportlib/vendor-copy/libuv/include/{uv-sunos.h → uv/sunos.h} +0 -0
  898. /data/src/cxx_supportlib/{ServerKit/llhttp_http.c → vendor-copy/llhttp/http.c} +0 -0
@@ -1,4 +1,4 @@
1
- /// Json-cpp amalgated header (http://jsoncpp.sourceforge.net/).
1
+ /// Json-cpp amalgamated header (https://github.com/open-source-parsers/jsoncpp/).
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
- The JsonCpp Authors explicitly disclaim copyright in all
13
+ Baptiste Lepilleur and 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 The JsonCpp Authors, and is
19
- released under the terms of the MIT License (see below).
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).
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 The JsonCpp Authors
34
+ Copyright (c) 2007-2010 Baptiste Lepilleur and 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_AMALGATED_H_INCLUDED
76
- # define JSON_AMALGATED_H_INCLUDED
77
- /// If defined, indicates that the source file is amalgated
75
+ #ifndef JSON_AMALGAMATED_H_INCLUDED
76
+ # define JSON_AMALGAMATED_H_INCLUDED
77
+ /// If defined, indicates that the source file is amalgamated
78
78
  /// to prevent private header inclusion.
79
79
  #define JSON_IS_AMALGAMATION
80
80
 
@@ -82,22 +82,29 @@ 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.
87
85
  #ifndef JSON_VERSION_H_INCLUDED
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))
96
-
97
- #ifdef JSONCPP_USING_SECURE_MEMORY
98
- #undef JSONCPP_USING_SECURE_MEMORY
86
+ #define JSON_VERSION_H_INCLUDED
87
+
88
+ // Note: version must be updated in four 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
+ // 4. /MODULE.bazel
95
+ // IMPORTANT: also update the SOVERSION!!
96
+
97
+ #define JSONCPP_VERSION_STRING "1.9.8"
98
+ #define JSONCPP_VERSION_MAJOR 1
99
+ #define JSONCPP_VERSION_MINOR 9
100
+ #define JSONCPP_VERSION_PATCH 8
101
+ #define JSONCPP_VERSION_HEXA \
102
+ ((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | \
103
+ (JSONCPP_VERSION_PATCH << 8))
104
+
105
+ #if !defined(JSONCPP_USE_SECURE_MEMORY)
106
+ #define JSONCPP_USE_SECURE_MEMORY 0
99
107
  #endif
100
- #define JSONCPP_USING_SECURE_MEMORY 0
101
108
  // If non-zero, the library zeroes any memory that it has allocated before
102
109
  // it frees its memory.
103
110
 
@@ -112,30 +119,141 @@ license you like.
112
119
 
113
120
 
114
121
 
122
+ // //////////////////////////////////////////////////////////////////////
123
+ // Beginning of content of file: include/json/allocator.h
124
+ // //////////////////////////////////////////////////////////////////////
125
+
126
+ // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
127
+ // Distributed under MIT license, or public domain if desired and
128
+ // recognized in your jurisdiction.
129
+ // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
130
+
131
+ #ifndef JSON_ALLOCATOR_H_INCLUDED
132
+ #define JSON_ALLOCATOR_H_INCLUDED
133
+
134
+ #include <algorithm>
135
+ #include <cstring>
136
+ #include <memory>
137
+
138
+ #pragma pack(push)
139
+ #pragma pack()
140
+
141
+ namespace Passenger {
142
+ namespace Json {
143
+ template <typename T> class SecureAllocator {
144
+ public:
145
+ // Type definitions
146
+ using value_type = T;
147
+ using pointer = T*;
148
+ using const_pointer = const T*;
149
+ using reference = T&;
150
+ using const_reference = const T&;
151
+ using size_type = std::size_t;
152
+ using difference_type = std::ptrdiff_t;
153
+
154
+ /**
155
+ * Allocate memory for N items using the standard allocator.
156
+ */
157
+ pointer allocate(size_type n) {
158
+ // allocate using "global operator new"
159
+ return static_cast<pointer>(::operator new(n * sizeof(T)));
160
+ }
161
+
162
+ /**
163
+ * Release memory which was allocated for N items at pointer P.
164
+ *
165
+ * The memory block is filled with zeroes before being released.
166
+ */
167
+ void deallocate(pointer p, size_type n) {
168
+ // These constructs will not be removed by the compiler during optimization,
169
+ // unlike memset.
170
+ #if defined(HAVE_MEMSET_S)
171
+ memset_s(p, n * sizeof(T), 0, n * sizeof(T));
172
+ #elif defined(_WIN32)
173
+ RtlSecureZeroMemory(p, n * sizeof(T));
174
+ #else
175
+ std::fill_n(reinterpret_cast<volatile unsigned char*>(p), n, 0);
176
+ #endif
177
+
178
+ // free using "global operator delete"
179
+ ::operator delete(p);
180
+ }
181
+
182
+ /**
183
+ * Construct an item in-place at pointer P.
184
+ */
185
+ template <typename... Args> void construct(pointer p, Args&&... args) {
186
+ // construct using "placement new" and "perfect forwarding"
187
+ ::new (static_cast<void*>(p)) T(std::forward<Args>(args)...);
188
+ }
189
+
190
+ size_type max_size() const { return size_t(-1) / sizeof(T); }
191
+
192
+ pointer address(reference x) const { return std::addressof(x); }
193
+
194
+ const_pointer address(const_reference x) const { return std::addressof(x); }
195
+
196
+ /**
197
+ * Destroy an item in-place at pointer P.
198
+ */
199
+ void destroy(pointer p) {
200
+ // destroy using "explicit destructor"
201
+ p->~T();
202
+ }
203
+
204
+ // Boilerplate
205
+ SecureAllocator() {}
206
+ template <typename U> SecureAllocator(const SecureAllocator<U>&) {}
207
+ template <typename U> struct rebind {
208
+ using other = SecureAllocator<U>;
209
+ };
210
+ };
211
+
212
+ template <typename T, typename U>
213
+ bool operator==(const SecureAllocator<T>&, const SecureAllocator<U>&) {
214
+ return true;
215
+ }
216
+
217
+ template <typename T, typename U>
218
+ bool operator!=(const SecureAllocator<T>&, const SecureAllocator<U>&) {
219
+ return false;
220
+ }
221
+
222
+ } // namespace Json
223
+ } // namespace Passenger
224
+
225
+ #pragma pack(pop)
226
+
227
+ #endif // JSON_ALLOCATOR_H_INCLUDED
228
+
229
+ // //////////////////////////////////////////////////////////////////////
230
+ // End of content of file: include/json/allocator.h
231
+ // //////////////////////////////////////////////////////////////////////
232
+
233
+
234
+
235
+
236
+
237
+
115
238
  // //////////////////////////////////////////////////////////////////////
116
239
  // Beginning of content of file: include/json/config.h
117
240
  // //////////////////////////////////////////////////////////////////////
118
241
 
119
- // Copyright 2007-2010 Baptiste Lepilleur
242
+ // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
120
243
  // Distributed under MIT license, or public domain if desired and
121
244
  // recognized in your jurisdiction.
122
245
  // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
123
246
 
124
247
  #ifndef JSON_CONFIG_H_INCLUDED
125
248
  #define JSON_CONFIG_H_INCLUDED
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
249
+ #include <cstddef>
250
+ #include <cstdint>
251
+ #include <istream>
252
+ #include <memory>
253
+ #include <ostream>
254
+ #include <sstream>
255
+ #include <string>
256
+ #include <type_traits>
139
257
 
140
258
  // If non-zero, the library uses exceptions to report bad input instead of C
141
259
  // assertion macros. The default is to use exceptions.
@@ -143,163 +261,137 @@ license you like.
143
261
  #define JSON_USE_EXCEPTION 1
144
262
  #endif
145
263
 
146
- /// If defined, indicates that the source file is amalgated
264
+ // Temporary, tracked for removal with issue #982.
265
+ #ifndef JSON_USE_NULLREF
266
+ #define JSON_USE_NULLREF 1
267
+ #endif
268
+
269
+ /// If defined, indicates that the source file is amalgamated
147
270
  /// to prevent private header inclusion.
148
- /// Remarks: it is automatically defined in the generated amalgated header.
271
+ /// Remarks: it is automatically defined in the generated amalgamated header.
149
272
  // #define JSON_IS_AMALGAMATION
150
273
 
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)
274
+ // Export macros for DLL visibility
275
+ #if defined(JSON_DLL_BUILD)
161
276
  #if defined(_MSC_VER) || defined(__MINGW32__)
162
277
  #define JSON_API __declspec(dllexport)
163
278
  #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
279
+ #elif defined(__GNUC__) || defined(__clang__)
280
+ #define JSON_API __attribute__((visibility("default")))
164
281
  #endif // if defined(_MSC_VER)
282
+
165
283
  #elif defined(JSON_DLL)
166
284
  #if defined(_MSC_VER) || defined(__MINGW32__)
167
285
  #define JSON_API __declspec(dllimport)
168
286
  #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
169
287
  #endif // if defined(_MSC_VER)
170
- #endif // ifdef JSON_IN_CPPTL
288
+ #endif // ifdef JSON_DLL_BUILD
289
+
171
290
  #if !defined(JSON_API)
172
291
  #define JSON_API
173
292
  #endif
174
293
 
175
- // If JSON_NO_INT64 is defined, then Json only support C++ "int" type for
176
- // integer
177
- // Storages, and 64 bits integer support is disabled.
178
- // #define JSON_NO_INT64 1
294
+ #if defined(_MSC_VER) && _MSC_VER < 1800
295
+ #error \
296
+ "ERROR: Visual Studio 12 (2013) with _MSC_VER=1800 is the oldest supported compiler with sufficient C++11 capabilities"
297
+ #endif
179
298
 
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
299
+ #if defined(_MSC_VER) && _MSC_VER < 1900
300
+ // As recommended at
301
+ // https://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-2010
302
+ extern JSON_API int msvc_pre1900_c99_snprintf(char* outBuf, size_t size,
303
+ const char* format, ...);
304
+ #define jsoncpp_snprintf msvc_pre1900_c99_snprintf
211
305
  #else
212
- # define JSONCPP_OVERRIDE
213
- # define JSONCPP_NOEXCEPT throw()
306
+ #define jsoncpp_snprintf std::snprintf
214
307
  #endif
215
308
 
216
- #ifndef JSON_HAS_RVALUE_REFERENCES
309
+ // If JSON_NO_INT64 is defined, then Json only support C++ "int" type for
310
+ // integer
311
+ // Storages, and 64 bits integer support is disabled.
312
+ // #define JSON_NO_INT64 1
217
313
 
218
- #if defined(_MSC_VER) && _MSC_VER >= 1600 // MSVC >= 2010
219
- #define JSON_HAS_RVALUE_REFERENCES 1
220
- #endif // MSVC >= 2010
314
+ // JSONCPP_OVERRIDE is maintained for backwards compatibility of external tools.
315
+ // C++11 should be used directly in JSONCPP.
316
+ #define JSONCPP_OVERRIDE override
221
317
 
222
318
  #ifdef __clang__
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
319
+ #if __has_extension(attribute_deprecated_with_message)
320
+ #define JSONCPP_DEPRECATED(message) __attribute__((deprecated(message)))
238
321
  #endif
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__
322
+ #elif defined(__GNUC__) // not clang (gcc comes later since clang emulates gcc)
323
+ #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
324
+ #define JSONCPP_DEPRECATED(message) __attribute__((deprecated(message)))
325
+ #elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
326
+ #define JSONCPP_DEPRECATED(message) __attribute__((__deprecated__))
327
+ #endif // GNUC version
328
+ #elif defined(_MSC_VER) // MSVC (after clang because clang on Windows emulates
329
+ // MSVC)
330
+ #define JSONCPP_DEPRECATED(message) __declspec(deprecated(message))
331
+ #endif // __clang__ || __GNUC__ || _MSC_VER
248
332
 
249
333
  #if !defined(JSONCPP_DEPRECATED)
250
334
  #define JSONCPP_DEPRECATED(message)
251
335
  #endif // if !defined(JSONCPP_DEPRECATED)
252
336
 
253
- #if __GNUC__ >= 6
254
- # define JSON_USE_INT64_DOUBLE_CONVERSION 1
337
+ #if defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 6))
338
+ #define JSON_USE_INT64_DOUBLE_CONVERSION 1
255
339
  #endif
256
340
 
257
341
  #if !defined(JSON_IS_AMALGAMATION)
258
342
 
259
- # include "version.h"
260
-
261
- # if JSONCPP_USING_SECURE_MEMORY
262
- # include "allocator.h" //typedef Allocator
263
- # endif
343
+ #include "allocator.h"
344
+ #include "version.h"
264
345
 
265
346
  #endif // if !defined(JSON_IS_AMALGAMATION)
266
347
 
267
348
  namespace Passenger {
268
349
  namespace Json {
269
- typedef int Int;
270
- typedef unsigned int UInt;
350
+ JSON_API const char* version();
351
+ using Int = int;
352
+ using UInt = unsigned int;
271
353
  #if defined(JSON_NO_INT64)
272
- typedef int LargestInt;
273
- typedef unsigned int LargestUInt;
354
+ using LargestInt = int;
355
+ using LargestUInt = unsigned int;
274
356
  #undef JSON_HAS_INT64
275
357
  #else // if defined(JSON_NO_INT64)
276
358
  // For Microsoft Visual use specific types as long long is not supported
277
359
  #if defined(_MSC_VER) // Microsoft Visual Studio
278
- typedef __int64 Int64;
279
- typedef unsigned __int64 UInt64;
360
+ using Int64 = __int64;
361
+ using UInt64 = unsigned __int64;
280
362
  #else // if defined(_MSC_VER) // Other platforms, use long long
281
- typedef int64_t Int64;
282
- typedef uint64_t UInt64;
283
- #endif // if defined(_MSC_VER)
284
- typedef Int64 LargestInt;
285
- typedef UInt64 LargestUInt;
363
+ using Int64 = int64_t;
364
+ using UInt64 = uint64_t;
365
+ #endif // if defined(_MSC_VER)
366
+ using LargestInt = Int64;
367
+ using LargestUInt = UInt64;
368
+ #ifndef JSON_HAS_INT64
286
369
  #define JSON_HAS_INT64
370
+ #endif // ifndef JSON_HAS_INT64
287
371
  #endif // if defined(JSON_NO_INT64)
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
372
+
373
+ template <typename T>
374
+ using Allocator =
375
+ typename std::conditional<JSONCPP_USE_SECURE_MEMORY, SecureAllocator<T>,
376
+ std::allocator<T>>::type;
377
+ using String = std::basic_string<char, std::char_traits<char>, Allocator<char>>;
378
+ using IStringStream =
379
+ std::basic_istringstream<String::value_type, String::traits_type,
380
+ String::allocator_type>;
381
+ using OStringStream =
382
+ std::basic_ostringstream<String::value_type, String::traits_type,
383
+ String::allocator_type>;
384
+ using IStream = std::istream;
385
+ using OStream = std::ostream;
386
+ } // namespace Json
387
+ } // namespace Passenger
388
+
389
+ // Legacy names (formerly macros).
390
+ using JSONCPP_STRING = Passenger::Json::String;
391
+ using JSONCPP_ISTRINGSTREAM = Passenger::Json::IStringStream;
392
+ using JSONCPP_OSTRINGSTREAM = Passenger::Json::OStringStream;
393
+ using JSONCPP_ISTREAM = Passenger::Json::IStream;
394
+ using JSONCPP_OSTREAM = Passenger::Json::OStream;
303
395
 
304
396
  #endif // JSON_CONFIG_H_INCLUDED
305
397
 
@@ -316,7 +408,7 @@ typedef UInt64 LargestUInt;
316
408
  // Beginning of content of file: include/json/forwards.h
317
409
  // //////////////////////////////////////////////////////////////////////
318
410
 
319
- // Copyright 2007-2010 Baptiste Lepilleur
411
+ // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
320
412
  // Distributed under MIT license, or public domain if desired and
321
413
  // recognized in your jurisdiction.
322
414
  // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
@@ -332,17 +424,23 @@ namespace Passenger {
332
424
  namespace Json {
333
425
 
334
426
  // writer.h
427
+ class StreamWriter;
428
+ class StreamWriterBuilder;
429
+ class Writer;
335
430
  class FastWriter;
336
431
  class StyledWriter;
432
+ class StyledStreamWriter;
337
433
 
338
434
  // reader.h
339
435
  class Reader;
436
+ class CharReader;
437
+ class CharReaderBuilder;
340
438
 
341
- // features.h
439
+ // json_features.h
342
440
  class Features;
343
441
 
344
442
  // value.h
345
- typedef unsigned int ArrayIndex;
443
+ using ArrayIndex = unsigned int;
346
444
  class StaticString;
347
445
  class Path;
348
446
  class PathArgument;
@@ -350,6 +448,8 @@ class Value;
350
448
  class ValueIteratorBase;
351
449
  class ValueIterator;
352
450
  class ValueConstIterator;
451
+ class ValueMembersView;
452
+ class ValueConstMembersView;
353
453
 
354
454
  } // namespace Json
355
455
  } // namespace Passenger
@@ -366,22 +466,23 @@ class ValueConstIterator;
366
466
 
367
467
 
368
468
  // //////////////////////////////////////////////////////////////////////
369
- // Beginning of content of file: include/json/features.h
469
+ // Beginning of content of file: include/json/json_features.h
370
470
  // //////////////////////////////////////////////////////////////////////
371
471
 
372
- // Copyright 2007-2010 Baptiste Lepilleur
472
+ // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
373
473
  // Distributed under MIT license, or public domain if desired and
374
474
  // recognized in your jurisdiction.
375
475
  // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
376
476
 
377
- #ifndef CPPTL_JSON_FEATURES_H_INCLUDED
378
- #define CPPTL_JSON_FEATURES_H_INCLUDED
477
+ #ifndef JSON_FEATURES_H_INCLUDED
478
+ #define JSON_FEATURES_H_INCLUDED
379
479
 
380
480
  #if !defined(JSON_IS_AMALGAMATION)
381
481
  #include "forwards.h"
382
482
  #endif // if !defined(JSON_IS_AMALGAMATION)
383
483
 
384
- #pragma pack(push, 8)
484
+ #pragma pack(push)
485
+ #pragma pack()
385
486
 
386
487
  namespace Passenger {
387
488
  namespace Json {
@@ -413,17 +514,17 @@ public:
413
514
  Features();
414
515
 
415
516
  /// \c true if comments are allowed. Default: \c true.
416
- bool allowComments_;
517
+ bool allowComments_{true};
417
518
 
418
519
  /// \c true if root must be either an array or an object value. Default: \c
419
520
  /// false.
420
- bool strictRoot_;
521
+ bool strictRoot_{false};
421
522
 
422
523
  /// \c true if dropped null placeholders are allowed. Default: \c false.
423
- bool allowDroppedNullPlaceholders_;
524
+ bool allowDroppedNullPlaceholders_{false};
424
525
 
425
526
  /// \c true if numeric object key are allowed. Default: \c false.
426
- bool allowNumericKeys_;
527
+ bool allowNumericKeys_{false};
427
528
  };
428
529
 
429
530
  } // namespace Json
@@ -431,10 +532,10 @@ public:
431
532
 
432
533
  #pragma pack(pop)
433
534
 
434
- #endif // CPPTL_JSON_FEATURES_H_INCLUDED
535
+ #endif // JSON_FEATURES_H_INCLUDED
435
536
 
436
537
  // //////////////////////////////////////////////////////////////////////
437
- // End of content of file: include/json/features.h
538
+ // End of content of file: include/json/json_features.h
438
539
  // //////////////////////////////////////////////////////////////////////
439
540
 
440
541
 
@@ -446,68 +547,95 @@ public:
446
547
  // Beginning of content of file: include/json/value.h
447
548
  // //////////////////////////////////////////////////////////////////////
448
549
 
449
- // Copyright 2007-2010 Baptiste Lepilleur
550
+ // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
450
551
  // Distributed under MIT license, or public domain if desired and
451
552
  // recognized in your jurisdiction.
452
553
  // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
453
554
 
454
- #ifndef CPPTL_JSON_H_INCLUDED
455
- #define CPPTL_JSON_H_INCLUDED
555
+ #ifndef JSON_VALUE_H_INCLUDED
556
+ #define JSON_VALUE_H_INCLUDED
456
557
 
457
558
  #if !defined(JSON_IS_AMALGAMATION)
458
559
  #include "forwards.h"
459
560
  #endif // if !defined(JSON_IS_AMALGAMATION)
460
- #include <string>
461
- #include <vector>
462
- #include <exception>
463
561
 
464
- #ifndef JSON_USE_CPPTL_SMALLMAP
465
- #include <map>
562
+ // Conditional NORETURN attribute on the throw functions would:
563
+ // a) suppress false positives from static code analysis
564
+ // b) possibly improve optimization opportunities.
565
+ #if !defined(JSONCPP_NORETURN)
566
+ #if defined(_MSC_VER) && _MSC_VER == 1800
567
+ #define JSONCPP_NORETURN __declspec(noreturn)
466
568
  #else
467
- #include <cpptl/smallmap.h>
569
+ #define JSONCPP_NORETURN [[noreturn]]
468
570
  #endif
469
- #ifdef JSON_USE_CPPTL
470
- #include <cpptl/forwards.h>
471
571
  #endif
472
572
 
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
573
+ // Support for '= delete' with template declarations was a late addition
574
+ // to the c++11 standard and is rejected by clang 3.8 and Apple clang 8.2
575
+ // even though these declare themselves to be c++11 compilers.
576
+ #if !defined(JSONCPP_TEMPLATE_DELETE)
577
+ #if defined(__clang__) && defined(__apple_build_version__)
578
+ #if __apple_build_version__ <= 8000042
579
+ #define JSONCPP_TEMPLATE_DELETE
580
+ #endif
581
+ #elif defined(__clang__)
582
+ #if __clang_major__ == 3 && __clang_minor__ <= 8
583
+ #define JSONCPP_TEMPLATE_DELETE
584
+ #endif
585
+ #endif
586
+ #if !defined(JSONCPP_TEMPLATE_DELETE)
587
+ #define JSONCPP_TEMPLATE_DELETE = delete
588
+ #endif
589
+ #endif
590
+
591
+ #ifndef JSONCPP_HAS_STRING_VIEW
592
+ #if __cplusplus >= 201703L
593
+ #define JSONCPP_HAS_STRING_VIEW 1
594
+ #endif
595
+ #endif
596
+
597
+ #include <array>
598
+ #include <exception>
599
+ #include <map>
600
+ #include <memory>
601
+ #include <string>
602
+ #include <vector>
603
+
604
+ // Forward declaration for testing.
605
+ struct ValueTest;
606
+
607
+ #ifdef JSONCPP_HAS_STRING_VIEW
608
+ #include <string_view>
484
609
  #endif
485
610
 
486
611
  // Disable warning C4251: <data member>: <type> needs to have dll-interface to
487
612
  // be used by...
488
613
  #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
489
614
  #pragma warning(push)
490
- #pragma warning(disable : 4251)
615
+ #pragma warning(disable : 4251 4275)
491
616
  #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
492
617
 
493
- #pragma pack(push, 8)
618
+ #pragma pack(push)
619
+ #pragma pack()
494
620
 
495
621
  /** \brief JSON (JavaScript Object Notation).
496
622
  */
497
623
  namespace Passenger {
498
624
  namespace Json {
499
625
 
626
+ #if JSON_USE_EXCEPTION
500
627
  /** Base class for all exceptions we throw.
501
628
  *
502
629
  * We use nothing but these internally. Of course, STL can throw others.
503
630
  */
504
631
  class JSON_API Exception : public std::exception {
505
632
  public:
506
- Exception(JSONCPP_STRING const& msg);
507
- ~Exception() JSONCPP_NOEXCEPT JSONCPP_OVERRIDE;
508
- char const* what() const JSONCPP_NOEXCEPT JSONCPP_OVERRIDE;
633
+ Exception(String msg);
634
+ ~Exception() noexcept override;
635
+ char const* what() const noexcept override;
636
+
509
637
  protected:
510
- JSONCPP_STRING msg_;
638
+ String msg_;
511
639
  };
512
640
 
513
641
  /** Exceptions which the user cannot easily avoid.
@@ -518,7 +646,7 @@ protected:
518
646
  */
519
647
  class JSON_API RuntimeError : public Exception {
520
648
  public:
521
- RuntimeError(JSONCPP_STRING const& msg);
649
+ RuntimeError(String const& msg);
522
650
  };
523
651
 
524
652
  /** Exceptions thrown by JSON_ASSERT/JSON_FAIL macros.
@@ -529,13 +657,14 @@ public:
529
657
  */
530
658
  class JSON_API LogicError : public Exception {
531
659
  public:
532
- LogicError(JSONCPP_STRING const& msg);
660
+ LogicError(String const& msg);
533
661
  };
662
+ #endif
534
663
 
535
664
  /// used internally
536
- JSONCPP_NORETURN void throwRuntimeError(JSONCPP_STRING const& msg);
665
+ JSONCPP_NORETURN void throwRuntimeError(String const& msg);
537
666
  /// used internally
538
- JSONCPP_NORETURN void throwLogicError(JSONCPP_STRING const& msg);
667
+ JSONCPP_NORETURN void throwLogicError(String const& msg);
539
668
 
540
669
  /** \brief Type of the value held by a Value object.
541
670
  */
@@ -558,14 +687,16 @@ enum CommentPlacement {
558
687
  numberOfCommentPlacement
559
688
  };
560
689
 
561
- //# ifdef JSON_USE_CPPTL
562
- // typedef CppTL::AnyEnumerator<const char *> EnumMemberNames;
563
- // typedef CppTL::AnyEnumerator<const Value &> EnumValues;
564
- //# endif
690
+ /** \brief Type of precision for formatting of real values.
691
+ */
692
+ enum PrecisionType {
693
+ significantDigits = 0, ///< we set max number of significant digits in string
694
+ decimalPlaces ///< we set max number of digits after "." in string
695
+ };
565
696
 
566
697
  /** \brief Lightweight wrapper to tag static string.
567
698
  *
568
- * Value constructor and objectValue member assignement takes advantage of the
699
+ * Value constructor and objectValue member assignment takes advantage of the
569
700
  * StaticString and avoid the cost of string duplication when storing the
570
701
  * string or the member name.
571
702
  *
@@ -614,7 +745,7 @@ private:
614
745
  * The get() methods can be used to obtain default value in the case the
615
746
  * required element does not exist.
616
747
  *
617
- * It is possible to iterate over the list of a #objectValue values using
748
+ * It is possible to iterate over the list of member keys of an object using
618
749
  * the getMemberNames() method.
619
750
  *
620
751
  * \note #Value string-length fit in size_t, but keys must be < 2^30.
@@ -625,68 +756,87 @@ private:
625
756
  */
626
757
  class JSON_API Value {
627
758
  friend class ValueIteratorBase;
759
+ friend struct ::ValueTest;
760
+
628
761
  public:
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;
762
+ using Members = std::vector<String>;
763
+ using iterator = ValueIterator;
764
+ using const_iterator = ValueConstIterator;
765
+ using UInt = Json::UInt;
766
+ using Int = Json::Int;
634
767
  #if defined(JSON_HAS_INT64)
635
- typedef Json::UInt64 UInt64;
636
- typedef Json::Int64 Int64;
768
+ using UInt64 = Json::UInt64;
769
+ using Int64 = Json::Int64;
637
770
  #endif // defined(JSON_HAS_INT64)
638
- typedef Json::LargestInt LargestInt;
639
- typedef Json::LargestUInt LargestUInt;
640
- typedef Json::ArrayIndex ArrayIndex;
771
+ using LargestInt = Json::LargestInt;
772
+ using LargestUInt = Json::LargestUInt;
773
+ using ArrayIndex = Json::ArrayIndex;
774
+
775
+ // Required for boost integration, e. g. BOOST_TEST
776
+ using value_type = std::string;
641
777
 
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.
778
+ #if JSON_USE_NULLREF
779
+ // Binary compatibility kludges, do not use.
780
+ static const Value& null;
781
+ static const Value& nullRef;
782
+ #endif
783
+
784
+ // null and nullRef are deprecated, use this instead.
785
+ static Value const& nullSingleton();
645
786
 
646
787
  /// Minimum signed integer value that can be stored in a Json::Value.
647
- static const LargestInt minLargestInt;
788
+ static constexpr LargestInt minLargestInt =
789
+ LargestInt(~(LargestUInt(-1) / 2));
648
790
  /// Maximum signed integer value that can be stored in a Json::Value.
649
- static const LargestInt maxLargestInt;
791
+ static constexpr LargestInt maxLargestInt = LargestInt(LargestUInt(-1) / 2);
650
792
  /// Maximum unsigned integer value that can be stored in a Json::Value.
651
- static const LargestUInt maxLargestUInt;
793
+ static constexpr LargestUInt maxLargestUInt = LargestUInt(-1);
652
794
 
653
795
  /// Minimum signed int value that can be stored in a Json::Value.
654
- static const Int minInt;
796
+ static constexpr Int minInt = Int(~(UInt(-1) / 2));
655
797
  /// Maximum signed int value that can be stored in a Json::Value.
656
- static const Int maxInt;
798
+ static constexpr Int maxInt = Int(UInt(-1) / 2);
657
799
  /// Maximum unsigned int value that can be stored in a Json::Value.
658
- static const UInt maxUInt;
800
+ static constexpr UInt maxUInt = UInt(-1);
659
801
 
660
802
  #if defined(JSON_HAS_INT64)
661
803
  /// Minimum signed 64 bits int value that can be stored in a Json::Value.
662
- static const Int64 minInt64;
804
+ static constexpr Int64 minInt64 = Int64(~(UInt64(-1) / 2));
663
805
  /// Maximum signed 64 bits int value that can be stored in a Json::Value.
664
- static const Int64 maxInt64;
806
+ static constexpr Int64 maxInt64 = Int64(UInt64(-1) / 2);
665
807
  /// Maximum unsigned 64 bits int value that can be stored in a Json::Value.
666
- static const UInt64 maxUInt64;
808
+ static constexpr UInt64 maxUInt64 = UInt64(-1);
667
809
  #endif // defined(JSON_HAS_INT64)
668
-
810
+ /// Default precision for real value for string representation.
811
+ static constexpr UInt defaultRealPrecision = 17;
812
+ // The constant is hard-coded because some compiler have trouble
813
+ // converting Value::maxUInt64 to a double correctly (AIX/xlC).
814
+ // Assumes that UInt64 is a 64 bits integer.
815
+ static constexpr double maxUInt64AsDouble = 18446744073709551615.0;
816
+ // Workaround for bug in the NVIDIAs CUDA 9.1 nvcc compiler
817
+ // when using gcc and clang backend compilers. CZString
818
+ // cannot be defined as private. See issue #486
819
+ #ifdef __NVCC__
820
+ public:
821
+ #else
669
822
  private:
823
+ #endif
670
824
  #ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
671
- class CZString {
825
+ class JSON_API CZString {
672
826
  public:
673
- enum DuplicationPolicy {
674
- noDuplication = 0,
675
- duplicate,
676
- duplicateOnCopy
677
- };
827
+ enum DuplicationPolicy { noDuplication = 0, duplicate, duplicateOnCopy };
678
828
  CZString(ArrayIndex index);
679
829
  CZString(char const* str, unsigned length, DuplicationPolicy allocate);
680
830
  CZString(CZString const& other);
681
- #if JSON_HAS_RVALUE_REFERENCES
682
- CZString(CZString&& other);
683
- #endif
831
+ CZString(CZString&& other) noexcept;
684
832
  ~CZString();
685
- CZString& operator=(CZString other);
833
+ CZString& operator=(const CZString& other);
834
+ CZString& operator=(CZString&& other) noexcept;
835
+
686
836
  bool operator<(CZString const& other) const;
687
837
  bool operator==(CZString const& other) const;
688
838
  ArrayIndex index() const;
689
- //const char* c_str() const; ///< \deprecated
839
+ // const char* c_str() const; ///< \deprecated
690
840
  char const* data() const;
691
841
  unsigned length() const;
692
842
  bool isStaticString() const;
@@ -695,11 +845,11 @@ private:
695
845
  void swap(CZString& other);
696
846
 
697
847
  struct StringStorage {
698
- unsigned policy_: 2;
699
- unsigned length_: 30; // 1GB max
848
+ unsigned policy_ : 2;
849
+ unsigned length_ : 30; // 1GB max
700
850
  };
701
851
 
702
- char const* cstr_; // actually, a prefixed string, unless policy is noDup
852
+ char const* cstr_; // actually, a prefixed string, unless policy is noDup
703
853
  union {
704
854
  ArrayIndex index_;
705
855
  StringStorage storage_;
@@ -707,29 +857,26 @@ private:
707
857
  };
708
858
 
709
859
  public:
710
- #ifndef JSON_USE_CPPTL_SMALLMAP
711
860
  typedef std::map<CZString, Value> ObjectValues;
712
- #else
713
- typedef CppTL::SmallMap<CZString, Value> ObjectValues;
714
- #endif // ifndef JSON_USE_CPPTL_SMALLMAP
715
861
  #endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
716
862
 
717
863
  public:
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
- */
864
+ /**
865
+ * \brief Create a default Value of the given type.
866
+ *
867
+ * This is a very useful constructor.
868
+ * To create an empty array, pass arrayValue.
869
+ * To create an empty object, pass objectValue.
870
+ * Another Value can then be set to this one by assignment.
871
+ * This is useful since clear() and resize() will not alter types.
872
+ *
873
+ * Examples:
874
+ * \code
875
+ * Json::Value null_value; // null
876
+ * Json::Value arr_value(Json::arrayValue); // []
877
+ * Json::Value obj_value(Json::objectValue); // {}
878
+ * \endcode
879
+ */
733
880
  Value(ValueType type = nullValue);
734
881
  Value(Int value);
735
882
  Value(UInt value);
@@ -740,43 +887,50 @@ Json::Value obj_value(Json::objectValue); // {}
740
887
  Value(double value);
741
888
  Value(const char* value); ///< Copy til first 0. (NULL causes to seg-fault.)
742
889
  Value(const char* begin, const char* end); ///< Copy all, incl zeroes.
743
- /** \brief Constructs a value from a static string.
744
-
890
+ /**
891
+ * \brief Constructs a value from a static string.
892
+ *
745
893
  * Like other value string constructor but do not duplicate the string for
746
- * internal storage. The given string must remain alive after the call to this
747
- * constructor.
894
+ * internal storage. The given string must remain alive after the call to
895
+ * this constructor.
896
+ *
748
897
  * \note This works only for null-terminated strings. (We cannot change the
749
- * size of this class, so we have nowhere to store the length,
750
- * which might be computed later for various operations.)
898
+ * size of this class, so we have nowhere to store the length, which might be
899
+ * computed later for various operations.)
751
900
  *
752
901
  * Example of usage:
753
- * \code
754
- * static StaticString foo("some text");
755
- * Json::Value aValue(foo);
756
- * \endcode
902
+ * \code
903
+ * static StaticString foo("some text");
904
+ * Json::Value aValue(foo);
905
+ * \endcode
757
906
  */
758
907
  Value(const StaticString& 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);
908
+ Value(const String& value);
909
+ #ifdef JSONCPP_HAS_STRING_VIEW
910
+ inline Value(std::string_view value)
911
+ : Value(value.data(), value.data() + value.length()) {}
762
912
  #endif
763
913
  Value(bool value);
764
- /// Deep copy.
914
+ Value(std::nullptr_t ptr) = delete;
765
915
  Value(const Value& other);
766
- #if JSON_HAS_RVALUE_REFERENCES
767
- /// Move constructor
768
- Value(Value&& other);
769
- #endif
770
- virtual ~Value();
916
+ Value(Value&& other) noexcept;
917
+ ~Value();
918
+
919
+ /// \note Overwrite existing comments. To preserve comments, use
920
+ /// #swapPayload().
921
+ Value& operator=(const Value& other);
922
+ Value& operator=(Value&& other) noexcept;
771
923
 
772
- /// Deep copy, then swap(other).
773
- /// \note Over-write existing comments. To preserve comments, use #swapPayload().
774
- Value& operator=(Value other);
775
924
  /// Swap everything.
776
925
  void swap(Value& other);
777
926
  /// Swap values but leave comments and source offsets in place.
778
927
  void swapPayload(Value& other);
779
928
 
929
+ /// copy everything.
930
+ void copy(const Value& other);
931
+ /// copy values but leave comments and source offsets in place.
932
+ void copyPayload(const Value& other);
933
+
780
934
  ValueType type() const;
781
935
 
782
936
  /// Compare payload only, not comments etc.
@@ -789,17 +943,27 @@ Json::Value obj_value(Json::objectValue); // {}
789
943
  int compare(const Value& other) const;
790
944
 
791
945
  const char* asCString() const; ///< Embedded zeroes could cause you trouble!
792
- #if JSONCPP_USING_SECURE_MEMORY
793
- unsigned getCStringLength() const; //Allows you to understand the length of the CString
946
+ #if JSONCPP_USE_SECURE_MEMORY
947
+ unsigned getCStringLength() const; // Allows you to understand the length of
948
+ // the CString
794
949
  #endif
795
- JSONCPP_STRING asString() const; ///< Embedded zeroes are possible.
950
+ String asString() const; ///< Embedded zeroes are possible.
796
951
  /** Get raw char* of string-value.
797
952
  * \return false if !string. (Seg-fault if str or end are NULL.)
798
953
  */
799
- bool getString(
800
- char const** begin, char const** end) const;
801
- #ifdef JSON_USE_CPPTL
802
- CppTL::ConstString asConstString() const;
954
+ bool getString(char const** begin, char const** end) const;
955
+ #ifdef JSONCPP_HAS_STRING_VIEW
956
+ /** Get string_view of string-value.
957
+ * \return false if !string. (Seg-fault if str is NULL.)
958
+ */
959
+ inline bool getString(std::string_view* str) const {
960
+ char const* begin;
961
+ char const* end;
962
+ if (!getString(&begin, &end))
963
+ return false;
964
+ *str = std::string_view(begin, static_cast<size_t>(end - begin));
965
+ return true;
966
+ }
803
967
  #endif
804
968
  Int asInt() const;
805
969
  UInt asUInt() const;
@@ -826,6 +990,10 @@ Json::Value obj_value(Json::objectValue); // {}
826
990
  bool isArray() const;
827
991
  bool isObject() const;
828
992
 
993
+ /// The `as<T>` and `is<T>` member function templates and specializations.
994
+ template <typename T> T as() const JSONCPP_TEMPLATE_DELETE;
995
+ template <typename T> bool is() const JSONCPP_TEMPLATE_DELETE;
996
+
829
997
  bool isConvertibleTo(ValueType other) const;
830
998
 
831
999
  /// Number of values in array or object
@@ -835,50 +1003,41 @@ Json::Value obj_value(Json::objectValue); // {}
835
1003
  /// otherwise, false.
836
1004
  bool empty() const;
837
1005
 
838
- /// Return isNull()
839
- bool operator!() const;
1006
+ /// Return !isNull()
1007
+ explicit operator bool() const;
840
1008
 
841
1009
  /// Remove all object members and array elements.
842
1010
  /// \pre type() is arrayValue, objectValue, or nullValue
843
1011
  /// \post type() is unchanged
844
1012
  void clear();
845
1013
 
846
- /// Resize the array to size elements.
1014
+ /// Resize the array to newSize elements.
847
1015
  /// New elements are initialized to null.
848
1016
  /// May only be called on nullValue or arrayValue.
849
1017
  /// \pre type() is arrayValue or nullValue
850
1018
  /// \post type() is arrayValue
851
- void resize(ArrayIndex size);
1019
+ void resize(ArrayIndex newSize);
852
1020
 
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.
1021
+ ///@{
1022
+ /// Access an array element (zero based index). If the array contains less
1023
+ /// than index element, then null value are inserted in the array so that
1024
+ /// its size is index+1.
857
1025
  /// (You may need to say 'value[0u]' to get your compiler to distinguish
858
- /// this from the operator[] which takes a string.)
1026
+ /// this from the operator[] which takes a string.)
859
1027
  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.)
867
1028
  Value& operator[](int index);
1029
+ ///@}
868
1030
 
869
- /// Access an array element (zero based index )
1031
+ ///@{
1032
+ /// Access an array element (zero based index).
870
1033
  /// (You may need to say 'value[0u]' to get your compiler to distinguish
871
- /// this from the operator[] which takes a string.)
1034
+ /// this from the operator[] which takes a string.)
872
1035
  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.)
877
1036
  const Value& operator[](int index) const;
1037
+ ///@}
878
1038
 
879
1039
  /// If the array contains at least index+1 elements, returns the element
880
- /// value,
881
- /// otherwise returns defaultValue.
1040
+ /// value, otherwise returns defaultValue.
882
1041
  Value get(ArrayIndex index, const Value& defaultValue) const;
883
1042
  /// Return true if index < size().
884
1043
  bool isValidIndex(ArrayIndex index) const;
@@ -886,109 +1045,162 @@ Json::Value obj_value(Json::objectValue); // {}
886
1045
  ///
887
1046
  /// Equivalent to jsonvalue[jsonvalue.size()] = value;
888
1047
  Value& append(const Value& value);
1048
+ Value& append(Value&& value);
1049
+
1050
+ /// \brief Insert value in array at specific index
1051
+ bool insert(ArrayIndex index, const Value& newValue);
1052
+ bool insert(ArrayIndex index, Value&& newValue);
889
1053
 
1054
+ #ifdef JSONCPP_HAS_STRING_VIEW
1055
+ /// Access an object value by name, create a null member if it does not exist.
1056
+ /// \param key may contain embedded nulls.
1057
+ inline Value& operator[](std::string_view key) {
1058
+ return resolveReference(key.data(), key.data() + key.length());
1059
+ }
1060
+ /// Access an object value by name, returns null if there is no member with
1061
+ /// that name.
1062
+ /// \param key may contain embedded nulls.
1063
+ inline const Value& operator[](std::string_view key) const {
1064
+ Value const* found = find(key.data(), key.data() + key.length());
1065
+ if (!found)
1066
+ return nullSingleton();
1067
+ return *found;
1068
+ }
1069
+ #endif
890
1070
  /// Access an object value by name, create a null member if it does not exist.
891
1071
  /// \note Because of our implementation, keys are limited to 2^30 -1 chars.
892
- /// Exceeding that will cause an exception.
1072
+ /// Exceeding that will cause an exception.
893
1073
  Value& operator[](const char* key);
894
1074
  /// Access an object value by name, returns null if there is no member with
895
1075
  /// that name.
896
1076
  const Value& operator[](const char* key) const;
897
1077
  /// Access an object value by name, create a null member if it does not exist.
898
1078
  /// \param key may contain embedded nulls.
899
- Value& operator[](const JSONCPP_STRING& key);
1079
+ Value& operator[](const String& key);
900
1080
  /// Access an object value by name, returns null if there is no member with
901
1081
  /// that name.
902
1082
  /// \param key may contain embedded nulls.
903
- const Value& operator[](const JSONCPP_STRING& key) const;
1083
+ const Value& operator[](const String& key) const;
904
1084
  /** \brief Access an object value by name, create a null member if it does not
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.
1085
+ * exist.
1086
+ *
1087
+ * If the object has no entry for that name, then the member name used to
1088
+ * store the new entry is not duplicated.
909
1089
  * Example of use:
910
- * \code
911
- * Json::Value object;
912
- * static const StaticString code("code");
913
- * object[code] = 1234;
914
- * \endcode
1090
+ * \code
1091
+ * Json::Value object;
1092
+ * static const StaticString code("code");
1093
+ * object[code] = 1234;
1094
+ * \endcode
915
1095
  */
916
1096
  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
1097
+ #ifdef JSONCPP_HAS_STRING_VIEW
924
1098
  /// Return the member named key if it exist, defaultValue otherwise.
925
1099
  /// \note deep copy
926
- Value get(const char* key, const Value& defaultValue) const;
1100
+ inline Value get(std::string_view key, const Value& defaultValue) const {
1101
+ return get(key.data(), key.data() + key.length(), defaultValue);
1102
+ }
1103
+ #endif
927
1104
  /// Return the member named key if it exist, defaultValue otherwise.
928
1105
  /// \note deep copy
929
- /// \note key may contain embedded nulls.
930
- Value get(const char* begin, const char* end, const Value& defaultValue) const;
1106
+ Value get(const char* key, const Value& defaultValue) const;
931
1107
  /// Return the member named key if it exist, defaultValue otherwise.
932
1108
  /// \note deep copy
933
1109
  /// \param key may contain embedded nulls.
934
- Value get(const JSONCPP_STRING& key, const Value& defaultValue) const;
935
- #ifdef JSON_USE_CPPTL
1110
+ Value get(const String& key, const Value& defaultValue) const;
936
1111
  /// Return the member named key if it exist, defaultValue otherwise.
937
1112
  /// \note deep copy
938
- Value get(const CppTL::ConstString& key, const Value& defaultValue) const;
939
- #endif
1113
+ /// \note key may contain embedded nulls.
1114
+ Value get(const char* begin, const char* end,
1115
+ const Value& defaultValue) const;
940
1116
  /// Most general and efficient version of isMember()const, get()const,
941
1117
  /// and operator[]const
942
1118
  /// \note As stated elsewhere, behavior is undefined if (end-begin) >= 2^30
943
1119
  Value const* find(char const* begin, char const* end) const;
1120
+ /// Most general and efficient version of isMember()const, get()const,
1121
+ /// and operator[]const
1122
+ Value const* find(const String& key) const;
1123
+
1124
+ /// Calls find and only returns a valid pointer if the type is found
1125
+ template <typename T, bool (T::*TMemFn)() const>
1126
+ Value const* findValue(const String& key) const {
1127
+ Value const* found = find(key);
1128
+ if (!found || !(found->*TMemFn)())
1129
+ return nullptr;
1130
+ return found;
1131
+ }
1132
+
1133
+ Value const* findNull(const String& key) const;
1134
+ Value const* findBool(const String& key) const;
1135
+ Value const* findInt(const String& key) const;
1136
+ Value const* findInt64(const String& key) const;
1137
+ Value const* findUInt(const String& key) const;
1138
+ Value const* findUInt64(const String& key) const;
1139
+ Value const* findIntegral(const String& key) const;
1140
+ Value const* findDouble(const String& key) const;
1141
+ Value const* findNumeric(const String& key) const;
1142
+ Value const* findString(const String& key) const;
1143
+ Value const* findArray(const String& key) const;
1144
+ Value const* findObject(const String& key) const;
1145
+
944
1146
  /// Most general and efficient version of object-mutators.
945
1147
  /// \note As stated elsewhere, behavior is undefined if (end-begin) >= 2^30
946
1148
  /// \return non-zero, but JSON_ASSERT if this is neither object nor nullValue.
947
- Value const* demand(char const* begin, char const* end);
1149
+ Value* demand(char const* begin, char const* end);
948
1150
  /// \brief Remove and return the named member.
949
1151
  ///
950
1152
  /// Do nothing if it did not exist.
951
- /// \return the removed Value, or null.
952
1153
  /// \pre type() is objectValue or nullValue
953
1154
  /// \post type() is unchanged
954
- /// \deprecated
955
- Value removeMember(const char* key);
1155
+ #if JSONCPP_HAS_STRING_VIEW
1156
+ inline void removeMember(std::string_view key) {
1157
+ removeMember(key.data(), key.data() + key.length(), nullptr);
1158
+ }
1159
+ #endif
1160
+ void removeMember(const char* key);
956
1161
  /// Same as removeMember(const char*)
957
1162
  /// \param key may contain embedded nulls.
958
- /// \deprecated
959
- Value removeMember(const JSONCPP_STRING& key);
1163
+ void removeMember(const String& key);
1164
+ /** \brief Remove the named map member.
1165
+ *
1166
+ * Update 'removed' iff removed.
1167
+ * \param key may contain embedded nulls.
1168
+ * \return true iff removed (no exceptions)
1169
+ */
1170
+ #if JSONCPP_HAS_STRING_VIEW
1171
+ inline bool removeMember(std::string_view key, Value* removed) {
1172
+ return removeMember(key.data(), key.data() + key.length(), removed);
1173
+ }
1174
+ #endif
1175
+ bool removeMember(String const& key, Value* removed);
960
1176
  /// Same as removeMember(const char* begin, const char* end, Value* removed),
961
1177
  /// but 'key' is null-terminated.
962
1178
  bool removeMember(const char* key, Value* removed);
963
- /** \brief Remove the named map member.
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)
1179
+ /// Same as removeMember(String const& key, Value* removed)
971
1180
  bool removeMember(const char* begin, const char* end, Value* removed);
972
1181
  /** \brief Remove the indexed array element.
1182
+ *
1183
+ * O(n) expensive operations.
1184
+ * Update 'removed' iff removed.
1185
+ * \return true if removed (no exceptions)
1186
+ */
1187
+ bool removeIndex(ArrayIndex index, Value* removed);
973
1188
 
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);
979
-
1189
+ #ifdef JSONCPP_HAS_STRING_VIEW
1190
+ /// Return true if the object has a member named key.
1191
+ /// \param key may contain embedded nulls.
1192
+ inline bool isMember(std::string_view key) const {
1193
+ return isMember(key.data(), key.data() + key.length());
1194
+ }
1195
+ #endif
980
1196
  /// Return true if the object has a member named key.
981
1197
  /// \note 'key' must be null-terminated.
982
1198
  bool isMember(const char* key) const;
983
1199
  /// Return true if the object has a member named key.
984
1200
  /// \param key may contain embedded nulls.
985
- bool isMember(const JSONCPP_STRING& key) const;
986
- /// Same as isMember(JSONCPP_STRING const& key)const
1201
+ bool isMember(const String& key) const;
1202
+ /// Same as isMember(String const& key)const
987
1203
  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
992
1204
 
993
1205
  /// \brief Return a list of the member names.
994
1206
  ///
@@ -997,23 +1209,22 @@ Json::Value obj_value(Json::objectValue); // {}
997
1209
  /// \post if type() was nullValue, it remains nullValue
998
1210
  Members getMemberNames() const;
999
1211
 
1000
- //# ifdef JSON_USE_CPPTL
1001
- // EnumMemberNames enumMemberNames() const;
1002
- // EnumValues enumValues() const;
1003
- //# endif
1004
-
1005
1212
  /// \deprecated Always pass len.
1006
- JSONCPP_DEPRECATED("Use setComment(JSONCPP_STRING const&) instead.")
1007
- void setComment(const char* comment, CommentPlacement placement);
1213
+ JSONCPP_DEPRECATED("Use setComment(String const&) instead.")
1214
+ void setComment(const char* comment, CommentPlacement placement) {
1215
+ setComment(String(comment, strlen(comment)), placement);
1216
+ }
1008
1217
  /// Comments must be //... or /* ... */
1009
- void setComment(const char* comment, size_t len, CommentPlacement placement);
1218
+ void setComment(const char* comment, size_t len, CommentPlacement placement) {
1219
+ setComment(String(comment, len), placement);
1220
+ }
1010
1221
  /// Comments must be //... or /* ... */
1011
- void setComment(const JSONCPP_STRING& comment, CommentPlacement placement);
1222
+ void setComment(String comment, CommentPlacement placement);
1012
1223
  bool hasComment(CommentPlacement placement) const;
1013
1224
  /// Include delimiters and embedded newlines.
1014
- JSONCPP_STRING getComment(CommentPlacement placement) const;
1225
+ String getComment(CommentPlacement placement) const;
1015
1226
 
1016
- JSONCPP_STRING toStyledString() const;
1227
+ String toStyledString() const;
1017
1228
 
1018
1229
  const_iterator begin() const;
1019
1230
  const_iterator end() const;
@@ -1021,6 +1232,31 @@ Json::Value obj_value(Json::objectValue); // {}
1021
1232
  iterator begin();
1022
1233
  iterator end();
1023
1234
 
1235
+ // \brief Returns a view of member pairs for range-based for loops.
1236
+ ValueMembersView members();
1237
+ // \brief Returns a view of member pairs for range-based for loops.
1238
+ ValueConstMembersView members() const;
1239
+
1240
+ /// \brief Returns a reference to the first element in the `Value`.
1241
+ /// Requires that this value holds an array or json object, with at least one
1242
+ /// element.
1243
+ const Value& front() const;
1244
+
1245
+ /// \brief Returns a reference to the first element in the `Value`.
1246
+ /// Requires that this value holds an array or json object, with at least one
1247
+ /// element.
1248
+ Value& front();
1249
+
1250
+ /// \brief Returns a reference to the last element in the `Value`.
1251
+ /// Requires that value holds an array or json object, with at least one
1252
+ /// element.
1253
+ const Value& back() const;
1254
+
1255
+ /// \brief Returns a reference to the last element in the `Value`.
1256
+ /// Requires that this value holds an array or json object, with at least one
1257
+ /// element.
1258
+ Value& back();
1259
+
1024
1260
  // Accessors for the [start, limit) range of bytes within the JSON text from
1025
1261
  // which this value was parsed, if any.
1026
1262
  void setOffsetStart(ptrdiff_t start);
@@ -1029,20 +1265,20 @@ Json::Value obj_value(Json::objectValue); // {}
1029
1265
  ptrdiff_t getOffsetLimit() const;
1030
1266
 
1031
1267
  private:
1268
+ void setType(ValueType v) {
1269
+ bits_.value_type_ = static_cast<unsigned char>(v);
1270
+ }
1271
+ bool isAllocated() const { return bits_.allocated_; }
1272
+ void setIsAllocated(bool v) { bits_.allocated_ = v; }
1273
+
1032
1274
  void initBasic(ValueType type, bool allocated = false);
1275
+ void dupPayload(const Value& other);
1276
+ void releasePayload();
1277
+ void dupMeta(const Value& other);
1033
1278
 
1034
1279
  Value& resolveReference(const char* key);
1035
1280
  Value& resolveReference(const char* key, const char* end);
1036
1281
 
1037
- struct CommentInfo {
1038
- CommentInfo();
1039
- ~CommentInfo();
1040
-
1041
- void setComment(const char* text, size_t len);
1042
-
1043
- char* comment_;
1044
- };
1045
-
1046
1282
  // struct MemberNamesTransform
1047
1283
  //{
1048
1284
  // typedef const char *result_type;
@@ -1057,13 +1293,33 @@ private:
1057
1293
  LargestUInt uint_;
1058
1294
  double real_;
1059
1295
  bool bool_;
1060
- char* string_; // actually ptr to unsigned, followed by str, unless !allocated_
1296
+ char* string_; // if allocated_, ptr to { unsigned, char[] }.
1061
1297
  ObjectValues* map_;
1062
1298
  } value_;
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_;
1299
+
1300
+ struct {
1301
+ // Really a ValueType, but types should agree for bitfield packing.
1302
+ unsigned int value_type_ : 8;
1303
+ // Unless allocated_, string_ must be null-terminated.
1304
+ unsigned int allocated_ : 1;
1305
+ } bits_;
1306
+
1307
+ class Comments {
1308
+ public:
1309
+ Comments() = default;
1310
+ Comments(const Comments& that);
1311
+ Comments(Comments&& that) noexcept;
1312
+ Comments& operator=(const Comments& that);
1313
+ Comments& operator=(Comments&& that) noexcept;
1314
+ bool has(CommentPlacement slot) const;
1315
+ String get(CommentPlacement slot) const;
1316
+ void set(CommentPlacement slot, String comment);
1317
+
1318
+ private:
1319
+ using Array = std::array<String, numberOfCommentPlacement>;
1320
+ std::unique_ptr<Array> ptr_;
1321
+ };
1322
+ Comments comments_;
1067
1323
 
1068
1324
  // [start, limit) byte offsets in the source JSON text from which this Value
1069
1325
  // was extracted.
@@ -1071,6 +1327,36 @@ private:
1071
1327
  ptrdiff_t limit_;
1072
1328
  };
1073
1329
 
1330
+ template <> inline bool Value::as<bool>() const { return asBool(); }
1331
+ template <> inline bool Value::is<bool>() const { return isBool(); }
1332
+
1333
+ template <> inline Int Value::as<Int>() const { return asInt(); }
1334
+ template <> inline bool Value::is<Int>() const { return isInt(); }
1335
+
1336
+ template <> inline UInt Value::as<UInt>() const { return asUInt(); }
1337
+ template <> inline bool Value::is<UInt>() const { return isUInt(); }
1338
+
1339
+ #if defined(JSON_HAS_INT64)
1340
+ template <> inline Int64 Value::as<Int64>() const { return asInt64(); }
1341
+ template <> inline bool Value::is<Int64>() const { return isInt64(); }
1342
+
1343
+ template <> inline UInt64 Value::as<UInt64>() const { return asUInt64(); }
1344
+ template <> inline bool Value::is<UInt64>() const { return isUInt64(); }
1345
+ #endif
1346
+
1347
+ template <> inline double Value::as<double>() const { return asDouble(); }
1348
+ template <> inline bool Value::is<double>() const { return isDouble(); }
1349
+
1350
+ template <> inline String Value::as<String>() const { return asString(); }
1351
+ template <> inline bool Value::is<String>() const { return isString(); }
1352
+
1353
+ /// These `as` specializations are type conversions, and do not have a
1354
+ /// corresponding `is`.
1355
+ template <> inline float Value::as<float>() const { return asFloat(); }
1356
+ template <> inline const char* Value::as<const char*>() const {
1357
+ return asCString();
1358
+ }
1359
+
1074
1360
  /** \brief Experimental and untested: represents an element of the "path" to
1075
1361
  * access a node.
1076
1362
  */
@@ -1081,17 +1367,13 @@ public:
1081
1367
  PathArgument();
1082
1368
  PathArgument(ArrayIndex index);
1083
1369
  PathArgument(const char* key);
1084
- PathArgument(const JSONCPP_STRING& key);
1370
+ PathArgument(String key);
1085
1371
 
1086
1372
  private:
1087
- enum Kind {
1088
- kindNone = 0,
1089
- kindIndex,
1090
- kindKey
1091
- };
1092
- JSONCPP_STRING key_;
1093
- ArrayIndex index_;
1094
- Kind kind_;
1373
+ enum Kind { kindNone = 0, kindIndex, kindKey };
1374
+ String key_;
1375
+ ArrayIndex index_{};
1376
+ Kind kind_{kindNone};
1095
1377
  };
1096
1378
 
1097
1379
  /** \brief Experimental and untested: represents a "path" to access a node.
@@ -1103,12 +1385,11 @@ private:
1103
1385
  * - ".name1.name2.name3"
1104
1386
  * - ".[0][1][2].name1[3]"
1105
1387
  * - ".%" => member name is provided as parameter
1106
- * - ".[%]" => index is provied as parameter
1388
+ * - ".[%]" => index is provided as parameter
1107
1389
  */
1108
1390
  class JSON_API Path {
1109
1391
  public:
1110
- Path(const JSONCPP_STRING& path,
1111
- const PathArgument& a1 = PathArgument(),
1392
+ Path(const String& path, const PathArgument& a1 = PathArgument(),
1112
1393
  const PathArgument& a2 = PathArgument(),
1113
1394
  const PathArgument& a3 = PathArgument(),
1114
1395
  const PathArgument& a4 = PathArgument(),
@@ -1121,15 +1402,13 @@ public:
1121
1402
  Value& make(Value& root) const;
1122
1403
 
1123
1404
  private:
1124
- typedef std::vector<const PathArgument*> InArgs;
1125
- typedef std::vector<PathArgument> Args;
1405
+ using InArgs = std::vector<const PathArgument*>;
1406
+ using Args = std::vector<PathArgument>;
1126
1407
 
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);
1408
+ void makePath(const String& path, const InArgs& in);
1409
+ void addPathInArg(const String& path, const InArgs& in,
1410
+ InArgs::const_iterator& itInArg, PathArgument::Kind kind);
1411
+ static void invalidPath(const String& path, int location);
1133
1412
 
1134
1413
  Args args_;
1135
1414
  };
@@ -1139,10 +1418,10 @@ private:
1139
1418
  */
1140
1419
  class JSON_API ValueIteratorBase {
1141
1420
  public:
1142
- typedef std::bidirectional_iterator_tag iterator_category;
1143
- typedef unsigned int size_t;
1144
- typedef int difference_type;
1145
- typedef ValueIteratorBase SelfType;
1421
+ using iterator_category = std::bidirectional_iterator_tag;
1422
+ using size_t = unsigned int;
1423
+ using difference_type = int;
1424
+ using SelfType = ValueIteratorBase;
1146
1425
 
1147
1426
  bool operator==(const SelfType& other) const { return isEqual(other); }
1148
1427
 
@@ -1156,17 +1435,19 @@ public:
1156
1435
  /// Value.
1157
1436
  Value key() const;
1158
1437
 
1159
- /// Return the index of the referenced Value, or -1 if it is not an arrayValue.
1438
+ /// Return the index of the referenced Value, or -1 if it is not an
1439
+ /// arrayValue.
1160
1440
  UInt index() const;
1161
1441
 
1162
1442
  /// Return the member name of the referenced Value, or "" if it is not an
1163
1443
  /// objectValue.
1164
1444
  /// \note Avoid `c_str()` on result, as embedded zeroes are possible.
1165
- JSONCPP_STRING name() const;
1445
+ String name() const;
1166
1446
 
1167
1447
  /// Return the member name of the referenced Value. "" if it is not an
1168
1448
  /// objectValue.
1169
- /// \deprecated This cannot be used for UTF-8 strings, since there can be embedded nulls.
1449
+ /// \deprecated This cannot be used for UTF-8 strings, since there can be
1450
+ /// embedded nulls.
1170
1451
  JSONCPP_DEPRECATED("Use `key = name();` instead.")
1171
1452
  char const* memberName() const;
1172
1453
  /// Return the member name of the referenced Value, or NULL if it is not an
@@ -1175,7 +1456,14 @@ public:
1175
1456
  char const* memberName(char const** end) const;
1176
1457
 
1177
1458
  protected:
1178
- Value& deref() const;
1459
+ /*! Internal utility functions to assist with implementing
1460
+ * other iterator functions. The const and non-const versions
1461
+ * of the "deref" protected methods expose the protected
1462
+ * current_ member variable in a way that can often be
1463
+ * optimized away by the compiler.
1464
+ */
1465
+ const Value& deref() const;
1466
+ Value& deref();
1179
1467
 
1180
1468
  void increment();
1181
1469
 
@@ -1190,7 +1478,7 @@ protected:
1190
1478
  private:
1191
1479
  Value::ObjectValues::iterator current_;
1192
1480
  // Indicates that iterator is for a null value.
1193
- bool isNull_;
1481
+ bool isNull_{true};
1194
1482
 
1195
1483
  public:
1196
1484
  // For some reason, BORLAND needs these at the end, rather
@@ -1206,20 +1494,21 @@ class JSON_API ValueConstIterator : public ValueIteratorBase {
1206
1494
  friend class Value;
1207
1495
 
1208
1496
  public:
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;
1497
+ using value_type = const Value;
1498
+ // typedef unsigned int size_t;
1499
+ // typedef int difference_type;
1500
+ using reference = const Value&;
1501
+ using pointer = const Value*;
1502
+ using SelfType = ValueConstIterator;
1215
1503
 
1216
1504
  ValueConstIterator();
1217
1505
  ValueConstIterator(ValueIterator const& other);
1218
1506
 
1219
1507
  private:
1220
- /*! \internal Use by Value to create an iterator.
1221
- */
1508
+ /*! \internal Use by Value to create an iterator.
1509
+ */
1222
1510
  explicit ValueConstIterator(const Value::ObjectValues::iterator& current);
1511
+
1223
1512
  public:
1224
1513
  SelfType& operator=(const ValueIteratorBase& other);
1225
1514
 
@@ -1256,21 +1545,22 @@ class JSON_API ValueIterator : public ValueIteratorBase {
1256
1545
  friend class Value;
1257
1546
 
1258
1547
  public:
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;
1548
+ using value_type = Value;
1549
+ using size_t = unsigned int;
1550
+ using difference_type = int;
1551
+ using reference = Value&;
1552
+ using pointer = Value*;
1553
+ using SelfType = ValueIterator;
1265
1554
 
1266
1555
  ValueIterator();
1267
1556
  explicit ValueIterator(const ValueConstIterator& other);
1268
1557
  ValueIterator(const ValueIterator& other);
1269
1558
 
1270
1559
  private:
1271
- /*! \internal Use by Value to create an iterator.
1272
- */
1560
+ /*! \internal Use by Value to create an iterator.
1561
+ */
1273
1562
  explicit ValueIterator(const Value::ObjectValues::iterator& current);
1563
+
1274
1564
  public:
1275
1565
  SelfType& operator=(const SelfType& other);
1276
1566
 
@@ -1296,20 +1586,152 @@ public:
1296
1586
  return *this;
1297
1587
  }
1298
1588
 
1299
- reference operator*() const { return deref(); }
1589
+ /*! The return value of non-const iterators can be
1590
+ * changed, so the these functions are not const
1591
+ * because the returned references/pointers can be used
1592
+ * to change state of the base class.
1593
+ */
1594
+ reference operator*() const { return const_cast<reference>(deref()); }
1595
+ pointer operator->() const { return const_cast<pointer>(&deref()); }
1596
+ };
1300
1597
 
1301
- pointer operator->() const { return &deref(); }
1598
+ /** \brief Proxy struct to enable range-based for loops over object members.
1599
+ */
1600
+ struct MemberProxy {
1601
+ const String name;
1602
+ Value& value;
1302
1603
  };
1303
1604
 
1304
- } // namespace Json
1305
- } // namespace Passenger
1605
+ /** \brief Proxy struct to enable range-based for loops over const object
1606
+ * members.
1607
+ */
1608
+ struct ConstMemberProxy {
1609
+ const String name;
1610
+ const Value& value;
1611
+ };
1612
+
1613
+ /** \brief Iterator adapter for range-based for loops.
1614
+ */
1615
+ class ValueMembersIterator {
1616
+ public:
1617
+ using iterator_category = std::forward_iterator_tag;
1618
+ using value_type = MemberProxy;
1619
+ using difference_type = int;
1620
+ using pointer = MemberProxy*;
1621
+ using reference = MemberProxy;
1622
+
1623
+ ValueMembersIterator() = default;
1624
+ explicit ValueMembersIterator(ValueIterator const& iter) : it_(iter) {}
1625
+
1626
+ ValueMembersIterator& operator++() {
1627
+ ++it_;
1628
+ return *this;
1629
+ }
1630
+ ValueMembersIterator operator++(int) {
1631
+ ValueMembersIterator temp(*this);
1632
+ ++*this;
1633
+ return temp;
1634
+ }
1635
+ bool operator==(ValueMembersIterator const& other) const {
1636
+ return it_ == other.it_;
1637
+ }
1638
+ bool operator!=(ValueMembersIterator const& other) const {
1639
+ return it_ != other.it_;
1640
+ }
1641
+ MemberProxy operator*() const { return MemberProxy{it_.name(), *it_}; }
1642
+
1643
+ private:
1644
+ ValueIterator it_;
1645
+ };
1646
+
1647
+ /** \brief Iterator adapter for range-based for loops.
1648
+ */
1649
+ class ValueConstMembersIterator {
1650
+ public:
1651
+ using iterator_category = std::forward_iterator_tag;
1652
+ using value_type = ConstMemberProxy;
1653
+ using difference_type = int;
1654
+ using pointer = ConstMemberProxy*;
1655
+ using reference = ConstMemberProxy;
1656
+
1657
+ ValueConstMembersIterator() = default;
1658
+ explicit ValueConstMembersIterator(ValueConstIterator const& iter)
1659
+ : it_(iter) {}
1660
+
1661
+ ValueConstMembersIterator& operator++() {
1662
+ ++it_;
1663
+ return *this;
1664
+ }
1665
+ ValueConstMembersIterator operator++(int) {
1666
+ ValueConstMembersIterator temp(*this);
1667
+ ++*this;
1668
+ return temp;
1669
+ }
1670
+ bool operator==(ValueConstMembersIterator const& other) const {
1671
+ return it_ == other.it_;
1672
+ }
1673
+ bool operator!=(ValueConstMembersIterator const& other) const {
1674
+ return it_ != other.it_;
1675
+ }
1676
+ ConstMemberProxy operator*() const {
1677
+ return ConstMemberProxy{it_.name(), *it_};
1678
+ }
1679
+
1680
+ private:
1681
+ ValueConstIterator it_;
1682
+ };
1683
+
1684
+ /** \brief Range-based for loop adapter for object members.
1685
+ */
1686
+ class ValueMembersView {
1687
+ public:
1688
+ ValueMembersView(ValueIterator begin, ValueIterator end)
1689
+ : begin_(begin), end_(end) {}
1690
+ ValueMembersIterator begin() const { return ValueMembersIterator(begin_); }
1691
+ ValueMembersIterator end() const { return ValueMembersIterator(end_); }
1692
+
1693
+ private:
1694
+ ValueIterator begin_;
1695
+ ValueIterator end_;
1696
+ };
1697
+
1698
+ /** \brief Range-based for loop adapter for object members.
1699
+ */
1700
+ class ValueConstMembersView {
1701
+ public:
1702
+ ValueConstMembersView(ValueConstIterator begin, ValueConstIterator end)
1703
+ : begin_(begin), end_(end) {}
1704
+ ValueConstMembersIterator begin() const {
1705
+ return ValueConstMembersIterator(begin_);
1706
+ }
1707
+ ValueConstMembersIterator end() const {
1708
+ return ValueConstMembersIterator(end_);
1709
+ }
1306
1710
 
1711
+ private:
1712
+ ValueConstIterator begin_;
1713
+ ValueConstIterator end_;
1714
+ };
1307
1715
 
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); }
1716
+ inline ValueMembersView Value::members() {
1717
+ return ValueMembersView(begin(), end());
1312
1718
  }
1719
+ inline ValueConstMembersView Value::members() const {
1720
+ return ValueConstMembersView(begin(), end());
1721
+ }
1722
+
1723
+ inline void swap(Value& a, Value& b) { a.swap(b); }
1724
+
1725
+ inline const Value& Value::front() const { return *begin(); }
1726
+
1727
+ inline Value& Value::front() { return *begin(); }
1728
+
1729
+ inline const Value& Value::back() const { return *(--end()); }
1730
+
1731
+ inline Value& Value::back() { return *(--end()); }
1732
+
1733
+ } // namespace Json
1734
+ } // namespace Passenger
1313
1735
 
1314
1736
  #pragma pack(pop)
1315
1737
 
@@ -1317,7 +1739,7 @@ inline void swap(Passenger::Json::Value& a, Passenger::Json::Value& b) { a.swap(
1317
1739
  #pragma warning(pop)
1318
1740
  #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1319
1741
 
1320
- #endif // CPPTL_JSON_H_INCLUDED
1742
+ #endif // JSON_H_INCLUDED
1321
1743
 
1322
1744
  // //////////////////////////////////////////////////////////////////////
1323
1745
  // End of content of file: include/json/value.h
@@ -1332,23 +1754,23 @@ inline void swap(Passenger::Json::Value& a, Passenger::Json::Value& b) { a.swap(
1332
1754
  // Beginning of content of file: include/json/reader.h
1333
1755
  // //////////////////////////////////////////////////////////////////////
1334
1756
 
1335
- // Copyright 2007-2010 Baptiste Lepilleur
1757
+ // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
1336
1758
  // Distributed under MIT license, or public domain if desired and
1337
1759
  // recognized in your jurisdiction.
1338
1760
  // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
1339
1761
 
1340
- #ifndef CPPTL_JSON_READER_H_INCLUDED
1341
- #define CPPTL_JSON_READER_H_INCLUDED
1762
+ #ifndef JSON_READER_H_INCLUDED
1763
+ #define JSON_READER_H_INCLUDED
1342
1764
 
1343
1765
  #if !defined(JSON_IS_AMALGAMATION)
1344
- #include "features.h"
1766
+ #include "json_features.h"
1345
1767
  #include "value.h"
1346
1768
  #endif // if !defined(JSON_IS_AMALGAMATION)
1347
1769
  #include <deque>
1348
1770
  #include <iosfwd>
1771
+ #include <istream>
1349
1772
  #include <stack>
1350
1773
  #include <string>
1351
- #include <istream>
1352
1774
 
1353
1775
  // Disable warning C4251: <data member>: <type> needs to have dll-interface to
1354
1776
  // be used by...
@@ -1357,138 +1779,139 @@ inline void swap(Passenger::Json::Value& a, Passenger::Json::Value& b) { a.swap(
1357
1779
  #pragma warning(disable : 4251)
1358
1780
  #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1359
1781
 
1360
- #pragma pack(push, 8)
1782
+ #pragma pack(push)
1783
+ #pragma pack()
1361
1784
 
1362
1785
  namespace Passenger {
1363
1786
  namespace Json {
1364
1787
 
1365
1788
  /** \brief Unserialize a <a HREF="http://www.json.org">JSON</a> document into a
1366
- *Value.
1789
+ * Value.
1367
1790
  *
1368
1791
  * \deprecated Use CharReader and CharReaderBuilder.
1369
1792
  */
1793
+
1370
1794
  class JSON_API Reader {
1371
1795
  public:
1372
- typedef char Char;
1373
- typedef const Char* Location;
1796
+ using Char = char;
1797
+ using Location = const Char*;
1374
1798
 
1375
1799
  /** \brief An error tagged with where in the JSON text it was encountered.
1376
1800
  *
1377
1801
  * The offsets give the [start, limit) range of bytes within the text. Note
1378
1802
  * that this is bytes, not codepoints.
1379
- *
1380
1803
  */
1381
1804
  struct StructuredError {
1382
1805
  ptrdiff_t offset_start;
1383
1806
  ptrdiff_t offset_limit;
1384
- JSONCPP_STRING message;
1807
+ String message;
1385
1808
  };
1386
1809
 
1387
- /** \brief Constructs a Reader allowing all features
1388
- * for parsing.
1810
+ /** \brief Constructs a Reader allowing all features for parsing.
1811
+ * \deprecated Use CharReader and CharReaderBuilder.
1389
1812
  */
1390
1813
  Reader();
1391
1814
 
1392
- /** \brief Constructs a Reader allowing the specified feature set
1393
- * for parsing.
1815
+ /** \brief Constructs a Reader allowing the specified feature set for parsing.
1816
+ * \deprecated Use CharReader and CharReaderBuilder.
1394
1817
  */
1395
1818
  Reader(const Features& features);
1396
1819
 
1397
1820
  /** \brief Read a Value from a <a HREF="http://www.json.org">JSON</a>
1398
1821
  * document.
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.
1822
+ *
1823
+ * \param document UTF-8 encoded string containing the document
1824
+ * to read.
1825
+ * \param[out] root Contains the root value of the document if it
1826
+ * was successfully parsed.
1827
+ * \param collectComments \c true to collect comment and allow writing
1828
+ * them back during serialization, \c false to
1829
+ * discard comments. This parameter is ignored
1830
+ * if Features::allowComments_ is \c false.
1408
1831
  * \return \c true if the document was successfully parsed, \c false if an
1409
1832
  * error occurred.
1410
1833
  */
1411
- bool
1412
- parse(const std::string& document, Value& root, bool collectComments = true);
1834
+ bool parse(const std::string& document, Value& root,
1835
+ bool collectComments = true);
1413
1836
 
1414
1837
  /** \brief Read a Value from a <a HREF="http://www.json.org">JSON</a>
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.
1838
+ * document.
1839
+ *
1840
+ * \param beginDoc Pointer on the beginning of the UTF-8 encoded
1841
+ * string of the document to read. The pointed-to
1842
+ * buffer must outlive this Reader if error
1843
+ * methods (e.g. getFormattedErrorMessages()) are
1844
+ * called after parse() returns.
1845
+ * \param endDoc Pointer on the end of the UTF-8 encoded string
1846
+ * of the document to read. Must be >= beginDoc.
1847
+ * \param[out] root Contains the root value of the document if it
1848
+ * was successfully parsed.
1849
+ * \param collectComments \c true to collect comment and allow writing
1850
+ * them back during serialization, \c false to
1851
+ * discard comments. This parameter is ignored
1852
+ * if Features::allowComments_ is \c false.
1429
1853
  * \return \c true if the document was successfully parsed, \c false if an
1430
- error occurred.
1854
+ * error occurred.
1431
1855
  */
1432
- bool parse(const char* beginDoc,
1433
- const char* endDoc,
1434
- Value& root,
1856
+ bool parse(const char* beginDoc, const char* endDoc, Value& root,
1435
1857
  bool collectComments = true);
1436
1858
 
1437
1859
  /// \brief Parse from input stream.
1438
1860
  /// \see Json::operator>>(std::istream&, Json::Value&).
1439
- bool parse(JSONCPP_ISTREAM& is, Value& root, bool collectComments = true);
1861
+ bool parse(IStream& is, Value& root, bool collectComments = true);
1440
1862
 
1441
1863
  /** \brief Returns a user friendly string that list errors in the parsed
1442
1864
  * document.
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.
1865
+ *
1866
+ * \return Formatted error message with the list of errors with their
1867
+ * location in the parsed document. An empty string is returned if no error
1868
+ * occurred during parsing.
1448
1869
  * \deprecated Use getFormattedErrorMessages() instead (typo fix).
1449
1870
  */
1450
1871
  JSONCPP_DEPRECATED("Use getFormattedErrorMessages() instead.")
1451
- JSONCPP_STRING getFormatedErrorMessages() const;
1872
+ String getFormatedErrorMessages() const;
1452
1873
 
1453
1874
  /** \brief Returns a user friendly string that list errors in the parsed
1454
1875
  * document.
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.
1876
+ *
1877
+ * \return Formatted error message with the list of errors with their
1878
+ * location in the parsed document. An empty string is returned if no error
1879
+ * occurred during parsing.
1460
1880
  */
1461
- JSONCPP_STRING getFormattedErrorMessages() const;
1881
+ String getFormattedErrorMessages() const;
1462
1882
 
1463
- /** \brief Returns a vector of structured erros encounted while parsing.
1883
+ /** \brief Returns a vector of structured errors encountered while parsing.
1884
+ *
1464
1885
  * \return A (possibly empty) vector of StructuredError objects. Currently
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.
1886
+ * only one error can be returned, but the caller should tolerate multiple
1887
+ * errors. This can occur if the parser recovers from a non-fatal parse
1888
+ * error and then encounters additional errors.
1469
1889
  */
1470
1890
  std::vector<StructuredError> getStructuredErrors() const;
1471
1891
 
1472
1892
  /** \brief Add a semantic error message.
1473
- * \param value JSON Value location associated with the error
1893
+ *
1894
+ * \param value JSON Value location associated with the error
1474
1895
  * \param message The error message.
1475
- * \return \c true if the error was successfully added, \c false if the
1476
- * Value offset exceeds the document size.
1896
+ * \return \c true if the error was successfully added, \c false if the Value
1897
+ * offset exceeds the document size.
1477
1898
  */
1478
- bool pushError(const Value& value, const JSONCPP_STRING& message);
1899
+ bool pushError(const Value& value, const String& message);
1479
1900
 
1480
1901
  /** \brief Add a semantic error message with extra context.
1481
- * \param value JSON Value location associated with the error
1902
+ *
1903
+ * \param value JSON Value location associated with the error
1482
1904
  * \param message The error message.
1483
- * \param extra Additional JSON Value location to contextualize the error
1905
+ * \param extra Additional JSON Value location to contextualize the error
1484
1906
  * \return \c true if the error was successfully added, \c false if either
1485
1907
  * Value offset exceeds the document size.
1486
1908
  */
1487
- bool pushError(const Value& value, const JSONCPP_STRING& message, const Value& extra);
1909
+ bool pushError(const Value& value, const String& message, const Value& extra);
1488
1910
 
1489
1911
  /** \brief Return whether there are any errors.
1490
- * \return \c true if there are no errors to report \c false if
1491
- * errors have occurred.
1912
+ *
1913
+ * \return \c true if there are no errors to report \c false if errors have
1914
+ * occurred.
1492
1915
  */
1493
1916
  bool good() const;
1494
1917
 
@@ -1520,15 +1943,16 @@ private:
1520
1943
  class ErrorInfo {
1521
1944
  public:
1522
1945
  Token token_;
1523
- JSONCPP_STRING message_;
1946
+ String message_;
1524
1947
  Location extra_;
1525
1948
  };
1526
1949
 
1527
- typedef std::deque<ErrorInfo> Errors;
1950
+ using Errors = std::deque<ErrorInfo>;
1528
1951
 
1529
1952
  bool readToken(Token& token);
1953
+ bool readTokenSkippingComments(Token& token);
1530
1954
  void skipSpaces();
1531
- bool match(Location pattern, int patternLength);
1955
+ bool match(const Char* pattern, int patternLength);
1532
1956
  bool readComment();
1533
1957
  bool readCStyleComment();
1534
1958
  bool readCppStyleComment();
@@ -1540,140 +1964,165 @@ private:
1540
1964
  bool decodeNumber(Token& token);
1541
1965
  bool decodeNumber(Token& token, Value& decoded);
1542
1966
  bool decodeString(Token& token);
1543
- bool decodeString(Token& token, JSONCPP_STRING& decoded);
1967
+ bool decodeString(Token& token, String& decoded);
1544
1968
  bool decodeDouble(Token& token);
1545
1969
  bool decodeDouble(Token& token, Value& decoded);
1546
- bool decodeUnicodeCodePoint(Token& token,
1547
- Location& current,
1548
- Location end,
1970
+ bool decodeUnicodeCodePoint(Token& token, Location& current, Location end,
1549
1971
  unsigned int& unicode);
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);
1972
+ bool decodeUnicodeEscapeSequence(Token& token, Location& current,
1973
+ Location end, unsigned int& unicode);
1974
+ bool addError(const String& message, Token& token, Location extra = nullptr);
1555
1975
  bool recoverFromError(TokenType skipUntilToken);
1556
- bool addErrorAndRecover(const JSONCPP_STRING& message,
1557
- Token& token,
1976
+ bool addErrorAndRecover(const String& message, Token& token,
1558
1977
  TokenType skipUntilToken);
1559
1978
  void skipUntilSpace();
1560
1979
  Value& currentValue();
1561
1980
  Char getNextChar();
1562
- void
1563
- getLocationLineAndColumn(Location location, int& line, int& column) const;
1564
- JSONCPP_STRING getLocationLineAndColumn(Location location) const;
1981
+ void getLocationLineAndColumn(Location location, int& line,
1982
+ int& column) const;
1983
+ String getLocationLineAndColumn(Location location) const;
1565
1984
  void addComment(Location begin, Location end, CommentPlacement placement);
1566
- void skipCommentTokens(Token& token);
1567
1985
 
1568
- typedef std::stack<Value*> Nodes;
1986
+ static bool containsNewLine(Location begin, Location end);
1987
+ static String normalizeEOL(Location begin, Location end);
1988
+
1989
+ using Nodes = std::stack<Value*>;
1569
1990
  Nodes nodes_;
1570
1991
  Errors errors_;
1571
- JSONCPP_STRING document_;
1572
- Location begin_;
1573
- Location end_;
1574
- Location current_;
1575
- Location lastValueEnd_;
1576
- Value* lastValue_;
1577
- JSONCPP_STRING commentsBefore_;
1992
+ String document_;
1993
+ Location begin_{};
1994
+ Location end_{};
1995
+ Location current_{};
1996
+ Location lastValueEnd_{};
1997
+ Value* lastValue_{};
1998
+ String commentsBefore_;
1578
1999
  Features features_;
1579
- bool collectComments_;
1580
- }; // Reader
2000
+ bool collectComments_{};
2001
+ }; // Reader
1581
2002
 
1582
2003
  /** Interface for reading JSON from a char array.
1583
2004
  */
1584
2005
  class JSON_API CharReader {
1585
2006
  public:
1586
- virtual ~CharReader() {}
2007
+ struct JSON_API StructuredError {
2008
+ ptrdiff_t offset_start;
2009
+ ptrdiff_t offset_limit;
2010
+ String message;
2011
+ };
2012
+
2013
+ virtual ~CharReader() = default;
1587
2014
  /** \brief Read a Value from a <a HREF="http://www.json.org">JSON</a>
1588
- document.
1589
- * The document must be a UTF-8 encoded string containing the document to read.
2015
+ * document. The document must be a UTF-8 encoded string containing the
2016
+ * document to read.
1590
2017
  *
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.
2018
+ * \param beginDoc Pointer on the beginning of the UTF-8 encoded string
2019
+ * of the document to read.
2020
+ * \param endDoc Pointer on the end of the UTF-8 encoded string of the
2021
+ * document to read. Must be >= beginDoc.
2022
+ * \param[out] root Contains the root value of the document if it was
2023
+ * successfully parsed.
2024
+ * \param[out] errs Formatted error messages (if not NULL) a user
2025
+ * friendly string that lists errors in the parsed
2026
+ * document.
1601
2027
  * \return \c true if the document was successfully parsed, \c false if an
1602
- error occurred.
2028
+ * error occurred.
2029
+ */
2030
+ virtual bool parse(char const* beginDoc, char const* endDoc, Value* root,
2031
+ String* errs);
2032
+
2033
+ /** \brief Returns a vector of structured errors encountered while parsing.
2034
+ * Each parse call resets the stored list of errors.
1603
2035
  */
1604
- virtual bool parse(
1605
- char const* beginDoc, char const* endDoc,
1606
- Value* root, JSONCPP_STRING* errs) = 0;
2036
+ std::vector<StructuredError> getStructuredErrors() const;
1607
2037
 
1608
2038
  class JSON_API Factory {
1609
2039
  public:
1610
- virtual ~Factory() {}
2040
+ virtual ~Factory() = default;
1611
2041
  /** \brief Allocate a CharReader via operator new().
1612
2042
  * \throw std::exception if something goes wrong (e.g. invalid settings)
1613
2043
  */
1614
2044
  virtual CharReader* newCharReader() const = 0;
1615
- }; // Factory
1616
- }; // CharReader
2045
+ }; // Factory
1617
2046
 
1618
- /** \brief Build a CharReader implementation.
2047
+ protected:
2048
+ class Impl {
2049
+ public:
2050
+ virtual ~Impl() = default;
2051
+ virtual bool parse(char const* beginDoc, char const* endDoc, Value* root,
2052
+ String* errs) = 0;
2053
+ virtual std::vector<StructuredError> getStructuredErrors() const = 0;
2054
+ };
1619
2055
 
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
- */
2056
+ explicit CharReader(std::unique_ptr<Impl> impl) : _impl(std::move(impl)) {}
2057
+
2058
+ private:
2059
+ std::unique_ptr<Impl> _impl;
2060
+ }; // CharReader
2061
+
2062
+ /** \brief Build a CharReader implementation.
2063
+ *
2064
+ * Usage:
2065
+ * \code
2066
+ * using namespace Json;
2067
+ * CharReaderBuilder builder;
2068
+ * builder["collectComments"] = false;
2069
+ * Value value;
2070
+ * String errs;
2071
+ * bool ok = parseFromStream(builder, std::cin, &value, &errs);
2072
+ * \endcode
2073
+ */
1631
2074
  class JSON_API CharReaderBuilder : public CharReader::Factory {
1632
2075
  public:
1633
2076
  // Note: We use a Json::Value so that we can add data-members to this class
1634
2077
  // without a major version bump.
1635
2078
  /** Configuration of this builder.
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
- */
2079
+ * These are case-sensitive.
2080
+ * Available settings (case-sensitive):
2081
+ * - `"collectComments": false or true`
2082
+ * - true to collect comment and allow writing them back during
2083
+ * serialization, false to discard comments. This parameter is ignored
2084
+ * if allowComments is false.
2085
+ * - `"allowComments": false or true`
2086
+ * - true if comments are allowed.
2087
+ * - `"allowTrailingCommas": false or true`
2088
+ * - true if trailing commas in objects and arrays are allowed.
2089
+ * - `"strictRoot": false or true`
2090
+ * - true if root must be either an array or an object value
2091
+ * - `"allowDroppedNullPlaceholders": false or true`
2092
+ * - true if dropped null placeholders are allowed. (See
2093
+ * StreamWriterBuilder.)
2094
+ * - `"allowNumericKeys": false or true`
2095
+ * - true if numeric object keys are allowed.
2096
+ * - `"allowSingleQuotes": false or true`
2097
+ * - true if '' are allowed for strings (both keys and values)
2098
+ * - `"stackLimit": integer`
2099
+ * - Exceeding stackLimit (recursive depth of `readValue()`) will cause an
2100
+ * exception.
2101
+ * - This is a security issue (seg-faults caused by deeply nested JSON), so
2102
+ * the default is low.
2103
+ * - `"failIfExtra": false or true`
2104
+ * - If true, `parse()` returns false when extra non-whitespace trails the
2105
+ * JSON value in the input string.
2106
+ * - `"rejectDupKeys": false or true`
2107
+ * - If true, `parse()` returns false when a key is duplicated within an
2108
+ * object.
2109
+ * - `"allowSpecialFloats": false or true`
2110
+ * - If true, special float values (NaNs and infinities) are allowed and
2111
+ * their values are lossfree restorable.
2112
+ * - `"skipBom": false or true`
2113
+ * - If true, if the input starts with the Unicode byte order mark (BOM),
2114
+ * it is skipped.
2115
+ *
2116
+ * You can examine 'settings_` yourself to see the defaults. You can also
2117
+ * write and read them just like any JSON Value.
2118
+ * \sa setDefaults()
2119
+ */
1671
2120
  Json::Value settings_;
1672
2121
 
1673
2122
  CharReaderBuilder();
1674
- ~CharReaderBuilder() JSONCPP_OVERRIDE;
2123
+ ~CharReaderBuilder() override;
1675
2124
 
1676
- CharReader* newCharReader() const JSONCPP_OVERRIDE;
2125
+ CharReader* newCharReader() const override;
1677
2126
 
1678
2127
  /** \return true if 'settings' are legal and consistent;
1679
2128
  * otherwise, indicate bad settings via 'invalid'.
@@ -1682,7 +2131,7 @@ public:
1682
2131
 
1683
2132
  /** A simple way to update a specific setting.
1684
2133
  */
1685
- Value& operator[](JSONCPP_STRING key);
2134
+ Value& operator[](const String& key);
1686
2135
 
1687
2136
  /** Called by ctor, but you can use this to reset settings_.
1688
2137
  * \pre 'settings' != NULL (but Json::null is fine)
@@ -1696,42 +2145,46 @@ public:
1696
2145
  * \snippet src/lib_json/json_reader.cpp CharReaderBuilderStrictMode
1697
2146
  */
1698
2147
  static void strictMode(Json::Value* settings);
2148
+ /** ECMA-404 mode.
2149
+ * \pre 'settings' != NULL (but Json::null is fine)
2150
+ * \remark Defaults:
2151
+ * \snippet src/lib_json/json_reader.cpp CharReaderBuilderECMA404Mode
2152
+ */
2153
+ static void ecma404Mode(Json::Value* settings);
1699
2154
  };
1700
2155
 
1701
2156
  /** Consume entire stream and use its begin/end.
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);
2157
+ * Someday we might have a real StreamReader, but for now this
2158
+ * is convenient.
2159
+ */
2160
+ bool JSON_API parseFromStream(CharReader::Factory const&, IStream&, Value* root,
2161
+ String* errs);
1709
2162
 
1710
2163
  /** \brief Read from 'sin' into 'root'.
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&);
2164
+ *
2165
+ * Always keep comments from the input JSON.
2166
+ *
2167
+ * This can be used to read a file into a particular sub-object.
2168
+ * For example:
2169
+ * \code
2170
+ * Json::Value root;
2171
+ * cin >> root["dir"]["file"];
2172
+ * cout << root;
2173
+ * \endcode
2174
+ * Result:
2175
+ * \verbatim
2176
+ * {
2177
+ * "dir": {
2178
+ * "file": {
2179
+ * // The input stream JSON would be nested here.
2180
+ * }
2181
+ * }
2182
+ * }
2183
+ * \endverbatim
2184
+ * \throw std::exception on parse error.
2185
+ * \see Json::operator<<()
2186
+ */
2187
+ JSON_API IStream& operator>>(IStream&, Value&);
1735
2188
 
1736
2189
  } // namespace Json
1737
2190
  } // namespace Passenger
@@ -1742,7 +2195,7 @@ JSON_API JSONCPP_ISTREAM& operator>>(JSONCPP_ISTREAM&, Value&);
1742
2195
  #pragma warning(pop)
1743
2196
  #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1744
2197
 
1745
- #endif // CPPTL_JSON_READER_H_INCLUDED
2198
+ #endif // JSON_READER_H_INCLUDED
1746
2199
 
1747
2200
  // //////////////////////////////////////////////////////////////////////
1748
2201
  // End of content of file: include/json/reader.h
@@ -1757,7 +2210,7 @@ JSON_API JSONCPP_ISTREAM& operator>>(JSONCPP_ISTREAM&, Value&);
1757
2210
  // Beginning of content of file: include/json/writer.h
1758
2211
  // //////////////////////////////////////////////////////////////////////
1759
2212
 
1760
- // Copyright 2007-2010 Baptiste Lepilleur
2213
+ // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
1761
2214
  // Distributed under MIT license, or public domain if desired and
1762
2215
  // recognized in your jurisdiction.
1763
2216
  // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
@@ -1768,18 +2221,19 @@ JSON_API JSONCPP_ISTREAM& operator>>(JSONCPP_ISTREAM&, Value&);
1768
2221
  #if !defined(JSON_IS_AMALGAMATION)
1769
2222
  #include "value.h"
1770
2223
  #endif // if !defined(JSON_IS_AMALGAMATION)
1771
- #include <vector>
1772
- #include <string>
1773
2224
  #include <ostream>
2225
+ #include <string>
2226
+ #include <vector>
1774
2227
 
1775
2228
  // Disable warning C4251: <data member>: <type> needs to have dll-interface to
1776
2229
  // be used by...
1777
- #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
2230
+ #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) && defined(_MSC_VER)
1778
2231
  #pragma warning(push)
1779
2232
  #pragma warning(disable : 4251)
1780
2233
  #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1781
2234
 
1782
- #pragma pack(push, 8)
2235
+ #pragma pack(push)
2236
+ #pragma pack()
1783
2237
 
1784
2238
  namespace Passenger {
1785
2239
  namespace Json {
@@ -1787,32 +2241,31 @@ namespace Json {
1787
2241
  class Value;
1788
2242
 
1789
2243
  /**
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
- */
2244
+ *
2245
+ * Usage:
2246
+ * \code
2247
+ * using namespace Json;
2248
+ * void writeToStdout(StreamWriter::Factory const& factory, Value const& value)
2249
+ * { std::unique_ptr<StreamWriter> const writer( factory.newStreamWriter());
2250
+ * writer->write(value, &std::cout);
2251
+ * std::cout << std::endl; // add lf and flush
2252
+ * }
2253
+ * \endcode
2254
+ */
1803
2255
  class JSON_API StreamWriter {
1804
2256
  protected:
1805
- JSONCPP_OSTREAM* sout_; // not owned; will not delete
2257
+ OStream* sout_; // not owned; will not delete
1806
2258
  public:
1807
2259
  StreamWriter();
1808
2260
  virtual ~StreamWriter();
1809
2261
  /** Write Value into document as configured in sub-class.
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
2262
+ * Do not take ownership of sout, but maintain a reference during function.
2263
+ * \pre sout != NULL
2264
+ * \return zero on success (For now, we always return zero, so check the
2265
+ * stream instead.) \throw std::exception possibly, depending on
2266
+ * configuration
1814
2267
  */
1815
- virtual int write(Value const& root, JSONCPP_OSTREAM* sout) = 0;
2268
+ virtual int write(Value const& root, OStream* sout) = 0;
1816
2269
 
1817
2270
  /** \brief A simple abstract factory.
1818
2271
  */
@@ -1823,65 +2276,71 @@ public:
1823
2276
  * \throw std::exception if something goes wrong (e.g. invalid settings)
1824
2277
  */
1825
2278
  virtual StreamWriter* newStreamWriter() const = 0;
1826
- }; // Factory
1827
- }; // StreamWriter
2279
+ }; // Factory
2280
+ }; // StreamWriter
1828
2281
 
1829
2282
  /** \brief Write into stringstream, then return string, for convenience.
1830
2283
  * A StreamWriter will be created from the factory, used, and then deleted.
1831
2284
  */
1832
- JSONCPP_STRING JSON_API writeString(StreamWriter::Factory const& factory, Value const& root);
1833
-
2285
+ String JSON_API writeString(StreamWriter::Factory const& factory,
2286
+ Value const& root);
1834
2287
 
1835
2288
  /** \brief Build a StreamWriter implementation.
1836
2289
 
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
2290
+ * Usage:
2291
+ * \code
2292
+ * using namespace Json;
2293
+ * Value value = ...;
2294
+ * StreamWriterBuilder builder;
2295
+ * builder["commentStyle"] = "None";
2296
+ * builder["indentation"] = " "; // or whatever you like
2297
+ * std::unique_ptr<Json::StreamWriter> writer(
2298
+ * builder.newStreamWriter());
2299
+ * writer->write(value, &std::cout);
2300
+ * std::cout << std::endl; // add lf and flush
2301
+ * \endcode
1850
2302
  */
1851
2303
  class JSON_API StreamWriterBuilder : public StreamWriter::Factory {
1852
2304
  public:
1853
2305
  // Note: We use a Json::Value so that we can add data-members to this class
1854
2306
  // without a major version bump.
1855
2307
  /** Configuration of this builder.
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
- */
2308
+ * Available settings (case-sensitive):
2309
+ * - "commentStyle": "None" or "All"
2310
+ * - "indentation": "<anything>".
2311
+ * - Setting this to an empty string also omits newline characters.
2312
+ * - "enableYAMLCompatibility": false or true
2313
+ * - slightly change the whitespace around colons
2314
+ * - "dropNullPlaceholders": false or true
2315
+ * - Drop the "null" string from the writer's output for nullValues.
2316
+ * Strictly speaking, this is not valid JSON. But when the output is being
2317
+ * fed to a browser's JavaScript, it makes for smaller output and the
2318
+ * browser can handle the output just fine.
2319
+ * - "useSpecialFloats": false or true
2320
+ * - If true, outputs non-finite floating point values in the following way:
2321
+ * NaN values as "NaN", positive infinity as "Infinity", and negative
2322
+ * infinity as "-Infinity".
2323
+ * - "precision": int
2324
+ * - Number of precision digits for formatting of real values.
2325
+ * - "precisionType": "significant"(default) or "decimal"
2326
+ * - Type of precision for formatting of real values.
2327
+ * - "emitUTF8": false or true
2328
+ * - If true, outputs raw UTF8 strings instead of escaping them.
2329
+
2330
+ * You can examine 'settings_` yourself
2331
+ * to see the defaults. You can also write and read them just like any
2332
+ * JSON Value.
2333
+ * \sa setDefaults()
2334
+ */
1876
2335
  Json::Value settings_;
1877
2336
 
1878
2337
  StreamWriterBuilder();
1879
- ~StreamWriterBuilder() JSONCPP_OVERRIDE;
2338
+ ~StreamWriterBuilder() override;
1880
2339
 
1881
2340
  /**
1882
2341
  * \throw std::exception if something goes wrong (e.g. invalid settings)
1883
2342
  */
1884
- StreamWriter* newStreamWriter() const JSONCPP_OVERRIDE;
2343
+ StreamWriter* newStreamWriter() const override;
1885
2344
 
1886
2345
  /** \return true if 'settings' are legal and consistent;
1887
2346
  * otherwise, indicate bad settings via 'invalid'.
@@ -1889,7 +2348,7 @@ public:
1889
2348
  bool validate(Json::Value* invalid) const;
1890
2349
  /** A simple way to update a specific setting.
1891
2350
  */
1892
- Value& operator[](JSONCPP_STRING key);
2351
+ Value& operator[](const String& key);
1893
2352
 
1894
2353
  /** Called by ctor, but you can use this to reset settings_.
1895
2354
  * \pre 'settings' != NULL (but Json::null is fine)
@@ -1906,7 +2365,7 @@ class JSON_API Writer {
1906
2365
  public:
1907
2366
  virtual ~Writer();
1908
2367
 
1909
- virtual JSONCPP_STRING write(const Value& root) = 0;
2368
+ virtual String write(const Value& root) = 0;
1910
2369
  };
1911
2370
 
1912
2371
  /** \brief Outputs a Value in <a HREF="http://www.json.org">JSON</a> format
@@ -1914,21 +2373,24 @@ public:
1914
2373
  *
1915
2374
  * The JSON document is written in a single line. It is not intended for 'human'
1916
2375
  *consumption,
1917
- * but may be usefull to support feature such as RPC where bandwith is limited.
2376
+ * but may be useful to support feature such as RPC where bandwidth is limited.
1918
2377
  * \sa Reader, Value
1919
2378
  * \deprecated Use StreamWriterBuilder.
1920
2379
  */
2380
+ #if defined(_MSC_VER)
2381
+ #pragma warning(push)
2382
+ #pragma warning(disable : 4996) // Deriving from deprecated class
2383
+ #endif
1921
2384
  class JSON_API FastWriter : public Writer {
1922
-
1923
2385
  public:
1924
2386
  FastWriter();
1925
- ~FastWriter() JSONCPP_OVERRIDE {}
2387
+ ~FastWriter() override = default;
1926
2388
 
1927
2389
  void enableYAMLCompatibility();
1928
2390
 
1929
2391
  /** \brief Drop the "null" string from the writer's output for nullValues.
1930
2392
  * Strictly speaking, this is not valid JSON. But when the output is being
1931
- * fed to a browser's Javascript, it makes for smaller output and the
2393
+ * fed to a browser's JavaScript, it makes for smaller output and the
1932
2394
  * browser can handle the output just fine.
1933
2395
  */
1934
2396
  void dropNullPlaceholders();
@@ -1936,16 +2398,19 @@ public:
1936
2398
  void omitEndingLineFeed();
1937
2399
 
1938
2400
  public: // overridden from Writer
1939
- JSONCPP_STRING write(const Value& root) JSONCPP_OVERRIDE;
2401
+ String write(const Value& root) override;
1940
2402
 
1941
2403
  private:
1942
2404
  void writeValue(const Value& value);
1943
2405
 
1944
- JSONCPP_STRING document_;
1945
- bool yamlCompatiblityEnabled_;
1946
- bool dropNullPlaceholders_;
1947
- bool omitEndingLineFeed_;
2406
+ String document_;
2407
+ bool yamlCompatibilityEnabled_{false};
2408
+ bool dropNullPlaceholders_{false};
2409
+ bool omitEndingLineFeed_{false};
1948
2410
  };
2411
+ #if defined(_MSC_VER)
2412
+ #pragma warning(pop)
2413
+ #endif
1949
2414
 
1950
2415
  /** \brief Writes a Value in <a HREF="http://www.json.org">JSON</a> format in a
1951
2416
  *human friendly way.
@@ -1965,47 +2430,54 @@ private:
1965
2430
  * - otherwise, it the values do not fit on one line, or the array contains
1966
2431
  * object or non empty array, then print one value per line.
1967
2432
  *
1968
- * If the Value have comments then they are outputed according to their
2433
+ * If the Value have comments then they are outputted according to their
1969
2434
  *#CommentPlacement.
1970
2435
  *
1971
2436
  * \sa Reader, Value, Value::setComment()
1972
2437
  * \deprecated Use StreamWriterBuilder.
1973
2438
  */
2439
+ #if defined(_MSC_VER)
2440
+ #pragma warning(push)
2441
+ #pragma warning(disable : 4996) // Deriving from deprecated class
2442
+ #endif
1974
2443
  class JSON_API StyledWriter : public Writer {
1975
2444
  public:
1976
2445
  StyledWriter();
1977
- ~StyledWriter() JSONCPP_OVERRIDE {}
2446
+ ~StyledWriter() override = default;
1978
2447
 
1979
2448
  public: // overridden from Writer
1980
2449
  /** \brief Serialize a Value in <a HREF="http://www.json.org">JSON</a> format.
1981
2450
  * \param root Value to serialize.
1982
2451
  * \return String containing the JSON document that represents the root value.
1983
2452
  */
1984
- JSONCPP_STRING write(const Value& root) JSONCPP_OVERRIDE;
2453
+ String write(const Value& root) override;
1985
2454
 
1986
2455
  private:
1987
2456
  void writeValue(const Value& value);
1988
2457
  void writeArrayValue(const Value& value);
1989
- bool isMultineArray(const Value& value);
1990
- void pushValue(const JSONCPP_STRING& value);
2458
+ bool isMultilineArray(const Value& value);
2459
+ void pushValue(const String& value);
1991
2460
  void writeIndent();
1992
- void writeWithIndent(const JSONCPP_STRING& value);
2461
+ void writeWithIndent(const String& value);
1993
2462
  void indent();
1994
2463
  void unindent();
1995
2464
  void writeCommentBeforeValue(const Value& root);
1996
2465
  void writeCommentAfterValueOnSameLine(const Value& root);
1997
- bool hasCommentForValue(const Value& value);
1998
- static JSONCPP_STRING normalizeEOL(const JSONCPP_STRING& text);
2466
+ static bool hasCommentForValue(const Value& value);
2467
+ static String normalizeEOL(const String& text);
1999
2468
 
2000
- typedef std::vector<JSONCPP_STRING> ChildValues;
2469
+ using ChildValues = std::vector<String>;
2001
2470
 
2002
2471
  ChildValues childValues_;
2003
- JSONCPP_STRING document_;
2004
- JSONCPP_STRING indentString_;
2005
- unsigned int rightMargin_;
2006
- unsigned int indentSize_;
2007
- bool addChildValues_;
2472
+ String document_;
2473
+ String indentString_;
2474
+ unsigned int rightMargin_{74};
2475
+ unsigned int indentSize_{3};
2476
+ bool addChildValues_{false};
2008
2477
  };
2478
+ #if defined(_MSC_VER)
2479
+ #pragma warning(pop)
2480
+ #endif
2009
2481
 
2010
2482
  /** \brief Writes a Value in <a HREF="http://www.json.org">JSON</a> format in a
2011
2483
  human friendly way,
@@ -2026,17 +2498,23 @@ private:
2026
2498
  * - otherwise, it the values do not fit on one line, or the array contains
2027
2499
  * object or non empty array, then print one value per line.
2028
2500
  *
2029
- * If the Value have comments then they are outputed according to their
2501
+ * If the Value have comments then they are outputted according to their
2030
2502
  #CommentPlacement.
2031
2503
  *
2032
- * \param indentation Each level will be indented by this amount extra.
2033
2504
  * \sa Reader, Value, Value::setComment()
2034
2505
  * \deprecated Use StreamWriterBuilder.
2035
2506
  */
2507
+ #if defined(_MSC_VER)
2508
+ #pragma warning(push)
2509
+ #pragma warning(disable : 4996) // Deriving from deprecated class
2510
+ #endif
2036
2511
  class JSON_API StyledStreamWriter {
2037
2512
  public:
2038
- StyledStreamWriter(JSONCPP_STRING indentation = "\t");
2039
- ~StyledStreamWriter() {}
2513
+ /**
2514
+ * \param indentation Each level will be indented by this amount extra.
2515
+ */
2516
+ StyledStreamWriter(String indentation = "\t");
2517
+ ~StyledStreamWriter() = default;
2040
2518
 
2041
2519
  public:
2042
2520
  /** \brief Serialize a Value in <a HREF="http://www.json.org">JSON</a> format.
@@ -2045,46 +2523,52 @@ public:
2045
2523
  * \note There is no point in deriving from Writer, since write() should not
2046
2524
  * return a value.
2047
2525
  */
2048
- void write(JSONCPP_OSTREAM& out, const Value& root);
2526
+ void write(OStream& out, const Value& root);
2049
2527
 
2050
2528
  private:
2051
2529
  void writeValue(const Value& value);
2052
2530
  void writeArrayValue(const Value& value);
2053
- bool isMultineArray(const Value& value);
2054
- void pushValue(const JSONCPP_STRING& value);
2531
+ bool isMultilineArray(const Value& value);
2532
+ void pushValue(const String& value);
2055
2533
  void writeIndent();
2056
- void writeWithIndent(const JSONCPP_STRING& value);
2534
+ void writeWithIndent(const String& value);
2057
2535
  void indent();
2058
2536
  void unindent();
2059
2537
  void writeCommentBeforeValue(const Value& root);
2060
2538
  void writeCommentAfterValueOnSameLine(const Value& root);
2061
- bool hasCommentForValue(const Value& value);
2062
- static JSONCPP_STRING normalizeEOL(const JSONCPP_STRING& text);
2539
+ static bool hasCommentForValue(const Value& value);
2540
+ static String normalizeEOL(const String& text);
2063
2541
 
2064
- typedef std::vector<JSONCPP_STRING> ChildValues;
2542
+ using ChildValues = std::vector<String>;
2065
2543
 
2066
2544
  ChildValues childValues_;
2067
- JSONCPP_OSTREAM* document_;
2068
- JSONCPP_STRING indentString_;
2069
- unsigned int rightMargin_;
2070
- JSONCPP_STRING indentation_;
2545
+ OStream* document_;
2546
+ String indentString_;
2547
+ unsigned int rightMargin_{74};
2548
+ String indentation_;
2071
2549
  bool addChildValues_ : 1;
2072
2550
  bool indented_ : 1;
2073
2551
  };
2552
+ #if defined(_MSC_VER)
2553
+ #pragma warning(pop)
2554
+ #endif
2074
2555
 
2075
2556
  #if defined(JSON_HAS_INT64)
2076
- JSONCPP_STRING JSON_API valueToString(Int value);
2077
- JSONCPP_STRING JSON_API valueToString(UInt value);
2557
+ String JSON_API valueToString(Int value);
2558
+ String JSON_API valueToString(UInt value);
2078
2559
  #endif // if defined(JSON_HAS_INT64)
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);
2560
+ String JSON_API valueToString(LargestInt value);
2561
+ String JSON_API valueToString(LargestUInt value);
2562
+ String JSON_API valueToString(
2563
+ double value, unsigned int precision = Value::defaultRealPrecision,
2564
+ PrecisionType precisionType = PrecisionType::significantDigits);
2565
+ String JSON_API valueToString(bool value);
2566
+ String JSON_API valueToQuotedString(const char* value);
2567
+ String JSON_API valueToQuotedString(const char* value, size_t length);
2084
2568
 
2085
2569
  /// \brief Output using the StyledStreamWriter.
2086
2570
  /// \see Json::operator>>()
2087
- JSON_API JSONCPP_OSTREAM& operator<<(JSONCPP_OSTREAM&, const Value& root);
2571
+ JSON_API OStream& operator<<(OStream&, const Value& root);
2088
2572
 
2089
2573
  } // namespace Json
2090
2574
  } // namespace Passenger
@@ -2110,15 +2594,15 @@ JSON_API JSONCPP_OSTREAM& operator<<(JSONCPP_OSTREAM&, const Value& root);
2110
2594
  // Beginning of content of file: include/json/assertions.h
2111
2595
  // //////////////////////////////////////////////////////////////////////
2112
2596
 
2113
- // Copyright 2007-2010 Baptiste Lepilleur
2597
+ // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
2114
2598
  // Distributed under MIT license, or public domain if desired and
2115
2599
  // recognized in your jurisdiction.
2116
2600
  // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
2117
2601
 
2118
- #ifndef CPPTL_JSON_ASSERTIONS_H_INCLUDED
2119
- #define CPPTL_JSON_ASSERTIONS_H_INCLUDED
2602
+ #ifndef JSON_ASSERTIONS_H_INCLUDED
2603
+ #define JSON_ASSERTIONS_H_INCLUDED
2120
2604
 
2121
- #include <stdlib.h>
2605
+ #include <cstdlib>
2122
2606
  #include <sstream>
2123
2607
 
2124
2608
  #if !defined(JSON_IS_AMALGAMATION)
@@ -2132,38 +2616,45 @@ JSON_API JSONCPP_OSTREAM& operator<<(JSONCPP_OSTREAM&, const Value& root);
2132
2616
  #if JSON_USE_EXCEPTION
2133
2617
 
2134
2618
  // @todo <= add detail about condition in exception
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; \
2619
+ #define JSON_ASSERT(condition) \
2620
+ do { \
2621
+ if (!(condition)) { \
2622
+ Json::throwLogicError("assert json failed"); \
2623
+ } \
2624
+ } while (0)
2625
+
2626
+ #define JSON_FAIL_MESSAGE(message) \
2627
+ do { \
2628
+ OStringStream oss; \
2629
+ oss << message; \
2141
2630
  Json::throwLogicError(oss.str()); \
2142
2631
  abort(); \
2143
- }
2632
+ } while (0)
2144
2633
 
2145
2634
  #else // JSON_USE_EXCEPTION
2146
2635
 
2147
- # define JSON_ASSERT(condition) assert(condition)
2636
+ #define JSON_ASSERT(condition) assert(condition)
2148
2637
 
2149
2638
  // The call to assert() will show the failure message in debug builds. In
2150
2639
  // release builds we abort, for a core-dump or debugger.
2151
- # define JSON_FAIL_MESSAGE(message) \
2640
+ #define JSON_FAIL_MESSAGE(message) \
2152
2641
  { \
2153
- JSONCPP_OSTRINGSTREAM oss; oss << message; \
2642
+ OStringStream oss; \
2643
+ oss << message; \
2154
2644
  assert(false && oss.str().c_str()); \
2155
2645
  abort(); \
2156
2646
  }
2157
2647
 
2158
-
2159
2648
  #endif
2160
2649
 
2161
2650
  #define JSON_ASSERT_MESSAGE(condition, message) \
2162
- if (!(condition)) { \
2163
- JSON_FAIL_MESSAGE(message); \
2164
- }
2651
+ do { \
2652
+ if (!(condition)) { \
2653
+ JSON_FAIL_MESSAGE(message); \
2654
+ } \
2655
+ } while (0)
2165
2656
 
2166
- #endif // CPPTL_JSON_ASSERTIONS_H_INCLUDED
2657
+ #endif // JSON_ASSERTIONS_H_INCLUDED
2167
2658
 
2168
2659
  // //////////////////////////////////////////////////////////////////////
2169
2660
  // End of content of file: include/json/assertions.h
@@ -2173,4 +2664,4 @@ JSON_API JSONCPP_OSTREAM& operator<<(JSONCPP_OSTREAM&, const Value& root);
2173
2664
 
2174
2665
 
2175
2666
 
2176
- #endif //ifndef JSON_AMALGATED_H_INCLUDED
2667
+ #endif //ifndef JSON_AMALGAMATED_H_INCLUDED