Compare commits

..

27 Commits

Author SHA1 Message Date
Niels Lohmann 2e928c39ae 🔀 merge develop 2024-11-17 07:45:45 +01:00
Niels Lohmann a65d65c724 🔀 merge develop 2024-11-16 23:25:05 +01:00
Niels Lohmann 5e9bf559b1 # Conflicts:
#	.github/workflows/macos.yml
#	include/nlohmann/detail/input/parser.hpp
#	include/nlohmann/detail/meta/std_fs.hpp
#	include/nlohmann/json.hpp
#	single_include/nlohmann/json.hpp
2024-11-16 23:23:05 +01:00
Niels Lohmann 9561a122a3 🚨 fix warning 2024-11-08 23:47:11 +01:00
Niels Lohmann ad552c41be 🚨 fix warning 2024-11-08 23:41:46 +01:00
Niels Lohmann 078d25ed68 🚨 fix warning 2024-11-08 23:19:04 +01:00
Niels Lohmann ddecb704e3 🚨 fix warning 2024-11-08 23:13:25 +01:00
Niels Lohmann 9240ba4911 Merge remote-tracking branch 'origin/clang-tidy' into clang-tidy 2024-11-08 23:07:51 +01:00
Niels Lohmann b48e05be7c 💚 update actions 2024-11-08 23:07:44 +01:00
Niels Lohmann c4ec5e0bc5 Merge branch 'develop' into clang-tidy 2024-11-08 22:49:30 +01:00
Niels Lohmann 83dc915ac2 🚑 fix warning 2024-11-08 22:48:11 +01:00
Niels Lohmann 88318f9a77 🔀 merge develop 2024-11-08 22:40:55 +01:00
Niels Lohmann fd968125e8 🚨 fix warning 2024-04-15 22:50:47 +02:00
Niels Lohmann 3c282210d6 🚨 fix warning 2024-04-15 21:44:44 +02:00
Niels Lohmann 751b93652f 🚨 fix warning 2024-04-15 21:44:33 +02:00
Niels Lohmann bb2468a52c 🚨 fix warning 2024-04-15 21:16:40 +02:00
Niels Lohmann 4b7721c392 🚨 fix warning 2024-04-14 13:56:22 +02:00
Niels Lohmann e8cfe1f712 🚨 fix warning 2024-04-14 12:38:17 +02:00
Niels Lohmann 760f54f993 🚨 fix warning 2024-04-14 12:01:20 +02:00
Niels Lohmann 414345eef9 🚨 fix warning 2024-04-13 14:59:13 +02:00
Niels Lohmann 8ef27594d1 🚨 fix warning 2024-03-26 17:25:26 +01:00
Niels Lohmann 91be9e0175 🚨 fix warning 2024-03-15 19:24:59 +01:00
Niels Lohmann 22d3ee930e 🚨 fix warning 2024-03-15 18:57:27 +01:00
Niels Lohmann cc4d7f1697 🚨 fix warning 2024-03-15 18:33:24 +01:00
Niels Lohmann 7b89d3ab29 🚨 fix warning 2024-03-15 17:32:27 +01:00
Niels Lohmann b131d285ed 🚨 fix warning 2024-03-15 17:27:37 +01:00
Niels Lohmann 57e22b996e 🚨 suppress warning 2024-03-15 13:08:10 +01:00
156 changed files with 478 additions and 1108 deletions
+17 -18
View File
@@ -35,29 +35,28 @@ jobs:
# - name: Test # - name: Test
# run: cd build ; ctest -j 10 --output-on-failure # run: cd build ; ctest -j 10 --output-on-failure
# macos-12 is deprecated (https://github.com/actions/runner-images/issues/10721) macos-12:
# macos-12: runs-on: macos-12 # https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md
# runs-on: macos-12 # https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md strategy:
# strategy: matrix:
# matrix: xcode: ['13.1', '13.2.1', '13.3.1', '13.4.1', '14.0', '14.0.1', '14.1']
# xcode: ['13.1', '13.2.1', '13.3.1', '13.4.1', '14.0', '14.0.1', '14.1'] env:
# env: DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
# DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
# steps:
# steps: - uses: actions/checkout@v4
# - uses: actions/checkout@v4 - name: Run CMake
# - name: Run CMake run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On -DJSON_FastTests=ON
# run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On -DJSON_FastTests=ON - name: Build
# - name: Build run: cmake --build build --parallel 10
# run: cmake --build build --parallel 10 - name: Test
# - name: Test run: cd build ; ctest -j 10 --output-on-failure
# run: cd build ; ctest -j 10 --output-on-failure
macos-13: macos-13:
runs-on: macos-13 # https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md runs-on: macos-13 # https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md
strategy: strategy:
matrix: matrix:
xcode: ['14.1', '14.2', '14.3', '14.3.1', '15.0.1', '15.1', '15.2'] xcode: [ '14.2', '14.3', '14.3.1', '15.0.1', '15.1', '15.2']
env: env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
+3 -9
View File
@@ -104,29 +104,23 @@ jobs:
ci_test_coverage: ci_test_coverage:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: ghcr.io/nlohmann/json-ci:v2.4.0
permissions: permissions:
contents: read contents: read
checks: write checks: write
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install dependencies and de_DE locale
run: |
sudo apt-get clean
sudo apt-get update
sudo apt-get install -y build-essential cmake lcov ninja-build make locales gcc-multilib g++-multilib
sudo locale-gen de_DE
sudo update-locale
- name: Run CMake - name: Run CMake
run: cmake -S . -B build -DJSON_CI=On run: cmake -S . -B build -DJSON_CI=On
- name: Build - name: Build
run: cmake --build build --target ci_test_coverage run: cmake --build build --target ci_test_coverage
- name: Archive coverage report - name: Archive coverage report
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v3
with: with:
name: code-coverage-report name: code-coverage-report
path: ${{ github.workspace }}/build/html path: ${{ github.workspace }}/build/html
- name: Publish report to Coveralls - name: Publish report to Coveralls
uses: coverallsapp/github-action@v2.3.4 uses: coverallsapp/github-action@master
with: with:
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ${{ github.workspace }}/build/json.info.filtered.noexcept path-to-lcov: ${{ github.workspace }}/build/json.info.filtered.noexcept
+2 -6
View File
@@ -4,13 +4,9 @@ Upstream-Contact: Niels Lohmann <mail@nlohmann.me>
Source: https://github.com/nlohmann/json Source: https://github.com/nlohmann/json
Files: * Files: *
Copyright: 2013-2024 Niels Lohmann <https://nlohmann.me> Copyright: 2013-2022 Niels Lohmann <https://nlohmann.me>
License: MIT License: MIT
Files: include/nlohmann/thirdparty/hedley.hpp
Copyright: 2016-2021 Evan Nemerson <evan@nemerson.com>
License: CC0
Files: tests/thirdparty/doctest/* Files: tests/thirdparty/doctest/*
Copyright: 2016-2021 Viktor Kirilov Copyright: 2016-2021 Viktor Kirilov
License: MIT License: MIT
@@ -20,7 +16,7 @@ Copyright: 2015-2017 Niels Lohmann
License: MIT License: MIT
Files: tests/thirdparty/Fuzzer/* Files: tests/thirdparty/Fuzzer/*
Copyright: 2003-2022 LLVM Project. Copyright: 2003-2022, LLVM Project.
License: Apache-2.0 License: Apache-2.0
Files: tests/thirdparty/imapdl/* Files: tests/thirdparty/imapdl/*
+1 -6
View File
@@ -40,7 +40,7 @@ endif()
option(JSON_BuildTests "Build the unit tests when BUILD_TESTING is enabled." ${JSON_BuildTests_INIT}) option(JSON_BuildTests "Build the unit tests when BUILD_TESTING is enabled." ${JSON_BuildTests_INIT})
option(JSON_CI "Enable CI build targets." OFF) option(JSON_CI "Enable CI build targets." OFF)
option(JSON_Diagnostics "Use extended diagnostic messages." OFF) option(JSON_Diagnostics "Use extended diagnostic messages." OFF)
option(JSON_GlobalUDLs "Place user-defined string literals in the global namespace." ON) option(JSON_GlobalUDLs "Place use-defined string literals in the global namespace." ON)
option(JSON_ImplicitConversions "Enable implicit conversions." ON) option(JSON_ImplicitConversions "Enable implicit conversions." ON)
option(JSON_DisableEnumSerialization "Disable default integer enum serialization." OFF) option(JSON_DisableEnumSerialization "Disable default integer enum serialization." OFF)
option(JSON_LegacyDiscardedValueComparison "Enable legacy discarded value comparison." OFF) option(JSON_LegacyDiscardedValueComparison "Enable legacy discarded value comparison." OFF)
@@ -96,10 +96,6 @@ if (JSON_Diagnostics)
message(STATUS "Diagnostics enabled") message(STATUS "Diagnostics enabled")
endif() endif()
if (NOT JSON_GlobalUDLs)
message(STATUS "User-defined string literals are not put in the global namespace")
endif()
if (JSON_SystemInclude) if (JSON_SystemInclude)
set(NLOHMANN_JSON_SYSTEM_INCLUDE "SYSTEM") set(NLOHMANN_JSON_SYSTEM_INCLUDE "SYSTEM")
endif() endif()
@@ -149,7 +145,6 @@ endif()
CONFIGURE_FILE( CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/pkg-config.pc.in" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/pkg-config.pc.in"
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc" "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc"
@ONLY
) )
## ##
+1 -1
View File
@@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2013-2024 Niels Lohmann Copyright (c) 2013-2022 Niels Lohmann
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
+2 -2
View File
@@ -279,6 +279,6 @@ serve_header:
########################################################################## ##########################################################################
reuse: reuse:
pipx run reuse annotate --recursive single_include include -tjson --license MIT --copyright "Niels Lohmann <https://nlohmann.me>" --year "2013-2024" --merge-copyrights pipx run reuse addheader --recursive single_include include -tjson --license MIT --copyright "Niels Lohmann <https://nlohmann.me>" --year "2013-2022"
pipx run reuse annotate $(TESTS_SRCS) -tjson_support --license MIT --copyright "Niels Lohmann <https://nlohmann.me>" --year "2013-2024" --merge-copyrights pipx run reuse addheader $(TESTS_SRCS) --style=c -tjson_support --license MIT --copyright "Niels Lohmann <https://nlohmann.me>" --year "2013-2022"
pipx run reuse lint pipx run reuse lint
+14 -18
View File
@@ -52,7 +52,6 @@
- [Notes](#notes) - [Notes](#notes)
- [Execute unit tests](#execute-unit-tests) - [Execute unit tests](#execute-unit-tests)
## Design goals ## Design goals
There are myriads of [JSON](https://json.org) libraries out there, and each may even have its reason to exist. Our class had these design goals: There are myriads of [JSON](https://json.org) libraries out there, and each may even have its reason to exist. Our class had these design goals:
@@ -79,7 +78,6 @@ You can sponsor this library at [GitHub Sponsors](https://github.com/sponsors/nl
### :raising_hand: Priority Sponsor ### :raising_hand: Priority Sponsor
- [Martti Laine](https://github.com/codeclown) - [Martti Laine](https://github.com/codeclown)
- [Paul Harrington](https://github.com/phrrngtn)
### :label: Named Sponsors ### :label: Named Sponsors
@@ -92,7 +90,6 @@ You can sponsor this library at [GitHub Sponsors](https://github.com/sponsors/nl
Thanks everyone! Thanks everyone!
## Support ## Support
:question: If you have a **question**, please check if it is already answered in the [**FAQ**](https://json.nlohmann.me/home/faq/) or the [**Q&A**](https://github.com/nlohmann/json/discussions/categories/q-a) section. If not, please [**ask a new question**](https://github.com/nlohmann/json/discussions/new) there. :question: If you have a **question**, please check if it is already answered in the [**FAQ**](https://json.nlohmann.me/home/faq/) or the [**Q&A**](https://github.com/nlohmann/json/discussions/categories/q-a) section. If not, please [**ask a new question**](https://github.com/nlohmann/json/discussions/new) there.
@@ -105,7 +102,6 @@ Thanks everyone!
There is also a [**docset**](https://github.com/Kapeli/Dash-User-Contributions/tree/master/docsets/JSON_for_Modern_C%2B%2B) for the documentation browsers [Dash](https://kapeli.com/dash), [Velocity](https://velocity.silverlakesoftware.com), and [Zeal](https://zealdocs.org) that contains the full [documentation](https://json.nlohmann.me) as offline resource. There is also a [**docset**](https://github.com/Kapeli/Dash-User-Contributions/tree/master/docsets/JSON_for_Modern_C%2B%2B) for the documentation browsers [Dash](https://kapeli.com/dash), [Velocity](https://velocity.silverlakesoftware.com), and [Zeal](https://zealdocs.org) that contains the full [documentation](https://json.nlohmann.me) as offline resource.
## Examples ## Examples
Here are some examples to give you an idea how to use the class. Here are some examples to give you an idea how to use the class.
@@ -1119,7 +1115,7 @@ Though it's 2024 already, the support for C++11 is still a bit sparse. Currently
- GCC 4.8 - 14.2 (and possibly later) - GCC 4.8 - 14.2 (and possibly later)
- Clang 3.4 - 20.0 (and possibly later) - Clang 3.4 - 20.0 (and possibly later)
- Apple Clang 9.1 - 16.1 (and possibly later) - Apple Clang 9.1 - 16.0 (and possibly later)
- Intel C++ Compiler 17.0.2 (and possibly later) - Intel C++ Compiler 17.0.2 (and possibly later)
- Nvidia CUDA Compiler 11.0.221 (and possibly later) - Nvidia CUDA Compiler 11.0.221 (and possibly later)
- Microsoft Visual C++ 2015 / Build Tools 14.0.25123.0 (and possibly later) - Microsoft Visual C++ 2015 / Build Tools 14.0.25123.0 (and possibly later)
@@ -1150,7 +1146,13 @@ The following compilers are currently used in continuous integration at [AppVeyo
| Compiler | Operating System | CI Provider | | Compiler | Operating System | CI Provider |
|--------------------------------------------------------------------------------------------------------|--------------------|----------------| |--------------------------------------------------------------------------------------------------------|--------------------|----------------|
| Apple Clang 14.0.0 (clang-1400.0.29.202); Xcode 14.1 | macOS 13.7 | GitHub Actions | | Apple Clang 13.0.0 (clang-1300.0.29.3); Xcode 13.1 | macOS 12.7.6 | GitHub Actions |
| Apple Clang 13.0.0 (clang-1300.0.29.30); Xcode 13.2.1 | macOS 12.7.6 | GitHub Actions |
| Apple Clang 13.1.6 (clang-1316.0.21.2.3); Xcode 13.3.1 | macOS 12.7.6 | GitHub Actions |
| Apple Clang 13.1.6 (clang-1316.0.21.2.5); Xcode 13.4.1 | macOS 12.7.6 | GitHub Actions |
| Apple Clang 14.0.0 (clang-1400.0.29.102); Xcode 14.0 | macOS 12.7.6 | GitHub Actions |
| Apple Clang 14.0.0 (clang-1400.0.29.102); Xcode 14.0.1 | macOS 12.7.6 | GitHub Actions |
| Apple Clang 14.0.0 (clang-1400.0.29.202); Xcode 14.1 | macOS 12.7.6 | GitHub Actions |
| Apple Clang 14.0.0 (clang-1400.0.29.202); Xcode 14.2 | macOS 13.7 | GitHub Actions | | Apple Clang 14.0.0 (clang-1400.0.29.202); Xcode 14.2 | macOS 13.7 | GitHub Actions |
| Apple Clang 14.0.3 (clang-1403.0.22.14.1); Xcode 14.3 | macOS 13.7 | GitHub Actions | | Apple Clang 14.0.3 (clang-1403.0.22.14.1); Xcode 14.3 | macOS 13.7 | GitHub Actions |
| Apple Clang 14.0.3 (clang-1403.0.22.14.1); Xcode 14.3.1 | macOS 13.7.1 | GitHub Actions | | Apple Clang 14.0.3 (clang-1403.0.22.14.1); Xcode 14.3.1 | macOS 13.7.1 | GitHub Actions |
@@ -1391,11 +1393,11 @@ json = dependency('nlohmann_json', required: true)
## License ## License
<img align="right" src="https://149753425.v2.pressablecdn.com/wp-content/uploads/2009/06/OSIApproved_100X125.png" alt="OSI approved license"> <img align="right" src="https://opensource.org/trademarks/opensource/OSI-Approved-License-100x137.png">
The class is licensed under the [MIT License](https://opensource.org/licenses/MIT): The class is licensed under the [MIT License](https://opensource.org/licenses/MIT):
Copyright &copy; 2013-2024 [Niels Lohmann](https://nlohmann.me) Copyright &copy; 2013-2022 [Niels Lohmann](https://nlohmann.me)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
@@ -1405,19 +1407,13 @@ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR I
* * * * * *
- The class contains the UTF-8 Decoder from Bjoern Hoehrmann which is licensed under the [MIT License](https://opensource.org/licenses/MIT) (see above). Copyright &copy; 2008-2009 [Björn Hoehrmann](https://bjoern.hoehrmann.de/) <bjoern@hoehrmann.de> The class contains the UTF-8 Decoder from Bjoern Hoehrmann which is licensed under the [MIT License](https://opensource.org/licenses/MIT) (see above). Copyright &copy; 2008-2009 [Björn Hoehrmann](https://bjoern.hoehrmann.de/) <bjoern@hoehrmann.de>
- The class contains a slightly modified version of the Grisu2 algorithm from Florian Loitsch which is licensed under the [MIT License](https://opensource.org/licenses/MIT) (see above). Copyright &copy; 2009 [Florian Loitsch](https://florian.loitsch.com/)
- The class contains a copy of [Hedley](https://nemequ.github.io/hedley/) from Evan Nemerson which is licensed as [CC0-1.0](https://creativecommons.org/publicdomain/zero/1.0/).
- The class contains parts of [Google Abseil](https://github.com/abseil/abseil-cpp) which is licensed under the [Apache 2.0 License](https://opensource.org/licenses/Apache-2.0).
<img align="right" src="https://git.fsfe.org/reuse/reuse-ci/raw/branch/master/reuse-horizontal.png" alt="REUSE Software"> The class contains a slightly modified version of the Grisu2 algorithm from Florian Loitsch which is licensed under the [MIT License](https://opensource.org/licenses/MIT) (see above). Copyright &copy; 2009 [Florian Loitsch](https://florian.loitsch.com/)
The library is compliant to version 3.3 of the [**REUSE specification**](https://reuse.software): The class contains a copy of [Hedley](https://nemequ.github.io/hedley/) from Evan Nemerson which is licensed as [CC0-1.0](https://creativecommons.org/publicdomain/zero/1.0/).
- Every source file contains an SPDX copyright header. The class contains parts of [Google Abseil](https://github.com/abseil/abseil-cpp) which is licensed under the [Apache 2.0 License](https://opensource.org/licenses/Apache-2.0).
- The full text of all licenses used in the repository can be found in the `LICENSES` folder.
- File `.reuse/dep5` contains an overview of all files' copyrights and licenses.
- Run `pipx run reuse lint` to verify the project's REUSE compliance and `pipx run reuse spdx` to generate a SPDX SBOM.
## Contact ## Contact
+2
View File
@@ -96,6 +96,7 @@ file(GLOB_RECURSE SRC_FILES ${PROJECT_SOURCE_DIR}/include/nlohmann/*.hpp)
# -Wno-padded We do not care about padding warnings. # -Wno-padded We do not care about padding warnings.
# -Wno-covered-switch-default All switches list all cases and a default case. # -Wno-covered-switch-default All switches list all cases and a default case.
# -Wno-unsafe-buffer-usage Otherwise Doctest would not compile. # -Wno-unsafe-buffer-usage Otherwise Doctest would not compile.
# -Wno-weak-vtables The library is header-only.
# -Wreserved-identifier See https://github.com/onqtam/doctest/issues/536. # -Wreserved-identifier See https://github.com/onqtam/doctest/issues/536.
set(CLANG_CXXFLAGS set(CLANG_CXXFLAGS
@@ -108,6 +109,7 @@ set(CLANG_CXXFLAGS
-Wno-padded -Wno-padded
-Wno-covered-switch-default -Wno-covered-switch-default
-Wno-unsafe-buffer-usage -Wno-unsafe-buffer-usage
-Wno-weak-vtables
-Wno-reserved-identifier -Wno-reserved-identifier
) )
+3 -6
View File
@@ -1,7 +1,4 @@
prefix=@CMAKE_INSTALL_PREFIX@ Name: ${PROJECT_NAME}
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
Name: @PROJECT_NAME@
Description: JSON for Modern C++ Description: JSON for Modern C++
Version: @PROJECT_VERSION@ Version: ${PROJECT_VERSION}
Cflags: -I${includedir} Cflags: -I${CMAKE_INSTALL_FULL_INCLUDEDIR}
+2 -2
View File
@@ -1,10 +1,10 @@
# License # License
<img align="right" src="https://149753425.v2.pressablecdn.com/wp-content/uploads/2009/06/OSIApproved_100X125.png"> <img align="right" src="https://opensource.org/trademarks/opensource/OSI-Approved-License-100x137.png">
The class is licensed under the [MIT License](https://opensource.org/licenses/MIT): The class is licensed under the [MIT License](https://opensource.org/licenses/MIT):
Copyright &copy; 2013-2024 [Niels Lohmann](https://nlohmann.me) Copyright &copy; 2013-2022 [Niels Lohmann](https://nlohmann.me)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
@@ -299,7 +299,14 @@ template < typename BasicJsonType, typename T, std::size_t... Idx >
std::array<T, sizeof...(Idx)> from_json_inplace_array_impl(BasicJsonType&& j, std::array<T, sizeof...(Idx)> from_json_inplace_array_impl(BasicJsonType&& j,
identity_tag<std::array<T, sizeof...(Idx)>> /*unused*/, index_sequence<Idx...> /*unused*/) identity_tag<std::array<T, sizeof...(Idx)>> /*unused*/, index_sequence<Idx...> /*unused*/)
{ {
return { { std::forward<BasicJsonType>(j).at(Idx).template get<T>()... } }; return { { std::forward<BasicJsonType>(j).at(Idx).template get < T&& > ()... } };
}
template < typename BasicJsonType, typename T, std::size_t... Idx >
std::array<T, sizeof...(Idx)> from_json_inplace_array_impl(const BasicJsonType& j,
identity_tag<std::array<T, sizeof...(Idx)>> /*unused*/, index_sequence<Idx...> /*unused*/)
{
return { { j.at(Idx).template get<T>()... } };
} }
template < typename BasicJsonType, typename T, std::size_t N > template < typename BasicJsonType, typename T, std::size_t N >
@@ -395,6 +402,12 @@ inline void from_json(const BasicJsonType& j, ArithmeticType& val)
} }
} }
template<typename BasicJsonType, typename... Args, std::size_t... Idx>
std::tuple<Args...> from_json_tuple_impl_base(const BasicJsonType& j, index_sequence<Idx...> /*unused*/)
{
return std::make_tuple(j.at(Idx).template get<Args>()...);
}
template<typename BasicJsonType, typename... Args, std::size_t... Idx> template<typename BasicJsonType, typename... Args, std::size_t... Idx>
std::tuple<Args...> from_json_tuple_impl_base(BasicJsonType&& j, index_sequence<Idx...> /*unused*/) std::tuple<Args...> from_json_tuple_impl_base(BasicJsonType&& j, index_sequence<Idx...> /*unused*/)
{ {
@@ -404,8 +417,14 @@ std::tuple<Args...> from_json_tuple_impl_base(BasicJsonType&& j, index_sequence<
template < typename BasicJsonType, class A1, class A2 > template < typename BasicJsonType, class A1, class A2 >
std::pair<A1, A2> from_json_tuple_impl(BasicJsonType&& j, identity_tag<std::pair<A1, A2>> /*unused*/, priority_tag<0> /*unused*/) std::pair<A1, A2> from_json_tuple_impl(BasicJsonType&& j, identity_tag<std::pair<A1, A2>> /*unused*/, priority_tag<0> /*unused*/)
{ {
return {std::forward<BasicJsonType>(j).at(0).template get<A1>(), return {std::forward<BasicJsonType>(j).at(0).template get < A1&& > (),
std::forward<BasicJsonType>(j).at(1).template get<A2>()}; std::forward<BasicJsonType>(j).at(1).template get < A2&& > ()};
}
template < typename BasicJsonType, class A1, class A2 >
std::pair<A1, A2> from_json_tuple_impl(const BasicJsonType& j, identity_tag<std::pair<A1, A2>> /*unused*/, priority_tag<0> /*unused*/)
{
return {j.at(0).template get<A1>(), j.at(1).template get<A2>()};
} }
template<typename BasicJsonType, typename A1, typename A2> template<typename BasicJsonType, typename A1, typename A2>
@@ -4,7 +4,7 @@
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2009 Florian Loitsch <https://florian.loitsch.com/> // SPDX-FileCopyrightText: 2009 Florian Loitsch <https://florian.loitsch.com/>
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
+1 -17
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
@@ -25,18 +25,6 @@
#include <nlohmann/detail/meta/type_traits.hpp> #include <nlohmann/detail/meta/type_traits.hpp>
#include <nlohmann/detail/string_concat.hpp> #include <nlohmann/detail/string_concat.hpp>
// With -Wweak-vtables, Clang will complain about the exception classes as they
// have no out-of-line virtual method definitions and their vtable will be
// emitted in every translation unit. This issue cannot be fixed with a
// header-only library as there is no implementation file to move these
// functions to. As a result, we suppress this warning here to avoid client
// code to stumble over this. See https://github.com/nlohmann/json/issues/4087
// for a discussion.
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wweak-vtables"
#endif
NLOHMANN_JSON_NAMESPACE_BEGIN NLOHMANN_JSON_NAMESPACE_BEGIN
namespace detail namespace detail
{ {
@@ -267,7 +255,3 @@ class other_error : public exception
} // namespace detail } // namespace detail
NLOHMANN_JSON_NAMESPACE_END NLOHMANN_JSON_NAMESPACE_END
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
+22 -57
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
@@ -20,9 +20,6 @@
#include <string> // char_traits, string #include <string> // char_traits, string
#include <utility> // make_pair, move #include <utility> // make_pair, move
#include <vector> // vector #include <vector> // vector
#ifdef __cpp_lib_byteswap
#include <bit> //byteswap
#endif
#include <nlohmann/detail/exceptions.hpp> #include <nlohmann/detail/exceptions.hpp>
#include <nlohmann/detail/input/input_adapters.hpp> #include <nlohmann/detail/input/input_adapters.hpp>
@@ -2757,29 +2754,6 @@ class binary_reader
return current = ia.get_character(); return current = ia.get_character();
} }
/*!
@brief get_to read into a primitive type
This function provides the interface to the used input adapter. It does
not throw in case the input reached EOF, but returns false instead
@return bool, whether the read was successful
*/
template<class T>
bool get_to(T& dest, const input_format_t format, const char* context)
{
auto new_chars_read = ia.get_elements(&dest);
chars_read += new_chars_read;
if (JSON_HEDLEY_UNLIKELY(new_chars_read < sizeof(T)))
{
// in case of failure, advance position by 1 to report failing location
++chars_read;
sax->parse_error(chars_read, "<end of file>", parse_error::create(110, chars_read, exception_message(format, "unexpected end of input", context), nullptr));
return false;
}
return true;
}
/*! /*!
@return character read from the input after ignoring all 'N' entries @return character read from the input after ignoring all 'N' entries
*/ */
@@ -2794,28 +2768,6 @@ class binary_reader
return current; return current;
} }
template<class NumberType>
static void byte_swap(NumberType& number)
{
constexpr std::size_t sz = sizeof(number);
#ifdef __cpp_lib_byteswap
if constexpr (sz == 1)
{
return;
}
if constexpr(std::is_integral_v<NumberType>)
{
number = std::byteswap(number);
return;
}
#endif
auto* ptr = reinterpret_cast<std::uint8_t*>(&number);
for (std::size_t i = 0; i < sz / 2; ++i)
{
std::swap(ptr[i], ptr[sz - i - 1]);
}
}
/* /*
@brief read a number from the input @brief read a number from the input
@@ -2834,16 +2786,29 @@ class binary_reader
template<typename NumberType, bool InputIsLittleEndian = false> template<typename NumberType, bool InputIsLittleEndian = false>
bool get_number(const input_format_t format, NumberType& result) bool get_number(const input_format_t format, NumberType& result)
{ {
// read in the original format // step 1: read input into array with system's byte order
std::array<std::uint8_t, sizeof(NumberType)> vec{};
for (std::size_t i = 0; i < sizeof(NumberType); ++i)
{
get();
if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(format, "number")))
{
return false;
}
if (JSON_HEDLEY_UNLIKELY(!get_to(result, format, "number"))) // reverse byte order prior to conversion if necessary
{ if (is_little_endian != (InputIsLittleEndian || format == input_format_t::bjdata))
return false; {
} vec[sizeof(NumberType) - i - 1] = static_cast<std::uint8_t>(current);
if (is_little_endian != (InputIsLittleEndian || format == input_format_t::bjdata)) }
{ else
byte_swap(result); {
vec[i] = static_cast<std::uint8_t>(current); // LCOV_EXCL_LINE
}
} }
// step 2: convert array into number of type T and return
std::memcpy(&result, vec.data(), sizeof(NumberType));
return true; return true;
} }
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
@@ -23,7 +23,6 @@
#include <istream> // istream #include <istream> // istream
#endif // JSON_NO_IO #endif // JSON_NO_IO
#include <nlohmann/detail/exceptions.hpp>
#include <nlohmann/detail/iterators/iterator_traits.hpp> #include <nlohmann/detail/iterators/iterator_traits.hpp>
#include <nlohmann/detail/macro_scope.hpp> #include <nlohmann/detail/macro_scope.hpp>
#include <nlohmann/detail/meta/type_traits.hpp> #include <nlohmann/detail/meta/type_traits.hpp>
@@ -68,13 +67,6 @@ class file_input_adapter
return std::fgetc(m_file); return std::fgetc(m_file);
} }
// returns the number of characters successfully read
template<class T>
std::size_t get_elements(T* dest, std::size_t count = 1)
{
return fread(dest, 1, sizeof(T) * count, m_file);
}
private: private:
/// the file pointer to read from /// the file pointer to read from
std::FILE* m_file; std::FILE* m_file;
@@ -134,17 +126,6 @@ class input_stream_adapter
return res; return res;
} }
template<class T>
std::size_t get_elements(T* dest, std::size_t count = 1)
{
auto res = static_cast<std::size_t>(sb->sgetn(reinterpret_cast<char*>(dest), static_cast<std::streamsize>(count * sizeof(T))));
if (JSON_HEDLEY_UNLIKELY(res < count * sizeof(T)))
{
is->clear(is->rdstate() | std::ios::eofbit);
}
return res;
}
private: private:
/// the associated input stream /// the associated input stream
std::istream* is = nullptr; std::istream* is = nullptr;
@@ -176,26 +157,6 @@ class iterator_input_adapter
return char_traits<char_type>::eof(); return char_traits<char_type>::eof();
} }
// for general iterators, we cannot really do something better than falling back to processing the range one-by-one
template<class T>
std::size_t get_elements(T* dest, std::size_t count = 1)
{
auto* ptr = reinterpret_cast<char*>(dest);
for (std::size_t read_index = 0; read_index < count * sizeof(T); ++read_index)
{
if (JSON_HEDLEY_LIKELY(current != end))
{
ptr[read_index] = static_cast<char>(*current);
std::advance(current, 1);
}
else
{
return read_index;
}
}
return count * sizeof(T);
}
private: private:
IteratorType current; IteratorType current;
IteratorType end; IteratorType end;
@@ -359,13 +320,6 @@ class wide_string_input_adapter
return utf8_bytes[utf8_bytes_index++]; return utf8_bytes[utf8_bytes_index++];
} }
// parsing binary with wchar doesn't make sense, but since the parsing mode can be runtime, we need something here
template<class T>
std::size_t get_elements(T* /*dest*/, std::size_t /*count*/ = 1)
{
JSON_THROW(parse_error::create(112, 1, "wide string type cannot be interpreted as binary data", nullptr));
}
private: private:
BaseInputAdapter base_adapter; BaseInputAdapter base_adapter;
@@ -466,10 +420,6 @@ typename container_input_adapter_factory_impl::container_input_adapter_factory<C
// Special cases with fast paths // Special cases with fast paths
inline file_input_adapter input_adapter(std::FILE* file) inline file_input_adapter input_adapter(std::FILE* file)
{ {
if (file == nullptr)
{
JSON_THROW(parse_error::create(101, 0, "attempting to parse an empty input; check that your input string or stream contains the expected JSON", nullptr));
}
return file_input_adapter(file); return file_input_adapter(file);
} }
@@ -496,10 +446,6 @@ template < typename CharT,
int >::type = 0 > int >::type = 0 >
contiguous_bytes_input_adapter input_adapter(CharT b) contiguous_bytes_input_adapter input_adapter(CharT b)
{ {
if (b == nullptr)
{
JSON_THROW(parse_error::create(101, 0, "attempting to parse an empty input; check that your input string or stream contains the expected JSON", nullptr));
}
auto length = std::strlen(reinterpret_cast<const char*>(b)); auto length = std::strlen(reinterpret_cast<const char*>(b));
const auto* ptr = reinterpret_cast<const char*>(b); const auto* ptr = reinterpret_cast<const char*>(b);
return input_adapter(ptr, ptr + length); return input_adapter(ptr, ptr + length);
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
+3 -13
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
@@ -1049,7 +1049,6 @@ scan_number_zero:
case '.': case '.':
{ {
add(decimal_point_char); add(decimal_point_char);
decimal_point_position = token_buffer.size() - 1;
goto scan_number_decimal1; goto scan_number_decimal1;
} }
@@ -1086,7 +1085,6 @@ scan_number_any1:
case '.': case '.':
{ {
add(decimal_point_char); add(decimal_point_char);
decimal_point_position = token_buffer.size() - 1;
goto scan_number_decimal1; goto scan_number_decimal1;
} }
@@ -1258,7 +1256,7 @@ scan_number_done:
// we checked the number format before // we checked the number format before
JSON_ASSERT(endptr == token_buffer.data() + token_buffer.size()); JSON_ASSERT(endptr == token_buffer.data() + token_buffer.size());
if (errno != ERANGE) if (errno == 0)
{ {
value_unsigned = static_cast<number_unsigned_t>(x); value_unsigned = static_cast<number_unsigned_t>(x);
if (value_unsigned == x) if (value_unsigned == x)
@@ -1274,7 +1272,7 @@ scan_number_done:
// we checked the number format before // we checked the number format before
JSON_ASSERT(endptr == token_buffer.data() + token_buffer.size()); JSON_ASSERT(endptr == token_buffer.data() + token_buffer.size());
if (errno != ERANGE) if (errno == 0)
{ {
value_integer = static_cast<number_integer_t>(x); value_integer = static_cast<number_integer_t>(x);
if (value_integer == x) if (value_integer == x)
@@ -1324,7 +1322,6 @@ scan_number_done:
{ {
token_buffer.clear(); token_buffer.clear();
token_string.clear(); token_string.clear();
decimal_point_position = std::string::npos;
token_string.push_back(char_traits<char_type>::to_char_type(current)); token_string.push_back(char_traits<char_type>::to_char_type(current));
} }
@@ -1433,11 +1430,6 @@ scan_number_done:
/// return current string value (implicitly resets the token; useful only once) /// return current string value (implicitly resets the token; useful only once)
string_t& get_string() string_t& get_string()
{ {
// translate decimal points from locale back to '.' (#4084)
if (decimal_point_char != '.' && decimal_point_position != std::string::npos)
{
token_buffer[decimal_point_position] = '.';
}
return token_buffer; return token_buffer;
} }
@@ -1635,8 +1627,6 @@ scan_number_done:
/// the decimal point /// the decimal point
const char_int_type decimal_point_char = '.'; const char_int_type decimal_point_char = '.';
/// the position of the decimal point in the input
std::size_t decimal_point_position = std::string::npos;
}; };
} // namespace detail } // namespace detail
+23 -47
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
@@ -212,12 +212,9 @@ class parser
// parse key // parse key
if (JSON_HEDLEY_UNLIKELY(last_token != token_type::value_string)) if (JSON_HEDLEY_UNLIKELY(last_token != token_type::value_string))
{ {
if (!sax->parse_error(m_lexer.get_position(), return sax->parse_error(m_lexer.get_position(),
m_lexer.get_token_string(), m_lexer.get_token_string(),
parse_error::create(101, m_lexer.get_position(), exception_message(token_type::value_string, "object key"), nullptr))) parse_error::create(101, m_lexer.get_position(), exception_message(token_type::value_string, "object key"), nullptr));
{
return false;
}
} }
if (JSON_HEDLEY_UNLIKELY(!sax->key(m_lexer.get_string()))) if (JSON_HEDLEY_UNLIKELY(!sax->key(m_lexer.get_string())))
{ {
@@ -227,12 +224,9 @@ class parser
// parse separator (:) // parse separator (:)
if (JSON_HEDLEY_UNLIKELY(get_token() != token_type::name_separator)) if (JSON_HEDLEY_UNLIKELY(get_token() != token_type::name_separator))
{ {
if (!sax->parse_error(m_lexer.get_position(), return sax->parse_error(m_lexer.get_position(),
m_lexer.get_token_string(), m_lexer.get_token_string(),
parse_error::create(101, m_lexer.get_position(), exception_message(token_type::name_separator, "object separator"), nullptr))) parse_error::create(101, m_lexer.get_position(), exception_message(token_type::name_separator, "object separator"), nullptr));
{
return false;
}
} }
// remember we are now inside an object // remember we are now inside an object
@@ -273,12 +267,9 @@ class parser
if (JSON_HEDLEY_UNLIKELY(!std::isfinite(res))) if (JSON_HEDLEY_UNLIKELY(!std::isfinite(res)))
{ {
if (!sax->parse_error(m_lexer.get_position(), return sax->parse_error(m_lexer.get_position(),
m_lexer.get_token_string(), m_lexer.get_token_string(),
out_of_range::create(406, concat("number overflow parsing '", m_lexer.get_token_string(), '\''), nullptr))) out_of_range::create(406, concat("number overflow parsing '", m_lexer.get_token_string(), '\''), nullptr));
{
return false;
}
} }
if (JSON_HEDLEY_UNLIKELY(!sax->number_float(res, m_lexer.get_string()))) if (JSON_HEDLEY_UNLIKELY(!sax->number_float(res, m_lexer.get_string())))
@@ -346,33 +337,24 @@ class parser
case token_type::parse_error: case token_type::parse_error:
{ {
// using "uninitialized" to avoid "expected" message // using "uninitialized" to avoid "expected" message
if (!sax->parse_error(m_lexer.get_position(), return sax->parse_error(m_lexer.get_position(),
m_lexer.get_token_string(), m_lexer.get_token_string(),
parse_error::create(101, m_lexer.get_position(), exception_message(token_type::uninitialized, "value"), nullptr))) parse_error::create(101, m_lexer.get_position(), exception_message(token_type::uninitialized, "value"), nullptr));
{
return false;
}
break;
} }
case token_type::end_of_input: case token_type::end_of_input:
{ {
if (JSON_HEDLEY_UNLIKELY(m_lexer.get_position().chars_read_total == 1)) if (JSON_HEDLEY_UNLIKELY(m_lexer.get_position().chars_read_total == 1))
{ {
if (!sax->parse_error(m_lexer.get_position(), return sax->parse_error(m_lexer.get_position(),
m_lexer.get_token_string(), m_lexer.get_token_string(),
parse_error::create(101, m_lexer.get_position(), parse_error::create(101, m_lexer.get_position(),
"attempting to parse an empty input; check that your input string or stream contains the expected JSON", nullptr))) "attempting to parse an empty input; check that your input string or stream contains the expected JSON", nullptr));
{
return false;
}
} }
return sax->parse_error(m_lexer.get_position(), return sax->parse_error(m_lexer.get_position(),
m_lexer.get_token_string(), m_lexer.get_token_string(),
parse_error::create(101, m_lexer.get_position(), exception_message(token_type::literal_or_value, "value"), nullptr)); parse_error::create(101, m_lexer.get_position(), exception_message(token_type::literal_or_value, "value"), nullptr));
} }
case token_type::uninitialized: case token_type::uninitialized:
case token_type::end_array: case token_type::end_array:
case token_type::end_object: case token_type::end_object:
@@ -440,12 +422,9 @@ class parser
// parse key // parse key
if (JSON_HEDLEY_UNLIKELY(get_token() != token_type::value_string)) if (JSON_HEDLEY_UNLIKELY(get_token() != token_type::value_string))
{ {
if (!sax->parse_error(m_lexer.get_position(), return sax->parse_error(m_lexer.get_position(),
m_lexer.get_token_string(), m_lexer.get_token_string(),
parse_error::create(101, m_lexer.get_position(), exception_message(token_type::value_string, "object key"), nullptr))) parse_error::create(101, m_lexer.get_position(), exception_message(token_type::value_string, "object key"), nullptr));
{
return false;
}
} }
if (JSON_HEDLEY_UNLIKELY(!sax->key(m_lexer.get_string()))) if (JSON_HEDLEY_UNLIKELY(!sax->key(m_lexer.get_string())))
@@ -456,12 +435,9 @@ class parser
// parse separator (:) // parse separator (:)
if (JSON_HEDLEY_UNLIKELY(get_token() != token_type::name_separator)) if (JSON_HEDLEY_UNLIKELY(get_token() != token_type::name_separator))
{ {
if (!sax->parse_error(m_lexer.get_position(), return sax->parse_error(m_lexer.get_position(),
m_lexer.get_token_string(), m_lexer.get_token_string(),
parse_error::create(101, m_lexer.get_position(), exception_message(token_type::name_separator, "object separator"), nullptr))) parse_error::create(101, m_lexer.get_position(), exception_message(token_type::name_separator, "object separator"), nullptr));
{
return false;
}
} }
// parse values // parse values
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
@@ -463,7 +463,7 @@ class iter_impl // NOLINT(cppcoreguidelines-special-member-functions,hicpp-speci
/*! /*!
@brief comparison: equal @brief comparison: equal
@pre (1) Both iterators are initialized to point to the same object, or (2) both iterators are value-initialized. @pre The iterator is initialized; i.e. `m_object != nullptr`.
*/ */
template < typename IterImpl, detail::enable_if_t < (std::is_same<IterImpl, iter_impl>::value || std::is_same<IterImpl, other_iter_impl>::value), std::nullptr_t > = nullptr > template < typename IterImpl, detail::enable_if_t < (std::is_same<IterImpl, iter_impl>::value || std::is_same<IterImpl, other_iter_impl>::value), std::nullptr_t > = nullptr >
bool operator==(const IterImpl& other) const bool operator==(const IterImpl& other) const
@@ -474,11 +474,7 @@ class iter_impl // NOLINT(cppcoreguidelines-special-member-functions,hicpp-speci
JSON_THROW(invalid_iterator::create(212, "cannot compare iterators of different containers", m_object)); JSON_THROW(invalid_iterator::create(212, "cannot compare iterators of different containers", m_object));
} }
// value-initialized forward iterators can be compared, and must compare equal to other value-initialized iterators of the same type #4493 JSON_ASSERT(m_object != nullptr);
if (m_object == nullptr)
{
return true;
}
switch (m_object->m_data.m_type) switch (m_object->m_data.m_type)
{ {
@@ -503,7 +499,7 @@ class iter_impl // NOLINT(cppcoreguidelines-special-member-functions,hicpp-speci
/*! /*!
@brief comparison: not equal @brief comparison: not equal
@pre (1) Both iterators are initialized to point to the same object, or (2) both iterators are value-initialized. @pre The iterator is initialized; i.e. `m_object != nullptr`.
*/ */
template < typename IterImpl, detail::enable_if_t < (std::is_same<IterImpl, iter_impl>::value || std::is_same<IterImpl, other_iter_impl>::value), std::nullptr_t > = nullptr > template < typename IterImpl, detail::enable_if_t < (std::is_same<IterImpl, iter_impl>::value || std::is_same<IterImpl, other_iter_impl>::value), std::nullptr_t > = nullptr >
bool operator!=(const IterImpl& other) const bool operator!=(const IterImpl& other) const
@@ -513,7 +509,7 @@ class iter_impl // NOLINT(cppcoreguidelines-special-member-functions,hicpp-speci
/*! /*!
@brief comparison: smaller @brief comparison: smaller
@pre (1) Both iterators are initialized to point to the same object, or (2) both iterators are value-initialized. @pre The iterator is initialized; i.e. `m_object != nullptr`.
*/ */
bool operator<(const iter_impl& other) const bool operator<(const iter_impl& other) const
{ {
@@ -523,12 +519,7 @@ class iter_impl // NOLINT(cppcoreguidelines-special-member-functions,hicpp-speci
JSON_THROW(invalid_iterator::create(212, "cannot compare iterators of different containers", m_object)); JSON_THROW(invalid_iterator::create(212, "cannot compare iterators of different containers", m_object));
} }
// value-initialized forward iterators can be compared, and must compare equal to other value-initialized iterators of the same type #4493 JSON_ASSERT(m_object != nullptr);
if (m_object == nullptr)
{
// the iterators are both value-initialized and are to be considered equal, but this function checks for smaller, so we return false
return false;
}
switch (m_object->m_data.m_type) switch (m_object->m_data.m_type)
{ {
@@ -553,7 +544,7 @@ class iter_impl // NOLINT(cppcoreguidelines-special-member-functions,hicpp-speci
/*! /*!
@brief comparison: less than or equal @brief comparison: less than or equal
@pre (1) Both iterators are initialized to point to the same object, or (2) both iterators are value-initialized. @pre The iterator is initialized; i.e. `m_object != nullptr`.
*/ */
bool operator<=(const iter_impl& other) const bool operator<=(const iter_impl& other) const
{ {
@@ -562,7 +553,7 @@ class iter_impl // NOLINT(cppcoreguidelines-special-member-functions,hicpp-speci
/*! /*!
@brief comparison: greater than @brief comparison: greater than
@pre (1) Both iterators are initialized to point to the same object, or (2) both iterators are value-initialized. @pre The iterator is initialized; i.e. `m_object != nullptr`.
*/ */
bool operator>(const iter_impl& other) const bool operator>(const iter_impl& other) const
{ {
@@ -571,7 +562,7 @@ class iter_impl // NOLINT(cppcoreguidelines-special-member-functions,hicpp-speci
/*! /*!
@brief comparison: greater than or equal @brief comparison: greater than or equal
@pre (1) The iterator is initialized; i.e. `m_object != nullptr`, or (2) both iterators are value-initialized. @pre The iterator is initialized; i.e. `m_object != nullptr`.
*/ */
bool operator>=(const iter_impl& other) const bool operator>=(const iter_impl& other) const
{ {
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
+1 -5
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
@@ -216,9 +216,7 @@
template<typename BasicJsonType> \ template<typename BasicJsonType> \
inline void to_json(BasicJsonType& j, const ENUM_TYPE& e) \ inline void to_json(BasicJsonType& j, const ENUM_TYPE& e) \
{ \ { \
/* NOLINTNEXTLINE(modernize-type-traits) we use C++11 */ \
static_assert(std::is_enum<ENUM_TYPE>::value, #ENUM_TYPE " must be an enum!"); \ static_assert(std::is_enum<ENUM_TYPE>::value, #ENUM_TYPE " must be an enum!"); \
/* NOLINTNEXTLINE(modernize-avoid-c-arrays) we don't want to depend on <array> */ \
static const std::pair<ENUM_TYPE, BasicJsonType> m[] = __VA_ARGS__; \ static const std::pair<ENUM_TYPE, BasicJsonType> m[] = __VA_ARGS__; \
auto it = std::find_if(std::begin(m), std::end(m), \ auto it = std::find_if(std::begin(m), std::end(m), \
[e](const std::pair<ENUM_TYPE, BasicJsonType>& ej_pair) -> bool \ [e](const std::pair<ENUM_TYPE, BasicJsonType>& ej_pair) -> bool \
@@ -230,9 +228,7 @@
template<typename BasicJsonType> \ template<typename BasicJsonType> \
inline void from_json(const BasicJsonType& j, ENUM_TYPE& e) \ inline void from_json(const BasicJsonType& j, ENUM_TYPE& e) \
{ \ { \
/* NOLINTNEXTLINE(modernize-type-traits) we use C++11 */ \
static_assert(std::is_enum<ENUM_TYPE>::value, #ENUM_TYPE " must be an enum!"); \ static_assert(std::is_enum<ENUM_TYPE>::value, #ENUM_TYPE " must be an enum!"); \
/* NOLINTNEXTLINE(modernize-avoid-c-arrays) we don't want to depend on <array> */ \
static const std::pair<ENUM_TYPE, BasicJsonType> m[] = __VA_ARGS__; \ static const std::pair<ENUM_TYPE, BasicJsonType> m[] = __VA_ARGS__; \
auto it = std::find_if(std::begin(m), std::end(m), \ auto it = std::find_if(std::begin(m), std::end(m), \
[&j](const std::pair<ENUM_TYPE, BasicJsonType>& ej_pair) -> bool \ [&j](const std::pair<ENUM_TYPE, BasicJsonType>& ej_pair) -> bool \
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-FileCopyrightText: 2018 The Abseil Authors // SPDX-FileCopyrightText: 2018 The Abseil Authors
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
+2 -2
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
@@ -19,7 +19,7 @@ namespace std_fs = std::experimental::filesystem;
} // namespace detail } // namespace detail
NLOHMANN_JSON_NAMESPACE_END NLOHMANN_JSON_NAMESPACE_END
#elif JSON_HAS_FILESYSTEM #elif JSON_HAS_FILESYSTEM
#include <filesystem> // NOLINT(build/c++17) #include <filesystem> // NOLINT(build/c++17)
NLOHMANN_JSON_NAMESPACE_BEGIN NLOHMANN_JSON_NAMESPACE_BEGIN
namespace detail namespace detail
{ {
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
@@ -3,8 +3,8 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2008 - 2009 Björn Hoehrmann <bjoern@hoehrmann.de> // SPDX-FileCopyrightText: 2008-2009 Björn Hoehrmann <bjoern@hoehrmann.de>
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
+8 -10
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
/****************************************************************************\ /****************************************************************************\
@@ -1212,15 +1212,13 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
/// @brief move constructor /// @brief move constructor
/// @sa https://json.nlohmann.me/api/basic_json/basic_json/ /// @sa https://json.nlohmann.me/api/basic_json/basic_json/
basic_json(basic_json&& other) noexcept basic_json(basic_json&& other) noexcept
: json_base_class_t(std::forward<json_base_class_t>(other)), // check that passed value is valid (has to be done before forwarding)
m_data(std::move(other.m_data)) : json_base_class_t((other.assert_invariant(false), std::forward<json_base_class_t>(other))),
m_data(std::move(other.m_data))// NOLINT(bugprone-use-after-move,hicpp-invalid-access-moved)
{ {
// check that passed value is valid
other.assert_invariant(false);
// invalidate payload // invalidate payload
other.m_data.m_type = value_t::null; other.m_data.m_type = value_t::null; // NOLINT(bugprone-use-after-move,hicpp-invalid-access-moved)
other.m_data.m_value = {}; other.m_data.m_value = {};// NOLINT(bugprone-use-after-move,hicpp-invalid-access-moved)
set_parents(); set_parents();
assert_invariant(); assert_invariant();
@@ -2012,7 +2010,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
auto it = m_data.m_value.object->find(std::forward<KeyType>(key)); auto it = m_data.m_value.object->find(std::forward<KeyType>(key));
if (it == m_data.m_value.object->end()) if (it == m_data.m_value.object->end())
{ {
JSON_THROW(out_of_range::create(403, detail::concat("key '", string_t(std::forward<KeyType>(key)), "' not found"), this)); JSON_THROW(out_of_range::create(403, "key not found (key is an rvalue and cannot be shown)", this));
} }
return set_parent(it->second); return set_parent(it->second);
} }
@@ -2050,7 +2048,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
auto it = m_data.m_value.object->find(std::forward<KeyType>(key)); auto it = m_data.m_value.object->find(std::forward<KeyType>(key));
if (it == m_data.m_value.object->end()) if (it == m_data.m_value.object->end())
{ {
JSON_THROW(out_of_range::create(403, detail::concat("key '", string_t(std::forward<KeyType>(key)), "' not found"), this)); JSON_THROW(out_of_range::create(403, "key not found (key is an rvalue and cannot be shown)", this));
} }
return it->second; return it->second;
} }
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#ifndef INCLUDE_NLOHMANN_JSON_FWD_HPP_ #ifndef INCLUDE_NLOHMANN_JSON_FWD_HPP_
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
+2 -2
View File
@@ -5,8 +5,8 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-FileCopyrightText: 2016 - 2021 Evan Nemerson <evan@nemerson.com> // SPDX-FileCopyrightText: 2016-2021 Evan Nemerson <evan@nemerson.com>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
/* Hedley - https://nemequ.github.io/hedley /* Hedley - https://nemequ.github.io/hedley
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
+129 -265
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
/****************************************************************************\ /****************************************************************************\
@@ -37,7 +37,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -50,7 +50,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -152,7 +152,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -179,7 +179,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -199,7 +199,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -215,7 +215,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -227,7 +227,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -240,7 +240,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -327,8 +327,8 @@ NLOHMANN_JSON_NAMESPACE_END
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-FileCopyrightText: 2016 - 2021 Evan Nemerson <evan@nemerson.com> // SPDX-FileCopyrightText: 2016-2021 Evan Nemerson <evan@nemerson.com>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
/* Hedley - https://nemequ.github.io/hedley /* Hedley - https://nemequ.github.io/hedley
@@ -2572,9 +2572,7 @@ JSON_HEDLEY_DIAGNOSTIC_POP
template<typename BasicJsonType> \ template<typename BasicJsonType> \
inline void to_json(BasicJsonType& j, const ENUM_TYPE& e) \ inline void to_json(BasicJsonType& j, const ENUM_TYPE& e) \
{ \ { \
/* NOLINTNEXTLINE(modernize-type-traits) we use C++11 */ \
static_assert(std::is_enum<ENUM_TYPE>::value, #ENUM_TYPE " must be an enum!"); \ static_assert(std::is_enum<ENUM_TYPE>::value, #ENUM_TYPE " must be an enum!"); \
/* NOLINTNEXTLINE(modernize-avoid-c-arrays) we don't want to depend on <array> */ \
static const std::pair<ENUM_TYPE, BasicJsonType> m[] = __VA_ARGS__; \ static const std::pair<ENUM_TYPE, BasicJsonType> m[] = __VA_ARGS__; \
auto it = std::find_if(std::begin(m), std::end(m), \ auto it = std::find_if(std::begin(m), std::end(m), \
[e](const std::pair<ENUM_TYPE, BasicJsonType>& ej_pair) -> bool \ [e](const std::pair<ENUM_TYPE, BasicJsonType>& ej_pair) -> bool \
@@ -2586,9 +2584,7 @@ JSON_HEDLEY_DIAGNOSTIC_POP
template<typename BasicJsonType> \ template<typename BasicJsonType> \
inline void from_json(const BasicJsonType& j, ENUM_TYPE& e) \ inline void from_json(const BasicJsonType& j, ENUM_TYPE& e) \
{ \ { \
/* NOLINTNEXTLINE(modernize-type-traits) we use C++11 */ \
static_assert(std::is_enum<ENUM_TYPE>::value, #ENUM_TYPE " must be an enum!"); \ static_assert(std::is_enum<ENUM_TYPE>::value, #ENUM_TYPE " must be an enum!"); \
/* NOLINTNEXTLINE(modernize-avoid-c-arrays) we don't want to depend on <array> */ \
static const std::pair<ENUM_TYPE, BasicJsonType> m[] = __VA_ARGS__; \ static const std::pair<ENUM_TYPE, BasicJsonType> m[] = __VA_ARGS__; \
auto it = std::find_if(std::begin(m), std::end(m), \ auto it = std::find_if(std::begin(m), std::end(m), \
[&j](const std::pair<ENUM_TYPE, BasicJsonType>& ej_pair) -> bool \ [&j](const std::pair<ENUM_TYPE, BasicJsonType>& ej_pair) -> bool \
@@ -2976,7 +2972,7 @@ NLOHMANN_JSON_NAMESPACE_END
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -3051,7 +3047,7 @@ NLOHMANN_JSON_NAMESPACE_END
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -3093,7 +3089,7 @@ NLOHMANN_JSON_NAMESPACE_END
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-FileCopyrightText: 2018 The Abseil Authors // SPDX-FileCopyrightText: 2018 The Abseil Authors
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -3267,7 +3263,7 @@ NLOHMANN_JSON_NAMESPACE_END
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -3284,7 +3280,7 @@ NLOHMANN_JSON_NAMESPACE_END
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -3352,7 +3348,7 @@ NLOHMANN_JSON_NAMESPACE_END
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -3372,7 +3368,7 @@ NLOHMANN_JSON_NAMESPACE_END
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -3396,7 +3392,7 @@ NLOHMANN_JSON_NAMESPACE_END
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#ifndef INCLUDE_NLOHMANN_JSON_FWD_HPP_ #ifndef INCLUDE_NLOHMANN_JSON_FWD_HPP_
@@ -4247,7 +4243,7 @@ NLOHMANN_JSON_NAMESPACE_END
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -4392,18 +4388,6 @@ inline OutStringType concat(Args && ... args)
NLOHMANN_JSON_NAMESPACE_END NLOHMANN_JSON_NAMESPACE_END
// With -Wweak-vtables, Clang will complain about the exception classes as they
// have no out-of-line virtual method definitions and their vtable will be
// emitted in every translation unit. This issue cannot be fixed with a
// header-only library as there is no implementation file to move these
// functions to. As a result, we suppress this warning here to avoid client
// code to stumble over this. See https://github.com/nlohmann/json/issues/4087
// for a discussion.
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wweak-vtables"
#endif
NLOHMANN_JSON_NAMESPACE_BEGIN NLOHMANN_JSON_NAMESPACE_BEGIN
namespace detail namespace detail
{ {
@@ -4635,10 +4619,6 @@ class other_error : public exception
} // namespace detail } // namespace detail
NLOHMANN_JSON_NAMESPACE_END NLOHMANN_JSON_NAMESPACE_END
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
// #include <nlohmann/detail/macro_scope.hpp> // #include <nlohmann/detail/macro_scope.hpp>
// #include <nlohmann/detail/meta/cpp_future.hpp> // #include <nlohmann/detail/meta/cpp_future.hpp>
@@ -4649,7 +4629,7 @@ NLOHMANN_JSON_NAMESPACE_END
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -4673,7 +4653,7 @@ NLOHMANN_JSON_NAMESPACE_END
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -4972,7 +4952,14 @@ template < typename BasicJsonType, typename T, std::size_t... Idx >
std::array<T, sizeof...(Idx)> from_json_inplace_array_impl(BasicJsonType&& j, std::array<T, sizeof...(Idx)> from_json_inplace_array_impl(BasicJsonType&& j,
identity_tag<std::array<T, sizeof...(Idx)>> /*unused*/, index_sequence<Idx...> /*unused*/) identity_tag<std::array<T, sizeof...(Idx)>> /*unused*/, index_sequence<Idx...> /*unused*/)
{ {
return { { std::forward<BasicJsonType>(j).at(Idx).template get<T>()... } }; return { { std::forward<BasicJsonType>(j).at(Idx).template get < T&& > ()... } };
}
template < typename BasicJsonType, typename T, std::size_t... Idx >
std::array<T, sizeof...(Idx)> from_json_inplace_array_impl(const BasicJsonType& j,
identity_tag<std::array<T, sizeof...(Idx)>> /*unused*/, index_sequence<Idx...> /*unused*/)
{
return { { j.at(Idx).template get<T>()... } };
} }
template < typename BasicJsonType, typename T, std::size_t N > template < typename BasicJsonType, typename T, std::size_t N >
@@ -5068,6 +5055,12 @@ inline void from_json(const BasicJsonType& j, ArithmeticType& val)
} }
} }
template<typename BasicJsonType, typename... Args, std::size_t... Idx>
std::tuple<Args...> from_json_tuple_impl_base(const BasicJsonType& j, index_sequence<Idx...> /*unused*/)
{
return std::make_tuple(j.at(Idx).template get<Args>()...);
}
template<typename BasicJsonType, typename... Args, std::size_t... Idx> template<typename BasicJsonType, typename... Args, std::size_t... Idx>
std::tuple<Args...> from_json_tuple_impl_base(BasicJsonType&& j, index_sequence<Idx...> /*unused*/) std::tuple<Args...> from_json_tuple_impl_base(BasicJsonType&& j, index_sequence<Idx...> /*unused*/)
{ {
@@ -5077,8 +5070,14 @@ std::tuple<Args...> from_json_tuple_impl_base(BasicJsonType&& j, index_sequence<
template < typename BasicJsonType, class A1, class A2 > template < typename BasicJsonType, class A1, class A2 >
std::pair<A1, A2> from_json_tuple_impl(BasicJsonType&& j, identity_tag<std::pair<A1, A2>> /*unused*/, priority_tag<0> /*unused*/) std::pair<A1, A2> from_json_tuple_impl(BasicJsonType&& j, identity_tag<std::pair<A1, A2>> /*unused*/, priority_tag<0> /*unused*/)
{ {
return {std::forward<BasicJsonType>(j).at(0).template get<A1>(), return {std::forward<BasicJsonType>(j).at(0).template get < A1&& > (),
std::forward<BasicJsonType>(j).at(1).template get<A2>()}; std::forward<BasicJsonType>(j).at(1).template get < A2&& > ()};
}
template < typename BasicJsonType, class A1, class A2 >
std::pair<A1, A2> from_json_tuple_impl(const BasicJsonType& j, identity_tag<std::pair<A1, A2>> /*unused*/, priority_tag<0> /*unused*/)
{
return {j.at(0).template get<A1>(), j.at(1).template get<A2>()};
} }
template<typename BasicJsonType, typename A1, typename A2> template<typename BasicJsonType, typename A1, typename A2>
@@ -5197,7 +5196,7 @@ NLOHMANN_JSON_NAMESPACE_END
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -5220,7 +5219,7 @@ NLOHMANN_JSON_NAMESPACE_END
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -5958,7 +5957,7 @@ NLOHMANN_JSON_NAMESPACE_END
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -6070,7 +6069,7 @@ NLOHMANN_JSON_NAMESPACE_END
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -6203,7 +6202,7 @@ NLOHMANN_JSON_NAMESPACE_END
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -6220,9 +6219,6 @@ NLOHMANN_JSON_NAMESPACE_END
#include <string> // char_traits, string #include <string> // char_traits, string
#include <utility> // make_pair, move #include <utility> // make_pair, move
#include <vector> // vector #include <vector> // vector
#ifdef __cpp_lib_byteswap
#include <bit> //byteswap
#endif
// #include <nlohmann/detail/exceptions.hpp> // #include <nlohmann/detail/exceptions.hpp>
@@ -6232,7 +6228,7 @@ NLOHMANN_JSON_NAMESPACE_END
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -6252,8 +6248,6 @@ NLOHMANN_JSON_NAMESPACE_END
#include <istream> // istream #include <istream> // istream
#endif // JSON_NO_IO #endif // JSON_NO_IO
// #include <nlohmann/detail/exceptions.hpp>
// #include <nlohmann/detail/iterators/iterator_traits.hpp> // #include <nlohmann/detail/iterators/iterator_traits.hpp>
// #include <nlohmann/detail/macro_scope.hpp> // #include <nlohmann/detail/macro_scope.hpp>
@@ -6301,13 +6295,6 @@ class file_input_adapter
return std::fgetc(m_file); return std::fgetc(m_file);
} }
// returns the number of characters successfully read
template<class T>
std::size_t get_elements(T* dest, std::size_t count = 1)
{
return fread(dest, 1, sizeof(T) * count, m_file);
}
private: private:
/// the file pointer to read from /// the file pointer to read from
std::FILE* m_file; std::FILE* m_file;
@@ -6367,17 +6354,6 @@ class input_stream_adapter
return res; return res;
} }
template<class T>
std::size_t get_elements(T* dest, std::size_t count = 1)
{
auto res = static_cast<std::size_t>(sb->sgetn(reinterpret_cast<char*>(dest), static_cast<std::streamsize>(count * sizeof(T))));
if (JSON_HEDLEY_UNLIKELY(res < count * sizeof(T)))
{
is->clear(is->rdstate() | std::ios::eofbit);
}
return res;
}
private: private:
/// the associated input stream /// the associated input stream
std::istream* is = nullptr; std::istream* is = nullptr;
@@ -6409,26 +6385,6 @@ class iterator_input_adapter
return char_traits<char_type>::eof(); return char_traits<char_type>::eof();
} }
// for general iterators, we cannot really do something better than falling back to processing the range one-by-one
template<class T>
std::size_t get_elements(T* dest, std::size_t count = 1)
{
auto* ptr = reinterpret_cast<char*>(dest);
for (std::size_t read_index = 0; read_index < count * sizeof(T); ++read_index)
{
if (JSON_HEDLEY_LIKELY(current != end))
{
ptr[read_index] = static_cast<char>(*current);
std::advance(current, 1);
}
else
{
return read_index;
}
}
return count * sizeof(T);
}
private: private:
IteratorType current; IteratorType current;
IteratorType end; IteratorType end;
@@ -6592,13 +6548,6 @@ class wide_string_input_adapter
return utf8_bytes[utf8_bytes_index++]; return utf8_bytes[utf8_bytes_index++];
} }
// parsing binary with wchar doesn't make sense, but since the parsing mode can be runtime, we need something here
template<class T>
std::size_t get_elements(T* /*dest*/, std::size_t /*count*/ = 1)
{
JSON_THROW(parse_error::create(112, 1, "wide string type cannot be interpreted as binary data", nullptr));
}
private: private:
BaseInputAdapter base_adapter; BaseInputAdapter base_adapter;
@@ -6699,10 +6648,6 @@ typename container_input_adapter_factory_impl::container_input_adapter_factory<C
// Special cases with fast paths // Special cases with fast paths
inline file_input_adapter input_adapter(std::FILE* file) inline file_input_adapter input_adapter(std::FILE* file)
{ {
if (file == nullptr)
{
JSON_THROW(parse_error::create(101, 0, "attempting to parse an empty input; check that your input string or stream contains the expected JSON", nullptr));
}
return file_input_adapter(file); return file_input_adapter(file);
} }
@@ -6729,10 +6674,6 @@ template < typename CharT,
int >::type = 0 > int >::type = 0 >
contiguous_bytes_input_adapter input_adapter(CharT b) contiguous_bytes_input_adapter input_adapter(CharT b)
{ {
if (b == nullptr)
{
JSON_THROW(parse_error::create(101, 0, "attempting to parse an empty input; check that your input string or stream contains the expected JSON", nullptr));
}
auto length = std::strlen(reinterpret_cast<const char*>(b)); auto length = std::strlen(reinterpret_cast<const char*>(b));
const auto* ptr = reinterpret_cast<const char*>(b); const auto* ptr = reinterpret_cast<const char*>(b);
return input_adapter(ptr, ptr + length); return input_adapter(ptr, ptr + length);
@@ -6784,7 +6725,7 @@ NLOHMANN_JSON_NAMESPACE_END
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -7516,7 +7457,7 @@ NLOHMANN_JSON_NAMESPACE_END
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -8566,7 +8507,6 @@ scan_number_zero:
case '.': case '.':
{ {
add(decimal_point_char); add(decimal_point_char);
decimal_point_position = token_buffer.size() - 1;
goto scan_number_decimal1; goto scan_number_decimal1;
} }
@@ -8603,7 +8543,6 @@ scan_number_any1:
case '.': case '.':
{ {
add(decimal_point_char); add(decimal_point_char);
decimal_point_position = token_buffer.size() - 1;
goto scan_number_decimal1; goto scan_number_decimal1;
} }
@@ -8775,7 +8714,7 @@ scan_number_done:
// we checked the number format before // we checked the number format before
JSON_ASSERT(endptr == token_buffer.data() + token_buffer.size()); JSON_ASSERT(endptr == token_buffer.data() + token_buffer.size());
if (errno != ERANGE) if (errno == 0)
{ {
value_unsigned = static_cast<number_unsigned_t>(x); value_unsigned = static_cast<number_unsigned_t>(x);
if (value_unsigned == x) if (value_unsigned == x)
@@ -8791,7 +8730,7 @@ scan_number_done:
// we checked the number format before // we checked the number format before
JSON_ASSERT(endptr == token_buffer.data() + token_buffer.size()); JSON_ASSERT(endptr == token_buffer.data() + token_buffer.size());
if (errno != ERANGE) if (errno == 0)
{ {
value_integer = static_cast<number_integer_t>(x); value_integer = static_cast<number_integer_t>(x);
if (value_integer == x) if (value_integer == x)
@@ -8841,7 +8780,6 @@ scan_number_done:
{ {
token_buffer.clear(); token_buffer.clear();
token_string.clear(); token_string.clear();
decimal_point_position = std::string::npos;
token_string.push_back(char_traits<char_type>::to_char_type(current)); token_string.push_back(char_traits<char_type>::to_char_type(current));
} }
@@ -8950,11 +8888,6 @@ scan_number_done:
/// return current string value (implicitly resets the token; useful only once) /// return current string value (implicitly resets the token; useful only once)
string_t& get_string() string_t& get_string()
{ {
// translate decimal points from locale back to '.' (#4084)
if (decimal_point_char != '.' && decimal_point_position != std::string::npos)
{
token_buffer[decimal_point_position] = '.';
}
return token_buffer; return token_buffer;
} }
@@ -9152,8 +9085,6 @@ scan_number_done:
/// the decimal point /// the decimal point
const char_int_type decimal_point_char = '.'; const char_int_type decimal_point_char = '.';
/// the position of the decimal point in the input
std::size_t decimal_point_position = std::string::npos;
}; };
} // namespace detail } // namespace detail
@@ -9167,7 +9098,7 @@ NLOHMANN_JSON_NAMESPACE_END
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -12055,29 +11986,6 @@ class binary_reader
return current = ia.get_character(); return current = ia.get_character();
} }
/*!
@brief get_to read into a primitive type
This function provides the interface to the used input adapter. It does
not throw in case the input reached EOF, but returns false instead
@return bool, whether the read was successful
*/
template<class T>
bool get_to(T& dest, const input_format_t format, const char* context)
{
auto new_chars_read = ia.get_elements(&dest);
chars_read += new_chars_read;
if (JSON_HEDLEY_UNLIKELY(new_chars_read < sizeof(T)))
{
// in case of failure, advance position by 1 to report failing location
++chars_read;
sax->parse_error(chars_read, "<end of file>", parse_error::create(110, chars_read, exception_message(format, "unexpected end of input", context), nullptr));
return false;
}
return true;
}
/*! /*!
@return character read from the input after ignoring all 'N' entries @return character read from the input after ignoring all 'N' entries
*/ */
@@ -12092,28 +12000,6 @@ class binary_reader
return current; return current;
} }
template<class NumberType>
static void byte_swap(NumberType& number)
{
constexpr std::size_t sz = sizeof(number);
#ifdef __cpp_lib_byteswap
if constexpr (sz == 1)
{
return;
}
if constexpr(std::is_integral_v<NumberType>)
{
number = std::byteswap(number);
return;
}
#endif
auto* ptr = reinterpret_cast<std::uint8_t*>(&number);
for (std::size_t i = 0; i < sz / 2; ++i)
{
std::swap(ptr[i], ptr[sz - i - 1]);
}
}
/* /*
@brief read a number from the input @brief read a number from the input
@@ -12132,16 +12018,29 @@ class binary_reader
template<typename NumberType, bool InputIsLittleEndian = false> template<typename NumberType, bool InputIsLittleEndian = false>
bool get_number(const input_format_t format, NumberType& result) bool get_number(const input_format_t format, NumberType& result)
{ {
// read in the original format // step 1: read input into array with system's byte order
std::array<std::uint8_t, sizeof(NumberType)> vec{};
for (std::size_t i = 0; i < sizeof(NumberType); ++i)
{
get();
if (JSON_HEDLEY_UNLIKELY(!unexpect_eof(format, "number")))
{
return false;
}
if (JSON_HEDLEY_UNLIKELY(!get_to(result, format, "number"))) // reverse byte order prior to conversion if necessary
{ if (is_little_endian != (InputIsLittleEndian || format == input_format_t::bjdata))
return false; {
} vec[sizeof(NumberType) - i - 1] = static_cast<std::uint8_t>(current);
if (is_little_endian != (InputIsLittleEndian || format == input_format_t::bjdata)) }
{ else
byte_swap(result); {
vec[i] = static_cast<std::uint8_t>(current); // LCOV_EXCL_LINE
}
} }
// step 2: convert array into number of type T and return
std::memcpy(&result, vec.data(), sizeof(NumberType));
return true; return true;
} }
@@ -12351,7 +12250,7 @@ NLOHMANN_JSON_NAMESPACE_END
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -12568,12 +12467,9 @@ class parser
// parse key // parse key
if (JSON_HEDLEY_UNLIKELY(last_token != token_type::value_string)) if (JSON_HEDLEY_UNLIKELY(last_token != token_type::value_string))
{ {
if (!sax->parse_error(m_lexer.get_position(), return sax->parse_error(m_lexer.get_position(),
m_lexer.get_token_string(), m_lexer.get_token_string(),
parse_error::create(101, m_lexer.get_position(), exception_message(token_type::value_string, "object key"), nullptr))) parse_error::create(101, m_lexer.get_position(), exception_message(token_type::value_string, "object key"), nullptr));
{
return false;
}
} }
if (JSON_HEDLEY_UNLIKELY(!sax->key(m_lexer.get_string()))) if (JSON_HEDLEY_UNLIKELY(!sax->key(m_lexer.get_string())))
{ {
@@ -12583,12 +12479,9 @@ class parser
// parse separator (:) // parse separator (:)
if (JSON_HEDLEY_UNLIKELY(get_token() != token_type::name_separator)) if (JSON_HEDLEY_UNLIKELY(get_token() != token_type::name_separator))
{ {
if (!sax->parse_error(m_lexer.get_position(), return sax->parse_error(m_lexer.get_position(),
m_lexer.get_token_string(), m_lexer.get_token_string(),
parse_error::create(101, m_lexer.get_position(), exception_message(token_type::name_separator, "object separator"), nullptr))) parse_error::create(101, m_lexer.get_position(), exception_message(token_type::name_separator, "object separator"), nullptr));
{
return false;
}
} }
// remember we are now inside an object // remember we are now inside an object
@@ -12629,12 +12522,9 @@ class parser
if (JSON_HEDLEY_UNLIKELY(!std::isfinite(res))) if (JSON_HEDLEY_UNLIKELY(!std::isfinite(res)))
{ {
if (!sax->parse_error(m_lexer.get_position(), return sax->parse_error(m_lexer.get_position(),
m_lexer.get_token_string(), m_lexer.get_token_string(),
out_of_range::create(406, concat("number overflow parsing '", m_lexer.get_token_string(), '\''), nullptr))) out_of_range::create(406, concat("number overflow parsing '", m_lexer.get_token_string(), '\''), nullptr));
{
return false;
}
} }
if (JSON_HEDLEY_UNLIKELY(!sax->number_float(res, m_lexer.get_string()))) if (JSON_HEDLEY_UNLIKELY(!sax->number_float(res, m_lexer.get_string())))
@@ -12702,33 +12592,24 @@ class parser
case token_type::parse_error: case token_type::parse_error:
{ {
// using "uninitialized" to avoid "expected" message // using "uninitialized" to avoid "expected" message
if (!sax->parse_error(m_lexer.get_position(), return sax->parse_error(m_lexer.get_position(),
m_lexer.get_token_string(), m_lexer.get_token_string(),
parse_error::create(101, m_lexer.get_position(), exception_message(token_type::uninitialized, "value"), nullptr))) parse_error::create(101, m_lexer.get_position(), exception_message(token_type::uninitialized, "value"), nullptr));
{
return false;
}
break;
} }
case token_type::end_of_input: case token_type::end_of_input:
{ {
if (JSON_HEDLEY_UNLIKELY(m_lexer.get_position().chars_read_total == 1)) if (JSON_HEDLEY_UNLIKELY(m_lexer.get_position().chars_read_total == 1))
{ {
if (!sax->parse_error(m_lexer.get_position(), return sax->parse_error(m_lexer.get_position(),
m_lexer.get_token_string(), m_lexer.get_token_string(),
parse_error::create(101, m_lexer.get_position(), parse_error::create(101, m_lexer.get_position(),
"attempting to parse an empty input; check that your input string or stream contains the expected JSON", nullptr))) "attempting to parse an empty input; check that your input string or stream contains the expected JSON", nullptr));
{
return false;
}
} }
return sax->parse_error(m_lexer.get_position(), return sax->parse_error(m_lexer.get_position(),
m_lexer.get_token_string(), m_lexer.get_token_string(),
parse_error::create(101, m_lexer.get_position(), exception_message(token_type::literal_or_value, "value"), nullptr)); parse_error::create(101, m_lexer.get_position(), exception_message(token_type::literal_or_value, "value"), nullptr));
} }
case token_type::uninitialized: case token_type::uninitialized:
case token_type::end_array: case token_type::end_array:
case token_type::end_object: case token_type::end_object:
@@ -12796,12 +12677,9 @@ class parser
// parse key // parse key
if (JSON_HEDLEY_UNLIKELY(get_token() != token_type::value_string)) if (JSON_HEDLEY_UNLIKELY(get_token() != token_type::value_string))
{ {
if (!sax->parse_error(m_lexer.get_position(), return sax->parse_error(m_lexer.get_position(),
m_lexer.get_token_string(), m_lexer.get_token_string(),
parse_error::create(101, m_lexer.get_position(), exception_message(token_type::value_string, "object key"), nullptr))) parse_error::create(101, m_lexer.get_position(), exception_message(token_type::value_string, "object key"), nullptr));
{
return false;
}
} }
if (JSON_HEDLEY_UNLIKELY(!sax->key(m_lexer.get_string()))) if (JSON_HEDLEY_UNLIKELY(!sax->key(m_lexer.get_string())))
@@ -12812,12 +12690,9 @@ class parser
// parse separator (:) // parse separator (:)
if (JSON_HEDLEY_UNLIKELY(get_token() != token_type::name_separator)) if (JSON_HEDLEY_UNLIKELY(get_token() != token_type::name_separator))
{ {
if (!sax->parse_error(m_lexer.get_position(), return sax->parse_error(m_lexer.get_position(),
m_lexer.get_token_string(), m_lexer.get_token_string(),
parse_error::create(101, m_lexer.get_position(), exception_message(token_type::name_separator, "object separator"), nullptr))) parse_error::create(101, m_lexer.get_position(), exception_message(token_type::name_separator, "object separator"), nullptr));
{
return false;
}
} }
// parse values // parse values
@@ -12904,7 +12779,7 @@ NLOHMANN_JSON_NAMESPACE_END
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -12917,7 +12792,7 @@ NLOHMANN_JSON_NAMESPACE_END
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -13076,7 +12951,7 @@ NLOHMANN_JSON_NAMESPACE_END
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -13543,7 +13418,7 @@ class iter_impl // NOLINT(cppcoreguidelines-special-member-functions,hicpp-speci
/*! /*!
@brief comparison: equal @brief comparison: equal
@pre (1) Both iterators are initialized to point to the same object, or (2) both iterators are value-initialized. @pre The iterator is initialized; i.e. `m_object != nullptr`.
*/ */
template < typename IterImpl, detail::enable_if_t < (std::is_same<IterImpl, iter_impl>::value || std::is_same<IterImpl, other_iter_impl>::value), std::nullptr_t > = nullptr > template < typename IterImpl, detail::enable_if_t < (std::is_same<IterImpl, iter_impl>::value || std::is_same<IterImpl, other_iter_impl>::value), std::nullptr_t > = nullptr >
bool operator==(const IterImpl& other) const bool operator==(const IterImpl& other) const
@@ -13554,11 +13429,7 @@ class iter_impl // NOLINT(cppcoreguidelines-special-member-functions,hicpp-speci
JSON_THROW(invalid_iterator::create(212, "cannot compare iterators of different containers", m_object)); JSON_THROW(invalid_iterator::create(212, "cannot compare iterators of different containers", m_object));
} }
// value-initialized forward iterators can be compared, and must compare equal to other value-initialized iterators of the same type #4493 JSON_ASSERT(m_object != nullptr);
if (m_object == nullptr)
{
return true;
}
switch (m_object->m_data.m_type) switch (m_object->m_data.m_type)
{ {
@@ -13583,7 +13454,7 @@ class iter_impl // NOLINT(cppcoreguidelines-special-member-functions,hicpp-speci
/*! /*!
@brief comparison: not equal @brief comparison: not equal
@pre (1) Both iterators are initialized to point to the same object, or (2) both iterators are value-initialized. @pre The iterator is initialized; i.e. `m_object != nullptr`.
*/ */
template < typename IterImpl, detail::enable_if_t < (std::is_same<IterImpl, iter_impl>::value || std::is_same<IterImpl, other_iter_impl>::value), std::nullptr_t > = nullptr > template < typename IterImpl, detail::enable_if_t < (std::is_same<IterImpl, iter_impl>::value || std::is_same<IterImpl, other_iter_impl>::value), std::nullptr_t > = nullptr >
bool operator!=(const IterImpl& other) const bool operator!=(const IterImpl& other) const
@@ -13593,7 +13464,7 @@ class iter_impl // NOLINT(cppcoreguidelines-special-member-functions,hicpp-speci
/*! /*!
@brief comparison: smaller @brief comparison: smaller
@pre (1) Both iterators are initialized to point to the same object, or (2) both iterators are value-initialized. @pre The iterator is initialized; i.e. `m_object != nullptr`.
*/ */
bool operator<(const iter_impl& other) const bool operator<(const iter_impl& other) const
{ {
@@ -13603,12 +13474,7 @@ class iter_impl // NOLINT(cppcoreguidelines-special-member-functions,hicpp-speci
JSON_THROW(invalid_iterator::create(212, "cannot compare iterators of different containers", m_object)); JSON_THROW(invalid_iterator::create(212, "cannot compare iterators of different containers", m_object));
} }
// value-initialized forward iterators can be compared, and must compare equal to other value-initialized iterators of the same type #4493 JSON_ASSERT(m_object != nullptr);
if (m_object == nullptr)
{
// the iterators are both value-initialized and are to be considered equal, but this function checks for smaller, so we return false
return false;
}
switch (m_object->m_data.m_type) switch (m_object->m_data.m_type)
{ {
@@ -13633,7 +13499,7 @@ class iter_impl // NOLINT(cppcoreguidelines-special-member-functions,hicpp-speci
/*! /*!
@brief comparison: less than or equal @brief comparison: less than or equal
@pre (1) Both iterators are initialized to point to the same object, or (2) both iterators are value-initialized. @pre The iterator is initialized; i.e. `m_object != nullptr`.
*/ */
bool operator<=(const iter_impl& other) const bool operator<=(const iter_impl& other) const
{ {
@@ -13642,7 +13508,7 @@ class iter_impl // NOLINT(cppcoreguidelines-special-member-functions,hicpp-speci
/*! /*!
@brief comparison: greater than @brief comparison: greater than
@pre (1) Both iterators are initialized to point to the same object, or (2) both iterators are value-initialized. @pre The iterator is initialized; i.e. `m_object != nullptr`.
*/ */
bool operator>(const iter_impl& other) const bool operator>(const iter_impl& other) const
{ {
@@ -13651,7 +13517,7 @@ class iter_impl // NOLINT(cppcoreguidelines-special-member-functions,hicpp-speci
/*! /*!
@brief comparison: greater than or equal @brief comparison: greater than or equal
@pre (1) The iterator is initialized; i.e. `m_object != nullptr`, or (2) both iterators are value-initialized. @pre The iterator is initialized; i.e. `m_object != nullptr`.
*/ */
bool operator>=(const iter_impl& other) const bool operator>=(const iter_impl& other) const
{ {
@@ -13847,7 +13713,7 @@ NLOHMANN_JSON_NAMESPACE_END
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -13982,7 +13848,7 @@ NLOHMANN_JSON_NAMESPACE_END
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -14024,7 +13890,7 @@ NLOHMANN_JSON_NAMESPACE_END
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -15019,7 +14885,7 @@ NLOHMANN_JSON_NAMESPACE_END
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -15111,7 +14977,7 @@ NLOHMANN_JSON_NAMESPACE_END
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -15137,7 +15003,7 @@ NLOHMANN_JSON_NAMESPACE_END
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -17105,8 +16971,8 @@ NLOHMANN_JSON_NAMESPACE_END
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2008 - 2009 Björn Hoehrmann <bjoern@hoehrmann.de> // SPDX-FileCopyrightText: 2008-2009 Björn Hoehrmann <bjoern@hoehrmann.de>
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -17131,7 +16997,7 @@ NLOHMANN_JSON_NAMESPACE_END
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2009 Florian Loitsch <https://florian.loitsch.com/> // SPDX-FileCopyrightText: 2009 Florian Loitsch <https://florian.loitsch.com/>
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -19226,7 +19092,7 @@ NLOHMANN_JSON_NAMESPACE_END
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -20735,15 +20601,13 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
/// @brief move constructor /// @brief move constructor
/// @sa https://json.nlohmann.me/api/basic_json/basic_json/ /// @sa https://json.nlohmann.me/api/basic_json/basic_json/
basic_json(basic_json&& other) noexcept basic_json(basic_json&& other) noexcept
: json_base_class_t(std::forward<json_base_class_t>(other)), // check that passed value is valid (has to be done before forwarding)
m_data(std::move(other.m_data)) : json_base_class_t((other.assert_invariant(false), std::forward<json_base_class_t>(other))),
m_data(std::move(other.m_data))// NOLINT(bugprone-use-after-move,hicpp-invalid-access-moved)
{ {
// check that passed value is valid
other.assert_invariant(false);
// invalidate payload // invalidate payload
other.m_data.m_type = value_t::null; other.m_data.m_type = value_t::null; // NOLINT(bugprone-use-after-move,hicpp-invalid-access-moved)
other.m_data.m_value = {}; other.m_data.m_value = {};// NOLINT(bugprone-use-after-move,hicpp-invalid-access-moved)
set_parents(); set_parents();
assert_invariant(); assert_invariant();
@@ -21535,7 +21399,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
auto it = m_data.m_value.object->find(std::forward<KeyType>(key)); auto it = m_data.m_value.object->find(std::forward<KeyType>(key));
if (it == m_data.m_value.object->end()) if (it == m_data.m_value.object->end())
{ {
JSON_THROW(out_of_range::create(403, detail::concat("key '", string_t(std::forward<KeyType>(key)), "' not found"), this)); JSON_THROW(out_of_range::create(403, "key not found (key is an rvalue and cannot be shown)", this));
} }
return set_parent(it->second); return set_parent(it->second);
} }
@@ -21573,7 +21437,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
auto it = m_data.m_value.object->find(std::forward<KeyType>(key)); auto it = m_data.m_value.object->find(std::forward<KeyType>(key));
if (it == m_data.m_value.object->end()) if (it == m_data.m_value.object->end())
{ {
JSON_THROW(out_of_range::create(403, detail::concat("key '", string_t(std::forward<KeyType>(key)), "' not found"), this)); JSON_THROW(out_of_range::create(403, "key not found (key is an rvalue and cannot be shown)", this));
} }
return it->second; return it->second;
} }
@@ -24782,7 +24646,7 @@ inline void swap(nlohmann::NLOHMANN_BASIC_JSON_TPL& j1, nlohmann::NLOHMANN_BASIC
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
@@ -24827,7 +24691,7 @@ inline void swap(nlohmann::NLOHMANN_BASIC_JSON_TPL& j1, nlohmann::NLOHMANN_BASIC
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
+2 -2
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#ifndef INCLUDE_NLOHMANN_JSON_FWD_HPP_ #ifndef INCLUDE_NLOHMANN_JSON_FWD_HPP_
@@ -21,7 +21,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#include "doctest_compatibility.h" #include "doctest_compatibility.h"
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#include "doctest_compatibility.h" #include "doctest_compatibility.h"
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#include "doctest_compatibility.h" #include "doctest_compatibility.h"
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#include "doctest_compatibility.h" #include "doctest_compatibility.h"
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#undef JSON_DIAGNOSTICS #undef JSON_DIAGNOSTICS
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#undef JSON_DIAGNOSTICS #undef JSON_DIAGNOSTICS
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#include "doctest_compatibility.h" #include "doctest_compatibility.h"
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#include "doctest_compatibility.h" #include "doctest_compatibility.h"
+2 -1
View File
@@ -3,7 +3,8 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // Copyright (c) 2013-2022 Niels Lohmann <http://nlohmann.me>.
// SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
+1 -41
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#include <benchmark/benchmark.h> #include <benchmark/benchmark.h>
@@ -140,46 +140,6 @@ BENCHMARK_CAPTURE(ToCbor, signed_ints, TEST_DATA_DIRECTORY "/regression/si
BENCHMARK_CAPTURE(ToCbor, unsigned_ints, TEST_DATA_DIRECTORY "/regression/unsigned_ints.json"); BENCHMARK_CAPTURE(ToCbor, unsigned_ints, TEST_DATA_DIRECTORY "/regression/unsigned_ints.json");
BENCHMARK_CAPTURE(ToCbor, small_signed_ints, TEST_DATA_DIRECTORY "/regression/small_signed_ints.json"); BENCHMARK_CAPTURE(ToCbor, small_signed_ints, TEST_DATA_DIRECTORY "/regression/small_signed_ints.json");
//////////////////////////////////////////////////////////////////////////////
// Parse Msgpack
//////////////////////////////////////////////////////////////////////////////
static void FromMsgpack(benchmark::State& state, const char* filename)
{
std::ifstream f(filename);
std::string str((std::istreambuf_iterator<char>(f)), std::istreambuf_iterator<char>());
auto bytes = json::to_msgpack(json::parse(str));
std::ofstream o("test.msgpack");
o.write((char*)bytes.data(), bytes.size());
o.flush();
o.close();
for (auto _ : state)
{
state.PauseTiming();
auto* j = new json();
auto file = fopen("test.msgpack", "rb");
state.ResumeTiming();
*j = json::from_msgpack(file);
state.PauseTiming();
fclose(file);
delete j;
state.ResumeTiming();
}
state.SetBytesProcessed(state.iterations() * bytes.size());
}
BENCHMARK_CAPTURE(FromMsgpack, jeopardy, TEST_DATA_DIRECTORY "/jeopardy/jeopardy.json");
BENCHMARK_CAPTURE(FromMsgpack, canada, TEST_DATA_DIRECTORY "/nativejson-benchmark/canada.json");
BENCHMARK_CAPTURE(FromMsgpack, citm_catalog, TEST_DATA_DIRECTORY "/nativejson-benchmark/citm_catalog.json");
BENCHMARK_CAPTURE(FromMsgpack, twitter, TEST_DATA_DIRECTORY "/nativejson-benchmark/twitter.json");
BENCHMARK_CAPTURE(FromMsgpack, floats, TEST_DATA_DIRECTORY "/regression/floats.json");
BENCHMARK_CAPTURE(FromMsgpack, signed_ints, TEST_DATA_DIRECTORY "/regression/signed_ints.json");
BENCHMARK_CAPTURE(FromMsgpack, unsigned_ints, TEST_DATA_DIRECTORY "/regression/unsigned_ints.json");
BENCHMARK_CAPTURE(FromMsgpack, small_signed_ints, TEST_DATA_DIRECTORY "/regression/small_signed_ints.json");
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// serialize binary CBOR // serialize binary CBOR
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#include "Bar.hpp" #include "Bar.hpp"
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#include "Foo.hpp" #include "Foo.hpp"
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
/* /*
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
/* /*
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
/* /*
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
/* /*
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
/* /*
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
/* /*
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
/* /*
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#pragma once #pragma once
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#include "doctest_compatibility.h" #include "doctest_compatibility.h"
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#include "doctest_compatibility.h" #include "doctest_compatibility.h"
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#include "doctest_compatibility.h" #include "doctest_compatibility.h"
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-FileCopyrightText: 2018 Vitaliy Manushkin <agri@akamo.info> // SPDX-FileCopyrightText: 2018 Vitaliy Manushkin <agri@akamo.info>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#include "doctest_compatibility.h" #include "doctest_compatibility.h"
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#include "doctest_compatibility.h" #include "doctest_compatibility.h"
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#include "doctest_compatibility.h" #include "doctest_compatibility.h"
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#include "doctest_compatibility.h" #include "doctest_compatibility.h"
@@ -3,7 +3,8 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // Copyright (c) 2013-2022 Niels Lohmann <http://nlohmann.me>.
// SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#include "doctest_compatibility.h" #include "doctest_compatibility.h"
+2 -1
View File
@@ -3,7 +3,8 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // Copyright (c) 2013-2022 Niels Lohmann <http://nlohmann.me>.
// SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#include "doctest_compatibility.h" #include "doctest_compatibility.h"
+1 -1
View File
@@ -3,7 +3,7 @@
// | | |__ | | | | | | version 3.11.3 // | | |__ | | | | | | version 3.11.3
// |_____|_____|_____|_|___| https://github.com/nlohmann/json // |_____|_____|_____|_|___| https://github.com/nlohmann/json
// //
// SPDX-FileCopyrightText: 2013 - 2024 Niels Lohmann <https://nlohmann.me> // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#include "doctest_compatibility.h" #include "doctest_compatibility.h"

Some files were not shown because too many files have changed in this diff Show More