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.
- checksums.yaml +4 -4
- data/CHANGELOG +69 -15
- data/CONTRIBUTING.md +7 -311
- data/CONTRIBUTORS +1 -0
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/Rakefile +1 -1
- data/bin/passenger +1 -1
- data/bin/passenger-config +1 -1
- data/bin/passenger-install-apache2-module +1 -1
- data/bin/passenger-install-nginx-module +4 -9
- data/bin/passenger-memory-stats +1 -1
- data/bin/passenger-status +1 -1
- data/build/agent.rb +13 -15
- data/build/apache2.rb +13 -16
- data/build/basics.rb +10 -13
- data/build/common_library.rb +5 -9
- data/build/cxx_tests.rb +39 -12
- data/build/integration_tests.rb +5 -2
- data/build/misc.rb +1 -1
- data/build/nginx.rb +1 -1
- data/build/node_tests.rb +1 -1
- data/build/oxt_tests.rb +6 -8
- data/build/packaging.rb +1 -1
- data/build/ruby_extension.rb +1 -1
- data/build/ruby_tests.rb +1 -1
- data/build/schema_printer.rb +13 -15
- data/build/support/cplusplus.rb +61 -69
- data/build/support/cxx_dependency_map.rb +5 -64
- data/build/support/general.rb +1 -1
- data/build/support/vendor/cxx_hinted_parser/LICENSE.md +1 -1
- data/build/support/vendor/cxx_hinted_parser/lib/cxx_hinted_parser/parser.rb +1 -1
- data/build/support/vendor/cxx_hinted_parser/lib/cxx_hinted_parser.rb +1 -1
- data/build/support/vendor/cxxcodebuilder/LICENSE.md +1 -1
- data/build/support/vendor/cxxcodebuilder/lib/cxxcodebuilder/builder.rb +1 -1
- data/build/support/vendor/cxxcodebuilder/lib/cxxcodebuilder/initializer_builder.rb +1 -1
- data/build/support/vendor/cxxcodebuilder/lib/cxxcodebuilder.rb +1 -1
- data/build/test_basics.rb +1 -1
- data/dev/copy_boost_headers +1 -1
- data/dev/index_cxx_dependencies.rb +5 -1
- data/dev/libev-changes.patch +108 -0
- data/dev/nginx_version_sha256 +1 -1
- data/dev/ruby_server.rb +1 -6
- data/dev/upgrading_libuv.sh +16 -0
- data/doc/BasicArchitectureOverview.md +55 -0
- data/doc/BuildCaching.md +23 -0
- data/doc/BuildSystem.md +49 -0
- data/doc/DebuggingAndStressTesting.md +2 -0
- data/doc/DesignAspects/LimitedGemDependencies.md +1 -0
- data/doc/DevEnvironmentSetup.md +46 -0
- data/doc/DevHandbook.md +28 -0
- data/doc/Packaging.md +1 -1
- data/doc/RunningTests.md +88 -0
- data/doc/{TempFileHandling.md → SecureTempFileHandling.md} +1 -1
- data/doc/{CxxTestingGuide.md → WritingCxxTests.md} +1 -20
- data/src/agent/AgentMain.cpp +1 -1
- data/src/agent/Core/ApiServer.h +1 -1
- data/src/agent/Core/ApplicationPool/AbstractSession.h +1 -1
- data/src/agent/Core/ApplicationPool/BasicGroupInfo.h +1 -1
- data/src/agent/Core/ApplicationPool/BasicProcessInfo.h +1 -1
- data/src/agent/Core/ApplicationPool/Common.h +1 -1
- data/src/agent/Core/ApplicationPool/Context.h +1 -1
- data/src/agent/Core/ApplicationPool/Group/InitializationAndShutdown.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Group/InternalUtils.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Group/LifetimeAndBasics.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Group/Miscellaneous.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Group/OutOfBandWork.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Group/ProcessListManagement.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Group/SessionManagement.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Group/SpawningAndRestarting.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Group/StateInspection.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Group/Verification.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Group.h +1 -1
- data/src/agent/Core/ApplicationPool/Implementation.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Options.h +1 -1
- data/src/agent/Core/ApplicationPool/Pool/AnalyticsCollection.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Pool/GarbageCollection.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Pool/GeneralUtils.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Pool/GroupUtils.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Pool/InitializationAndShutdown.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Pool/Miscellaneous.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Pool/ProcessUtils.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Pool/StateInspection.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Pool.h +1 -1
- data/src/agent/Core/ApplicationPool/Process.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Process.h +1 -1
- data/src/agent/Core/ApplicationPool/Session.h +1 -1
- data/src/agent/Core/ApplicationPool/Socket.h +1 -1
- data/src/agent/Core/ApplicationPool/TestSession.h +1 -1
- data/src/agent/Core/Config.h +3 -2
- data/src/agent/Core/ConfigChange.cpp +1 -1
- data/src/agent/Core/ConfigChange.h +1 -1
- data/src/agent/Core/Controller/AppResponse.h +1 -1
- data/src/agent/Core/Controller/BufferBody.cpp +1 -1
- data/src/agent/Core/Controller/CheckoutSession.cpp +8 -5
- data/src/agent/Core/Controller/Client.h +1 -1
- data/src/agent/Core/Controller/Config.cpp +1 -1
- data/src/agent/Core/Controller/Config.h +2 -2
- data/src/agent/Core/Controller/ForwardResponse.cpp +2 -2
- data/src/agent/Core/Controller/Hooks.cpp +12 -9
- data/src/agent/Core/Controller/Implementation.cpp +1 -1
- data/src/agent/Core/Controller/InitRequest.cpp +1 -1
- data/src/agent/Core/Controller/InitializationAndShutdown.cpp +1 -1
- data/src/agent/Core/Controller/InternalUtils.cpp +1 -1
- data/src/agent/Core/Controller/Miscellaneous.cpp +1 -1
- data/src/agent/Core/Controller/Request.h +1 -1
- data/src/agent/Core/Controller/SendRequest.cpp +1 -1
- data/src/agent/Core/Controller/StateInspection.cpp +1 -1
- data/src/agent/Core/Controller/TurboCaching.h +1 -1
- data/src/agent/Core/Controller.h +1 -1
- data/src/agent/Core/CoreMain.cpp +1 -1
- data/src/agent/Core/OptionParser.h +1 -1
- data/src/agent/Core/ResponseCache.h +1 -1
- data/src/agent/Core/SecurityUpdateChecker.h +1 -1
- data/src/agent/Core/SpawningKit/Config/AutoGeneratedCode.h +1 -1
- data/src/agent/Core/SpawningKit/Config/AutoGeneratedCode.h.cxxcodebuilder +1 -1
- data/src/agent/Core/SpawningKit/Config.h +1 -1
- data/src/agent/Core/SpawningKit/Context.h +1 -1
- data/src/agent/Core/SpawningKit/DirectSpawner.h +1 -1
- data/src/agent/Core/SpawningKit/DummySpawner.h +1 -1
- data/src/agent/Core/SpawningKit/ErrorRenderer.h +1 -1
- data/src/agent/Core/SpawningKit/Exceptions.h +63 -2
- data/src/agent/Core/SpawningKit/Factory.h +1 -1
- data/src/agent/Core/SpawningKit/Handshake/BackgroundIOCapturer.h +1 -1
- data/src/agent/Core/SpawningKit/Handshake/Perform.h +3 -2
- data/src/agent/Core/SpawningKit/Handshake/Prepare.h +1 -1
- data/src/agent/Core/SpawningKit/Handshake/Session.h +1 -1
- data/src/agent/Core/SpawningKit/Handshake/WorkDir.h +1 -1
- data/src/agent/Core/SpawningKit/Journey.h +1 -1
- data/src/agent/Core/SpawningKit/PipeWatcher.h +1 -1
- data/src/agent/Core/SpawningKit/README.md +3 -3
- data/src/agent/Core/SpawningKit/Result/AutoGeneratedCode.h +1 -1
- data/src/agent/Core/SpawningKit/Result/AutoGeneratedCode.h.cxxcodebuilder +1 -1
- data/src/agent/Core/SpawningKit/Result.h +1 -1
- data/src/agent/Core/SpawningKit/SmartSpawner.h +17 -17
- data/src/agent/Core/SpawningKit/Spawner.h +1 -1
- data/src/agent/Core/SpawningKit/UserSwitchingRules.h +1 -1
- data/src/agent/Core/TelemetryCollector.h +1 -1
- data/src/agent/ExecHelper/ExecHelperMain.cpp +1 -1
- data/src/agent/FileReadHelper/FileReadHelperMain.cpp +1 -1
- data/src/agent/MainFunctions.h +1 -1
- data/src/agent/Shared/ApiAccountUtils.h +4 -3
- data/src/agent/Shared/ApiServerUtils.h +2 -3
- data/src/agent/Shared/ApplicationPoolApiKey.h +1 -1
- data/src/agent/Shared/Fundamentals/AbortHandler.cpp +1 -1
- data/src/agent/Shared/Fundamentals/AbortHandler.h +1 -1
- data/src/agent/Shared/Fundamentals/Initialization.cpp +1 -1
- data/src/agent/Shared/Fundamentals/Initialization.h +1 -1
- data/src/agent/Shared/Fundamentals/Utils.cpp +1 -1
- data/src/agent/Shared/Fundamentals/Utils.h +1 -1
- data/src/agent/SpawnEnvSetupper/SpawnEnvSetupperMain.cpp +1 -1
- data/src/agent/SystemMetrics/SystemMetricsMain.cpp +1 -1
- data/src/agent/TempDirToucher/TempDirToucherMain.cpp +1 -1
- data/src/agent/Watchdog/ApiServer.h +7 -6
- data/src/agent/Watchdog/Config.h +2 -2
- data/src/apache2_module/Bucket.cpp +1 -1
- data/src/apache2_module/Bucket.h +1 -1
- data/src/apache2_module/CBindings.cpp +1 -1
- data/src/apache2_module/Config.cpp +1 -1
- data/src/apache2_module/Config.h +1 -1
- data/src/apache2_module/ConfigGeneral/AutoGeneratedDefinitions.cpp +104 -104
- data/src/apache2_module/ConfigGeneral/AutoGeneratedDefinitions.cpp.cxxcodebuilder +2 -2
- data/src/apache2_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.cpp +1 -1
- data/src/apache2_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.cpp.cxxcodebuilder +1 -1
- data/src/apache2_module/ConfigGeneral/AutoGeneratedSetterFuncs.cpp +1 -1
- data/src/apache2_module/ConfigGeneral/AutoGeneratedSetterFuncs.cpp.cxxcodebuilder +1 -1
- data/src/apache2_module/ConfigGeneral/Common.h +1 -1
- data/src/apache2_module/ConfigGeneral/ManifestGeneration.h +1 -1
- data/src/apache2_module/ConfigGeneral/SetterFuncs.h +1 -1
- data/src/apache2_module/DirConfig/AutoGeneratedCreateFunction.cpp +1 -1
- data/src/apache2_module/DirConfig/AutoGeneratedCreateFunction.cpp.cxxcodebuilder +1 -1
- data/src/apache2_module/DirConfig/AutoGeneratedHeaderSerialization.cpp +1 -1
- data/src/apache2_module/DirConfig/AutoGeneratedHeaderSerialization.cpp.cxxcodebuilder +1 -1
- data/src/apache2_module/DirConfig/AutoGeneratedManifestGeneration.cpp +1 -1
- data/src/apache2_module/DirConfig/AutoGeneratedManifestGeneration.cpp.cxxcodebuilder +1 -1
- data/src/apache2_module/DirConfig/AutoGeneratedMergeFunction.cpp +1 -1
- data/src/apache2_module/DirConfig/AutoGeneratedMergeFunction.cpp.cxxcodebuilder +1 -1
- data/src/apache2_module/DirConfig/AutoGeneratedStruct.h +1 -1
- data/src/apache2_module/DirConfig/AutoGeneratedStruct.h.cxxcodebuilder +1 -1
- data/src/apache2_module/DirectoryMapper.h +1 -1
- data/src/apache2_module/Hooks.cpp +21 -2
- data/src/apache2_module/Hooks.h +1 -1
- data/src/apache2_module/ServerConfig/AutoGeneratedManifestGeneration.cpp +1 -1
- data/src/apache2_module/ServerConfig/AutoGeneratedManifestGeneration.cpp.cxxcodebuilder +1 -1
- data/src/apache2_module/ServerConfig/AutoGeneratedStruct.h +1 -1
- data/src/apache2_module/ServerConfig/AutoGeneratedStruct.h.cxxcodebuilder +1 -1
- data/src/apache2_module/Utils.h +15 -1
- data/src/apache2_module/mod_passenger.c +1 -1
- data/src/cxx_supportlib/Algorithms/Hasher.cpp +1 -1
- data/src/cxx_supportlib/Algorithms/Hasher.h +1 -1
- data/src/cxx_supportlib/Algorithms/MovingAverage.h +1 -1
- data/src/cxx_supportlib/AppLocalConfigFileUtils.h +1 -1
- data/src/cxx_supportlib/AppTypeDetector/CBindings.cpp +1 -1
- data/src/cxx_supportlib/AppTypeDetector/CBindings.h +1 -1
- data/src/cxx_supportlib/AppTypeDetector/Detector.h +1 -1
- data/src/cxx_supportlib/BackgroundEventLoop.cpp +1 -1
- data/src/cxx_supportlib/BackgroundEventLoop.h +1 -1
- data/src/cxx_supportlib/ConfigKit/AsyncUtils.h +1 -1
- data/src/cxx_supportlib/ConfigKit/Common.h +1 -1
- data/src/cxx_supportlib/ConfigKit/ConfigKit.h +1 -1
- data/src/cxx_supportlib/ConfigKit/DummyTranslator.h +1 -1
- data/src/cxx_supportlib/ConfigKit/IN_PRACTICE.md +1 -3
- data/src/cxx_supportlib/ConfigKit/PrefixTranslator.h +3 -3
- data/src/cxx_supportlib/ConfigKit/Schema.h +1 -1
- data/src/cxx_supportlib/ConfigKit/SchemaUtils.h +1 -1
- data/src/cxx_supportlib/ConfigKit/Store.h +1 -1
- data/src/cxx_supportlib/ConfigKit/SubComponentUtils.h +1 -1
- data/src/cxx_supportlib/ConfigKit/TableTranslator.h +1 -1
- data/src/cxx_supportlib/ConfigKit/Translator.h +1 -1
- data/src/cxx_supportlib/ConfigKit/Utils.h +1 -1
- data/src/cxx_supportlib/Constants.h +2 -2
- data/src/cxx_supportlib/Constants.h.cxxcodebuilder +1 -1
- data/src/cxx_supportlib/DataStructures/HashedStaticString.h +1 -1
- data/src/cxx_supportlib/DataStructures/LString.cpp +1 -1
- data/src/cxx_supportlib/DataStructures/LString.h +1 -1
- data/src/cxx_supportlib/DataStructures/StringKeyTable.h +1 -1
- data/src/cxx_supportlib/DataStructures/StringMap.h +1 -1
- data/src/cxx_supportlib/Exceptions.cpp +1 -1
- data/src/cxx_supportlib/Exceptions.h +1 -1
- data/src/cxx_supportlib/FileDescriptor.h +1 -1
- data/src/cxx_supportlib/FileTools/FileManip.cpp +28 -4
- data/src/cxx_supportlib/FileTools/FileManip.h +1 -1
- data/src/cxx_supportlib/FileTools/PathManip.cpp +1 -1
- data/src/cxx_supportlib/FileTools/PathManip.h +1 -1
- data/src/cxx_supportlib/FileTools/PathManipCBindings.cpp +1 -1
- data/src/cxx_supportlib/FileTools/PathManipCBindings.h +1 -1
- data/src/cxx_supportlib/FileTools/PathSecurityCheck.cpp +1 -1
- data/src/cxx_supportlib/FileTools/PathSecurityCheck.h +1 -1
- data/src/cxx_supportlib/Hooks.h +1 -1
- data/src/cxx_supportlib/IOTools/BufferedIO.h +1 -1
- data/src/cxx_supportlib/IOTools/IOUtils.cpp +10 -10
- data/src/cxx_supportlib/IOTools/IOUtils.h +1 -1
- data/src/cxx_supportlib/IOTools/MessageIO.h +1 -1
- data/src/cxx_supportlib/IOTools/MessageSerialization.h +1 -1
- data/src/cxx_supportlib/InstanceDirectory.h +31 -4
- data/src/cxx_supportlib/Integrations/LibevJsonUtils.h +1 -1
- data/src/cxx_supportlib/JsonTools/Autocast.h +1 -1
- data/src/cxx_supportlib/JsonTools/CBindings.cpp +1 -1
- data/src/cxx_supportlib/JsonTools/CBindings.h +1 -1
- data/src/cxx_supportlib/JsonTools/JsonUtils.h +1 -1
- data/src/cxx_supportlib/LoggingKit/Assert.h +1 -1
- data/src/cxx_supportlib/LoggingKit/Config.h +2 -1
- data/src/cxx_supportlib/LoggingKit/Context.h +1 -1
- data/src/cxx_supportlib/LoggingKit/Forward.h +1 -1
- data/src/cxx_supportlib/LoggingKit/Implementation.cpp +11 -1
- data/src/cxx_supportlib/LoggingKit/Logging.h +1 -1
- data/src/cxx_supportlib/LoggingKit/LoggingKit.h +1 -1
- data/src/cxx_supportlib/LveLoggingDecorator.h +1 -1
- data/src/cxx_supportlib/MemoryKit/mbuf.cpp +1 -1
- data/src/cxx_supportlib/MemoryKit/mbuf.h +1 -1
- data/src/cxx_supportlib/MemoryKit/palloc.cpp +1 -1
- data/src/cxx_supportlib/MemoryKit/palloc.h +1 -1
- data/src/cxx_supportlib/ProcessManagement/Ruby.cpp +1 -1
- data/src/cxx_supportlib/ProcessManagement/Ruby.h +1 -1
- data/src/cxx_supportlib/ProcessManagement/Spawn.cpp +1 -1
- data/src/cxx_supportlib/ProcessManagement/Spawn.h +1 -1
- data/src/cxx_supportlib/ProcessManagement/Utils.cpp +1 -1
- data/src/cxx_supportlib/ProcessManagement/Utils.h +1 -1
- data/src/cxx_supportlib/RandomGenerator.h +1 -1
- data/src/cxx_supportlib/ResourceLocator.h +1 -1
- data/src/cxx_supportlib/SafeLibev.h +1 -1
- data/src/cxx_supportlib/SecurityKit/Crypto.cpp +9 -27
- data/src/cxx_supportlib/SecurityKit/Crypto.h +2 -2
- data/src/cxx_supportlib/SecurityKit/MemZeroGuard.h +1 -1
- data/src/cxx_supportlib/ServerKit/AcceptLoadBalancer.h +1 -1
- data/src/cxx_supportlib/ServerKit/Channel.h +1 -1
- data/src/cxx_supportlib/ServerKit/Client.h +1 -1
- data/src/cxx_supportlib/ServerKit/ClientRef.h +1 -1
- data/src/cxx_supportlib/ServerKit/Config.h +1 -1
- data/src/cxx_supportlib/ServerKit/Context.h +1 -1
- data/src/cxx_supportlib/ServerKit/CookieUtils.h +1 -1
- data/src/cxx_supportlib/ServerKit/Errors.h +2 -2
- data/src/cxx_supportlib/ServerKit/FdSinkChannel.h +1 -1
- data/src/cxx_supportlib/ServerKit/FdSourceChannel.h +1 -1
- data/src/cxx_supportlib/ServerKit/FileBufferedChannel.h +54 -2
- data/src/cxx_supportlib/ServerKit/FileBufferedFdSinkChannel.h +1 -1
- data/src/cxx_supportlib/ServerKit/HeaderTable.h +1 -1
- data/src/cxx_supportlib/ServerKit/Hooks.h +1 -1
- data/src/cxx_supportlib/ServerKit/HttpChunkedBodyParser.h +1 -1
- data/src/cxx_supportlib/ServerKit/HttpChunkedBodyParserState.h +1 -1
- data/src/cxx_supportlib/ServerKit/HttpClient.h +1 -1
- data/src/cxx_supportlib/ServerKit/HttpHeaderParser.h +2 -2
- data/src/cxx_supportlib/ServerKit/HttpHeaderParserState.h +2 -2
- data/src/cxx_supportlib/ServerKit/HttpRequest.h +2 -2
- data/src/cxx_supportlib/ServerKit/HttpRequestRef.h +1 -1
- data/src/cxx_supportlib/ServerKit/HttpServer.h +1 -1
- data/src/cxx_supportlib/ServerKit/Implementation.cpp +1 -1
- data/src/cxx_supportlib/ServerKit/Server.h +4 -2
- data/src/cxx_supportlib/ServerKit/llerrors.h +3 -3
- data/src/cxx_supportlib/ServerKit/llversion.h +1 -1
- data/src/cxx_supportlib/StaticString.h +1 -1
- data/src/cxx_supportlib/StrIntTools/DateParsing.h +1 -1
- data/src/cxx_supportlib/StrIntTools/StrIntUtils.cpp +1 -1
- data/src/cxx_supportlib/StrIntTools/StrIntUtils.h +1 -1
- data/src/cxx_supportlib/StrIntTools/StrIntUtilsNoStrictAliasing.cpp +1 -1
- data/src/cxx_supportlib/StrIntTools/StringScanning.h +1 -1
- data/src/cxx_supportlib/StrIntTools/Template.h +1 -1
- data/src/cxx_supportlib/SystemTools/ContainerHelpers.h +1 -1
- data/src/cxx_supportlib/SystemTools/ProcessMetricsCollector.h +1 -1
- data/src/cxx_supportlib/SystemTools/SystemMetricsCollector.h +1 -1
- data/src/cxx_supportlib/SystemTools/SystemTime.cpp +1 -1
- data/src/cxx_supportlib/SystemTools/SystemTime.h +1 -1
- data/src/cxx_supportlib/SystemTools/UserDatabase.cpp +1 -1
- data/src/cxx_supportlib/SystemTools/UserDatabase.h +1 -1
- data/src/cxx_supportlib/Utils/AnsiColorConstants.h +1 -1
- data/src/cxx_supportlib/Utils/AsyncSignalSafeUtils.h +1 -1
- data/src/cxx_supportlib/Utils/BlockingQueue.h +1 -1
- data/src/cxx_supportlib/Utils/CachedFileStat.cpp +1 -1
- data/src/cxx_supportlib/Utils/CachedFileStat.h +1 -1
- data/src/cxx_supportlib/Utils/CachedFileStat.hpp +1 -1
- data/src/cxx_supportlib/Utils/ClassUtils.h +1 -1
- data/src/cxx_supportlib/Utils/Curl.h +1 -1
- data/src/cxx_supportlib/Utils/FastStringStream.h +1 -1
- data/src/cxx_supportlib/Utils/FileChangeChecker.h +1 -1
- data/src/cxx_supportlib/Utils/HttpConstants.h +1 -1
- data/src/cxx_supportlib/Utils/IniFile.h +1 -1
- data/src/cxx_supportlib/Utils/MessagePassing.h +1 -1
- data/src/cxx_supportlib/Utils/OptionParsing.h +1 -1
- data/src/cxx_supportlib/Utils/ReleaseableScopedPointer.h +1 -1
- data/src/cxx_supportlib/Utils/ScopeGuard.h +1 -1
- data/src/cxx_supportlib/Utils/SpeedMeter.h +1 -1
- data/src/cxx_supportlib/Utils/Timer.h +1 -1
- data/src/cxx_supportlib/Utils/VariantMap.h +1 -1
- data/src/cxx_supportlib/Utils.cpp +1 -1
- data/src/cxx_supportlib/Utils.h +1 -1
- data/src/cxx_supportlib/WatchdogLauncher.cpp +1 -1
- data/src/cxx_supportlib/WatchdogLauncher.h +1 -1
- data/src/cxx_supportlib/WrapperRegistry/CBindings.cpp +1 -1
- data/src/cxx_supportlib/WrapperRegistry/CBindings.h +1 -1
- data/src/cxx_supportlib/WrapperRegistry/Entry.h +1 -1
- data/src/cxx_supportlib/WrapperRegistry/Registry.h +1 -1
- data/src/cxx_supportlib/oxt/backtrace.hpp +1 -1
- data/src/cxx_supportlib/oxt/detail/backtrace_disabled.hpp +1 -1
- data/src/cxx_supportlib/oxt/detail/backtrace_enabled.hpp +1 -1
- data/src/cxx_supportlib/oxt/detail/context.hpp +1 -1
- data/src/cxx_supportlib/oxt/detail/tracable_exception_disabled.hpp +1 -1
- data/src/cxx_supportlib/oxt/detail/tracable_exception_enabled.hpp +1 -1
- data/src/cxx_supportlib/oxt/dynamic_thread_group.hpp +1 -1
- data/src/cxx_supportlib/oxt/implementation.cpp +1 -1
- data/src/cxx_supportlib/oxt/initialize.hpp +1 -1
- data/src/cxx_supportlib/oxt/macros.hpp +1 -1
- data/src/cxx_supportlib/oxt/spin_lock.hpp +1 -1
- data/src/cxx_supportlib/oxt/system_calls.cpp +1 -1
- data/src/cxx_supportlib/oxt/system_calls.hpp +1 -1
- data/src/cxx_supportlib/oxt/thread.hpp +1 -1
- data/src/cxx_supportlib/oxt/tracable_exception.hpp +1 -1
- data/src/cxx_supportlib/vendor-copy/adhoc_lve.h +1 -1
- data/src/cxx_supportlib/vendor-copy/libuv/AUTHORS +353 -3
- data/src/cxx_supportlib/vendor-copy/libuv/ChangeLog +3981 -2
- data/src/cxx_supportlib/vendor-copy/libuv/LICENSE +1 -28
- data/src/cxx_supportlib/vendor-copy/libuv/LICENSE-docs +396 -0
- data/src/cxx_supportlib/vendor-copy/libuv/LICENSE-extra +36 -0
- data/src/cxx_supportlib/vendor-copy/libuv/Makefile.am +275 -58
- data/src/cxx_supportlib/vendor-copy/libuv/Makefile.in +4380 -2125
- data/src/cxx_supportlib/vendor-copy/libuv/aclocal.m4 +425 -221
- data/src/cxx_supportlib/vendor-copy/libuv/ar-lib +30 -10
- data/src/cxx_supportlib/vendor-copy/libuv/compile +31 -14
- data/src/cxx_supportlib/vendor-copy/libuv/config.guess +1084 -690
- data/src/cxx_supportlib/vendor-copy/libuv/config.sub +1844 -1297
- data/src/cxx_supportlib/vendor-copy/libuv/configure +6935 -3664
- data/src/cxx_supportlib/vendor-copy/libuv/configure.ac +43 -19
- data/src/cxx_supportlib/vendor-copy/libuv/depcomp +12 -11
- data/src/cxx_supportlib/vendor-copy/libuv/include/{uv-darwin.h → uv/darwin.h} +3 -3
- data/src/cxx_supportlib/vendor-copy/libuv/include/{uv-errno.h → uv/errno.h} +119 -60
- data/src/cxx_supportlib/vendor-copy/libuv/include/{uv-linux.h → uv/linux.h} +1 -1
- data/src/cxx_supportlib/vendor-copy/libuv/include/uv/os390.h +33 -0
- data/src/cxx_supportlib/vendor-copy/libuv/include/uv/posix.h +31 -0
- data/src/cxx_supportlib/vendor-copy/libuv/include/{uv-threadpool.h → uv/threadpool.h} +1 -1
- data/src/cxx_supportlib/vendor-copy/libuv/include/{tree.h → uv/tree.h} +3 -250
- data/src/cxx_supportlib/vendor-copy/libuv/include/{uv-unix.h → uv/unix.h} +186 -60
- data/src/cxx_supportlib/vendor-copy/libuv/include/{uv-version.h → uv/version.h} +3 -3
- data/src/cxx_supportlib/vendor-copy/libuv/include/uv/win.h +703 -0
- data/src/cxx_supportlib/vendor-copy/libuv/include/uv.h +528 -40
- data/src/cxx_supportlib/vendor-copy/libuv/install-sh +110 -70
- data/src/cxx_supportlib/vendor-copy/libuv/libuv-static.pc.in +12 -0
- data/src/cxx_supportlib/vendor-copy/libuv/libuv.pc.in +4 -2
- data/src/cxx_supportlib/vendor-copy/libuv/ltmain.sh +995 -619
- data/src/cxx_supportlib/vendor-copy/libuv/m4/ax_pthread.m4 +485 -0
- data/src/cxx_supportlib/vendor-copy/libuv/m4/libtool.m4 +438 -289
- data/src/cxx_supportlib/vendor-copy/libuv/m4/libuv-check-flags.m4 +21 -4
- data/src/cxx_supportlib/vendor-copy/libuv/m4/libuv-check-versions.m4 +7 -0
- data/src/cxx_supportlib/vendor-copy/libuv/m4/ltoptions.m4 +69 -39
- data/src/cxx_supportlib/vendor-copy/libuv/m4/ltsugar.m4 +1 -1
- data/src/cxx_supportlib/vendor-copy/libuv/m4/ltversion.m4 +7 -6
- data/src/cxx_supportlib/vendor-copy/libuv/m4/lt~obsolete.m4 +2 -2
- data/src/cxx_supportlib/vendor-copy/libuv/missing +55 -34
- data/src/cxx_supportlib/vendor-copy/libuv/src/fs-poll.c +52 -20
- data/src/cxx_supportlib/vendor-copy/libuv/src/idna.c +560 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/idna.h +31 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/inet.c +5 -16
- data/src/cxx_supportlib/vendor-copy/libuv/src/queue.h +68 -86
- data/src/cxx_supportlib/vendor-copy/libuv/src/random.c +123 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/strscpy.c +38 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/strscpy.h +39 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/strtok.c +52 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/strtok.h +27 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/thread-common.c +175 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/threadpool.c +172 -57
- data/src/cxx_supportlib/vendor-copy/libuv/src/{unix/timer.c → timer.c} +57 -29
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/aix-common.c +89 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/aix.c +418 -256
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/async.c +168 -129
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/bsd-ifaddrs.c +163 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/bsd-proctitle.c +99 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/core.c +1312 -378
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/cygwin.c +93 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/darwin-proctitle.c +18 -32
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/darwin-stub.h +97 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/darwin-syscalls.h +17 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/darwin.c +41 -139
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/dl.c +1 -1
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/freebsd.c +75 -235
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/fs.c +1308 -299
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/fsevents.c +150 -148
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/getaddrinfo.c +58 -8
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/getnameinfo.c +3 -2
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/haiku.c +172 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/hurd.c +172 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/ibmi.c +542 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/internal.h +297 -106
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/kqueue.c +325 -94
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/linux.c +2708 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/loop-watcher.c +11 -11
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/loop.c +105 -24
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/netbsd.c +51 -157
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/no-fsevents.c +42 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/no-proctitle.c +45 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/openbsd.c +42 -183
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/os390-proctitle.c +136 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/os390-syscalls.c +536 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/os390-syscalls.h +75 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/os390.c +1070 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/pipe.c +324 -55
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/poll.c +58 -11
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/posix-hrtime.c +36 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/posix-poll.c +385 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/process.c +795 -248
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/procfs-exepath.c +45 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/proctitle.c +77 -22
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/qnx.c +142 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/random-devurandom.c +93 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/random-getentropy.c +57 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/random-getrandom.c +86 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/random-sysctl-linux.c +99 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/signal.c +147 -39
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/stream.c +426 -474
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/sunos.c +240 -98
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/sysinfo-loadavg.c +36 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/sysinfo-memory.c +42 -0
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/tcp.c +402 -91
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/thread.c +497 -145
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/tty.c +269 -45
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/udp.c +695 -165
- data/src/cxx_supportlib/vendor-copy/libuv/src/uv-common.c +463 -61
- data/src/cxx_supportlib/vendor-copy/libuv/src/uv-common.h +248 -44
- data/src/cxx_supportlib/vendor-copy/libuv/src/uv-data-getter-setters.c +119 -0
- data/src/cxx_supportlib/vendor-copy/libuv/tsansupp.txt +2 -0
- data/src/cxx_supportlib/{ServerKit/llhttp_api.c → vendor-copy/llhttp/api.c} +30 -23
- data/src/cxx_supportlib/{ServerKit → vendor-copy/llhttp}/llhttp.c +1756 -1645
- data/src/cxx_supportlib/{ServerKit → vendor-copy/llhttp}/llhttp.h +35 -13
- data/src/cxx_supportlib/vendor-modified/boost/algorithm/string/classification.hpp +19 -0
- data/src/cxx_supportlib/vendor-modified/boost/algorithm/string/formatter.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/algorithm/string/trim_all.hpp +0 -2
- data/src/cxx_supportlib/vendor-modified/boost/assert.hpp +20 -13
- data/src/cxx_supportlib/vendor-modified/boost/atomic/detail/core_arch_ops_gcc_x86.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/atomic/thread_pause.hpp +4 -0
- data/src/cxx_supportlib/vendor-modified/boost/bind/mem_fn.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/circular_buffer/debug.hpp +4 -0
- data/src/cxx_supportlib/vendor-modified/boost/config/assert_cxx03.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/assert_cxx11.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/assert_cxx14.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/assert_cxx17.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/assert_cxx20.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/assert_cxx23.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/auto_link.hpp +6 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/clang_version.hpp +10 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/compiler/visualc.hpp +5 -3
- data/src/cxx_supportlib/vendor-modified/boost/config/detail/cxx_composite.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/config/workaround.hpp +5 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/adaptive_pool.hpp +57 -53
- data/src/cxx_supportlib/vendor-modified/boost/container/allocator.hpp +10 -10
- data/src/cxx_supportlib/vendor-modified/boost/container/allocator_traits.hpp +34 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/container_fwd.hpp +14 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/deque.hpp +176 -2287
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/adaptive_node_pool.hpp +13 -9
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/adaptive_node_pool_impl.hpp +186 -70
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/algorithm.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/aligned_allocation.hpp +149 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/alloc_helpers.hpp +35 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/alloc_lib.h +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/bit_utilities.hpp +133 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/compare_functors.hpp +18 -3
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/config_begin.hpp +5 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/config_end.hpp +4 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/container_rebind.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/copy_move_algo.hpp +20 -10
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/deque_impl.hpp +2744 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/dispatch_uses_allocator.hpp +202 -104
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/dlmalloc.hpp +5 -4
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/flat_tree.hpp +161 -85
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/is_constructible.hpp +180 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/iterators.hpp +3 -2
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/math_functions.hpp +12 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/mpl.hpp +16 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/mutex.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/next_capacity.hpp +9 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/node_pool.hpp +18 -14
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/node_pool_impl.hpp +256 -41
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/operator_new_helpers.hpp +75 -24
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/pair.hpp +1 -56
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/placement_new.hpp +16 -3
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/pool_common_alloc.hpp +1 -7
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/range_utils.hpp +196 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/std_fwd.hpp +33 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/tree.hpp +124 -69
- data/src/cxx_supportlib/vendor-modified/boost/container/detail/workaround.hpp +109 -7
- data/src/cxx_supportlib/vendor-modified/boost/container/devector.hpp +168 -162
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/nest.hpp +2978 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/pmr/nest.hpp +45 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_all_of.hpp +43 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_any_of.hpp +42 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_copy.hpp +229 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_copy_if.hpp +270 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_copy_n.hpp +308 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_count.hpp +101 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_count_if.hpp +100 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_equal.hpp +268 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_fill.hpp +101 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_fill_n.hpp +171 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_find.hpp +110 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_find_if.hpp +110 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_find_if_not.hpp +43 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_find_last.hpp +179 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_find_last_if.hpp +179 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_find_last_if_not.hpp +43 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_for_each.hpp +92 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_generate.hpp +90 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_generate_n.hpp +162 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_is_partitioned.hpp +46 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_is_sorted.hpp +49 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_is_sorted_until.hpp +169 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_iterator_traits.hpp +382 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_merge.hpp +428 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_mismatch.hpp +350 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_none_of.hpp +98 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_partition.hpp +296 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_partition_copy.hpp +105 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_partition_point.hpp +116 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_remove.hpp +57 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_remove_copy.hpp +207 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_remove_copy_if.hpp +223 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_remove_if.hpp +57 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_replace.hpp +90 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_replace_if.hpp +90 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_reverse.hpp +245 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_reverse_copy.hpp +229 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_search.hpp +211 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_search_n.hpp +476 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_set_difference.hpp +300 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_set_intersection.hpp +287 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_set_symmetric_difference.hpp +306 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_set_union.hpp +294 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_stable_partition.hpp +153 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_swap_ranges.hpp +92 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/segmented_transform.hpp +93 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/experimental/wrapped_iterator.hpp +142 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/flat_map.hpp +642 -417
- data/src/cxx_supportlib/vendor-modified/boost/container/flat_set.hpp +141 -30
- data/src/cxx_supportlib/vendor-modified/boost/container/hub.hpp +2426 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/list.hpp +65 -57
- data/src/cxx_supportlib/vendor-modified/boost/container/map.hpp +247 -68
- data/src/cxx_supportlib/vendor-modified/boost/container/new_allocator.hpp +7 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/node_allocator.hpp +39 -33
- data/src/cxx_supportlib/vendor-modified/boost/container/options.hpp +156 -23
- data/src/cxx_supportlib/vendor-modified/boost/container/pmr/global_resource.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/container/pmr/hub.hpp +43 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/pmr/memory_resource.hpp +5 -3
- data/src/cxx_supportlib/vendor-modified/boost/container/pmr/monotonic_buffer_resource.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/pmr/polymorphic_allocator.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/pmr/resource_adaptor.hpp +4 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/pmr/segtor.hpp +45 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/scoped_allocator.hpp +5 -4
- data/src/cxx_supportlib/vendor-modified/boost/container/segtor.hpp +905 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/set.hpp +148 -35
- data/src/cxx_supportlib/vendor-modified/boost/container/slist.hpp +59 -52
- data/src/cxx_supportlib/vendor-modified/boost/container/small_vector.hpp +632 -5
- data/src/cxx_supportlib/vendor-modified/boost/container/stable_vector.hpp +66 -60
- data/src/cxx_supportlib/vendor-modified/boost/container/static_vector.hpp +46 -1
- data/src/cxx_supportlib/vendor-modified/boost/container/string.hpp +612 -317
- data/src/cxx_supportlib/vendor-modified/boost/container/uses_allocator.hpp +54 -111
- data/src/cxx_supportlib/vendor-modified/boost/container/uses_allocator_construction.hpp +100 -0
- data/src/cxx_supportlib/vendor-modified/boost/container/uses_allocator_fwd.hpp +1 -3
- data/src/cxx_supportlib/vendor-modified/boost/container/vector.hpp +233 -116
- data/src/cxx_supportlib/vendor-modified/boost/container_hash/hash.hpp +5 -1
- data/src/cxx_supportlib/vendor-modified/boost/core/lightweight_test.hpp +17 -10
- data/src/cxx_supportlib/vendor-modified/boost/date_time/period.hpp +1 -3
- data/src/cxx_supportlib/vendor-modified/boost/describe/detail/config.hpp +16 -0
- data/src/cxx_supportlib/vendor-modified/boost/exception/detail/encoder.hpp +114 -0
- data/src/cxx_supportlib/vendor-modified/boost/exception/detail/error_info_impl.hpp +4 -0
- data/src/cxx_supportlib/vendor-modified/boost/exception/detail/requires_cxx11.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/exception/detail/type_info.hpp +211 -1
- data/src/cxx_supportlib/vendor-modified/boost/exception/diagnostic_information.hpp +59 -0
- data/src/cxx_supportlib/vendor-modified/boost/exception/exception.hpp +6 -0
- data/src/cxx_supportlib/vendor-modified/boost/exception/info.hpp +34 -0
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/avltree.hpp +0 -1
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/bstree.hpp +12 -3
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/derivation_value_traits.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/ebo_functor_holder.hpp +29 -174
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/generic_hook.hpp +18 -2
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/key_nodeptr_comp.hpp +0 -1
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/detail/workaround.hpp +4 -5
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/hashtable.hpp +20 -11
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/list.hpp +42 -14
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/slist.hpp +58 -22
- data/src/cxx_supportlib/vendor-modified/boost/intrusive/unordered_set.hpp +3 -1
- data/src/cxx_supportlib/vendor-modified/boost/iterator/advance.hpp +5 -1
- data/src/cxx_supportlib/vendor-modified/boost/iterator/distance.hpp +8 -2
- data/src/cxx_supportlib/vendor-modified/boost/iterator/is_iterator.hpp +9 -0
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/bad_lexical_cast.hpp +11 -1
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/buffer_view.hpp +9 -1
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/config.hpp +22 -0
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/converter_lexical.hpp +15 -7
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/converter_lexical_streams.hpp +23 -11
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/converter_numeric.hpp +11 -1
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/inf_nan.hpp +9 -1
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/is_character.hpp +11 -2
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/lcast_basic_unlockedbuf.hpp +10 -1
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/lcast_char_constants.hpp +8 -1
- data/src/cxx_supportlib/vendor-modified/boost/{detail → lexical_cast/detail}/lcast_precision.hpp +13 -1
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/lcast_unsigned_converters.hpp +11 -1
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/detail/widest_char.hpp +10 -2
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast/try_lexical_convert.hpp +15 -2
- data/src/cxx_supportlib/vendor-modified/boost/lexical_cast.hpp +11 -1
- data/src/cxx_supportlib/vendor-modified/boost/libs/thread/src/pthread/once_atomic.cpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/libs/thread/src/pthread/thread.cpp +48 -46
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/meta_utils.hpp +23 -0
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/move_helpers.hpp +24 -24
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/nsec_clock.hpp +12 -4
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/type_traits.hpp +76 -0
- data/src/cxx_supportlib/vendor-modified/boost/move/detail/workaround.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/move/traits.hpp +11 -0
- data/src/cxx_supportlib/vendor-modified/boost/mp11/algorithm.hpp +58 -37
- data/src/cxx_supportlib/vendor-modified/boost/mp11/detail/mp_copy_if.hpp +1 -2
- data/src/cxx_supportlib/vendor-modified/boost/mp11/detail/mp_map_find.hpp +17 -9
- data/src/cxx_supportlib/vendor-modified/boost/mp11/detail/mp_remove_if.hpp +1 -2
- data/src/cxx_supportlib/vendor-modified/boost/mp11/integer_sequence.hpp +6 -0
- data/src/cxx_supportlib/vendor-modified/boost/mp11/version.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/none_t.hpp +6 -1
- data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_common_defs.hpp +188 -0
- data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_factory_support.hpp +0 -6
- data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_hash.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_nonmember_interface.hpp +117 -0
- data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_reference_spec.hpp +108 -83
- data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_relops.hpp +39 -39
- data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_select_implementation.hpp +37 -0
- data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_swap.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_trivially_copyable_base.hpp +8 -8
- data/src/cxx_supportlib/vendor-modified/boost/optional/detail/union_optional.hpp +724 -0
- data/src/cxx_supportlib/vendor-modified/boost/optional/optional.hpp +93 -220
- data/src/cxx_supportlib/vendor-modified/boost/optional/optional_fwd.hpp +14 -4
- data/src/cxx_supportlib/vendor-modified/boost/optional/optional_io.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/random/binomial_distribution.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/random/uniform_int_distribution.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/rational.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/static_assert.hpp +4 -6
- data/src/cxx_supportlib/vendor-modified/boost/system/api_config.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/system/detail/config.hpp +16 -0
- data/src/cxx_supportlib/vendor-modified/boost/system/detail/error_category.hpp +13 -13
- data/src/cxx_supportlib/vendor-modified/boost/system/detail/error_category_impl.hpp +5 -5
- data/src/cxx_supportlib/vendor-modified/boost/thread/concurrent_queues/detail/sync_deque_base.hpp +3 -2
- data/src/cxx_supportlib/vendor-modified/boost/thread/concurrent_queues/detail/sync_queue_base.hpp +3 -2
- data/src/cxx_supportlib/vendor-modified/boost/thread/detail/thread.hpp +2 -1
- data/src/cxx_supportlib/vendor-modified/boost/thread/experimental/parallel/v2/task_region.hpp +1 -1
- data/src/cxx_supportlib/vendor-modified/boost/thread/future.hpp +30 -28
- data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/once.hpp +6 -3
- data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/once_atomic.hpp +5 -1
- data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/pthread_helpers.hpp +1 -0
- data/src/cxx_supportlib/vendor-modified/boost/thread/pthread/shared_mutex.hpp +16 -16
- data/src/cxx_supportlib/vendor-modified/boost/thread/v2/shared_mutex.hpp +26 -26
- data/src/cxx_supportlib/vendor-modified/boost/unordered/concurrent_flat_map.hpp +196 -6
- data/src/cxx_supportlib/vendor-modified/boost/unordered/concurrent_flat_set.hpp +191 -6
- data/src/cxx_supportlib/vendor-modified/boost/unordered/concurrent_node_map.hpp +196 -5
- data/src/cxx_supportlib/vendor-modified/boost/unordered/concurrent_node_set.hpp +192 -5
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/foa/concurrent_table.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/foa/core.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/foa/table.hpp +3 -3
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/implementation.hpp +52 -16
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/ranges_support.hpp +104 -0
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/type_traits.hpp +1 -14
- data/src/cxx_supportlib/vendor-modified/boost/unordered/detail/unordered_printers.hpp +10 -4
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_map.hpp +121 -3
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_flat_set.hpp +118 -3
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_map.hpp +338 -1
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_node_map.hpp +121 -3
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_node_set.hpp +118 -3
- data/src/cxx_supportlib/vendor-modified/boost/unordered/unordered_set.hpp +333 -1
- data/src/cxx_supportlib/vendor-modified/boost/version.hpp +2 -2
- data/src/cxx_supportlib/vendor-modified/jsoncpp/json-forwards.h +276 -143
- data/src/cxx_supportlib/vendor-modified/jsoncpp/json.h +1262 -771
- data/src/cxx_supportlib/vendor-modified/jsoncpp/jsoncpp.cpp +1704 -1586
- data/src/cxx_supportlib/vendor-modified/libev/Changes +109 -0
- data/src/cxx_supportlib/vendor-modified/libev/Makefile.am +2 -1
- data/src/cxx_supportlib/vendor-modified/libev/Makefile.in +47 -33
- data/src/cxx_supportlib/vendor-modified/libev/README +2 -1
- data/src/cxx_supportlib/vendor-modified/libev/aclocal.m4 +1653 -1224
- data/src/cxx_supportlib/vendor-modified/libev/config.guess +376 -316
- data/src/cxx_supportlib/vendor-modified/libev/config.h.in +13 -2
- data/src/cxx_supportlib/vendor-modified/libev/config.sub +156 -154
- data/src/cxx_supportlib/vendor-modified/libev/configure +1431 -940
- data/src/cxx_supportlib/vendor-modified/libev/configure.ac +3 -3
- data/src/cxx_supportlib/vendor-modified/libev/depcomp +5 -5
- data/src/cxx_supportlib/vendor-modified/libev/ev++.h +109 -107
- data/src/cxx_supportlib/vendor-modified/libev/ev.c +807 -319
- data/src/cxx_supportlib/vendor-modified/libev/ev.h +111 -105
- data/src/cxx_supportlib/vendor-modified/libev/ev_epoll.c +42 -29
- data/src/cxx_supportlib/vendor-modified/libev/ev_iouring.c +694 -0
- data/src/cxx_supportlib/vendor-modified/libev/ev_kqueue.c +15 -9
- data/src/cxx_supportlib/vendor-modified/libev/ev_linuxaio.c +620 -0
- data/src/cxx_supportlib/vendor-modified/libev/ev_poll.c +19 -14
- data/src/cxx_supportlib/vendor-modified/libev/ev_port.c +8 -5
- data/src/cxx_supportlib/vendor-modified/libev/ev_select.c +6 -6
- data/src/cxx_supportlib/vendor-modified/libev/ev_vars.h +48 -3
- data/src/cxx_supportlib/vendor-modified/libev/ev_win32.c +2 -2
- data/src/cxx_supportlib/vendor-modified/libev/ev_wrap.h +72 -0
- data/src/cxx_supportlib/vendor-modified/libev/install-sh +23 -13
- data/src/cxx_supportlib/vendor-modified/libev/libev.m4 +6 -1
- data/src/cxx_supportlib/vendor-modified/libev/ltmain.sh +3581 -1993
- data/src/cxx_supportlib/vendor-modified/libev/missing +8 -8
- data/src/cxx_supportlib/vendor-modified/libev/mkinstalldirs +3 -3
- data/src/cxx_supportlib/vendor-modified/modp_b64_strict_aliasing.cpp +1 -1
- data/src/helper-scripts/backtrace-sanitizer.rb +1 -1
- data/src/helper-scripts/crash-watch.rb +1 -1
- data/src/helper-scripts/download_binaries/extconf.rb +1 -1
- data/src/helper-scripts/meteor-loader.rb +1 -1
- data/src/helper-scripts/node-loader.js +1 -1
- data/src/helper-scripts/prespawn +1 -1
- data/src/helper-scripts/rack-loader.rb +1 -1
- data/src/helper-scripts/rack-preloader.rb +1 -1
- data/src/helper-scripts/wsgi-loader.py +1 -1
- data/src/nginx_module/ConfigGeneral/AutoGeneratedDefinitions.c +1 -1
- data/src/nginx_module/ConfigGeneral/AutoGeneratedDefinitions.c.cxxcodebuilder +1 -1
- data/src/nginx_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.c +1 -1
- data/src/nginx_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.c.cxxcodebuilder +1 -1
- data/src/nginx_module/ConfigGeneral/AutoGeneratedSetterFuncs.c +1 -1
- data/src/nginx_module/ConfigGeneral/AutoGeneratedSetterFuncs.c.cxxcodebuilder +1 -1
- data/src/nginx_module/Configuration.c +1 -1
- data/src/nginx_module/Configuration.h +1 -1
- data/src/nginx_module/ContentHandler.c +36 -1
- data/src/nginx_module/ContentHandler.h +1 -1
- data/src/nginx_module/LocationConfig/AutoGeneratedCreateFunction.c +1 -1
- data/src/nginx_module/LocationConfig/AutoGeneratedCreateFunction.c.cxxcodebuilder +1 -1
- data/src/nginx_module/LocationConfig/AutoGeneratedHeaderSerialization.c +1 -1
- data/src/nginx_module/LocationConfig/AutoGeneratedHeaderSerialization.c.cxxcodebuilder +1 -1
- data/src/nginx_module/LocationConfig/AutoGeneratedManifestGeneration.c +1 -1
- data/src/nginx_module/LocationConfig/AutoGeneratedManifestGeneration.c.cxxcodebuilder +1 -1
- data/src/nginx_module/LocationConfig/AutoGeneratedMergeFunction.c +1 -1
- data/src/nginx_module/LocationConfig/AutoGeneratedMergeFunction.c.cxxcodebuilder +1 -1
- data/src/nginx_module/LocationConfig/AutoGeneratedStruct.h +1 -1
- data/src/nginx_module/LocationConfig/AutoGeneratedStruct.h.cxxcodebuilder +1 -1
- data/src/nginx_module/MainConfig/AutoGeneratedCreateFunction.c +1 -1
- data/src/nginx_module/MainConfig/AutoGeneratedCreateFunction.c.cxxcodebuilder +1 -1
- data/src/nginx_module/MainConfig/AutoGeneratedManifestGeneration.c +1 -1
- data/src/nginx_module/MainConfig/AutoGeneratedManifestGeneration.c.cxxcodebuilder +1 -1
- data/src/nginx_module/MainConfig/AutoGeneratedStruct.h +1 -1
- data/src/nginx_module/MainConfig/AutoGeneratedStruct.h.cxxcodebuilder +1 -1
- data/src/nginx_module/StaticContentHandler.c +1 -1
- data/src/nginx_module/StaticContentHandler.h +1 -1
- data/src/nginx_module/ngx_http_passenger_module.c +1 -1
- data/src/nginx_module/ngx_http_passenger_module.h +1 -1
- data/src/nodejs_supportlib/phusion_passenger/line_reader.js +1 -1
- data/src/ruby_native_extension/extconf.rb +1 -1
- data/src/ruby_native_extension/passenger_native_support.c +1 -1
- data/src/ruby_supportlib/phusion_passenger/abstract_installer.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/admin_tools/instance.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/admin_tools/instance_registry.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/admin_tools/memory_stats.rb +2 -12
- data/src/ruby_supportlib/phusion_passenger/admin_tools.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/apache2/config_options.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/apache2/config_utils.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/common_library.rb +14 -16
- data/src/ruby_supportlib/phusion_passenger/config/about_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/agent_compiler.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/api_call_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/build_native_support_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/compile_agent_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/compile_nginx_engine_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/detach_process_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/download_agent_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/download_nginx_engine_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/install_agent_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/install_standalone_runtime_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/installation_utils.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/list_instances_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/main.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/nginx_engine_compiler.rb +3 -2
- data/src/ruby_supportlib/phusion_passenger/config/reopen_logs_command.rb +6 -1
- data/src/ruby_supportlib/phusion_passenger/config/restart_app_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/system_metrics_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/system_properties_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/utils.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/validate_install_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/console_text_template.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/constants.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/debug_logging.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/message_channel.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/message_client.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/native_support.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/nginx/config_options.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/packaging.rb +4 -3
- data/src/ruby_supportlib/phusion_passenger/platform_info/apache.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/platform_info/apache_detector.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/platform_info/binary_compatibility.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/platform_info/compiler.rb +195 -11
- data/src/ruby_supportlib/phusion_passenger/platform_info/crypto.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/platform_info/curl.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/platform_info/cxx_portability.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/platform_info/linux.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/platform_info/networking.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/platform_info/openssl.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/platform_info/operating_system.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/platform_info/pcre.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/platform_info/ruby.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/platform_info/zlib.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/platform_info.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/plugin.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/preloader_shared_helpers.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/public_api.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/rack/handler.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/rack/out_of_band_gc.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/rack/thread_handler_extension.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/rack_handler.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/request_handler/thread_handler.rb +2 -7
- data/src/ruby_supportlib/phusion_passenger/request_handler.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/ruby_core_enhancements.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/ruby_core_io_enhancements.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/simple_benchmarking.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/standalone/app_finder.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/standalone/command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/standalone/config_options_list.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/standalone/config_utils.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/standalone/control_utils.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/standalone/main.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/standalone/start_command/builtin_engine.rb +2 -2
- data/src/ruby_supportlib/phusion_passenger/standalone/start_command/nginx_engine.rb +4 -8
- data/src/ruby_supportlib/phusion_passenger/standalone/start_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/standalone/status_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/standalone/stop_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/standalone/version_command.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/utils/ansi_colors.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/utils/download.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/utils/file_system_watcher.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/utils/hosts_file_parser.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/utils/json.rb +25 -2
- data/src/ruby_supportlib/phusion_passenger/utils/lock.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/utils/native_support_utils.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/utils/progress_bar.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/utils/strscan.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/utils/terminal_choice_menu.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/utils/unseekable_socket.rb +3 -13
- data/src/ruby_supportlib/phusion_passenger/utils.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/app.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/base.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/gdb_controller.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/lldb_controller.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/utils.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/version.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/vendor/daemon_controller/lock_file.rb +8 -6
- data/src/ruby_supportlib/phusion_passenger/vendor/daemon_controller/spawn.rb +4 -3
- data/src/ruby_supportlib/phusion_passenger/vendor/daemon_controller/version.rb +6 -4
- data/src/ruby_supportlib/phusion_passenger/vendor/daemon_controller.rb +406 -579
- data/src/ruby_supportlib/phusion_passenger.rb +8 -8
- data/src/schema_printer/SchemaPrinterMain.cpp +1 -1
- data/src/schema_printer/SchemaPrinterMain.cpp.cxxcodebuilder +1 -1
- metadata +140 -38
- data/doc/DeveloperQuickstart.md +0 -70
- data/src/README.md +0 -7
- data/src/cxx_supportlib/vendor-copy/libuv/README.md +0 -245
- data/src/cxx_supportlib/vendor-copy/libuv/checksparse.sh +0 -234
- data/src/cxx_supportlib/vendor-copy/libuv/common.gypi +0 -210
- data/src/cxx_supportlib/vendor-copy/libuv/gyp_uv.py +0 -93
- data/src/cxx_supportlib/vendor-copy/libuv/include/android-ifaddrs.h +0 -54
- data/src/cxx_supportlib/vendor-copy/libuv/include/pthread-fixes.h +0 -72
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/android-ifaddrs.c +0 -703
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/atomic-ops.h +0 -77
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/linux-core.c +0 -899
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/linux-inotify.c +0 -285
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/linux-syscalls.c +0 -471
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/linux-syscalls.h +0 -158
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/pthread-fixes.c +0 -104
- data/src/cxx_supportlib/vendor-copy/libuv/src/unix/spinlock.h +0 -53
- data/src/cxx_supportlib/vendor-copy/libuv/uv.gyp +0 -508
- data/src/cxx_supportlib/vendor-modified/boost/optional/detail/optional_utility.hpp +0 -41
- /data/src/cxx_supportlib/vendor-copy/libuv/include/{uv-aix.h → uv/aix.h} +0 -0
- /data/src/cxx_supportlib/vendor-copy/libuv/include/{uv-bsd.h → uv/bsd.h} +0 -0
- /data/src/cxx_supportlib/vendor-copy/libuv/include/{uv-sunos.h → uv/sunos.h} +0 -0
- /data/src/cxx_supportlib/{ServerKit/llhttp_http.c → vendor-copy/llhttp/http.c} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/// Json-cpp
|
|
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
|
|
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
|
|
76
|
-
# define
|
|
77
|
-
/// If defined, indicates that the source file is
|
|
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
|
-
#
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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 <
|
|
127
|
-
#include <
|
|
128
|
-
#include <
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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
|
-
|
|
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
|
|
271
|
+
/// Remarks: it is automatically defined in the generated amalgamated header.
|
|
149
272
|
// #define JSON_IS_AMALGAMATION
|
|
150
273
|
|
|
151
|
-
|
|
152
|
-
#
|
|
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
|
|
288
|
+
#endif // ifdef JSON_DLL_BUILD
|
|
289
|
+
|
|
171
290
|
#if !defined(JSON_API)
|
|
172
291
|
#define JSON_API
|
|
173
292
|
#endif
|
|
174
293
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
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)
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
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
|
-
#
|
|
213
|
-
# define JSONCPP_NOEXCEPT throw()
|
|
306
|
+
#define jsoncpp_snprintf std::snprintf
|
|
214
307
|
#endif
|
|
215
308
|
|
|
216
|
-
|
|
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
|
-
|
|
219
|
-
|
|
220
|
-
#
|
|
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
|
|
224
|
-
#define
|
|
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
|
-
#
|
|
241
|
-
#
|
|
242
|
-
#
|
|
243
|
-
#
|
|
244
|
-
#
|
|
245
|
-
#
|
|
246
|
-
|
|
247
|
-
#
|
|
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
|
-
#
|
|
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
|
-
#
|
|
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
|
-
|
|
270
|
-
|
|
350
|
+
JSON_API const char* version();
|
|
351
|
+
using Int = int;
|
|
352
|
+
using UInt = unsigned int;
|
|
271
353
|
#if defined(JSON_NO_INT64)
|
|
272
|
-
|
|
273
|
-
|
|
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
|
-
|
|
279
|
-
|
|
360
|
+
using Int64 = __int64;
|
|
361
|
+
using UInt64 = unsigned __int64;
|
|
280
362
|
#else // if defined(_MSC_VER) // Other platforms, use long long
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
#endif
|
|
284
|
-
|
|
285
|
-
|
|
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
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
} //
|
|
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
|
-
//
|
|
439
|
+
// json_features.h
|
|
342
440
|
class Features;
|
|
343
441
|
|
|
344
442
|
// value.h
|
|
345
|
-
|
|
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/
|
|
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
|
|
378
|
-
#define
|
|
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
|
|
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 //
|
|
535
|
+
#endif // JSON_FEATURES_H_INCLUDED
|
|
435
536
|
|
|
436
537
|
// //////////////////////////////////////////////////////////////////////
|
|
437
|
-
// End of content of file: include/json/
|
|
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
|
|
455
|
-
#define
|
|
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
|
-
|
|
465
|
-
|
|
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
|
-
#
|
|
569
|
+
#define JSONCPP_NORETURN [[noreturn]]
|
|
468
570
|
#endif
|
|
469
|
-
#ifdef JSON_USE_CPPTL
|
|
470
|
-
#include <cpptl/forwards.h>
|
|
471
571
|
#endif
|
|
472
572
|
|
|
473
|
-
//
|
|
474
|
-
//
|
|
475
|
-
//
|
|
476
|
-
#if !defined(
|
|
477
|
-
#
|
|
478
|
-
#
|
|
479
|
-
#
|
|
480
|
-
#
|
|
481
|
-
#
|
|
482
|
-
#
|
|
483
|
-
#
|
|
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
|
|
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(
|
|
507
|
-
~Exception()
|
|
508
|
-
char const* what() const
|
|
633
|
+
Exception(String msg);
|
|
634
|
+
~Exception() noexcept override;
|
|
635
|
+
char const* what() const noexcept override;
|
|
636
|
+
|
|
509
637
|
protected:
|
|
510
|
-
|
|
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(
|
|
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(
|
|
660
|
+
LogicError(String const& msg);
|
|
533
661
|
};
|
|
662
|
+
#endif
|
|
534
663
|
|
|
535
664
|
/// used internally
|
|
536
|
-
JSONCPP_NORETURN void throwRuntimeError(
|
|
665
|
+
JSONCPP_NORETURN void throwRuntimeError(String const& msg);
|
|
537
666
|
/// used internally
|
|
538
|
-
JSONCPP_NORETURN void throwLogicError(
|
|
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
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
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
|
-
|
|
636
|
-
|
|
768
|
+
using UInt64 = Json::UInt64;
|
|
769
|
+
using Int64 = Json::Int64;
|
|
637
770
|
#endif // defined(JSON_HAS_INT64)
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
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
|
-
|
|
643
|
-
|
|
644
|
-
static Value
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
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_;
|
|
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
|
-
/**
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
Json::Value
|
|
730
|
-
Json::Value
|
|
731
|
-
|
|
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
|
-
/**
|
|
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
|
|
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
|
-
*
|
|
750
|
-
*
|
|
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
|
-
*
|
|
754
|
-
*
|
|
755
|
-
*
|
|
756
|
-
*
|
|
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
|
|
760
|
-
#ifdef
|
|
761
|
-
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
|
-
|
|
914
|
+
Value(std::nullptr_t ptr) = delete;
|
|
765
915
|
Value(const Value& other);
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
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
|
|
793
|
-
unsigned getCStringLength() const; //Allows you to understand the length of
|
|
946
|
+
#if JSONCPP_USE_SECURE_MEMORY
|
|
947
|
+
unsigned getCStringLength() const; // Allows you to understand the length of
|
|
948
|
+
// the CString
|
|
794
949
|
#endif
|
|
795
|
-
|
|
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
|
-
|
|
801
|
-
|
|
802
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
1019
|
+
void resize(ArrayIndex newSize);
|
|
852
1020
|
|
|
853
|
-
|
|
854
|
-
///
|
|
855
|
-
/// inserted
|
|
856
|
-
///
|
|
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
|
-
///
|
|
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
|
-
|
|
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
|
-
///
|
|
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
|
-
///
|
|
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
|
|
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
|
|
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
|
|
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
|
-
*
|
|
911
|
-
*
|
|
912
|
-
*
|
|
913
|
-
*
|
|
914
|
-
*
|
|
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
|
|
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(
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
939
|
-
|
|
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
|
|
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
|
-
|
|
955
|
-
|
|
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
|
-
|
|
959
|
-
|
|
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
|
-
|
|
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
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
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
|
|
986
|
-
/// Same as isMember(
|
|
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(
|
|
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(
|
|
1222
|
+
void setComment(String comment, CommentPlacement placement);
|
|
1012
1223
|
bool hasComment(CommentPlacement placement) const;
|
|
1013
1224
|
/// Include delimiters and embedded newlines.
|
|
1014
|
-
|
|
1225
|
+
String getComment(CommentPlacement placement) const;
|
|
1015
1226
|
|
|
1016
|
-
|
|
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_;
|
|
1296
|
+
char* string_; // if allocated_, ptr to { unsigned, char[] }.
|
|
1061
1297
|
ObjectValues* map_;
|
|
1062
1298
|
} value_;
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
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(
|
|
1370
|
+
PathArgument(String key);
|
|
1085
1371
|
|
|
1086
1372
|
private:
|
|
1087
|
-
enum Kind {
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
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
|
|
1388
|
+
* - ".[%]" => index is provided as parameter
|
|
1107
1389
|
*/
|
|
1108
1390
|
class JSON_API Path {
|
|
1109
1391
|
public:
|
|
1110
|
-
Path(const
|
|
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
|
-
|
|
1125
|
-
|
|
1405
|
+
using InArgs = std::vector<const PathArgument*>;
|
|
1406
|
+
using Args = std::vector<PathArgument>;
|
|
1126
1407
|
|
|
1127
|
-
void makePath(const
|
|
1128
|
-
void addPathInArg(const
|
|
1129
|
-
|
|
1130
|
-
|
|
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
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
1210
|
-
//typedef unsigned int size_t;
|
|
1211
|
-
//typedef int difference_type;
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
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
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1305
|
-
|
|
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
|
-
|
|
1309
|
-
|
|
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 //
|
|
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
|
|
1341
|
-
#define
|
|
1762
|
+
#ifndef JSON_READER_H_INCLUDED
|
|
1763
|
+
#define JSON_READER_H_INCLUDED
|
|
1342
1764
|
|
|
1343
1765
|
#if !defined(JSON_IS_AMALGAMATION)
|
|
1344
|
-
#include "
|
|
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
|
|
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
|
-
|
|
1373
|
-
|
|
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
|
-
|
|
1807
|
+
String message;
|
|
1385
1808
|
};
|
|
1386
1809
|
|
|
1387
|
-
/** \brief Constructs a Reader allowing all features
|
|
1388
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
1400
|
-
* \param
|
|
1401
|
-
*
|
|
1402
|
-
* \param
|
|
1403
|
-
*
|
|
1404
|
-
*
|
|
1405
|
-
*
|
|
1406
|
-
*
|
|
1407
|
-
*
|
|
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
|
-
|
|
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
|
-
*
|
|
1417
|
-
|
|
1418
|
-
*
|
|
1419
|
-
|
|
1420
|
-
*
|
|
1421
|
-
*
|
|
1422
|
-
*
|
|
1423
|
-
*
|
|
1424
|
-
|
|
1425
|
-
*
|
|
1426
|
-
*
|
|
1427
|
-
|
|
1428
|
-
*
|
|
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(
|
|
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
|
-
*
|
|
1444
|
-
*
|
|
1445
|
-
*
|
|
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
|
-
|
|
1872
|
+
String getFormatedErrorMessages() const;
|
|
1452
1873
|
|
|
1453
1874
|
/** \brief Returns a user friendly string that list errors in the parsed
|
|
1454
1875
|
* document.
|
|
1455
|
-
*
|
|
1456
|
-
*
|
|
1457
|
-
*
|
|
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
|
-
|
|
1881
|
+
String getFormattedErrorMessages() const;
|
|
1462
1882
|
|
|
1463
|
-
/** \brief Returns a vector of structured
|
|
1883
|
+
/** \brief Returns a vector of structured errors encountered while parsing.
|
|
1884
|
+
*
|
|
1464
1885
|
* \return A (possibly empty) vector of StructuredError objects. Currently
|
|
1465
|
-
*
|
|
1466
|
-
*
|
|
1467
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
|
1899
|
+
bool pushError(const Value& value, const String& message);
|
|
1479
1900
|
|
|
1480
1901
|
/** \brief Add a semantic error message with extra context.
|
|
1481
|
-
*
|
|
1902
|
+
*
|
|
1903
|
+
* \param value JSON Value location associated with the error
|
|
1482
1904
|
* \param message The error message.
|
|
1483
|
-
* \param extra
|
|
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
|
|
1909
|
+
bool pushError(const Value& value, const String& message, const Value& extra);
|
|
1488
1910
|
|
|
1489
1911
|
/** \brief Return whether there are any errors.
|
|
1490
|
-
*
|
|
1491
|
-
* errors have
|
|
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
|
-
|
|
1946
|
+
String message_;
|
|
1524
1947
|
Location extra_;
|
|
1525
1948
|
};
|
|
1526
1949
|
|
|
1527
|
-
|
|
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(
|
|
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,
|
|
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&
|
|
1552
|
-
|
|
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
|
|
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
|
-
|
|
1564
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1572
|
-
Location begin_;
|
|
1573
|
-
Location end_;
|
|
1574
|
-
Location current_;
|
|
1575
|
-
Location lastValueEnd_;
|
|
1576
|
-
Value* lastValue_;
|
|
1577
|
-
|
|
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
|
-
};
|
|
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
|
-
|
|
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
|
-
*
|
|
2015
|
+
* document. The document must be a UTF-8 encoded string containing the
|
|
2016
|
+
* document to read.
|
|
1590
2017
|
*
|
|
1591
|
-
* \param
|
|
1592
|
-
document to read.
|
|
1593
|
-
* \param
|
|
1594
|
-
document to read.
|
|
1595
|
-
*
|
|
1596
|
-
*
|
|
1597
|
-
*
|
|
1598
|
-
*
|
|
1599
|
-
*
|
|
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
|
-
|
|
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
|
-
};
|
|
1616
|
-
}; // CharReader
|
|
2045
|
+
}; // Factory
|
|
1617
2046
|
|
|
1618
|
-
|
|
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
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
\
|
|
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
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
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()
|
|
2123
|
+
~CharReaderBuilder() override;
|
|
1675
2124
|
|
|
1676
|
-
CharReader* newCharReader() const
|
|
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[](
|
|
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
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
bool JSON_API parseFromStream(
|
|
1706
|
-
|
|
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
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
}
|
|
1729
|
-
}
|
|
1730
|
-
\endverbatim
|
|
1731
|
-
\throw std::exception on parse error.
|
|
1732
|
-
\see Json::operator<<()
|
|
1733
|
-
*/
|
|
1734
|
-
JSON_API
|
|
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 //
|
|
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
|
|
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
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
std::
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
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,
|
|
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
|
-
};
|
|
1827
|
-
};
|
|
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
|
-
|
|
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
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
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
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
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()
|
|
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
|
|
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[](
|
|
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
|
|
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
|
|
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()
|
|
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
|
|
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
|
-
|
|
2401
|
+
String write(const Value& root) override;
|
|
1940
2402
|
|
|
1941
2403
|
private:
|
|
1942
2404
|
void writeValue(const Value& value);
|
|
1943
2405
|
|
|
1944
|
-
|
|
1945
|
-
bool
|
|
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
|
|
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()
|
|
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
|
-
|
|
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
|
|
1990
|
-
void pushValue(const
|
|
2458
|
+
bool isMultilineArray(const Value& value);
|
|
2459
|
+
void pushValue(const String& value);
|
|
1991
2460
|
void writeIndent();
|
|
1992
|
-
void writeWithIndent(const
|
|
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
|
|
2466
|
+
static bool hasCommentForValue(const Value& value);
|
|
2467
|
+
static String normalizeEOL(const String& text);
|
|
1999
2468
|
|
|
2000
|
-
|
|
2469
|
+
using ChildValues = std::vector<String>;
|
|
2001
2470
|
|
|
2002
2471
|
ChildValues childValues_;
|
|
2003
|
-
|
|
2004
|
-
|
|
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
|
|
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
|
-
|
|
2039
|
-
|
|
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(
|
|
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
|
|
2054
|
-
void pushValue(const
|
|
2531
|
+
bool isMultilineArray(const Value& value);
|
|
2532
|
+
void pushValue(const String& value);
|
|
2055
2533
|
void writeIndent();
|
|
2056
|
-
void writeWithIndent(const
|
|
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
|
|
2539
|
+
static bool hasCommentForValue(const Value& value);
|
|
2540
|
+
static String normalizeEOL(const String& text);
|
|
2063
2541
|
|
|
2064
|
-
|
|
2542
|
+
using ChildValues = std::vector<String>;
|
|
2065
2543
|
|
|
2066
2544
|
ChildValues childValues_;
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
unsigned int rightMargin_;
|
|
2070
|
-
|
|
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
|
-
|
|
2077
|
-
|
|
2557
|
+
String JSON_API valueToString(Int value);
|
|
2558
|
+
String JSON_API valueToString(UInt value);
|
|
2078
2559
|
#endif // if defined(JSON_HAS_INT64)
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
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
|
|
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
|
|
2119
|
-
#define
|
|
2602
|
+
#ifndef JSON_ASSERTIONS_H_INCLUDED
|
|
2603
|
+
#define JSON_ASSERTIONS_H_INCLUDED
|
|
2120
2604
|
|
|
2121
|
-
#include <
|
|
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
|
-
#
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
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
|
-
#
|
|
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
|
-
#
|
|
2640
|
+
#define JSON_FAIL_MESSAGE(message) \
|
|
2152
2641
|
{ \
|
|
2153
|
-
|
|
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
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2651
|
+
do { \
|
|
2652
|
+
if (!(condition)) { \
|
|
2653
|
+
JSON_FAIL_MESSAGE(message); \
|
|
2654
|
+
} \
|
|
2655
|
+
} while (0)
|
|
2165
2656
|
|
|
2166
|
-
#endif //
|
|
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
|
|
2667
|
+
#endif //ifndef JSON_AMALGAMATED_H_INCLUDED
|