Compare commits

...

3871 Commits

Author SHA1 Message Date
dependabot[bot]
8167d2f641 ⬆️ Bump github/codeql-action from 4.32.1 to 4.32.3 (#5077)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.32.1 to 4.32.3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](6bc82e05fd...9e907b5e64)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.32.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-16 19:36:02 +01:00
dependabot[bot]
e5e06e1a7b ⬆️ Bump srvaroa/labeler (#5080)
Bumps [srvaroa/labeler](https://github.com/srvaroa/labeler) from b4493338d7929ddc4ffc95fadf6f28c73bae2e90 to 471cdb892ebac76de6cb869105a2017fa3b9b9b3.
- [Release notes](https://github.com/srvaroa/labeler/releases)
- [Commits](b4493338d7...471cdb892e)

---
updated-dependencies:
- dependency-name: srvaroa/labeler
  dependency-version: 471cdb892ebac76de6cb869105a2017fa3b9b9b3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-16 19:35:48 +01:00
dependabot[bot]
904592d2a8 ⬆️ Bump step-security/harden-runner from 2.14.1 to 2.14.2 (#5075)
Bumps [step-security/harden-runner](https://github.com/step-security/harden-runner) from 2.14.1 to 2.14.2.
- [Release notes](https://github.com/step-security/harden-runner/releases)
- [Commits](e3f713f2d8...5ef0c079ce)

---
updated-dependencies:
- dependency-name: step-security/harden-runner
  dependency-version: 2.14.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-09 20:15:00 +01:00
Niels Lohmann
f8eee1bb79 Annotate unreachable comment-scanner switch paths to satisfy C26819 (#5071) 2026-02-07 09:15:18 +01:00
dependabot[bot]
21b53746c9 ⬆️ Bump github/codeql-action from 4.32.0 to 4.32.1 (#5067) 2026-02-03 07:33:53 +01:00
dependabot[bot]
553c314fb8 ⬆️ Bump github/codeql-action from 4.31.10 to 4.32.0 (#5064)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.10 to 4.32.0.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](cdefb33c0f...b20883b0cd)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.32.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-27 17:53:44 +01:00
dependabot[bot]
fa02f62316 ⬆️ Bump step-security/harden-runner from 2.14.0 to 2.14.1 (#5062)
Bumps [step-security/harden-runner](https://github.com/step-security/harden-runner) from 2.14.0 to 2.14.1.
- [Release notes](https://github.com/step-security/harden-runner/releases)
- [Commits](20cf305ff2...e3f713f2d8)

---
updated-dependencies:
- dependency-name: step-security/harden-runner
  dependency-version: 2.14.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-27 17:08:28 +01:00
dependabot[bot]
ae4c81858b ⬆️ Bump mkdocs-git-revision-date-localized-plugin (#5061)
Bumps [mkdocs-git-revision-date-localized-plugin](https://github.com/timvink/mkdocs-git-revision-date-localized-plugin) from 1.5.0 to 1.5.1.
- [Release notes](https://github.com/timvink/mkdocs-git-revision-date-localized-plugin/releases)
- [Commits](https://github.com/timvink/mkdocs-git-revision-date-localized-plugin/compare/v1.5.0...v1.5.1)

---
updated-dependencies:
- dependency-name: mkdocs-git-revision-date-localized-plugin
  dependency-version: 1.5.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-27 17:07:31 +01:00
dependabot[bot]
5aef01cca1 ⬆️ Bump actions/checkout from 6.0.1 to 6.0.2 (#5058)
Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](8e8c483db8...de0fac2e45)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-27 17:06:55 +01:00
dependabot[bot]
e313c6f6ba ⬆️ Bump mkdocs-htmlproofer-plugin in /docs/mkdocs (#5057)
Bumps [mkdocs-htmlproofer-plugin](https://github.com/manuzhang/mkdocs-htmlproofer-plugin) from 1.4.0 to 1.4.1.
- [Release notes](https://github.com/manuzhang/mkdocs-htmlproofer-plugin/releases)
- [Commits](https://github.com/manuzhang/mkdocs-htmlproofer-plugin/compare/v1.4.0...v1.4.1)

---
updated-dependencies:
- dependency-name: mkdocs-htmlproofer-plugin
  dependency-version: 1.4.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-27 17:06:05 +01:00
Niels Lohmann
17d1dd9964 💸 add sponsor note (#5063)
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2026-01-27 17:05:04 +01:00
EALePain
25f48639c7 Reference tuple from json (#5016)
* Add reference handling to tuples

Signed-off-by: Evelyn LePain <ava.lepain@gmail.com>

* Remove template template type because pair isn't working

Signed-off-by: Evelyn LePain <ava.lepain@gmail.com>

* amalgamate std::tie changes

Signed-off-by: Evelyn LePain <ava.lepain@gmail.com>

* allow the elation of a move by removing the ref requirement

Signed-off-by: Evelyn LePain <ava.lepain@gmail.com>

* force all number_xxx_t to be interchangeable

Signed-off-by: Evelyn LePain <ava.lepain@gmail.com>

* Finally got amalgamate to work correctly

Signed-off-by: Evelyn LePain <ava.lepain@gmail.com>

* remove const version, add a test case for scrambled number representations.

Signed-off-by: Evelyn LePain <ava.lepain@gmail.com>

* Use the logical set of requirements instead of decltype because VS 2015 doesn't like it

Signed-off-by: Evelyn LePain <ava.lepain@gmail.com>

---------

Signed-off-by: Evelyn LePain <ava.lepain@gmail.com>
2026-01-23 08:14:55 +01:00
dependabot[bot]
deb4c4f69f ⬆️ Bump wheel from 0.45.1 to 0.46.3 in /docs/mkdocs (#5056)
Bumps [wheel](https://github.com/pypa/wheel) from 0.45.1 to 0.46.3.
- [Release notes](https://github.com/pypa/wheel/releases)
- [Changelog](https://github.com/pypa/wheel/blob/main/docs/news.rst)
- [Commits](https://github.com/pypa/wheel/compare/0.45.1...0.46.3)

---
updated-dependencies:
- dependency-name: wheel
  dependency-version: 0.46.3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-22 17:58:14 +01:00
dependabot[bot]
156ce8dcb4 ⬆️ Bump lukka/get-cmake from 4.2.1 to 4.2.2 (#5055)
Bumps [lukka/get-cmake](https://github.com/lukka/get-cmake) from 4.2.1 to 4.2.2.
- [Release notes](https://github.com/lukka/get-cmake/releases)
- [Commits](9e07ecdcee...dc05ee1ee5)

---
updated-dependencies:
- dependency-name: lukka/get-cmake
  dependency-version: 4.2.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-22 09:12:52 +01:00
Charles Cabergs
5ed07097fa Fix -Wtautological-constant-out-of-range-compare in serializer (#5050)
Signed-off-by: Charles Cabergs <me@cacharle.xyz>
2026-01-13 17:19:38 +01:00
Niels Lohmann
e3014f162a Fix conversion to std::optional (#5052)
* 🐛 fix conversion to std::optional

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 fix warning

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 fix warning

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2026-01-13 17:19:34 +01:00
dependabot[bot]
2bb9d59fde ⬆️ Bump github/codeql-action from 4.31.9 to 4.31.10 (#5051)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.9 to 4.31.10.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](5d4e8d1aca...cdefb33c0f)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.10
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-12 21:28:21 +01:00
Ville Vesilehto
457bc283ff fix(cbor): reject overflowing negative integers (#5039)
* fix(cbor): reject negative ints overflowing int64

CBOR encodes negative integers as "-1 - n" where n is uint64_t. When
n > INT64_MAX, casting to int64_t caused undefined behavior and silent
data corruption. Large negative values were incorrectly parsed as
positive integers (e.g., -9223372036854775809 became 9223372036854775807).

Add bounds check for to reject values that exceed int64_t
representable range, returning parse_error instead of silently
corrupting data.

Added regression test cases to verify.

Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>

* chore: clarify tests

Add test for "n=0" case (result=-1) to cover the smallest magnitude
boundary. Update comments to explain CBOR 0x3B encoding and why
"result=0" is not possible. Clarify that n is an unsigned integer
in the formula "result = -1 - n" to help understanding the tests.

Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>

* fix(cbor): extend overflow checks for other types

Extend negative integer overflow detection to all CBOR negative
integer cases (0x38, 0x39, 0x3A) for consistency with the existing
0x3B check.

Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>

---------

Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>
2026-01-12 10:17:47 +01:00
KhloodElhossiny
8f75700141 support types convertible to string_view as JSON keys (#4958)
Signed-off-by: khloodelhossiny <khloood.elhossiny@gmail.com>
Co-authored-by: khloodelhossiny <khloood.elhossiny@gmail.com>
2026-01-11 21:45:22 +01:00
Niels Lohmann
515d994acb 📄 adjust year (#5044)
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2026-01-01 20:00:39 +01:00
dependabot[bot]
14374af9e5 ⬆️ Bump egor-tensin/setup-mingw from 2.2.0 to 3 (#5041) 2025-12-30 18:47:46 +01:00
cheese1
d6e6b21f16 Update README.md (#5040) 2025-12-29 23:05:44 +01:00
dependabot[bot]
30b28175e4 ⬆️ Bump actions/upload-artifact from 5.0.0 to 6.0.0 (#5032)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5.0.0 to 6.0.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](330a01c490...b7c566a772)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-22 14:12:18 +01:00
Niels Lohmann
7c2b2ede37 Update bug report template with FAQ reminder (#5037) 2025-12-21 09:14:44 +01:00
dependabot[bot]
8c7a7d474f ⬆️ Bump mkdocs-material from 9.7.0 to 9.7.1 in /docs/mkdocs (#5035)
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.7.0 to 9.7.1.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.7.0...9.7.1)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-version: 9.7.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-19 07:39:11 +01:00
dependabot[bot]
ae9c8d82ca ⬆️ Bump github/codeql-action from 4.31.8 to 4.31.9 (#5033)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.8 to 4.31.9.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](1b168cd394...5d4e8d1aca)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-19 07:38:44 +01:00
Niels Lohmann
6a4282395f Adjust versions (#5034)
* 📌 adjust versions

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 📌 adjust versions

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 📌 adjust versions

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 📌 adjust versions

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 📌 adjust versions

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-12-18 18:06:51 +01:00
dependabot[bot]
9f35919110 ⬆️ Bump github/codeql-action from 4.31.7 to 4.31.8 (#5031)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.7 to 4.31.8.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](cf1bb45a27...1b168cd394)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-15 10:01:17 +01:00
dependabot[bot]
75d9166a68 ⬆️ Bump step-security/harden-runner from 2.13.3 to 2.14.0 (#5029)
Bumps [step-security/harden-runner](https://github.com/step-security/harden-runner) from 2.13.3 to 2.14.0.
- [Release notes](https://github.com/step-security/harden-runner/releases)
- [Commits](df199fb7be...20cf305ff2)

---
updated-dependencies:
- dependency-name: step-security/harden-runner
  dependency-version: 2.14.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-10 15:57:58 +00:00
dependabot[bot]
ea3950e040 ⬆️ Bump github/codeql-action from 4.31.6 to 4.31.7 (#5027)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.6 to 4.31.7.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](fe4161a26a...cf1bb45a27)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-09 16:32:57 +00:00
dependabot[bot]
38819a9b04 ⬆️ Bump lukka/get-cmake from 4.2.0 to 4.2.1 (#5028)
Bumps [lukka/get-cmake](https://github.com/lukka/get-cmake) from 4.2.0 to 4.2.1.
- [Release notes](https://github.com/lukka/get-cmake/releases)
- [Commits](bb2faa721a...9e07ecdcee)

---
updated-dependencies:
- dependency-name: lukka/get-cmake
  dependency-version: 4.2.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-09 16:32:27 +00:00
dependabot[bot]
02ac0d6525 ⬆️ Bump actions/stale from 10.1.0 to 10.1.1 (#5024)
Bumps [actions/stale](https://github.com/actions/stale) from 10.1.0 to 10.1.1.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](5f858e3efb...997185467f)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-version: 10.1.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-03 18:11:49 +01:00
dependabot[bot]
c89e8fac63 ⬆️ Bump actions/checkout from 6.0.0 to 6.0.1 (#5025)
Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.0 to 6.0.1.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](1af3b93b68...8e8c483db8)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-03 18:11:27 +01:00
Aditya
b825d3dafb docs: improve clarity and formatting in documentation generation section (#5021) 2025-12-03 00:15:27 +01:00
dependabot[bot]
baceef2286 ⬆️ Bump step-security/harden-runner from 2.13.2 to 2.13.3 (#5020)
Bumps [step-security/harden-runner](https://github.com/step-security/harden-runner) from 2.13.2 to 2.13.3.
- [Release notes](https://github.com/step-security/harden-runner/releases)
- [Commits](95d9a5deda...df199fb7be)

---
updated-dependencies:
- dependency-name: step-security/harden-runner
  dependency-version: 2.13.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-02 16:54:33 +01:00
SamareshSingh
0422165315 Handle 'moved' events in serve_header.py (#4997)
Fixes #3659

I was testing serve_header.py with my local development setup and noticed
that when I moved directories into or out of the monitored root, they
weren't being picked up properly. The script would only detect create and
delete events but not move operations.

This was happening because the on_any_event handler only checked for
'created' and 'deleted' events on directories. Move events have a
separate event type 'moved' that includes both the source and destination
paths.

The fix treats a move event like a combination of delete (for the source)
and create (for the destination) - we rescan to remove any trees that were
moved out, and add the destination directory to check for new trees that
were moved in.

This should make the development workflow smoother when reorganizing
project directories while the server is running.

Signed-off-by: Samaresh Kumar Singh <ssam3003@gmail.com>
2025-12-01 21:21:25 +01:00
dependabot[bot]
942d0225c5 ⬆️ Bump github/codeql-action from 4.31.4 to 4.31.6 (#5019)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.4 to 4.31.6.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](e12f017898...fe4161a26a)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-01 21:19:40 +01:00
dependabot[bot]
a0e9fb1e63 ⬆️ Bump actions/checkout from 5.0.1 to 6.0.0 (#5008)
Bumps [actions/checkout](https://github.com/actions/checkout) from 5.0.1 to 6.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](93cb6efe18...1af3b93b68)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-21 23:57:41 +01:00
dependabot[bot]
d88916a04e ⬆️ Bump lukka/get-cmake from 4.1.2 to 4.2.0 (#5007)
Bumps [lukka/get-cmake](https://github.com/lukka/get-cmake) from 4.1.2 to 4.2.0.
- [Release notes](https://github.com/lukka/get-cmake/releases)
- [Commits](628dd514be...bb2faa721a)

---
updated-dependencies:
- dependency-name: lukka/get-cmake
  dependency-version: 4.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-20 18:35:53 +01:00
dependabot[bot]
2b40a69a25 ⬆️ Bump github/codeql-action from 4.31.3 to 4.31.4 (#5003)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.3 to 4.31.4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](014f16e7ab...e12f017898)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-19 18:57:59 +01:00
dependabot[bot]
8fb6fca692 ⬆️ Bump actions/checkout from 5.0.0 to 5.0.1 (#5001)
Bumps [actions/checkout](https://github.com/actions/checkout) from 5.0.0 to 5.0.1.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](08c6903cd8...93cb6efe18)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 5.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-18 18:15:21 +01:00
dependabot[bot]
682b14bb57 ⬆️ Bump coverallsapp/github-action from 2.3.6 to 2.3.7 (#5000)
Bumps [coverallsapp/github-action](https://github.com/coverallsapp/github-action) from 2.3.6 to 2.3.7.
- [Release notes](https://github.com/coverallsapp/github-action/releases)
- [Commits](648a8eb78e...5cbfd81b66)

---
updated-dependencies:
- dependency-name: coverallsapp/github-action
  dependency-version: 2.3.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-18 18:15:16 +01:00
dependabot[bot]
d9878dff1c ⬆️ Bump github/codeql-action from 4.31.2 to 4.31.3 (#4995)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.2 to 4.31.3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v4.31.2...014f16e7ab1402f30e7c3329d33797e7948572db)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.31.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-17 20:00:54 +01:00
dependabot[bot]
49026f7999 ⬆️ Bump mkdocs-material from 9.6.23 to 9.7.0 in /docs/mkdocs (#4991)
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.6.23 to 9.7.0.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.6.23...9.7.0)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-version: 9.7.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-12 19:52:47 +01:00
dependabot[bot]
667c143262 ⬆️ Bump actions/dependency-review-action from 4.8.1 to 4.8.2 (#4992)
Bumps [actions/dependency-review-action](https://github.com/actions/dependency-review-action) from 4.8.1 to 4.8.2.
- [Release notes](https://github.com/actions/dependency-review-action/releases)
- [Commits](40c09b7dc9...3c4e3dcb1a)

---
updated-dependencies:
- dependency-name: actions/dependency-review-action
  dependency-version: 4.8.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-12 19:52:39 +01:00
dependabot[bot]
af524ab666 ⬆️ Bump step-security/harden-runner from 2.13.1 to 2.13.2 (#4990) 2025-11-05 18:07:31 +01:00
dependabot[bot]
11627521ae ⬆️ Bump mkdocs-material from 9.6.22 to 9.6.23 in /docs/mkdocs (#4986)
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.6.22 to 9.6.23.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.6.22...9.6.23)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-version: 9.6.23
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-04 11:26:49 +01:00
dependabot[bot]
63bc495cf8 ⬆️ Bump returntocorp/semgrep-action (#4988)
Bumps [returntocorp/semgrep-action](https://github.com/returntocorp/semgrep-action) from fcd5ab7459e8d91cb1777481980d1b18b4fc6735 to 713efdd345f3035192eaa63f56867b88e63e4e5d.
- [Changelog](https://github.com/returntocorp/semgrep-action/blob/develop/CHANGELOG.md)
- [Commits](fcd5ab7459...713efdd345)

---
updated-dependencies:
- dependency-name: returntocorp/semgrep-action
  dependency-version: 713efdd345f3035192eaa63f56867b88e63e4e5d
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-04 11:26:36 +01:00
dependabot[bot]
9c38185167 ⬆️ Bump mkdocs-git-revision-date-localized-plugin (#4987) 2025-11-04 08:03:46 +01:00
Niels Lohmann
c8b66cf36e 🔒 harden runners (#4985) 2025-11-03 06:33:14 +01:00
Gianfranco Costamagna
0c9b68e110 Add a mention of git_required label to skil tests also in case of network issues (#4851) 2025-11-02 08:34:30 +01:00
Niels Lohmann
8deac49f50 Update GitHub Actions versions in semgrep.yml (#4982)
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-10-31 20:36:36 +01:00
Niels Lohmann
8c5344eeb2 Update flawfinder workflow with new versions (#4981)
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-10-31 20:36:30 +01:00
Niels Lohmann
034f3ecdc6 Add Flawfinder workflow for security scanning (#4979)
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-10-31 17:51:08 +01:00
Niels Lohmann
e137f2ac88 Add Semgrep workflow for code scanning (#4980)
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-10-31 17:47:28 +01:00
Niels Lohmann
49d5c45767 📌 pin emscripten dependency (#4977) 2025-10-31 11:45:32 +01:00
dependabot[bot]
bccdfad507 ⬆️ Bump github/codeql-action from 4.31.0 to 4.31.2 (#4976) 2025-10-30 17:58:05 +01:00
Andy Choi
cda9c1e3bd Use get instead of template get in REAMD.md and docs in non-template context (#4846)
Signed-off-by: Andy Choi <ccpong516@gmail.com>
2025-10-30 10:23:04 +01:00
dependabot[bot]
a6a92c19bf ⬆️ Bump reuse from 6.1.2 to 6.2.0 in /cmake/requirements (#4971)
Bumps [reuse](https://github.com/fsfe/reuse-tool) from 6.1.2 to 6.2.0.
- [Release notes](https://github.com/fsfe/reuse-tool/releases)
- [Changelog](https://github.com/fsfe/reuse-tool/blob/main/CHANGELOG.md)
- [Commits](https://github.com/fsfe/reuse-tool/compare/v6.1.2...v6.2.0)

---
updated-dependencies:
- dependency-name: reuse
  dependency-version: 6.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-28 17:15:37 +01:00
dependabot[bot]
4f8ee1d5e0 ⬆️ Bump github/codeql-action from 4.30.9 to 4.31.0 (#4969) 2025-10-27 20:10:10 +01:00
dependabot[bot]
cddd4b831e ⬆️ Bump mkdocs-htmlproofer-plugin in /docs/mkdocs (#4968) 2025-10-27 20:09:56 +01:00
dependabot[bot]
3d8aa21d5f ⬆️ Bump actions/upload-artifact from 4.6.2 to 5.0.0 (#4966) 2025-10-27 20:09:46 +01:00
Niels Lohmann
29913ca760 Add char8_t* overload for _json and _json_pointer (#4963) 2025-10-25 07:56:05 +02:00
dependabot[bot]
df263544ed ⬆️ Bump actions/checkout from 4.2.2 to 5.0.0 (#4964)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.2.2 to 5.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.2.2...08c6903cd8c0fde910a37f88322edcfb5dd907a8)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-25 07:49:10 +02:00
Bander
11cc676142 Improve MSVC C++ modules compatibility for nlohmann_json (#4952)
* Improve MSVC C++ modules compatibility for nlohmann_json

- Keep complete module interface with all exports
- Export all standard types: json, basic_json, adl_serializer, json_pointer, ordered_json, ordered_map
- Export detail namespace symbols for advanced usage
- Ensure compatibility with MSVC C++20/23 modules
- Maintain full functionality without breaking changes

Signed-off-by: yudaichen <250074249@qq.com>

* Add C++20 module Windows CI test and fix file ending

- Add ci_module_cpp20 job to Windows workflow to verify module support with MSVC

- Add missing newline at end of json.cppm file

Signed-off-by: yudaichen <250074249@qq.com>

---------

Signed-off-by: yudaichen <250074249@qq.com>
2025-10-24 11:34:11 +02:00
Niels Lohmann
54be9b04f0 📄 update REUSE (#4960) 2025-10-23 06:56:36 +02:00
Niels Lohmann
1cc56b2dcd Address CWG issue 2521 (#4957) 2025-10-23 06:56:16 +02:00
dependabot[bot]
22ac227155 ⬆️ Bump ossf/scorecard-action from 2.4.2 to 2.4.3 (#4938)
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.4.2 to 2.4.3.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](05b42c6244...4eaacf0543)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-version: 2.4.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-22 21:28:24 +02:00
dependabot[bot]
80069a970f ⬆️ Bump mkdocs-material from 9.6.20 to 9.6.22 in /docs/mkdocs (#4953)
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.6.20 to 9.6.22.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.6.20...9.6.22)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-version: 9.6.22
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-22 21:28:17 +02:00
dependabot[bot]
9f334eccf0 ⬆️ Bump github/codeql-action from 3.30.4 to 4.30.9 (#4955)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.30.4 to 4.30.9.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](303c0aef88...16140ae1a1)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.30.9
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-22 21:28:08 +02:00
dependabot[bot]
d5d2f99a6d ⬆️ Bump lukka/get-cmake from 4.1.1 to 4.1.2 (#4940)
Bumps [lukka/get-cmake](https://github.com/lukka/get-cmake) from 4.1.1 to 4.1.2.
- [Release notes](https://github.com/lukka/get-cmake/releases)
- [Commits](2ecc21724e...628dd514be)

---
updated-dependencies:
- dependency-name: lukka/get-cmake
  dependency-version: 4.1.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-22 21:27:56 +02:00
dependabot[bot]
8ae9bb34f4 ⬆️ Bump actions/dependency-review-action from 4.7.3 to 4.8.1 (#4950)
Bumps [actions/dependency-review-action](https://github.com/actions/dependency-review-action) from 4.7.3 to 4.8.1.
- [Release notes](https://github.com/actions/dependency-review-action/releases)
- [Commits](595b5aeba7...40c09b7dc9)

---
updated-dependencies:
- dependency-name: actions/dependency-review-action
  dependency-version: 4.8.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-22 21:27:51 +02:00
dependabot[bot]
8499f4f00f ⬆️ Bump actions/stale from 10.0.0 to 10.1.0 (#4944)
Bumps [actions/stale](https://github.com/actions/stale) from 10.0.0 to 10.1.0.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](3a9db7e6a4...5f858e3efb)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-version: 10.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-22 21:27:42 +02:00
Niels Lohmann
a63795caf1 🚨 avoid deprecation warning (#4791)
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-10-22 21:27:35 +02:00
dependabot[bot]
0d69a72167 ⬆️ Bump pyyaml from 6.0.2 to 6.0.3 in /docs/mkdocs (#4930)
Bumps [pyyaml](https://github.com/yaml/pyyaml) from 6.0.2 to 6.0.3.
- [Release notes](https://github.com/yaml/pyyaml/releases)
- [Changelog](https://github.com/yaml/pyyaml/blob/6.0.3/CHANGES)
- [Commits](https://github.com/yaml/pyyaml/compare/6.0.2...6.0.3)

---
updated-dependencies:
- dependency-name: pyyaml
  dependency-version: 6.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-22 11:18:18 +02:00
dependabot[bot]
2eb21b0eb0 ⬆️ Bump pyyaml from 6.0.2 to 6.0.3 in /tools/serve_header (#4932)
Bumps [pyyaml](https://github.com/yaml/pyyaml) from 6.0.2 to 6.0.3.
- [Release notes](https://github.com/yaml/pyyaml/releases)
- [Changelog](https://github.com/yaml/pyyaml/blob/6.0.3/CHANGES)
- [Commits](https://github.com/yaml/pyyaml/compare/6.0.2...6.0.3)

---
updated-dependencies:
- dependency-name: pyyaml
  dependency-version: 6.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-22 11:17:47 +02:00
Niels Lohmann
2566828ed5 Fix CI (#4954)
* 🚨 suppress readability-redundant-parentheses

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress google-runtime-float

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress bugprone-throwing-static-initialization

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress bugprone-throwing-static-initialization

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress bugprone-throwing-static-initialization

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress bugprone-throwing-static-initialization

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress bugprone-throwing-static-initialization

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🗑️ do not use macos-13 image

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ use more Xcode versions

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ fix Clang build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🔨 clean up

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-10-22 11:14:01 +02:00
DmitriBogdanov
3ed64e502a docs: Fix broken package manager links in the integration tab. (#4934)
Signed-off-by: DmitriBogdanov <dm.bogdanov2000@gmail.com>
2025-09-28 20:12:48 +02:00
dependabot[bot]
9810c39408 ⬆️ Bump github/codeql-action from 3.30.3 to 3.30.4 (#4929)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.30.3 to 3.30.4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](192325c861...303c0aef88)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.30.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-26 14:55:02 +02:00
co63oc
44bee1b138 chore: fix typos (#4921)
Signed-off-by: co63oc <co63oc@users.noreply.github.com>
2025-09-16 08:07:00 +02:00
dependabot[bot]
60b39ce2d7 ⬆️ Bump mkdocs-material from 9.6.18 to 9.6.20 in /docs/mkdocs (#4923)
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.6.18 to 9.6.20.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.6.18...9.6.20)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-version: 9.6.20
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-15 20:19:32 +02:00
dependabot[bot]
5b5729584c ⬆️ Bump github/codeql-action from 3.30.0 to 3.30.3 (#4917)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.30.0 to 3.30.3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](2d92b76c45...192325c861)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.30.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-15 20:18:58 +02:00
dependabot[bot]
f8913c7954 ⬆️ Bump reuse from 5.0.2 to 5.1.1 in /cmake/requirements (#4910)
Bumps [reuse](https://github.com/fsfe/reuse-tool) from 5.0.2 to 5.1.1.
- [Release notes](https://github.com/fsfe/reuse-tool/releases)
- [Changelog](https://github.com/fsfe/reuse-tool/blob/main/CHANGELOG.md)
- [Commits](https://github.com/fsfe/reuse-tool/compare/v5.0.2...v5.1.1)

---
updated-dependencies:
- dependency-name: reuse
  dependency-version: 5.1.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-15 20:18:24 +02:00
dependabot[bot]
44b5a6d535 ⬆️ Bump step-security/harden-runner from 2.13.0 to 2.13.1 (#4915)
Bumps [step-security/harden-runner](https://github.com/step-security/harden-runner) from 2.13.0 to 2.13.1.
- [Release notes](https://github.com/step-security/harden-runner/releases)
- [Commits](ec9f2d5744...f4a75cfd61)

---
updated-dependencies:
- dependency-name: step-security/harden-runner
  dependency-version: 2.13.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-15 20:17:48 +02:00
Niels Lohmann
df8605a4c1 Suppress cppcoreguidelines-pro-bounds-avoid-unchecked-container-access (#4919)
* 🚨 suppress cppcoreguidelines-pro-bounds-avoid-unchecked-container-access

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress llvm-use-ranges

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-09-15 12:40:27 +02:00
dependabot[bot]
867127c2f4 ⬆️ Bump actions/stale from 9.1.0 to 10.0.0 (#4908)
Bumps [actions/stale](https://github.com/actions/stale) from 9.1.0 to 10.0.0.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](5bef64f19d...3a9db7e6a4)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-version: 10.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-05 17:29:01 +02:00
dependabot[bot]
07babee604 ⬆️ Bump actions/github-script from 7.0.1 to 8.0.0 (#4907)
Bumps [actions/github-script](https://github.com/actions/github-script) from 7.0.1 to 8.0.0.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](60a0d83039...ed597411d8)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-version: 8.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-05 17:28:54 +02:00
dependabot[bot]
87a3e4de99 ⬆️ Bump github/codeql-action from 3.29.11 to 3.30.0 (#4905) 2025-09-02 09:19:21 +02:00
dependabot[bot]
b74e119bc6 ⬆️ Bump lukka/get-cmake from 4.1.0 to 4.1.1 (#4906) 2025-09-02 09:18:00 +02:00
Niels Lohmann
4bc4e37f4f Fix Windows CI (#4897)
* 👷 fix Windows CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix Windows CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix Windows CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix Windows CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix Windows CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix Windows CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix Windows CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix Windows CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix Windows CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix Windows CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix Windows CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix Windows CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix Windows CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix Windows CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-08-28 16:21:01 +02:00
dependabot[bot]
ec857100a5 ⬆️ Bump actions/dependency-review-action from 4.7.2 to 4.7.3 (#4904) 2025-08-28 08:19:03 +02:00
dependabot[bot]
22db828de4 ⬆️ Bump mkdocs-material from 9.6.17 to 9.6.18 in /docs/mkdocs (#4902)
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.6.17 to 9.6.18.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.6.17...9.6.18)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-version: 9.6.18
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-22 18:19:12 +02:00
dependabot[bot]
000db7a6a2 ⬆️ Bump github/codeql-action from 3.29.10 to 3.29.11 (#4900)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.29.10 to 3.29.11.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](96f518a34f...3c3833e0f8)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.29.11
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-21 22:07:35 +02:00
Erik Hu
1fd00198ec add fail-on-error:false for Coveralls (#4891) 2025-08-21 11:07:21 +02:00
dependabot[bot]
6131e52a5b ⬆️ Bump actions/dependency-review-action from 4.7.1 to 4.7.2 (#4895)
Bumps [actions/dependency-review-action](https://github.com/actions/dependency-review-action) from 4.7.1 to 4.7.2.
- [Release notes](https://github.com/actions/dependency-review-action/releases)
- [Commits](da24556b54...bc41886e18)

---
updated-dependencies:
- dependency-name: actions/dependency-review-action
  dependency-version: 4.7.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-20 22:46:56 +02:00
dependabot[bot]
c711517c00 ⬆️ Bump github/codeql-action from 3.29.9 to 3.29.10 (#4894)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.29.9 to 3.29.10.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](df559355d5...96f518a34f)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.29.10
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-20 22:46:49 +02:00
dependabot[bot]
cb13999032 ⬆️ Bump mkdocs-material from 9.6.16 to 9.6.17 in /docs/mkdocs (#4893)
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.6.16 to 9.6.17.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.6.16...9.6.17)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-version: 9.6.17
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-20 22:46:44 +02:00
Niels Lohmann
4106af8d92 🚨 suppress cppcoreguidelines-c-copy-assignment-signature,misc-unconventional-assign-operator (#4896)
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-08-20 18:39:45 +02:00
dependabot[bot]
52d3f6e034 ⬆️ Bump github/codeql-action from 3.29.8 to 3.29.9 (#4888) 2025-08-13 09:29:28 +02:00
dependabot[bot]
cd783971aa ⬆️ Bump lukka/get-cmake from 4.0.3 to 4.1.0 (#4887)
Bumps [lukka/get-cmake](https://github.com/lukka/get-cmake) from 4.0.3 to 4.1.0.
- [Release notes](https://github.com/lukka/get-cmake/releases)
- [Commits](6b3e96a9bc...f3273e0bce)

---
updated-dependencies:
- dependency-name: lukka/get-cmake
  dependency-version: 4.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-12 13:05:27 +02:00
dependabot[bot]
d275e706ca ⬆️ Bump actions/checkout from 4.2.2 to 5.0.0 (#4886)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.2.2 to 5.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](11bd71901b...08c6903cd8)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-12 13:04:52 +02:00
dependabot[bot]
89f0225dc6 ⬆️ Bump github/codeql-action from 3.29.6 to 3.29.8 (#4884) 2025-08-08 20:24:47 +02:00
dependabot[bot]
bdc50d513f ⬆️ Bump github/codeql-action from 3.29.5 to 3.29.6 (#4881)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.29.5 to 3.29.6.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](51f77329af...a4e1a019f5)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.29.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-08 10:26:07 +02:00
Niels Lohmann
32771c5ea3 Suppress more Clang-Tidy warnings (#4879) 2025-08-07 06:50:00 +02:00
Niels Lohmann
e00484f866 📝 update sax_parse documentation (#4878) 2025-08-03 11:21:05 +02:00
Devon Thomas
c5cc4face3 Mention AStyle Formatting in CONTRIBUTING.md (#4867)
* ⬆️ Bump step-security/harden-runner from 2.12.1 to 2.12.2 (#4837)

Signed-off-by: Devon Thomas <thomadev@oregonstate.edu>

* Fix CI (#4871)

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
Signed-off-by: Devon Thomas <thomadev@oregonstate.edu>

* Update CONTRIBUTING.md

Mentioned Artistic Style formatting under make amalgamate section

Signed-off-by: Devon Thomas <thomadev@oregonstate.edu>

* Update CONTRIBUTING.md

removed > syntax

Signed-off-by: Devon Thomas <thomadev@oregonstate.edu>

---------

Signed-off-by: Devon Thomas <thomadev@oregonstate.edu>
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
Signed-off-by: Devon Thomas <166056408+ThomaDevOSU@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Niels Lohmann <mail@nlohmann.me>
2025-08-03 10:04:53 +02:00
Miko
a3211ab3ca Simplify module API (#4840)
* Simplify module API

Signed-off-by: Miko <110693261+mikomikotaishi@users.noreply.github.com>

* Forgot missing newline

Signed-off-by: Miko <110693261+mikomikotaishi@users.noreply.github.com>

---------

Signed-off-by: Miko <110693261+mikomikotaishi@users.noreply.github.com>
2025-08-03 10:02:12 +02:00
Nikhil
efcf9efb4f Fixes #4854 Explicitly handle nullptr in sax_parse (#4873)
* handle nullptr explicitly

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* add test

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* make amalgamate

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* Fix formatting

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* move sax parse test to relevant unit test file

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* extend exceptions.md to include other_error.502

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* Better exception messages

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* link sax_parse function

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* fix string

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* amalgamate

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* fix clang-tidy checks

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* cover valid handler with no throw

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* Add tests for other two overloads

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* cover overload with valid sax handler

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* pass an rvalue

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* ignore -Wtautological-pointer-compare

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* ignore clang-analyzer-core.NonNullParamChecker

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* ignore gcc -Wnonnull-compare

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* ignore undefined-behaviour-sanitizer

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* nest directives to ignore sanitizer errors

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* use elif

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

---------

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>
2025-08-02 21:06:01 +02:00
hitgirl
55abcb5c0f Fix #4863: skip try_run for LIBCPP_VERSION_OUTPUT during cross compil… (#4876)
* Fix #4863: skip try_run for LIBCPP_VERSION_OUTPUT during cross compilation

Signed-off-by: Hitgirl <hitgirl@Hitgirls-MacBook-Air.local>

* fix #4863: handle cross-compiling in libc++ detection gracefully

Signed-off-by: Hitgirl <hitgirl@Hitgirls-MacBook-Air.local>

* refactor: move cross-compiling check before cached output detection

Signed-off-by: Hitgirl <hitgirl@Hitgirls-MacBook-Air.local>

* refactor: move cross-compiling check before cached output detection

Signed-off-by: Hitgirl <hitgirl@Hitgirls-MacBook-Air.local>

* refactor: move cross-compiling check before cached output detection

Signed-off-by: Hitgirl <hitgirl@Hitgirls-MacBook-Air.local>

---------

Signed-off-by: Hitgirl <hitgirl@Hitgirls-MacBook-Air.local>
Co-authored-by: Hitgirl <hitgirl@Hitgirls-MacBook-Air.local>
2025-08-01 22:53:26 +02:00
dependabot[bot]
c637a8b453 ⬆️ Bump mkdocs-material from 9.6.14 to 9.6.16 in /docs/mkdocs (#4866)
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.6.14 to 9.6.16.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.6.14...9.6.16)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-version: 9.6.16
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-31 22:46:44 +02:00
dependabot[bot]
095d2b3a16 ⬆️ Bump step-security/harden-runner from 2.12.2 to 2.13.0 (#4848)
Bumps [step-security/harden-runner](https://github.com/step-security/harden-runner) from 2.12.2 to 2.13.0.
- [Release notes](https://github.com/step-security/harden-runner/releases)
- [Commits](6c439dc8bd...ec9f2d5744)

---
updated-dependencies:
- dependency-name: step-security/harden-runner
  dependency-version: 2.13.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-31 22:45:24 +02:00
dependabot[bot]
9d86144cc0 ⬆️ Bump srvaroa/labeler (#4872)
Bumps [srvaroa/labeler](https://github.com/srvaroa/labeler) from e7bef2249506ba9cbbd3ca5cee256abd9f930b04 to b4493338d7929ddc4ffc95fadf6f28c73bae2e90.
- [Release notes](https://github.com/srvaroa/labeler/releases)
- [Commits](e7bef22495...b4493338d7)

---
updated-dependencies:
- dependency-name: srvaroa/labeler
  dependency-version: b4493338d7929ddc4ffc95fadf6f28c73bae2e90
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-31 22:32:34 +02:00
dependabot[bot]
f0aa454655 ⬆️ Bump github/codeql-action from 3.29.2 to 3.29.5 (#4874)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.29.2 to 3.29.5.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](181d5eefc2...51f77329af)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.29.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-31 22:19:22 +02:00
Niels Lohmann
30d27df61c Fix CI (#4871)
* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 fix CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-07-31 20:10:57 +02:00
dependabot[bot]
d33ecd3f3b ⬆️ Bump step-security/harden-runner from 2.12.1 to 2.12.2 (#4837) 2025-06-30 23:28:49 +02:00
dependabot[bot]
d19060e6c7 ⬆️ Bump github/codeql-action from 3.29.1 to 3.29.2 (#4838) 2025-06-30 23:27:46 +02:00
dependabot[bot]
98ac4d85be ⬆️ Bump github/codeql-action from 3.28.18 to 3.29.1 (#4833) 2025-06-29 22:05:38 +02:00
Miko
b7f741165b Add proper C++20 module support (#4799) 2025-06-29 22:02:31 +02:00
David Kilzer
d70e46bc65 🐛 add missing header to input_adapters.hpp (#4830)
Signed-off-by: David Kilzer <ddkilzer@apple.com>
Co-authored-by: David Kilzer <ddkilzer@apple.com>
2025-06-25 07:20:17 +02:00
dependabot[bot]
b451735fe7 ⬆️ Bump lukka/get-cmake from 4.0.2 to 4.0.3 (#4820)
Bumps [lukka/get-cmake](https://github.com/lukka/get-cmake) from 4.0.2 to 4.0.3.
- [Release notes](https://github.com/lukka/get-cmake/releases)
- [Commits](ea00481682...6b3e96a9bc)

---
updated-dependencies:
- dependency-name: lukka/get-cmake
  dependency-version: 4.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-16 19:55:34 +02:00
dependabot[bot]
568b708fd4 ⬆️ Bump step-security/harden-runner from 2.12.0 to 2.12.1 (#4815)
Bumps [step-security/harden-runner](https://github.com/step-security/harden-runner) from 2.12.0 to 2.12.1.
- [Release notes](https://github.com/step-security/harden-runner/releases)
- [Commits](0634a2670c...002fdce3c6)

---
updated-dependencies:
- dependency-name: step-security/harden-runner
  dependency-version: 2.12.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-11 18:42:32 +02:00
dependabot[bot]
c633693d3e ⬆️ Bump ossf/scorecard-action from 2.4.1 to 2.4.2 (#4807)
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.4.1 to 2.4.2.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](f49aabe0b5...05b42c6244)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-version: 2.4.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-02 19:21:43 +02:00
Niels Lohmann
cf16c5ab9f Use binary_t::value_type (#4805) 2025-06-02 06:35:27 +02:00
Niels Lohmann
b19f058465 Encode infinity and NaN as float for MsgPack and CBOR (#4802)
* 🚸 encode infinity and NaN as float for MsgPack and CBOR

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-06-01 18:50:14 +02:00
Niels Lohmann
5f77df4e22 Add Xcode 16.3 (#4803)
* 👷 add Xcode 16.3

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 add arm64 images

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 add arm64 images

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 add Xcode 16.3

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-06-01 17:56:06 +02:00
dependabot[bot]
64ebc6d511 ⬆️ Bump mkdocs-git-revision-date-localized-plugin (#4800)
Bumps [mkdocs-git-revision-date-localized-plugin](https://github.com/timvink/mkdocs-git-revision-date-localized-plugin) from 1.4.6 to 1.4.7.
- [Release notes](https://github.com/timvink/mkdocs-git-revision-date-localized-plugin/releases)
- [Commits](https://github.com/timvink/mkdocs-git-revision-date-localized-plugin/compare/v1.4.6...v1.4.7)

---
updated-dependencies:
- dependency-name: mkdocs-git-revision-date-localized-plugin
  dependency-version: 1.4.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-01 15:51:53 +02:00
Niels Lohmann
82f4f70669 Adjust warnings flags (#4801)
* 🚨 suppress warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-05-31 17:48:34 +02:00
Niels Lohmann
68c25aec60 Update customers and add Cloudback (#4797)
* 📝 update customers

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 📝 add badge to Cloudback

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-05-27 20:55:45 +02:00
dependabot[bot]
ac0133ea89 ⬆️ Bump mkdocs-git-revision-date-localized-plugin (#4795)
Bumps [mkdocs-git-revision-date-localized-plugin](https://github.com/timvink/mkdocs-git-revision-date-localized-plugin) from 1.4.5 to 1.4.6.
- [Release notes](https://github.com/timvink/mkdocs-git-revision-date-localized-plugin/releases)
- [Commits](https://github.com/timvink/mkdocs-git-revision-date-localized-plugin/compare/v1.4.5...v1.4.6)

---
updated-dependencies:
- dependency-name: mkdocs-git-revision-date-localized-plugin
  dependency-version: 1.4.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-26 20:43:44 +02:00
Niels Lohmann
281d1e929b Detect used C++ standard library (#4793) 2025-05-23 17:59:52 +02:00
Kuan-Fu, Wu
7421ac31a7 doc: Fix JSON Pointer example to use direct initialization (#4468)
Changed the example code in the documentation from copy initialization
to direct initialization for `json::json_pointer`.
This prevents compilation errors caused by the constructor being explicit.
2025-05-22 12:39:39 +02:00
chirsz
4b17f90f65 Add ignore_trailing_commas option (#4609)
Added examples and modified the corresponding documents and unit tests.

Signed-off-by: chirsz-ever <chirsz-ever@outlook.com>
Co-authored-by: Niels Lohmann <niels.lohmann@gmail.com>
2025-05-22 08:01:46 +02:00
dependabot[bot]
2d9a251266 ⬆️ Bump srvaroa/labeler (#4789) 2025-05-20 17:56:25 +02:00
dependabot[bot]
3cca3ad210 ⬆️ Bump github/codeql-action from 3.28.17 to 3.28.18 (#4787)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.17 to 3.28.18.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](60168efe1c...ff0a06e83c)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.28.18
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-16 19:55:33 +02:00
Niels Lohmann
828c891427 Extend type_name() to invalid type (#4786)
*  add regression test

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 💚 fix build

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 📝 add comment

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-05-16 18:16:47 +02:00
NmPassTHFan
46e7cd3dc2 Replace deprecated std::is_trivial in C++26 (#4775) 2025-05-16 16:11:44 +02:00
Niels Lohmann
6f6be39332 Add GCC 15.1.0 flags (#4766)
* 🔧 add GCC 15.1.0 flags

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🔧 add GCC 15.1.0 flags

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🔧 add GCC 15.1.0 flags

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress -Wstrict-overflow warning

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress -Wstrict-overflow warning

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress -Wstrict-overflow warning

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress -Wstrict-overflow warning

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 fix -Wstrict-overflow warning

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 fix -Wstrict-overflow warning

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 fix warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 fix warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🎨 fix format

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-05-16 08:32:18 +02:00
Niels Lohmann
e02de2f971 Update to Doctest 2.4.12 (#4771)
* ⬆️ Doctest 2.4.12

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 fix warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 fix warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 fix warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 fix warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 fix warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 fix warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 fix warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 fix warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 fix warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 fix warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 fix warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 fix warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 fix warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 fix warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 fix warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-05-15 19:25:27 +02:00
dependabot[bot]
410c96228c ⬆️ Bump mkdocs-material from 9.6.12 to 9.6.14 in /docs/mkdocs (#4783)
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.6.12 to 9.6.14.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.6.12...9.6.14)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-version: 9.6.14
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-15 19:24:00 +02:00
dependabot[bot]
4e518d43d7 ⬆️ Bump actions/dependency-review-action from 4.7.0 to 4.7.1 (#4785)
Bumps [actions/dependency-review-action](https://github.com/actions/dependency-review-action) from 4.7.0 to 4.7.1.
- [Release notes](https://github.com/actions/dependency-review-action/releases)
- [Commits](38ecb5b593...da24556b54)

---
updated-dependencies:
- dependency-name: actions/dependency-review-action
  dependency-version: 4.7.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-15 19:23:51 +02:00
dependabot[bot]
230bfd15a2 ⬆️ Bump actions/dependency-review-action from 4.6.0 to 4.7.0 (#4779)
Bumps [actions/dependency-review-action](https://github.com/actions/dependency-review-action) from 4.6.0 to 4.7.0.
- [Release notes](https://github.com/actions/dependency-review-action/releases)
- [Commits](ce3cf9537a...38ecb5b593)

---
updated-dependencies:
- dependency-name: actions/dependency-review-action
  dependency-version: 4.7.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-10 10:32:19 +02:00
dependabot[bot]
e9391dc5bc ⬆️ Bump lukka/get-cmake from 4.0.1 to 4.02 (#4777)
Bumps [lukka/get-cmake](https://github.com/lukka/get-cmake) from 4.0.1 to 4.02.
- [Release notes](https://github.com/lukka/get-cmake/releases)
- [Commits](57c20a23a6...ea00481682)

---
updated-dependencies:
- dependency-name: lukka/get-cmake
  dependency-version: '4.02'
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-08 17:09:01 +02:00
dependabot[bot]
697c7e557c ⬆️ Bump github/codeql-action from 3.28.16 to 3.28.17 (#4774)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.16 to 3.28.17.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](28deaeda66...60168efe1c)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.28.17
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-04 10:28:46 +02:00
Niels Lohmann
9110918cf8 Fix typos (#4748)
* ✏️ fix typos

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ✏️ address review comments

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ✏️ address review comments

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-05-04 10:28:24 +02:00
Niels Lohmann
0a8b48ac6a Add comment regarding #4767 (#4770)
* 💡 add comment regarding #4767

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ✏️ address review comments

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ✏️ address review comments

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-05-04 10:27:58 +02:00
Ville Vesilehto
dff2b4756c fix: BJData size calculation overflow (#4765)
Adds pre-multiplication overflow detection to catch cases where dimension
products would exceed size_t max. The previous check only detected when
overflow resulted in exactly 0 or SIZE_MAX, missing other cases.

Retains the original post-multiplication check for backward compatibility.
Adds tests verifying overflow detection with dimensions (2^32+1)×(2^32),
which previously overflowed silently to 2^32.

This prevents custom SAX handlers from receiving incorrect array sizes
that could lead to buffer overflows.

Signed-off-by: Ville Vesilehto <ville@vesilehto.fi>
2025-04-29 10:17:50 +02:00
Niels Lohmann
eef76c200e Make library work with C++20 modules (#4764)
*  add test for C++20 modules

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 fix warning

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* Add missing header (#4763)

* 🐛 add missing header

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 fix warning

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 fix warning

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-04-28 21:52:26 +02:00
Xiaochuan Ye
3b02afb9d9 Specialize char_traits for std::byte to fix from_msgpack (fixes #4756) (#4760)
* Specialize char_traits for std::byte to fix from_msgpack (fixes #4756)

Provide a char_traits<std::byte> specialization under __cpp_lib_byte
to allow parsing MessagePack data from containers of std::byte.

Signed-off-by: xuesongtap <tap91624@gmail.com>
Signed-off-by: yexiaochuan <tap91624@gmail.com>

* Fix comments for cstddef include and MessagePack tests

Signed-off-by: xuesongtap <tap91624@gmail.com>
Signed-off-by: yexiaochuan <tap91624@gmail.com>

* Fix include <cstddef> only when __cpp_lib_byte is defined and sufficient

Signed-off-by: yexiaochuan <tap91624@gmail.com>

* Fix clang-tidy warnings in MessagePack std::byte tests

Signed-off-by: yexiaochuan <tap91624@gmail.com>

* Fix handle return value in MessagePack tests

Signed-off-by: yexiaochuan <tap91624@gmail.com>

---------

Signed-off-by: xuesongtap <tap91624@gmail.com>
Signed-off-by: yexiaochuan <tap91624@gmail.com>
2025-04-28 16:19:47 +02:00
Niels Lohmann
6b9199382b Add missing header (#4763)
* 🐛 add missing header

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 fix warning

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 fix warning

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-04-27 18:18:57 +02:00
dependabot[bot]
51a77f1dca ⬆️ Bump github/codeql-action from 3.28.15 to 3.28.16 (#4757) 2025-04-23 18:37:41 +02:00
Sergiu Deitsch
756ca22ec5 Provide fallback for missing char8_t support (#4736) 2025-04-23 18:36:41 +02:00
dependabot[bot]
85df7ed593 ⬆️ Bump mkdocs-material from 9.6.11 to 9.6.12 in /docs/mkdocs (#4750)
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.6.11 to 9.6.12.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.6.11...9.6.12)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-version: 9.6.12
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-23 13:14:34 +02:00
dependabot[bot]
2be2c83d5c ⬆️ Bump step-security/harden-runner from 2.11.1 to 2.12.0 (#4754) 2025-04-22 18:56:49 +02:00
Niels Lohmann
c67d538274 Fix C4702 warning and extend MSVC CI job (#4749)
* ⚗️ try matrix for latest

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ♻️ refactor from https://github.com/nlohmann/json/issues/4745#issuecomment-2810128420

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 simplify CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 simplify CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 fix cpplint warning

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 simplify CI

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-04-17 18:04:09 +02:00
Niels Lohmann
88c92e605c Fix compilation failure and warnings with NVHPC (#4744)
* 🚨 fix warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 fix warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ enable ranges support

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🔥 remove ci_nvhpc job

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ enable ranges support

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🔥 remove ci_nvhpc job

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 fix warning

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-04-16 16:09:21 +02:00
Niels Lohmann
96c1b52f1c Fix conversion to std::optional (#4742)
* ⚗️ remove JSON_USE_IMPLICIT_CONVERSIONS check for from_json(json, std::optional)

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ remove JSON_USE_IMPLICIT_CONVERSIONS check for from_json(json, std::optional)

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ remove JSON_USE_IMPLICIT_CONVERSIONS check for from_json(json, std::optional)

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ remove JSON_USE_IMPLICIT_CONVERSIONS check for from_json(json, std::optional)

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ remove JSON_USE_IMPLICIT_CONVERSIONS check for from_json(json, std::optional)

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ⚗️ add C++ standard library as matrix option

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

*  remove inline

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-04-15 16:10:39 +02:00
Niels Lohmann
4cca3b9cb2 Fix warning and add emscripten CI step (#4738)
* 🚨 fix warning

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 add emscripten

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 add emscripten

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 add emscripten

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 add emscripten

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 add emscripten

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 add emscripten

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 add emscripten

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 add emscripten

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 👷 add emscripten

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 📝 add compiler to list

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-04-13 17:54:56 +02:00
dependabot[bot]
93e957332b ⬆️ Bump lukka/get-cmake from 4.0.0 to 4.0.1 (#4735)
Bumps [lukka/get-cmake](https://github.com/lukka/get-cmake) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/lukka/get-cmake/releases)
- [Commits](28983e0d39...57c20a23a6)

---
updated-dependencies:
- dependency-name: lukka/get-cmake
  dependency-version: 4.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-12 10:31:40 +02:00
dependabot[bot]
7ddea2686f ⬆️ Bump cpplint from 2.0.1 to 2.0.2 in /cmake/requirements (#4728)
Bumps [cpplint](https://github.com/cpplint/cpplint) from 2.0.1 to 2.0.2.
- [Release notes](https://github.com/cpplint/cpplint/releases)
- [Changelog](https://github.com/cpplint/cpplint/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/cpplint/cpplint/compare/2.0.1...2.0.2)

---
updated-dependencies:
- dependency-name: cpplint
  dependency-version: 2.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-11 10:56:23 +02:00
dependabot[bot]
2b876ee671 ⬆️ Bump github/codeql-action from 3.28.14 to 3.28.15 (#4729)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.14 to 3.28.15.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](fc7e4a0fa0...45775bd823)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.28.15
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-11 10:56:15 +02:00
Niels Lohmann
1705bfe914 🔖 set version to 3.12.0 (#4727)
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-04-11 10:41:14 +02:00
dependabot[bot]
00ecc7ed7a ⬆️ Bump github/codeql-action from 3.28.13 to 3.28.14 (#4726)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.13 to 3.28.14.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](1b549b9259...fc7e4a0fa0)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.28.14
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-07 21:04:57 +02:00
Niels Lohmann
4424a0fcc1 📝 update documentation (#4723)
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-04-05 18:54:35 +02:00
risa2000
11aa5f944d Make std::filesystem::path conversion to/from UTF-8 encoded string explicit (#4631)
* Make std::filesystem::path conversion to/from UTF-8 encoded JSON string explicit.

Signed-off-by: Richard Musil <risa2000x@gmail.com>

* Experimental: Changing C++ standard detection logic to accommodate potential corner cases.

Signed-off-by: Richard Musil <risa2000x@gmail.com>

* Drop C++ standard tests for compilers which do not implement required features.

Signed-off-by: Richard Musil <risa2000x@gmail.com>

* Drop C++ standard tests for MSVC versions which do not implement required features.

Signed-off-by: Richard Musil <risa2000x@gmail.com>

---------

Signed-off-by: Richard Musil <risa2000x@gmail.com>
Co-authored-by: Richard Musil <risa2000x@gmail.com>
2025-04-04 10:59:23 +02:00
dependabot[bot]
79587f896e ⬆️ Bump mkdocs-material from 9.6.10 to 9.6.11 in /docs/mkdocs (#4715)
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.6.10 to 9.6.11.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.6.10...9.6.11)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-03 07:40:29 +02:00
dependabot[bot]
b67f8644ee ⬆️ Bump actions/dependency-review-action from 4.5.0 to 4.6.0 (#4716)
Bumps [actions/dependency-review-action](https://github.com/actions/dependency-review-action) from 4.5.0 to 4.6.0.
- [Release notes](https://github.com/actions/dependency-review-action/releases)
- [Commits](3b139cfc5f...ce3cf9537a)

---
updated-dependencies:
- dependency-name: actions/dependency-review-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-03 07:40:18 +02:00
dependabot[bot]
71884486d1 ⬆️ Bump step-security/harden-runner from 2.11.0 to 2.11.1 (#4718)
Bumps [step-security/harden-runner](https://github.com/step-security/harden-runner) from 2.11.0 to 2.11.1.
- [Release notes](https://github.com/step-security/harden-runner/releases)
- [Commits](4d991eb9b9...c6295a65d1)

---
updated-dependencies:
- dependency-name: step-security/harden-runner
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-03 07:40:09 +02:00
dependabot[bot]
9ef4967389 ⬆️ Bump cpplint from 2.0.0 to 2.0.1 in /cmake/requirements (#4719)
Bumps [cpplint](https://github.com/cpplint/cpplint) from 2.0.0 to 2.0.1.
- [Release notes](https://github.com/cpplint/cpplint/releases)
- [Changelog](https://github.com/cpplint/cpplint/blob/develop/CHANGELOG.rst)
- [Commits](https://github.com/cpplint/cpplint/compare/2.0.0...2.0.1)

---
updated-dependencies:
- dependency-name: cpplint
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-03 07:39:59 +02:00
dependabot[bot]
9f40a7b454 ⬆️ Bump mkdocs-material from 9.6.9 to 9.6.10 in /docs/mkdocs (#4711)
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.6.9 to 9.6.10.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.6.9...9.6.10)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-01 14:44:09 +02:00
Niels Lohmann
d41ca94fa8 Adjust CMake minimal version (#4709)
* 🔧 adjust CMake versions

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🔧 install OpenSSL for CMake

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🔧 install OpenSSL for CMake

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🔧 install OpenSSL for CMake

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🔧 install OpenSSL for CMake

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🔧 install OpenSSL for CMake

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🔨 clean up

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 📝 update documentation

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-04-01 14:42:08 +02:00
dependabot[bot]
3a5703931a ⬆️ Bump cppcheck from 1.4.8 to 1.5.0 in /cmake/requirements (#4698)
Bumps [cppcheck](https://github.com/msclock/cppcheck-wheel) from 1.4.8 to 1.5.0.
- [Release notes](https://github.com/msclock/cppcheck-wheel/releases)
- [Changelog](https://github.com/msclock/cppcheck-wheel/blob/master/.releaserc.js)
- [Commits](https://github.com/msclock/cppcheck-wheel/compare/v1.4.8...v1.5.0)

---
updated-dependencies:
- dependency-name: cppcheck
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-29 16:33:52 +01:00
dependabot[bot]
4d216e0c31 ⬆️ Bump actions/upload-artifact from 4.6.1 to 4.6.2 (#4700)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.6.1 to 4.6.2.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](4cec3d8aa0...ea165f8d65)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-29 16:33:17 +01:00
dependabot[bot]
f971dd7707 ⬆️ Bump github/codeql-action from 3.28.11 to 3.28.13 (#4707)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.11 to 3.28.13.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](6bb031afdd...1b549b9259)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-29 16:32:19 +01:00
Gianfranco Costamagna
cd92c09c18 tests: Fix ignored attributes warning during build (#4670)
Signed-off-by: Gianfranco Costamagna <locutusofborg@debian.org>
Co-authored-by: Pragyansh Chaturvedi <pragyansh.chaturvedi@gmail.com>
2025-03-29 09:42:53 +01:00
Niels Lohmann
b477d2b95e Suppress clang-analyzer-webkit.NoUncountedMemberChecker (#4701)
* 🚨 suppress clang-analyzer-webkit.NoUncountedMemberChecker

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress invalid misc-const-correctness warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 📝 add Clang 20/21

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress invalid misc-const-correctness warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress invalid misc-const-correctness warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress invalid misc-const-correctness warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress invalid misc-const-correctness warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress invalid misc-const-correctness warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress invalid misc-const-correctness warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress invalid misc-const-correctness warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 🚨 suppress invalid misc-const-correctness warnings

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-03-29 09:38:45 +01:00
dependabot[bot]
11a835df85 ⬆️ Bump cppcheck from 1.4.7 to 1.4.8 in /cmake/requirements (#4697)
Bumps [cppcheck](https://github.com/msclock/cppcheck-wheel) from 1.4.7 to 1.4.8.
- [Release notes](https://github.com/msclock/cppcheck-wheel/releases)
- [Changelog](https://github.com/msclock/cppcheck-wheel/blob/master/.releaserc.js)
- [Commits](https://github.com/msclock/cppcheck-wheel/compare/v1.4.7...v1.4.8)

---
updated-dependencies:
- dependency-name: cppcheck
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-19 08:29:39 +01:00
dependabot[bot]
b592b6f2d8 ⬆️ Bump mkdocs-material from 9.6.8 to 9.6.9 in /docs/mkdocs (#4695)
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.6.8 to 9.6.9.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.6.8...9.6.9)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-19 08:29:30 +01:00
dependabot[bot]
e2c95baef1 ⬆️ Bump mkdocs-git-revision-date-localized-plugin (#4689) 2025-03-18 16:20:19 +01:00
bitFiedler
7abcb5e9a7 fixes issue 4691 (#4693)
* bugfix removeprefix not available in python version < 3.9

there was a problem in my cLion gdb that comes with python version 3.8.
the pretty printer script do not work because the removeprefix function is added in version 3.9.
therefore we need a fix for that.

Signed-off-by: Matthias Popp <mpopp@arri.at>

* fix indentation, use the same indentation size at in class JsonValuePrinter

the indentation size was a mix up, we should use always the same indentation size of 4

Signed-off-by: Matthias Popp <mpopp@arri.at>

* use prefix as variable

easier handling or easier to change

Signed-off-by: Matthias Popp <mpopp@arri.at>

* add variables for easier access

Signed-off-by: Matthias Popp <mpopp@arri.at>

---------

Signed-off-by: Matthias Popp <mpopp@arri.at>
Co-authored-by: Matthias Popp <mpopp@arri.at>
2025-03-18 14:01:25 +01:00
dependabot[bot]
5474b22277 ⬆️ Bump mkdocs-material from 9.6.5 to 9.6.8 in /docs/mkdocs (#4688)
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.6.5 to 9.6.8.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.6.5...9.6.8)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-18 14:00:42 +01:00
dependabot[bot]
6e684350ba ⬆️ Bump github/codeql-action from 3.28.10 to 3.28.11 (#4683)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.10 to 3.28.11.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](b56ba49b26...6bb031afdd)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-18 14:00:34 +01:00
dependabot[bot]
f506d8acc7 ⬆️ Bump jinja2 from 3.1.5 to 3.1.6 in /tools/generate_natvis (#4680)
Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.5 to 3.1.6.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/3.1.5...3.1.6)

---
updated-dependencies:
- dependency-name: jinja2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-18 14:00:22 +01:00
Robert Chisholm
34665ae648 Correct typo in sax_interface.md (#4679)
binary -> binary_t

Signed-off-by: Robert Chisholm <robert.chisholm@sheffield.ac.uk>
2025-03-06 11:40:09 +01:00
dependabot[bot]
f3dc4684b4 ⬆️ Bump github/codeql-action from 3.28.9 to 3.28.10 (#4661)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.9 to 3.28.10.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](9e8d0789d4...b56ba49b26)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-27 20:16:53 +01:00
dependabot[bot]
0b938993e1 ⬆️ Bump lukka/get-cmake from 3.31.5 to 3.31.6 (#4668)
Bumps [lukka/get-cmake](https://github.com/lukka/get-cmake) from 3.31.5 to 3.31.6.
- [Release notes](https://github.com/lukka/get-cmake/releases)
- [Commits](5f6e04f526...56d043d188)

---
updated-dependencies:
- dependency-name: lukka/get-cmake
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-27 20:16:31 +01:00
dependabot[bot]
543d8e4179 ⬆️ Bump actions/upload-artifact from 4.6.0 to 4.6.1 (#4665)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.6.0 to 4.6.1.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](65c4c4a1dd...4cec3d8aa0)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-27 20:15:52 +01:00
dependabot[bot]
f2e4946865 ⬆️ Bump ossf/scorecard-action from 2.4.0 to 2.4.1 (#4664)
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.4.0 to 2.4.1.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](62b2cac7ed...f49aabe0b5)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-27 20:15:18 +01:00
dependabot[bot]
8215dbafbd ⬆️ Bump mkdocs-material from 9.6.4 to 9.6.5 in /docs/mkdocs (#4659)
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.6.4 to 9.6.5.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.6.4...9.6.5)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-21 08:32:23 +01:00
dependabot[bot]
a3143f5f2f ⬆️ Bump step-security/harden-runner from 2.10.4 to 2.11.0 (#4652)
Bumps [step-security/harden-runner](https://github.com/step-security/harden-runner) from 2.10.4 to 2.11.0.
- [Release notes](https://github.com/step-security/harden-runner/releases)
- [Commits](cb605e52c2...4d991eb9b9)

---
updated-dependencies:
- dependency-name: step-security/harden-runner
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-20 07:34:06 +01:00
Niels Lohmann
0b6881a95f Add regression test for #3810 (#4608)
*  add regression test for #3810

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

*  add regression test for #3810

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

*  add regression test for #3810

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

*  add regression test for #3810

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

*  add regression test for #3810

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-02-15 12:24:06 +01:00
Niels Lohmann
a43350c4e5 Remove wsjcpp package manager (#4623)
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-02-15 12:23:12 +01:00
Niels Lohmann
8fb5d6f92d Some documentation updates (#4636)
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-02-15 12:19:59 +01:00
dependabot[bot]
2dc82053dc ⬆️ Bump mkdocs-material from 9.5.50 to 9.6.4 in /docs/mkdocs (#4648)
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.5.50 to 9.6.4.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.5.50...9.6.4)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-15 12:19:28 +01:00
dependabot[bot]
bf6b1e2f40 ⬆️ Bump github/codeql-action from 3.28.6 to 3.28.9 (#4646)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.6 to 3.28.9.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](17a820bf2e...9e8d0789d4)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-15 12:19:15 +01:00
dependabot[bot]
606b6347ed ⬆️ Bump coverallsapp/github-action from 2.3.4 to 2.3.6 (#4634)
Bumps [coverallsapp/github-action](https://github.com/coverallsapp/github-action) from 2.3.4 to 2.3.6.
- [Release notes](https://github.com/coverallsapp/github-action/releases)
- [Commits](cfd0633edb...648a8eb78e)

---
updated-dependencies:
- dependency-name: coverallsapp/github-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-28 20:15:30 +01:00
dependabot[bot]
c7d949f9f0 ⬆️ Bump github/codeql-action from 3.28.4 to 3.28.6 (#4635)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.4 to 3.28.6.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](ee117c905a...17a820bf2e)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-28 20:14:38 +01:00
Niels Lohmann
e90c860d53 Add note on derived return type for value function (#4628)
* 📝 add note on derived return type

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 📝 add note on derived return type

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-01-26 18:40:55 +01:00
dependabot[bot]
d0789e365d Bump lukka/get-cmake from 3.31.4 to 3.31.5 (#4625) 2025-01-24 18:26:07 +01:00
dependabot[bot]
97dd60c22a Bump github/codeql-action from 3.28.3 to 3.28.4 (#4624)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.3 to 3.28.4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](dd196fa9ce...ee117c905a)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-24 18:09:11 +01:00
dependabot[bot]
666d061443 Bump github/codeql-action from 3.28.2 to 3.28.3 (#4620)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.2 to 3.28.3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](d68b2d4edb...dd196fa9ce)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-23 18:45:58 +01:00
Harinath Nampally
bf8ccc20e9 fix compilation issue (#4613)
* fix compilation issue

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* add unit test

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* fix ci failure check

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

---------

Signed-off-by: Harinath Nampally <harinath922@gmail.com>
2025-01-22 21:28:51 +01:00
dependabot[bot]
786c5040e2 Bump github/codeql-action from 3.28.1 to 3.28.2 (#4617)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.1 to 3.28.2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](b6a472f63d...d68b2d4edb)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-22 21:12:33 +01:00
dependabot[bot]
bd4fea39ea Bump actions/stale from 9.0.0 to 9.1.0 (#4616) 2025-01-21 18:46:24 +01:00
dependabot[bot]
8c7dcd3b43 Bump step-security/harden-runner from 2.10.3 to 2.10.4 (#4614)
Bumps [step-security/harden-runner](https://github.com/step-security/harden-runner) from 2.10.3 to 2.10.4.
- [Release notes](https://github.com/step-security/harden-runner/releases)
- [Commits](c95a14d0e5...cb605e52c2)

---
updated-dependencies:
- dependency-name: step-security/harden-runner
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-20 19:31:05 +01:00
dependabot[bot]
b23cdeac2c Bump mkdocs-material from 9.5.49 to 9.5.50 in /docs/mkdocs (#4615)
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.5.49 to 9.5.50.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.5.49...9.5.50)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-20 19:30:56 +01:00
Richard Topchii
1b813519c2 Add VisionOS support to Swift Package Manager Package.swift definition file (#4611)
Signed-off-by: Richard Topchii <8013017+richardtop@users.noreply.github.com>
2025-01-20 10:26:29 +01:00
Niels Lohmann
f06604fce0 Bump the copyright years (#4606)
* 📄 bump the copyright years

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 📄 bump the copyright years

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* 📄 bump the copyright years

Signed-off-by: Niels Lohmann <niels.lohmann@gmail.com>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
Signed-off-by: Niels Lohmann <niels.lohmann@gmail.com>
2025-01-19 17:04:17 +01:00
Harinath Nampally
d23291ba26 use diagnostic positions in exceptions (#4585)
* add a ci step for Json_Diagnostic_Positions

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* Update ci.cmake to address review comments

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* address review comment

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* fix typo in the comment

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* fix typos in ci.cmake

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* invoke the new ci step from ubuntu.yml

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* issue4561 - use diagnostic positions for exceptions

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* fix ci_test_documentation check

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* address review comments

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* fix ci check failures for unit-diagnostic-postions.cpp

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* improvements based on review comments

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* fix const correctness string

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* further refinements based on reviews

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* add one more test case for full coverage

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* ci check fix - add const

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* add unit tests for json_diagnostic_postions only

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* fix ci_test_diagnostics

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* fix ci_test_build_documentation check

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

---------

Signed-off-by: Harinath Nampally <harinath922@gmail.com>
2025-01-19 10:42:21 +01:00
Niels Lohmann
0f9e6ae098 Fix broken links (#4605)
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-01-18 23:20:45 +01:00
kimci86
8a882f32ed Generate template functions with NLOHMANN_DEFINE_TYPE macros (#4597)
* Support any basic_json type in NLOHMANN_DEFINE_TYPE_* macros

Signed-off-by: kimci86 <kimci86@hotmail.fr>

* Test NLOHMANN_DEFINE_TYPE_* macros also support unordered_json

Signed-off-by: kimci86 <kimci86@hotmail.fr>

* Simplify test about NLOHMANN_DEFINE_TYPE_ with many arguments

Signed-off-by: kimci86 <kimci86@hotmail.fr>

* Remove extra scope in macros tests

Signed-off-by: kimci86 <kimci86@hotmail.fr>

* Remove unused test class in macros tests

Signed-off-by: kimci86 <kimci86@hotmail.fr>

* Update documentation about NLOHMANN_DEFINE_TYPE_* macros

Signed-off-by: kimci86 <kimci86@hotmail.fr>

* Fix NLOHMANN_JSON_SERIALIZE_ENUM documentation

Signed-off-by: kimci86 <kimci86@hotmail.fr>

* Mark some variables const in macros tests, fixes clang-tidy

Signed-off-by: kimci86 <kimci86@hotmail.fr>

* Workaround clang 3.5 issue with const object initialization

Signed-off-by: kimci86 <kimci86@hotmail.fr>

* Update highlighted lines in NLOHMANN_DEFINE_TYPE_* macros examples

Signed-off-by: kimci86 <kimci86@hotmail.fr>

* Fix swapped macros in documentation

Signed-off-by: kimci86 <kimci86@hotmail.fr>

* Remove extra backslashes at the end of macros

Signed-off-by: kimci86 <kimci86@hotmail.fr>

* Require basic_json type in NLOHMANN_DEFINE_TYPE_* generated functions

Signed-off-by: kimci86 <kimci86@hotmail.fr>

* Fix typos in macros documentation

Signed-off-by: kimci86 <kimci86@hotmail.fr>

---------

Signed-off-by: kimci86 <kimci86@hotmail.fr>
2025-01-18 22:59:09 +01:00
Michael Valladolid
bdb8d2b7b3 Serialize empty tuple into '[]' instead of null (#4594)
Signed-off-by: Michael Valladolid <mikevalladolid@gmail.com>
2025-01-18 20:34:11 +01:00
dependabot[bot]
e72046ef9f Bump step-security/harden-runner from 2.10.2 to 2.10.3 (#4604)
Bumps [step-security/harden-runner](https://github.com/step-security/harden-runner) from 2.10.2 to 2.10.3.
- [Release notes](https://github.com/step-security/harden-runner/releases)
- [Commits](0080882f6c...c95a14d0e5)

---
updated-dependencies:
- dependency-name: step-security/harden-runner
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-17 10:52:26 +01:00
dependabot[bot]
4a0081a1cf Bump actions/upload-artifact from 4.5.0 to 4.6.0 (#4603)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.5.0 to 4.6.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](6f51ac03b9...65c4c4a1dd)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-17 10:09:26 +01:00
dependabot[bot]
52b2614217 Bump srvaroa/labeler (#4602)
Bumps [srvaroa/labeler](https://github.com/srvaroa/labeler) from 1b3cdb1af3e59155a08b9b2436d0d54feaff49e2 to e216fb40e2e6d3b17d90fb1d950f98bee92f65ce.
- [Release notes](https://github.com/srvaroa/labeler/releases)
- [Commits](1b3cdb1af3...e216fb40e2)

---
updated-dependencies:
- dependency-name: srvaroa/labeler
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-17 09:37:52 +01:00
dependabot[bot]
f74e5c6a57 Bump github/codeql-action from 3.27.9 to 3.28.1 (#4601)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.27.9 to 3.28.1.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](df409f7d92...b6a472f63d)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-17 09:21:21 +01:00
dependabot[bot]
e25a824616 Bump lukka/get-cmake from 3.31.2 to 3.31.4 (#4600)
Bumps [lukka/get-cmake](https://github.com/lukka/get-cmake) from 3.31.2 to 3.31.4.
- [Release notes](https://github.com/lukka/get-cmake/releases)
- [Commits](5979409e62...acb35cf920)

---
updated-dependencies:
- dependency-name: lukka/get-cmake
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-17 08:41:49 +01:00
Niels Lohmann
26cfec34be Clean up and document project files (#4560) 2025-01-17 06:53:35 +01:00
Niels Lohmann
ad2ee18539 Fix coverage job (#4595)
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-01-15 18:08:37 +01:00
Michael Valladolid
2d42229f4d Support BSON uint64 de/serialization (#4590)
* Support BSON uint64 de/serialization

Signed-off-by: Michael Valladolid <mikevalladolid@gmail.com>

* Treat 0x11 as uint64 and not timestamp specific

Signed-off-by: Michael Valladolid <mikevalladolid@gmail.com>

---------

Signed-off-by: Michael Valladolid <mikevalladolid@gmail.com>
2025-01-10 14:59:55 +01:00
Niels Lohmann
1809b3d800 Add note to Jetbrains support (#4592)
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-01-09 20:15:11 +01:00
Nebojša Cvetković
48e7b4c23b BJData Fixes (#4588) 2025-01-07 22:10:38 +01:00
Vertexwahn
0cb1241d5e Improve Bazel support: Switch to Bzlmod (#4584)
* Improve Bazel support: Switch to Bzlmod

Signed-off-by: Vertexwahn <julian.amann@tum.de>

* Update documentation

Signed-off-by: Vertexwahn <julian.amann@tum.de>

* Fix spelling

Signed-off-by: Vertexwahn <julian.amann@tum.de>

* Fix snippet filename error

Signed-off-by: Vertexwahn <julian.amann@tum.de>

---------

Signed-off-by: Vertexwahn <julian.amann@tum.de>
2025-01-07 18:47:51 +01:00
Nebojša Cvetković
2e50d5b2f3 BJData optimized binary array type (#4513) 2025-01-07 18:09:19 +01:00
Nikhil
60c48755e3 Add missing macros in README and link to docs for more info (#4582)
* Add nav items for serialize macros

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* match order of non-intrusive macros to intrusive macros

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* Add missing macros and link for more info

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* Add @brief macro tags

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* make amalgamate

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* Add since version tags

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

* Revert "Add missing macros and link for more info"

This reverts commit 4c9b3ae9bf7a25c81dc1c6217a72a30a39086979.

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>

---------

Signed-off-by: Nikhil <nikhilreddydev@gmail.com>
2025-01-03 22:19:37 +01:00
Harinath Nampally
a6255cc418 add a ci step for Json_Diagnostic_Positions (#4579)
* add a ci step for Json_Diagnostic_Positions

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* Update ci.cmake to address review comments

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* address review comment

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* fix typo in the comment

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* fix typos in ci.cmake

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

* invoke the new ci step from ubuntu.yml

Signed-off-by: Harinath Nampally <harinath922@gmail.com>

---------

Signed-off-by: Harinath Nampally <harinath922@gmail.com>
2025-01-03 07:15:37 +01:00
Niels Lohmann
f038ac4c9d Enable modernize-use-integer-sign-comparison check (#4581)
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
2025-01-02 13:24:05 +01:00
Michael Valladolid
4f64d8d0b4 Modernize integer comparison (#4577)
Replace static_cast<size_t>(-1) with std::numeric_limits<std::size_t>::max()
via the detail::unknown_size() function
2025-01-01 17:01:38 +01:00
Nissim Armand Ben Danan
2134cb947a Fix NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT with an empty JSON instance (#4508)
* change NLOHMANN_JSON_FROM_WITH_DEFAULT to let NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT work with an empty JSON instance

* fix ci_static_analysis_clang (ci_clang_tidy)

* change NLOHMANN_JSON_FROM_WITH_DEFAULT to let NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT work with an empty JSON instance
2024-12-31 08:16:43 +01:00
Niels Lohmann
6057b31df7 Overwork astyle call (#4573)
* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* Use ubuntu-latest image to run Valgrind (#4575)

* 🔧 use Clang image to run valgrind

* 🔧 use Clang image to run valgrind

* 🔧 use Clang image to run valgrind

* 🔧 use Ubuntu image to run valgrind

* Use Clang image to run iwyu (#4574)

* 🔧 use Clang image to run iwyu

* 🔧 use Clang image to run iwyu

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🔧 overwork astyle call

* 🎨 format code

* 🔨 clean up
2024-12-29 17:06:03 +01:00
Niels Lohmann
0fa326a8e8 Use Clang image to run iwyu (#4574)
* 🔧 use Clang image to run iwyu

* 🔧 use Clang image to run iwyu
2024-12-29 15:49:35 +01:00
Niels Lohmann
8314ac2f76 Use ubuntu-latest image to run Valgrind (#4575)
* 🔧 use Clang image to run valgrind

* 🔧 use Clang image to run valgrind

* 🔧 use Clang image to run valgrind

* 🔧 use Ubuntu image to run valgrind
2024-12-29 15:49:20 +01:00
Harinath Nampally
69c8758d51 fix the abi tests for diagnostics positions feature (#4572) 2024-12-28 16:24:52 +01:00
Harinath Nampally
5ff90d9e02 fix diagnostic positions related compilation errors (#4570) 2024-12-28 16:22:45 +01:00
dependabot[bot]
6be4e85600 Bump cppcheck from 1.4.6 to 1.4.7 in /cmake/requirements (#4567) 2024-12-23 19:17:06 +01:00
Greg Marr
663058e7d1 Fix typo in nlohmann_define_derived_type.md (#4565) 2024-12-21 12:53:15 +01:00
Einars Netlis-Galejs
af4ad7915c Add ONLY_SERIALIZE for NLOHMANN_DEFINE_DERIVED_TYPE_* macros (#4562) 2024-12-20 11:31:22 +01:00
Sushrut Shringarputale
58f5f25968 json start/end position implementation (#4517)
* Add implementation to retrieve start and end positions of json during parse

* Add more unit tests and add start/stop parsing for arrays

* Add raw value for all types

* Add more tests and fix compiler warning

* Amalgamate

* Fix CLang GCC warnings

* Fix error in build

* Style using astyle 3.1

* Fix whitespace changes

* revert

* more whitespace reverts

* Address PR comments

* Fix failing issues

* More whitespace reverts

* Address remaining PR comments

* Address comments

* Switch to using custom base class instead of default basic_json

* Adding a basic using for a json using the new base class. Also address PR comments and fix CI failures

* Address decltype comments

* Diagnostic positions macro (#4)

Co-authored-by: Sush Shringarputale <sushring@linux.microsoft.com>

* Fix missed include deletion

* Add docs and address other PR comments (#5)

* Add docs and address other PR comments

---------

Co-authored-by: Sush Shringarputale <sushring@linux.microsoft.com>

* Address new PR comments and fix CI tests for documentation

* Update documentation based on feedback (#6)

---------

Co-authored-by: Sush Shringarputale <sushring@linux.microsoft.com>

* Address std::size_t and other comments

* Fix new CI issues

* Fix lcov

* Improve lcov case with update to handle_diagnostic_positions call for discarded values

* Fix indentation of LCOV_EXCL_STOP comments

* fix amalgamation astyle issue

---------

Co-authored-by: Sush Shringarputale <sushring@linux.microsoft.com>
2024-12-18 22:46:14 +01:00
dependabot[bot]
733c59588d Bump actions/upload-artifact from 4.4.3 to 4.5.0 (#4557) 2024-12-18 18:43:22 +00:00
Niels Lohmann
6cb099e30e Suppress modernize-use-integer-sign-comparison (#4558) 2024-12-18 17:44:56 +01:00
Niels Lohmann
094bd2651b Set parents after insert call (#4537)
* 🐛 set parents after insert call

* 🚨 fix warning
2024-12-18 09:44:09 +01:00
Niels Lohmann
30cd44df95 Clean up CI (#4553)
* 💚 overwork cppcheck

* 🔒 adjust permissions

* 💚 fixes

* 💚 fixes
2024-12-17 18:58:05 +01:00
StepSecurity Bot
5362012fdd [StepSecurity] ci: Harden GitHub Actions (#4551)
Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>
2024-12-17 15:20:06 +01:00
Niels Lohmann
861ec9c3c6 Fix token permissions warnings (#4550)
* 🚨 fix token permissions warnings

* 🚨 fix token permissions warnings

* 🚨 fix token permissions warnings
2024-12-17 12:55:19 +01:00
dependabot[bot]
f4910b20ce Bump mkdocs-material from 9.5.48 to 9.5.49 in /docs/mkdocs (#4548) 2024-12-17 09:50:23 +00:00
Niels Lohmann
f2a4ac0673 Add step to build the documentation (#4549)
* 💚 add step to build the documentation

* 💚 add step to build the documentation
2024-12-17 09:48:24 +01:00
Niels Lohmann
8e1b800017 Move reuse dependency to requirements.txt file (#4547) 2024-12-16 17:25:18 +01:00
Niels Lohmann
677e19e39c Clean up (#4546) 2024-12-16 07:23:35 +01:00
dependabot[bot]
9e23b5d61e ⬆️ Bump watchdog from 2.1.7 to 6.0.0 in /tools/serve_header (#4542) 2024-12-15 22:39:16 +00:00
dependabot[bot]
eb142e33c0 ⬆️ Bump ossf/scorecard-action from 2.3.3 to 2.4.0 (#4545) 2024-12-15 21:54:00 +00:00
dependabot[bot]
1c8e26dcb4 ⬆️ Bump lukka/get-cmake from 3.31.0 to 3.31.2 (#4544) 2024-12-15 21:23:59 +00:00
dependabot[bot]
b6b8378c8c ⬆️ Bump github/codeql-action from 2.27.9 to 3.27.9 (#4543) 2024-12-15 20:55:09 +00:00
dependabot[bot]
58949c0ad5 ⬆️ Bump actions/github-script from 6.4.0 to 7.0.1 (#4540) 2024-12-15 20:13:29 +00:00
dependabot[bot]
7cfbe321be ⬆️ Bump pyyaml from 6.0 to 6.0.2 in /tools/serve_header (#4541) 2024-12-15 20:12:27 +00:00
StepSecurity Bot
4003f8da02 [StepSecurity] Apply security best practices (#4539)
Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>
2024-12-15 18:31:21 +01:00
Niels Lohmann
6a2ae22a5a 📝 add OpenSSF Scorecard badge 2024-12-15 17:16:26 +01:00
Niels Lohmann
620034ecec ♻️ allow patch and diff to be used with arbitrary string types (#4536) 2024-12-13 07:24:50 +01:00
Niels Lohmann
e6cafa573a 📝 fix CPM.cmake example 2024-12-11 08:31:43 +01:00
Niels Lohmann
e0a17f8475 📝 add more package managers (#4533) 2024-12-10 23:18:39 +01:00
Niels Lohmann
20ae363a71 Replace EOF with char_traits (#4532)
* 📝 update customers

* ♻️ replace EOF with char_traits #2755
2024-12-10 20:51:47 +01:00
peng-wang-cn
589641b175 Add support of multi-dim C-style array member of struct. (#4262)
* Add support of multi-dim C-style array.

* Support up to 4 dimensional array.

* Suppress clang-tidy checks for C-style arrays
2024-12-10 13:18:21 +01:00
Niels Lohmann
f385fe28f2 💸 update sponsors 2024-12-10 11:59:01 +01:00
Niels Lohmann
981a4c39f4 📝 trigger documentation build 2024-12-10 09:41:45 +01:00
Niels Lohmann
dd81f878f7 🚀 fix permissions 2024-12-10 09:39:21 +01:00
Niels Lohmann
549c79ba7e Overwork documentation (#4516) 2024-12-09 23:02:30 +01:00
Niels Lohmann
9f60e85557 Fix return value of get_ptr for unsigned integers (#4525)
* 🐛 fix return value of get_ptr for unsigned integers

* 📝 update documentation
2024-12-06 18:38:25 +01:00
Niels Lohmann
a006a7a48b Add more GCC warning flags (#4524)
* 🔧 add more GCC warning flags

* 👷 use GCC image for GCC test

* 👷 use GCC image for GCC test

* 👷 use GCC image for GCC test

* 👷 use GCC image for GCC test

* 👷 use GCC image for GCC test

* 👷 use GCC image for GCC test

* 👷 use GCC image for GCC test

* 👷 use GCC image for GCC test

* 🔧 adjust flags

* 👷 adjust jobs

* 👷 adjust jobs
2024-12-01 16:13:48 +01:00
Niels Lohmann
1b9a9d1f21 Update licenses (#4521)
* 📄 update licenses

* 📄 update licenses
2024-11-29 17:38:42 +01:00
Tianyi Chen
935c6eeb5a Optimize binary get_number implementation by reading multiple bytes at once (#4391)
* multibyte binary reader

* wide_string_input_adapter fallback to get_character

Update input_adapters.hpp

* Update json.hpp

* Add from msgpack test

* Test for broken msgpack with stream, address some warnings

* Reading binary number from wchar as an error, address warnings

* Not casting float to int, it violates strict aliasing rule
2024-11-29 09:19:58 +01:00
Niels Lohmann
e41905fcb0 💸 thanks @phrrngtn 2024-11-27 18:03:21 +01:00
Dylan Baker
d333f08958 CMake: generate a pkg-config file that follow pkg-config conventions (#4456)
* CMake: configure pkg-config with @only

And use @ replacement instead of {}, since ${} is significant in
pkg-config's format

* CMake: use conventional prefix and incluedir variables in pkg-config

This is more standard, and has some advantages when cross compiling.
This also means that the pkg-config files generated by Meson and CMake
now match.
2024-11-26 08:39:11 +01:00
Niels Lohmann
3d6c664de2 Allow comparing default initialized iterators (#4512) 2024-11-26 06:35:14 +01:00
Niels Lohmann
ee32bfc1c2 Make SAX output locale-independent (#4505)
* 🐛 make SAX output locale-independent #4084

*  add test

*  add test

*  add test

*  add test

*  add test

*  add test

* 🐛 make SAX output locale-independent #4084

* 🐛 make SAX output locale-independent #4084

* 🐛 make SAX output locale-independent #4084

* 🐛 make SAX output locale-independent #4084

* 🐛 make SAX output locale-independent #4084

* 🐛 make SAX output locale-independent #4084

* 🐛 make SAX output locale-independent #4084

* 🐛 make SAX output locale-independent #4084

* 🐛 make SAX output locale-independent #4084

* 🐛 make SAX output locale-independent #4084

* 🐛 make SAX output locale-independent #4084

* 🐛 make SAX output locale-independent #4084
2024-11-24 21:14:00 +01:00
Niels Lohmann
a97041a98f Skip enum tests when JSON_DisableEnumSerialization=ON (#4504)
*  skip enum tests when JSON_DisableEnumSerialization=ON

*  skip enum tests when JSON_DisableEnumSerialization=ON
2024-11-21 17:19:16 +01:00
Stuart Gorman
f9f8c07792 fix: integer parsed as float when EINTR set in errno (#4506)
* fix: integer parsed as float when EINTR set in errno

* chore: make amalgamate

* chore: make pretty

---------

Co-authored-by: Stuart Gorman <Stuart.Gorman@kallipr.com>
2024-11-21 13:09:29 +01:00
Niels Lohmann
378e091795 Fix weak-vtables warning (#4500)
* 🔧 remove warning suppression

* 🚨 fix weak-vtables warning #4087

* 🚨 suppress -Wweak-vtables warning

* 🚨 suppress -Wweak-vtables warning

*  fix test

*  fix test

*  fix test
2024-11-20 08:29:44 +01:00
jh96
1f218e1074 Possible fix for #4485 (#4487)
* Possible fix for #4485

Throw's an exception when i is nullptr,
also added a testcase for this scenario though most likely in the wrong test file.cpp

* quick cleanup

* Fix compile issues

* moved tests around, changed exceptions, removed a possibly unneeded include

* add back include <memory> for testing something

* Ninja doesn't like not having a \n, at end of file, adding it back

* update input_adapter file to deal with empty/null file ptr.

* ran make pretty

* added test for inputadapter

* ran make amalgamate

* Update tests/src/unit-deserialization.cpp

Co-authored-by: Niels Lohmann <niels.lohmann@gmail.com>

* Update tests/src/unit-deserialization.cpp

Co-authored-by: Niels Lohmann <niels.lohmann@gmail.com>

* Update input adapters.hpp with new includes

* fix unabigious use of _, (there was a double declare)

* did the amalagamate

* rm duplicate includes

* make amalgamate again

* reorder

* amalgamate

* moved it above

* amalgamate

---------

Co-authored-by: Jordan <jordan-hoang@users.noreply.github.com>
Co-authored-by: Niels Lohmann <niels.lohmann@gmail.com>
2024-11-19 13:54:04 +01:00
Niels Lohmann
64f68dc563 Suppress warnings in NLOHMANN_JSON_SERIALIZE_ENUM (#4497) 2024-11-17 14:29:27 +01:00
Niels Lohmann
1c5923e5d6 Add comment for #4494 (#4496) 2024-11-17 07:36:05 +01:00
Niels Lohmann
e3ac5a64bf Add test for libstdc++ (#4495)
* 👷 add test for libstdc++

* 👷 add test for libstdc++

* 💚 add fixes from #4490

* 💚 add fixes from #4490
2024-11-17 07:35:35 +01:00
Marcel
e509007df2 Remove alwayslink=True Bazel flag (#4396) 2024-11-16 23:13:11 +01:00
Fredrik Sandhei
060414037e feat: Rebase feature/optional to develop (#4036)
* 🚧 conversions for std::optional

* 🏁 fix <optional> inclusion

* 💚 overwork tests

* Use JSON_HAS_CPP_17 only after it has been defined

*  update tests

* 🏁 include right <optional> header

* ♻️ do not include experimental headers

* Add missing #endif after rebase

* Fix failing test

* Only define conversion to std::optional when JSON_USE_IMPLICIT_CONVERSION is disabled.

* missing endif

* Remove Wfloat-equal suppress

* amalgamate

* Move include of optional out of macro_scope; probably does not make sense to be there

* Make clang-tidy happy

* Suppress lint instead of changing to 'contains'

---------

Co-authored-by: Niels Lohmann <mail@nlohmann.me>
Co-authored-by: Markus Palonen <markus.palonen@gmail.com>
2024-11-16 17:19:33 +01:00
zjyhjqs
fd20975a94 Add CPack support (#4459) 2024-11-16 17:09:05 +01:00
Captain Crutches
fde9a86c5a Make iterator_proxy_value a forward_iterator (#4371) (#4372)
* Make iteration_proxy_value model forward_iterator

* Amalgamate

* Suppress tidy warning
2024-11-15 09:28:40 +01:00
Niels Lohmann
1825117e63 Another desperate try to fix the CI (#4489)
* 🚨 fix warning

* 💚 update actions

* 🚨 fix warning

* 🚨 fix warning

* 🚨 fix warning

* 💚 update actions

* 💚 update actions

* 🚨 fix warning

* 🚨 fix warning

* 💚 update actions

* 🚨 fix warning

* 💚 update actions

* 💚 update actions

* 💚 update actions

* 🚨 fix warning

* 🚨 fix warning

* 🚨 fix warning

* 🚨 fix warning

* 💚 update actions

* 💚 update actions

* 🚨 fix warning

* 💚 update actions

* 💚 update actions

* 💚 update actions

* 💚 update actions

* 💚 update actions
2024-11-13 10:21:26 +01:00
Niels Lohmann
4a602df34e Add lgtm explanation (#4362) 2024-11-10 13:15:23 +01:00
Borislav Stanimirov
18ff442e63 Allow overriding the CMake target name (#4483) 2024-11-08 21:42:36 +01:00
Niccolò Iardella
aff5a31d35 Add NLOHMANN_DEFINE_DERIVED_TYPE_* macros (#4033)
* Add NLOHMANN_DEFINE_DERIVED_TYPE_* macros

* Fix with amalgamate

* Add documentation

* Fix with amalgamate

* Fix with amalgamate

---------

Co-authored-by: Niccolò Iardella <niccolo.iardella@doriansrl.it>
2024-11-08 21:41:19 +01:00
Balazs Erseki
ac8b22180d Update CONTRIBUTING.md (#4486)
Typo in the filename.
2024-11-04 17:45:58 +01:00
thetimr
6325839776 Update is_structured.md (#4472) 2024-10-08 06:53:32 +02:00
Griffin Myers
b36f4c477c Update natvis to reflect 3.11.3 and the current structure of basic_json (#4451)
* Update natvis Jinja template to reflect the current structure of basic_json.

In 5a1a57510a the underlying structure of
basic_json was altered to move m_type and m_value under an m_data field.
This updates the nativ template to be consistent with this change.

* Generate nlohmann_json.natvis for 3.11.3 and latest basic_json structure.
2024-09-05 20:28:24 +02:00
Nikhil Idiculla
960b763ecd Docs: fix typos of 'whether' in operator_{gt,le,lt}.md (#4412) 2024-07-07 10:22:17 +02:00
Fallen_Breath
8c391e04fe Docs: Fix wrong code usage in the Value access section of json_pointer.md (#4255) 2024-04-13 14:15:00 +02:00
Yuanhao Jia
01da82eae2 Fix gdb pretty printer (#4343) 2024-04-13 14:11:49 +02:00
laterlaugh
97f0bdaf9a chore: fix some typos in comments (#4345)
chore: fix some typos in comments

Signed-off-by: laterlaugh <manziwenzhai@sina.cn>
2024-04-12 15:20:18 +02:00
Alex Prabhat Bara
c883fb0f17 Fix for incorrect function name in documentation example (#4342) 2024-04-10 18:17:47 +02:00
Leila Shcheglova
377c767aa1 Updated exception handling to catch const reference in out_of_range (#4331)
Co-authored-by: LeilaSh <leilanagieva81@gmail.com>
2024-04-08 21:12:32 +02:00
Philip Müller
16b3d841d5 Fixed an error in the Custom data source example. (#4335) 2024-04-08 21:11:25 +02:00
AniketDhemare
199dea11b1 #4307 Updated docx to 3.10.5 from 3.10.4 (#4310) 2024-03-15 13:12:21 +01:00
ss
0457de21cf Align astyle flags in Makefile with CI (#4277)
Remove unsupported `--squeeze-lines=2` parameter

Fixes #4275
2024-01-28 20:25:22 +01:00
Niels Lohmann
c35d260c2f Suppress Clang-Tidy warnings (#4276) 2024-01-28 14:04:07 +01:00
ss
6a064e026a Remove broken link from CONTRIBUTING.md (#4274)
http://issuestats.com domain does not exist anymore
2024-01-28 08:55:49 +01:00
alferov
7efe875495 Update json_has_static_rtti.md (#4269) 2024-01-18 19:21:53 +01:00
Juan Carlos Arevalo Baeza
a259ecc51e Fix to_json for enums when the enum has an unsigned underlying type. (#4237)
* Enhance the UDT unit test to expose the issue

Add a new enum type with uint64_t as the underlying type.
Use it in the overall UDT. Not strictly needed, but it helps exercise its expected usage.
Create an object of this enum type with a large value (negative if cast to int64_t).
Perform several checks on this object as converted to `json`, which fail without the fix.

* Fix the issue in the relevant `to_json` overload.

Select the correct json type depending on the signedness of the enum's underlying type.
This fixes the new checks in the unit test.

* Add the fix to the single_include

I ran `make pretty` but that modified 20 files, performing a significant amount of indentation changes, none of them related to my change.
I ran `make amalgamate`, but that did nothing. Apparently, the make rule won't run if the single_include files have already been updated by `make pretty`.
I forced `make amalgamate` to do the work by touching the file with the fix.
I then decided to keep just the minimal needed change: the addition of the fix to the single_include file.

I just am not conversant enough in Linux to know whether I installed astyle correctly (had to clone the source from a beta branch and build, in order to get support for `--squeeze-lines`).

* Resolve CI errors and use qualified `std::uint64_t`

The fix was relying on implicit conversions in the non-taken branch.
- Ordinarily (work on a C++20 codebase) I would have used `if constexpr` here, sidestepping the issue, but that's not available on C++11 so I didn't bother.
- So instead of an `if` statement, I used a compile-time constant to select the correct overload.
- This is arguably better in this case, anyway.

I was using function-style casts for typed constants, which I consider superior for constants, but the CI checks disagree, so changed all to `static_cast`.
- For some reason, the CI checks didn't point at all of them, so I hope I caught them all myself.

Built with clang14 and all unit tests pass.

---------

Co-authored-by: Juan Carlos Arevalo Baeza (JCAB) <jcab@ntdev.microsoft.com>
2023-12-14 09:26:10 +01:00
Niels Lohmann
3780b41dd0 💰 update sponsors 2023-12-06 20:51:04 +01:00
Niels Lohmann
9cca280a4d JSON for Modern C++ 3.11.3 (#4222) 2023-11-28 22:36:31 +01:00
Colby Haskell
1d597743d8 Fix char_traits deprecation warning (#4179) 2023-11-27 06:51:25 +01:00
Niels Lohmann
f56c6e2e30 Update documentation for the next release (#4216) 2023-11-26 15:51:19 +01:00
Vyacheslav Zhdanovskiy
360ce457f4 Add serialization-only user defined type macros (#3816) 2023-11-26 13:18:20 +01:00
Colby Haskell
5d931c59a3 Fix failing CI checks (#4215) 2023-11-25 18:04:59 +01:00
Niels Lohmann
6eab7a2b18 💚 fix documentation deploy 2023-11-01 22:16:27 +01:00
Niels Lohmann
1dfe4073e3 💚 fix documentation deploy 2023-11-01 22:09:53 +01:00
Niels Lohmann
4ffd5bd18e 💚 fix documentation deploy 2023-11-01 22:06:01 +01:00
Niels Lohmann
0261bc04d3 Fix CI (again) (#4196) 2023-11-01 21:23:55 +01:00
Colby Haskell
59da644db4 Add more specific error message when attempting to parse empty input (#4180) 2023-10-31 20:17:43 +01:00
Benjamin Buch
cdb29069da fix cmake header path in install with custom CMAKE_INSTALL_INCLUDEDIR (#4194) 2023-10-31 19:52:54 +01:00
Aleksei Sapitskii
58d6aa5831 Support Apple's Swift Package Manager (#4010)
Co-authored-by: Aleksei <sapial@f-secure.com>
2023-10-21 19:41:10 +02:00
scribam
edffad036d Fix MinGW CI (#4175) 2023-10-04 22:16:48 +02:00
Mathieu Westphal
6adae02ddd Fix spellcheck issue (#4173) 2023-10-04 15:24:38 +02:00
Vyacheslav Zhdanovskiy
35c0b3e54c Fix source highlighting in user defined type macros docs (#4169) 2023-10-02 13:09:53 +02:00
Craig Scott
fac07e22c5 Accept NEW CMake policies up to CMake 3.14 (#4112)
Starting with CMake 3.27, deprecation warnings are issued
when asking for policy settings for CMake 3.4 or earlier.
The cmake_minimum_required() command accepts a version
range, which allows NEW policy settings up to the upper end
of that range to be used, but without raising the minimum
CMake version above the bottom of that range. This means
NEW policy settings will be used where available, without
requiring them. This change updates the project's
cmake_minimum_required() calls to use a version range to
extend the upper policy version to 3.14 where it wasn't already
at that version or higher. This prevents the deprecation warning
from CMake 3.27, and gives breathing space before a future
CMake release will start issuing similar deprecation warnings
again.
2023-09-25 09:31:26 +02:00
alferov
6d4b72d3c3 Fix compile error with _HAS_STATIC_RTTI=0 (#4046) 2023-09-24 11:23:41 +02:00
Niels Lohmann
bbd2e1636d Fix deprecation warning (#4161) 2023-09-23 20:16:37 +02:00
tomalakgeretkal
6e36c721f0 Fixed init-list construction when size_type is not int (#4140) 2023-09-23 17:21:40 +02:00
miny1233
e75b94b31e Update index.md (#4159) 2023-09-23 17:20:47 +02:00
Ivor Wanders
aa87ab8b40 Capture exceptions by const& in docs. (#4099) 2023-09-23 17:19:50 +02:00
Niels Lohmann
1ce29fa22f Fix CI (#4160) 2023-09-23 17:19:28 +02:00
HO-COOH
5fec803493 Update index.md (#4149) 2023-09-14 17:46:34 +02:00
Felix Yan
da92c0e3e7 Correct a typo in serve_header/README.md (#4143) 2023-09-10 21:49:38 +02:00
Niels Lohmann
836b7beca4 Fix CI, again (#4083) 2023-09-07 20:41:12 +02:00
Ikko Eltociear Ashimine
788e5468e4 Fix typo in afl_driver.cpp (#4109) 2023-09-02 17:16:33 +02:00
taro
6cc0eaf88f Update CODEOWNERS (#4126) 2023-08-28 22:04:08 +02:00
Niels Lohmann
5d2754306d 💸 add sponsor 2023-06-14 07:39:09 +02:00
No
c71ecde505 Use template get instead of get in examples (#4039)
Co-authored-by: tusooa <tusooa@kazv.moe>
2023-06-11 10:06:24 +02:00
Tomerkm
793878898f Added to tests the file unit-algorithm.cpp (c++ 11) functions from algorithm library (#4044) 2023-06-11 09:59:57 +02:00
gregmarr
254395e5f7 Add to CONTRIBUTING.md that make pretty is required for test updates. (#4045) 2023-06-08 18:47:44 +02:00
Niels Lohmann
ab06fc9951 Fix Clang-Tidy warnings (#4047) 2023-06-08 18:46:48 +02:00
Niels Lohmann
a0c1318830 Fix CI + new Doctest (#3985) 2023-05-21 17:23:18 +02:00
Nicolas Jakob
6af826d0bd Add Vcpkg port version badge (#3988) 2023-03-24 14:45:47 +01:00
Joyce
546370c9e7 Set minimal permissions to Github Workflows (#3972) 2023-03-13 12:14:35 +01:00
Raphael Grimm
bbe337c3a3 Prevent memory leak when exception is thrown in adl_serializer::to_json (#3901)
Co-authored-by: barcode <barcode@example.com>
2023-03-08 13:43:45 +01:00
dependabot[bot]
fe4b66355c ⬆️ Bump future from 0.18.2 to 0.18.3 in /docs/mkdocs (#3934)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-08 13:41:44 +01:00
Joyce
31c00dc729 Refactor amalgamation workflow to avoid dangerous use of pull_request_target (#3969) 2023-03-08 13:41:20 +01:00
Sergei Trofimovich
6cec5aefc9 custom allocators: define missing 'rebind' type (#3895) 2023-03-08 12:31:56 +01:00
theevilone45
b504dca35a Fix typo in test.cmake (#3951) 2023-03-05 14:12:18 +01:00
Arsen Arsenović
660d0b5856 tests/unit-iterators2: use std::ranges::equals for range comparisons (#3950)
Closes https://github.com/nlohmann/json/issues/3927
2023-03-05 14:11:22 +01:00
haadfida
b2306145e1 removed lgtm badge and added Cirrus CI badge (#3937) 2023-02-01 08:19:45 +01:00
Florian Segginger
8fa0d7bb7e Change 2022 to 2023 (#3932) 2023-01-31 19:24:27 +01:00
Raphael Grimm
233d233439 Fix CI issues (#3906)
Co-authored-by: barcode <barcode@example.com>
2023-01-31 19:23:37 +01:00
Finkman
da6b908c4f PrettyPrinter: Check if match is valid before accessing group (#3920) 2023-01-14 16:07:49 +01:00
Niels Lohmann
4c6cde72e5 Try old MinGW script (#3892)
* ⚗️ try old MinGW script

* ⚗️ add Clang 13, 14, and 15 for Windows

* 📝 add Clang version to README
2022-12-21 09:30:43 +01:00
Niels Lohmann
a2f0593649 Upgrade Python packages (#3891) 2022-12-19 07:25:05 +01:00
Niels Lohmann
80dfb049b3 Fix warning about moved from object (#3889) 2022-12-18 17:20:30 +01:00
Niels Lohmann
2ca8dabeb9 Remove a magic number (#3888) 2022-12-18 17:04:51 +01:00
Niels Lohmann
885aa0014e Add migration guide (#3887) 2022-12-18 17:04:23 +01:00
Niels Lohmann
7f72eedc2d Clang 15 (#3876) 2022-12-11 17:08:34 +01:00
DavidKorczynski
094a3dc105 Add CIFuzz CI GitHub action (#3845) 2022-12-11 11:02:02 +01:00
dependabot[bot]
ea870ea247 Bump certifi from 2022.6.15 to 2022.12.7 in /docs/mkdocs (#3872)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-11 09:19:46 +01:00
Niels Lohmann
3c616ed688 💚 fix Ubuntu build 2022-12-10 23:18:35 +01:00
Niels Lohmann
813c329fbb 💚 fix Ubuntu build 2022-12-10 23:00:41 +01:00
Niels Lohmann
97f88ce21d 💚 fix Ubuntu build 2022-12-10 22:50:46 +01:00
Niels Lohmann
44423b4d8f 💚 fix Ubuntu build 2022-12-10 22:28:23 +01:00
Niels Lohmann
3e990876e1 💚 fix Ubuntu build 2022-12-10 22:17:37 +01:00
Niels Lohmann
b6dcf3edf3 💚 fix Ubuntu build 2022-12-10 22:01:08 +01:00
Niels Lohmann
07182ebc1d 💚 fix Ubuntu build 2022-12-10 14:45:41 +01:00
Niels Lohmann
f7d46b8803 💚 fix Ubuntu build 2022-12-10 14:42:58 +01:00
Niels Lohmann
84e5a321eb 💚 fix Ubuntu build 2022-12-10 14:23:18 +01:00
Niels Lohmann
23e69222c5 💚 fix Ubuntu build 2022-12-10 14:10:28 +01:00
Niels Lohmann
5fa4e66d37 💚 fix Ubuntu build 2022-12-10 13:55:30 +01:00
Niels Lohmann
c700a9ecbb 💚 fix Ubuntu build 2022-12-10 13:52:27 +01:00
Niels Lohmann
c5a03c2ea0 💚 fix Ubuntu build 2022-12-10 13:48:06 +01:00
Niels Lohmann
349e4b310e Fix natvis XML (#3863)
* 🐛 fix natvis XML

* 🐛 fix natvis XML
2022-12-09 16:34:34 +01:00
Niels Lohmann
8f8315368b 🐛 fix natvis XML 2022-12-04 21:47:08 +01:00
Niels Lohmann
24ba54e687 Fix pipeline (#3862) 2022-12-04 14:03:54 +01:00
dependabot[bot]
a3e6e26dc8 Bump joblib from 1.1.0 to 1.2.0 in /docs/mkdocs (#3781)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-02 11:55:39 +02:00
Dirk Stolle
4b2c8ce6bc Fix some typos for n-dimensional arrays (#3767) 2022-09-26 06:23:18 +02:00
Florian Albrechtskirchinger
17d9eacd24 Add missing files to release artifacts (#3728) 2022-09-25 12:00:44 +02:00
Florian Albrechtskirchinger
f4658de270 Fix 'declaration hides global declaration' warning (#3751) 2022-09-19 08:04:39 +02:00
Florian Albrechtskirchinger
3d1252bbff Replace limit macros with std::numeric_limits (#3723) 2022-09-19 08:02:50 +02:00
Vertexwahn
2d1f9b6a7d Add Bazel build support (#3709) 2022-09-18 08:15:12 +02:00
tocic
9dfa722669 Fix typos in .md files (#3748) 2022-09-17 10:34:30 +02:00
Niels Lohmann
c920f3f4fb Update Codacy link (#3740) 2022-09-16 08:54:27 +02:00
Florian Albrechtskirchinger
15ca78a886 Add dark mode toggle to documentation (#3726) 2022-09-15 22:02:54 +02:00
Niels Lohmann
58bd97e2b1 Add clang-tools to required tools for ci_static_analysis_clang (#3724)
* 💚 add clang-tools to required tools for ci_static_analysis_clang

* 🚨 update Clang-Tidy warning selection

* 🚨 fix Clang-Tidy warnings

* 🚨 fix Clang-Tidy warnings

* 🚨 fix Clang-Tidy warnings

* 🚨 fix Clang-Tidy warnings

* 🚨 fix Clang-Tidy warnings

* 🚨 fix Clang-Tidy warnings

* 🚨 fix Clang-Tidy warnings

* 🚨 fix Clang-Tidy warnings

* 🚨 fix Clang-Tidy warnings

* 🚨 fix Clang-Tidy warnings

* 🚨 fix Clang-Tidy warnings (#3738)

*  revert fix

*  revert fix

* 🚨 fix Clang-Tidy warnings (#3739)

Co-authored-by: Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com>
2022-09-13 12:58:26 +02:00
Florian Albrechtskirchinger
307c053b9b Add missing <numeric> include (#3719) 2022-08-30 20:55:47 +02:00
Raphael Grimm
bed648ca55 Allow custom base class as node customization point (#3110)
Co-authored-by: Niels Lohmann <niels.lohmann@gmail.com>
Co-authored-by: Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com>
Co-authored-by: barcode <barcode@example.com>
2022-08-28 13:59:07 +02:00
Niels Lohmann
f7973f46d6 Use official Clang/GCC containers (#3703) 2022-08-27 17:28:50 +02:00
Florian Albrechtskirchinger
4c8cdd7afc Add 'Check amalgamation' workflow (#3693) 2022-08-27 14:20:51 +02:00
Niels Lohmann
8fcdbf2e77 Merge tag 'v3.11.2' into develop
JSON for Modern C++ 3.11.2 v3.11.2
2022-08-12 15:06:07 +02:00
Niels Lohmann
bc889afb4c Merge branch 'release/3.11.2' 2022-08-12 15:06:06 +02:00
Niels Lohmann
9d69186291 🔖 set version to 3.11.2 2022-08-12 15:04:06 +02:00
Florian Albrechtskirchinger
32bbd38072 generate_natvis.py: validate version number; cleanup (#3698) 2022-08-12 12:13:52 +02:00
Florian Albrechtskirchinger
c0dae0f510 Add Python script for generating Natvis file and update file for 3.11.2 (#3697) 2022-08-12 08:24:32 +02:00
Florian Albrechtskirchinger
0e61ee8b07 Restructure inline namespace and allow version component to be disabled (#3683) 2022-08-10 20:24:16 +02:00
Ikko Ashimine
93112fbf4d fix typo in json_pointer.md (#3692) 2022-08-10 20:01:32 +02:00
Florian Albrechtskirchinger
a92ccafd2c Deprecate json_pointer/string_t comparisons (#3684)
* Deprecate json_pointer/string_t comparisons

* Update documentation
2022-08-07 22:26:59 +02:00
Niels Lohmann
e1a3fb74ba Add amalgamated json-fwd.hpp to release (#3687)
* 🔧 add amalgamated json-fwd.hpp to release

* 🔧 add amalgamated json-fwd.hpp to package managers
2022-08-07 20:33:34 +02:00
Florian Albrechtskirchinger
d79d12f854 Update docset index (#3686) 2022-08-07 20:33:15 +02:00
Florian Albrechtskirchinger
31265dc69c Make json_pointer usable as map key (again) (#3685)
* Make json_pointer usable as map key

* Add unit tests
2022-08-07 14:35:40 +02:00
Florian Albrechtskirchinger
231f3108ff Amalgamate the forward declaration header (#3679)
* Amalgamate the forward declaration header

* Update CONTRIBUTING and PULL_REQUEST_TEMPLATE

* Update documentation
2022-08-07 13:57:32 +02:00
Florian Albrechtskirchinger
dae5412268 Properly constrain non-string json_pointer overloads (#3681)
Thanks, @alex-700, for reminding me.
2022-08-07 13:55:09 +02:00
Florian Albrechtskirchinger
0c7a18374c Reimplement value() access functions (#3663)
* Reimplement value() access functions

* Merges the 'const char *' with the 'ValueType &&' overloads.
* Fixes ambiguities when default value is 0.
* Fixes 'no matching function' error when specifying ValueType template
  parameter.
* Fixes incorrect template parameter order in previous overloads.

* Add additional value() tests

* Make JSON_MultipleHeaders visible to unit tests

Define the macro JSON_TEST_USING_MULTIPLE_HEADERS to 0/1 depending on
JSON_MultipleHeaders.

* Add type_traits unit test

* Update documentation
2022-08-07 13:54:55 +02:00
Florian Albrechtskirchinger
8eee62d388 Miscellaneous small fixes (#3643)
* serve_header: suppress lgtm warning

* serve_header: fix exit code

* serve_header: replace deprecated ssl.wrap_socket()

* Add checks to unit test readme

* Add lgtm configuration file
2022-08-07 13:52:43 +02:00
Florian Albrechtskirchinger
f1e34070d2 Fix 'const' qualifier on bool& has no effect (#3678)
* Fix 'const' qualifier on bool& has no effect

Thanks, @georgthegreat, for pointing out this issue.

* Extend std::vector<bool> unit test
2022-08-07 13:50:08 +02:00
Niels Lohmann
bfbe774d8f 🚑 fix documentation job 2022-08-07 13:34:34 +02:00
Niels Lohmann
b0422f8013 🚑 fix documentation job 2022-08-05 23:09:55 +02:00
Niels Lohmann
7b6cf5918b Documentation change (#3672)
Co-authored-by: Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com>
2022-08-05 19:51:39 +02:00
Florian Albrechtskirchinger
9e1a7c85e3 Add json_pointer/string_t equality comparison operators (#3664) 2022-08-05 14:08:27 +02:00
Niels Lohmann
e839f58a2a 👷 fix whitespace (#3675) 2022-08-05 09:12:28 +02:00
Florian Albrechtskirchinger
01af734d63 Attempt to fix labeler permissions (#3674) 2022-08-04 23:38:27 +02:00
Florian Albrechtskirchinger
b13b8748b6 Refine 'Publish documentation' workflow (#3673)
* Only publish documentation when changed

* Enable manual publishing of the documentation

* Don't try to publish documentation from forks
2022-08-04 22:53:05 +02:00
Niels Lohmann
b6e2942d1c Complete contributor list (#3670)
* 👥 complete contributor list

* Update README.md

Co-authored-by: Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com>
2022-08-04 22:48:30 +02:00
Niels Lohmann
500bdc56bf Add labeler action (#3671)
👷 add labeler action
2022-08-04 16:46:45 +02:00
Niels Lohmann
98d70d4676 Publish documentation on push to develop branch (#3660)
👷 add job to publish the documentation
2022-08-03 22:28:26 +02:00
Niels Lohmann
22cd1c9eb9 🔧 adjust naming of GitHub action jobs (#3661) 2022-08-03 18:37:02 +02:00
Niels Lohmann
ac20714e2e 👥 complete contributor list (#3662) 2022-08-03 18:36:46 +02:00
Florian Albrechtskirchinger
2ac7d023d4 Add Discord badge to README (#3651) 2022-08-03 09:17:02 +02:00
Florian Albrechtskirchinger
32242022f7 Minor BJData fixes (#3637)
* Replace vector/map LUTs in binary_reader with arrays

* Replace string_t::npos in binary_reader
2022-08-03 09:15:37 +02:00
Florian Albrechtskirchinger
ac9e668e63 Update CI (#3626)
* Bump macos-10.5 runner to macos-11 and update Xcode versions

* Address CodeQL warning

* Only build relevant commits on AppVeyor

* Don't hardcode paths in Ubuntu workflow
2022-08-03 09:15:16 +02:00
Niels Lohmann
df98ca29f8 Merge tag 'v3.11.1' into develop
JSON for Modern C++ 3.11.1
2022-08-01 23:31:54 +02:00
Niels Lohmann
69d744867f Merge branch 'release/3.11.1' 2022-08-01 23:31:38 +02:00
Niels Lohmann
f2020da0dd 🔖 set version to 3.11.1 2022-08-01 23:27:58 +02:00
Florian Albrechtskirchinger
cbaf1033be Fix global UDLs (#3646)
* Add ci_test_noglobaludls to CI

* Really default JSON_GLOBAL_UDLS to 1

* Test global UDLs

* Suppress warnings

* Clarify documentation
2022-08-01 22:42:35 +02:00
Niels Lohmann
817a4a2117 Merge tag 'v3.11.0' into develop
JSON for Modern C++ 3.11.0
2022-08-01 13:15:38 +02:00
Niels Lohmann
499422b303 Merge branch 'release/3.11.0' 2022-08-01 13:12:06 +02:00
Niels Lohmann
ce0e13ccea 🔖 set version to 3.11.0 2022-07-31 23:19:06 +02:00
Florian Albrechtskirchinger
9aafcbe965 Move UDLs out of the global namespace (#3605)
* Move UDLs into nlohmann::literals::json_literals namespace

* Add 'using namespace' to unit tests

* Add 'using namespace' to examples

* Add 'using namespace' to README

* Move UDL mkdocs pages out of basic_json/

* Update documentation

* Update docset index

* Add JSON_GlobalUDLs CMake option

* Add unit test

* Build examples without global UDLs

* Add CI target
2022-07-31 17:38:52 +02:00
Niels Lohmann
8fd8b52907 Prepare 3.11.0 release (#3635)
* 📄 add license header

* Update Makefile

Co-authored-by: Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com>

* 🔥 remove unused Doxygen leftover

Co-authored-by: Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com>
2022-07-31 15:28:01 +02:00
Florian Albrechtskirchinger
d3e347bd2d More documentation updates for 3.11.0 (#3553)
* mkdocs: add string_view examples

* mkdocs: reference underlying operators

* mkdocs: add operator<=> examples

* mkdocs: fix style check issues

* mkdocs: tweak BJData page

* mkdocs: add CMake option hints to macros

* mkdocs: fix JSON_DISABLE_ENUM_SERIALIZATION definition

* mkdocs: fix link to unit-udt.cpp

* mkdocs: fix "Arbitrary Type Conversions" title

* mkdocs: link to api/macros/*.md instead of features/macros.md

* mkdocs: document JSON_DisableEnumSerialization CMake option

* mkdocs: encode required C++ standard in example files

* docset: detect gsed/sed

* docset: update index

* docset: fix CSS patching

* docset: add list_missing_pages make target

* docset: add list_removed_paths make target

* docset: replace page titles with name from index

* docset: add install target for Zeal docset browser

* Use GCC_TOOL in ci_test_documentation target
2022-07-31 14:05:58 +02:00
Niels Lohmann
11ba5c1120 🚨 fix warning (#3634) 2022-07-31 07:23:30 +02:00
Niels Lohmann
9472ab4f84 Add license header to new files (#3633) 2022-07-31 07:22:22 +02:00
Florian Albrechtskirchinger
66c8bb5b90 Add a unit test including windows.h (#3631) 2022-07-31 07:22:07 +02:00
Florian Albrechtskirchinger
19e4c2bda0 Add regression tests for #3204 and #3333 (#3629) 2022-07-31 07:21:48 +02:00
KsaNL
fc3e64cbf9 Fixed latest build error in msvc platform (#3630)
* Fixed latest build error in msvc platform

warnings in msvc about mix/max macro while windows.h is used in the project #762

* Update for CI

None

* Update single_include/nlohmann/json.hpp

Co-authored-by: Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com>

Co-authored-by: Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com>
2022-07-30 23:03:09 +02:00
Florian Albrechtskirchinger
a2578d1d50 Disable exceptions on ICPC (#3621) 2022-07-30 22:10:49 +02:00
Florian Albrechtskirchinger
d909f80960 Add versioned, ABI-tagged inline namespace and namespace macros (#3590)
* Add versioned inline namespace

Add a versioned inline namespace to prevent ABI issues when linking code
using multiple library versions.

* Add namespace macros

* Encode ABI information in inline namespace

Add _diag suffix to inline namespace if JSON_DIAGNOSTICS is enabled, and
_ldvcmp suffix if JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON is enabled.

* Move ABI-affecting macros into abi_macros.hpp

* Move std_fs namespace definition into std_fs.hpp

* Remove std_fs namespace from unit test

* Format more files in tests directory

* Add unit tests

* Update documentation

* Fix GDB pretty printer

* fixup! Add namespace macros

* Derive ABI prefix from NLOHMANN_JSON_VERSION_*
2022-07-30 21:59:13 +02:00
Florian Albrechtskirchinger
fca1ddda96 Fix patch::add creating nonexistent parents (#3628)
* Fix patch::add creating nonexistent parents

The previous behavior was not in accordance with RFC6902.
Add unit test.

Fixes #3134.

* Fix incorrect JSON patch unit test

Co-authored-by: Hudson00 <yagdhscdasg@gmail.com>
2022-07-30 21:23:55 +02:00
Niels Lohmann
d1d79b930d Adjust JSON Pointer examples (#3622)
* 📝 adjust JSON Pointer examples

* 👷 add test for documentation

* 📝 note platform-dependent output on some examples
2022-07-29 14:28:37 +02:00
Andrea Pappacoda
6576c3f776 build: install .pc and .cmake files to share/ (#3619)
As nlohmann_json is a header-only library, its pkg-config and cmake
config files should be installed to `share/` (GNUInstallDirs' DATADIR),
as `share/` is the canonical directory where architecture-independent
files should be stored, while `lib/` is for architecture-dependent stuff
(see the [FHS][]).

Apart from being technically correct, installing to `share/` can help
with cross-compiling, for example in Debian-based environments. If
you're interested, I'd suggest reading this [thread][].

Related to #1697

[FHS]: https://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.html#usrshareArchitectureindependentData
[thread]: https://github.com/marzer/tomlplusplus/pull/165#issuecomment-1193146210
2022-07-29 07:43:22 +02:00
Florian Albrechtskirchinger
e3095f636f Add operator<<(json_pointer) (#3601)
* Add operator<< for json_pointer

* Deprecate json_pointer::operator string_t()

* Update documentation

* Move operator<<(basic_json) example

* Add example

* Add mkdocs-redirects

* Move operator<< and operator>> doc pages out of basic_json/

* Rename JSON pointer operator_string to operator_string_t

* Add unit test
2022-07-28 22:12:23 +02:00
Florian Albrechtskirchinger
7777300442 Install MinGW from GitHub NuGet registry (#3618)
Attempt to workaround recent, frequent failures of the MinGW jobs by
installing an internalized Chocolatey package hosted on GitHub.
2022-07-28 21:54:12 +02:00
Florian Albrechtskirchinger
a87c1885cb Re-add value_type detection to distinguish string types (#3604)
* Re-add value_type detection to is_constructible_string_type trait

* Add value_type detection to from_json for strings
2022-07-28 21:52:23 +02:00
Florian Albrechtskirchinger
a714381a5f Use swap() by ADL (#3609)
* Use swap() by ADL

* Add type to swap() exception messages
2022-07-28 21:51:45 +02:00
Florian Albrechtskirchinger
298e4a9449 Use concurrency (#3610)
Use concurrency in GitHub workflows to cancel in-progress or pending
runs for the same ref.
2022-07-28 21:51:32 +02:00
Florian Albrechtskirchinger
5520761433 Fix Unicode test timeout (for real this time!) (#3614)
* Use TIMEOUT instead of TIMEOUT_AFTER_MATCH to set test timeout
2022-07-28 21:51:11 +02:00
Niels Lohmann
2d48a4d9c5 Add documentation for comparing json and ordered_json (#3599)
* 📝 add documentation for #3443

* Apply suggestions from code review

Co-authored-by: Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com>
2022-07-23 20:54:40 +02:00
Florian Albrechtskirchinger
e91686cc17 Make sure iterator_input_adapter advances iterators correctly (#3548)
When parsing a string containing two JSON values using iterators, after
parsing, iterator_input_adapter should have advanced to the first
character of the second value.
Add a unit test to check that this is true.
2022-07-23 14:36:10 +02:00
Niels Lohmann
dbfd33a70a Add assertion if nullptr is passed to parse function (#3593)
Addresses #3584
2022-07-23 01:26:51 +02:00
Niels Lohmann
b185c5bc9d 📝 clean up after #3581 (#3596) 2022-07-22 15:35:29 +02:00
Wolf Vollprecht
09fb4819ff add patch_inplace function (#3581)
* add patch_inplace function to json class

* add documentation

* fix up docs
2022-07-21 16:27:59 +02:00
Niels Lohmann
4b6d3638ca 📝 minor fixes (#3592) 2022-07-20 18:59:04 +02:00
Niels Lohmann
feef0eb595 Add error message if test suite cannot be found (#3585)
* 🚸 add error message if test suite cannot be found

Fixes #3584
2022-07-20 12:41:33 +02:00
Niels Lohmann
527da54dcb Use REUSE framework (#3546)
* 📄 add licenses

* 👷 add REUSE compliance check

* 📝 add badge for REUSE

Co-authored-by: Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com>
2022-07-20 12:38:07 +02:00
Jake Zimmerman
2a9ae2b487 Make certain usage patterns more prominent in the README (#3557)
* Make certain usage patterns more prominent in the README

We use this library extensively where I work. After pairing with many
teammates, I've learned that one common stumbling point when using this
library is how to first get a JSON value in the first place (because
once they have a variable of type `json` in hand, the API is intuitive
and mostly does what you expect).

With that in mind, I've added two subsections to the top of the Examples
section: how to read JSON from a file, and how to hardcode a JSON
literal.

I understand that these are already documented elsewhere in the Examples
section, and so these new subsections are technically redundant. But to
defend this choice:

- Redundancy in docs is actually good, because not everyone consumes
  docs in the same way or in the same order.

- Having these things called out explicitly in isolation encourages
  people to get something working faster. In later sections, these
  examples are presented alongside many other options. Having to choose
  between alternatives gets in the way of quickly prototyping something.

If you have further suggestions for how to improve or modify these docs
I'm open to them. The changes included here would really make a huge
improvement in the productivity of newer members of my team using this
library.

* Remove old TOC entry

* Put the section back

* Another tweak
2022-07-18 17:55:44 +02:00
Niels Lohmann
a15683e348 📝 add badge for https://repology.org/project/nlohmann-json/versions (#3586) 2022-07-18 17:48:42 +02:00
NN
d64d40518c Ignore output directory (#3572)
* Ignore output directory

* Update .gitignore

Co-authored-by: Niels Lohmann <niels.lohmann@gmail.com>

Co-authored-by: Niels Lohmann <niels.lohmann@gmail.com>
2022-07-17 13:43:55 +02:00
Florian Albrechtskirchinger
71bdaf5748 Enable overriding test properties and set Unicode test timeouts (#3580)
* CMake: Add TEST_PROPERTIES to json_test_set_test_options()

Allow overriding test properties via json_test_set_test_options().

* CMake: Set timeouts for Unicode tests
2022-07-17 13:43:32 +02:00
Romain Reignier
d4daaa897f Optimize output vector adapter write (#3569)
* Add benchmark for cbor serialization and cbor binary data serialization

* Use std::vector::insert method instead of std::copy in output_vector_adapter::write_characters

This change increases a lot the performance when writing lots of binary data.
2022-07-08 08:12:00 +02:00
Florian Albrechtskirchinger
7d361ec8ef Add overloads for more key types to ordered_map and fix ordered_map::erase(first, last) with first == last (#3564)
* Add overloads for more key types to ordered_map

Add overloads to accept additional key types defined by type trait
detail::is_usable_as_key_type to ordered_map.
The same key types that can be used with json can now also be used with
ordered_json.

* Fix ordered_map::erase(first, last) with first == last

* Modify element access unit test to also test ordered_json
2022-07-04 19:58:19 +02:00
Alexander Karzhenkov
954b10ad3b CI: fix "JSON_MultipleHeaders" option spelling (#3555) 2022-06-25 13:38:39 +02:00
Florian Albrechtskirchinger
39e27684ea Use DOCTEST_* compiler macros and suppress pragmas warning (#3550)
Use DOCTEST_* macros in place of predefined compiler macros for compiler
detection and version checks.

The suppression of warning -Wrange-loop-construct in unit-items.cpp
causes GCC<11 to warn about pragmas. Suppressed by adding a version
check.
2022-06-21 16:57:47 +02:00
郑少锟
87cda1d664 Use std::iterator_traits to extract iterator_category (#3544)
* Use `std::iterator_traits` to extract `iterator_category`

In third-party STL implementations, `array_t::iterator` might be a pointer (e.g., `vector` in [EASTL](https://github.com/electronicarts/EASTL)) rather than a class, in which case directly using `array_t::iterator::iterator_category` is invalid. This commit fixes it with `std::iterator_traits`, which handles pointers correctly.

* add the changes to the single-header version
2022-06-18 19:14:03 +02:00
Qianqian Fang
13730235f2 BJData dimension length can not be string_t::npos, fix #3541 (#3543)
* BJData dimension length can not be string_t::npos, fix #3541

* handle error messages on 32bit machine

* add explanation to why size can not be string_t::npos

* add test cases to 32bit unit test

Co-authored-by: Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com>
2022-06-18 19:12:22 +02:00
Richard Hozák
f6acdbec2c Allow disabling default enum conversions (#3536) 2022-06-16 19:34:32 +02:00
Florian Albrechtskirchinger
e80945da2c CI: Enable 32bit unit test (3) (#3532)
* Enable JSON_MultipleHeaders by default

* CI: Add single-header build

* CI: Enable 32bit unit test

* Fix "-Wuseless-cast" warnings

* Remove coverage exclusion

* Fix 32bit test case
2022-06-14 08:54:12 +02:00
Florian Albrechtskirchinger
9c31d54389 Add to_json() for std::vector<bool>::reference (#3534) 2022-06-13 13:21:55 +02:00
Niels Lohmann
af34396129 Use new CI image (#3528)
* ⬆️ use new CI image

* ⬆️ use new CI image

* 🚨 fix warning

* 🔧 remove duplicate warning flags

* 💚 fix test

* 📝 update compiler versions
2022-06-12 14:31:07 +02:00
Florian Albrechtskirchinger
48a102c2c5 Fix ndarray dimension signedness, fix ndarray length overflow (2); add 32bit unit test (#3523)
* Fix ndarray dimension signness, fix ndarray length overflow, close #3519

* detect size overflow in ubjson and bjdata

* force reformatting

* Fix MSVC compiler warning

* Add value_in_range_of trait

* Use value_in_range_of trait

* Correct 408 parse_errors to out_of_range

* Add 32bit unit test

The test can be enabled by setting JSON_32bitTest=ON.

* Exclude unreachable lines from coverage

Certain lines are unreachable in 64bit builds.

Co-authored-by: Qianqian Fang <fangqq@gmail.com>
2022-06-09 08:22:58 +02:00
Niels Lohmann
b6d00d1897 Small documentation fixes (#3520) 2022-06-06 16:46:55 +02:00
ivanovmp
7c65b5cdbd Update json.hpp (#3499)
* Update json.hpp

* Remove a space
2022-06-06 13:01:46 +02:00
Florian Albrechtskirchinger
7a6e28acfa Add assertion to converting constructor (#3517)
The converting basic_json constructor can inadvertently change the value
type of its parameter. Assert that both basic_json values are of the
same value type after conversion.
2022-06-03 21:05:44 +02:00
Florian Albrechtskirchinger
560cede06d CI: Remove -Wstrict-overflow (#3516) 2022-06-03 20:39:24 +02:00
Niels Lohmann
6058d9a8b3 Add more macOS builders (#3485)
* 👷 add more macOS builders

* 👷 add more macOS builders

* 💚 fix macOS build

* 📝 document new Xcode versions
2022-06-03 14:03:14 +02:00
Qianqian Fang
046927cc29 Fix nlohmann/json#3513, explain is_ndarray flag (#3514)
* Fix nlohmann/json#3513, explain is_ndarray flag

* add test for ndarray size following H
2022-06-03 08:51:33 +02:00
Florian Albrechtskirchinger
6b97599a27 Fix C++20/gcc-12 issues (Part 2) (#3446)
* Add C++20 3-way comparison operator and fix broken comparisons

Fixes #3207.
Fixes #3409.

* Fix iterators to meet (more) std::ranges requirements

Fixes #3130.
Related discussion: #3408

* Add note about CMake standard version selection to unit tests

Document how CMake chooses which C++ standard version to use when
building tests.

* Update documentation

* CI: add legacy discarded value comparison

* Fix internal linkage errors when building a module
2022-05-29 13:08:06 +02:00
Qianqian Fang
ede6667858 Prevent ndarray size vector from recursive use, fix nlohmann/json#3503 (#3505)
* Prevent ndarray size vector from recursive use, fix nlohmann/json#3503

* fix ci error

* complete coverage

* add missing coverage

* fix style issue in added test
2022-05-23 06:07:22 +02:00
Qianqian Fang
41226d0a03 prevent ndarray dimension vector from recusive array, nlohmann/json#3500 (#3502) 2022-05-20 09:41:51 +02:00
Niels Lohmann
6ff2ea3aed 🥅 add assertion for invariant in SAX-DOM parser (#3498) 2022-05-19 19:56:33 +02:00
Qianqian Fang
93c9e0c703 Discard optimized containers with negative counts in UBJSON/BJData (#3491,#3492,#3490) (#3500)
* Discard optimized containers with negative counts in UBJSON/BJData (#3491,#3492,#3490)

* fix msvc error

* update unit tests for negative sized containers

* use a loop to test 0 ndarray dimension

* throw an error when count is negative, merge CHECK_THROW_AS and _WITH with _WITH_AS
2022-05-18 18:38:15 +02:00
Niels Lohmann
6a7392058e Complete documentation for 3.11.0 (#3464)
* 👥 update contributor and sponsor list

* 🚧 document BJData format

* 🚧 document BJData format

* 📝 clarified documentation of [json.exception.parse_error.112]

* ✏️ adjust titles

* 📝 add more examples

* 🚨 adjust warnings for index.md files

* 📝 add more examples

* 🔥 remove example for deprecated code

* 📝 add missing enum entry

* 📝 overwork table for binary formats

*  add test to create table for binary formats

* 📝 fix wording in example

* 📝 add more examples

* Update iterators.md (#3481)

*  add check for overloads to linter #3455

* 👥 update contributor list

* 📝 add more examples

* 📝 fix documentation

* 📝 add more examples

* 🎨 fix indentation

* 🔥 remove example for destructor

* 📝 overwork documentation

* Updated BJData documentation, #3464 (#3493)

* update bjdata.md for #3464

* Minor edit

* Fix URL typo

* Add info on demoting ND array to a 1-D optimized array when singleton dimension

Co-authored-by: Chaoqi Zhang <prncoprs@163.com>
Co-authored-by: Qianqian Fang <fangqq@gmail.com>
2022-05-17 13:08:56 +02:00
Qianqian Fang
a8a547d7a2 change bjdata ndarray flag to detect negative size, as part of #3475 (#3479)
* change bjdata ndarray flag to detect negative size, fix https://github.com/nlohmann/json/issues/3475

* fix CI error

* fix CI on 32bit windows

* remove platform specific out_of_range error messages

* Incorporate suggestions from @nlohmann and @falbrechtskirchinger

* fix CI errors

* add coverage

* fix sax event order

* fix coverage
2022-05-10 21:13:24 +02:00
Niels Lohmann
d6efe672b5 Document fuzzer usage (#3478)
* 📝 document fuzzer usage

* 📝 address review comments
2022-05-09 08:02:41 +02:00
Qianqian Fang
b205361d86 Handle invalid BJData optimized type, fix #3461 (#3463)
* Handle invalid BJData optimized type, fix #3461

* Update unit test to handle bjdata optimized array type error
2022-05-01 22:47:06 +02:00
Florian Albrechtskirchinger
bdc21ad1a7 Add build step for ICPC (with fixes) (#3465)
* ⬆️ Doctest 2.4.7

* 👷 add CI step for ICPC

* 👷 add CI step for ICPC

* 👷 add CI step for ICPC

* ⬇️ downgrade to Doctest 2.4.6

* 👷 add CI step for ICPC

* 👷 add CI step for ICPC

* 👷 add CI step for ICPC

* 👷 add CI step for ICPC

* 👷 add CI step for ICPC

* 🔇 suppress warning #2196: routine is both "inline" and "noinline"

* Re-enable <filesystem> detection on ICPC

* Limit regression test for #3070 to Clang and GCC >=8.4

* Disable deprecation warnings on ICPC

* Disable regression test for #1647 on ICPC (C++20)

* Fix compilation failure of regression test for #3077 on ICPC

* Disable wstring unit test on ICPC

Fixes:
  error 913: invalid multibyte character sequence

* Add ICPC to README

Co-authored-by: Niels Lohmann <mail@nlohmann.me>
2022-05-01 22:46:45 +02:00
Florian Albrechtskirchinger
0c698b75cc Add serve_header.py for rapid testing on Compiler Explorer (#3456) 2022-05-01 13:52:52 +02:00
Niels Lohmann
b21c345179 Reorganize directories (#3462)
* 🚚 move files
* 🚚 rename doc folder to docs
* 🚚 rename test folder to tests
2022-05-01 09:41:50 +02:00
Florian Albrechtskirchinger
5352856f04 Implement support for string_view (attempt no. 3) (#3423)
* Add key_compare member to ordered_map

* Replace == with key_compare in ordered_map

* Expose the actual comparison function used by object_t

nlohmann::ordered_map uses a different comparison function than the one
provided via template parameter.
* Introduce a type trait to detect if object_t has a key_compare member.
* Rename object_comparator_t to default_object_comparator_t.
* Add object_comparator_t to be conditionally defined as
  object_t::key_compare, if available, or default_object_comparator_t
  otherwise.
* Update the documentation accordingly.

Co-authored-by: Niels Lohmann <niels.lohmann@gmail.com>

* Add type traits to check if a type is usable as object key

Add type trait to check:
* if a type is a specialization of a template.
* if a type is a json_pointer.
* if a type is a basic_json::{const_,}iterator.
* if two types are comparable using a given comparison functor.
* if a type is comparable to basic_json::object_t::key_type.
* if a type has a member type is_transparent.
* if a type is usable as object key.
* if a type has an erase() function accepting a given KeyType.

Co-authored-by: Niels Lohmann <niels.lohmann@gmail.com>

* Rework basic_json element access to accept more key types

Rework basic_json element access member functions and operators to
accept any type that meets the requirements defined by type trait
detail::is_usable_as_key_type.

Member functions and operators:
* at()
* operator[]
* value()
* erase()
* find()
* count()
* contains()

Update documentation to reflect these changes.

Add unit tests to excercise the new functions using std::string_view.

Co-authored-by: Niels Lohmann <niels.lohmann@gmail.com>

Co-authored-by: Niels Lohmann <niels.lohmann@gmail.com>
2022-04-29 21:40:02 +02:00
Qianqian Fang
ee51661481 Support UBJSON-derived Binary JData (BJData) format (#3336)
* support UBJSON-derived Binary JData (BJData) format

* fix Codacy warning

* partially fix VS compilation errors

* fix additional VS errors

* fix more VS compilation errors

* fix additional warnings and errors for clang and msvc

* add more tests to cover the new bjdata types

* add tests for optimized ndarray, improve coverage, fix clang/gcc warnings

* gcc warn useless conversion but msvc gives an error

* fix ci_test errors

* complete test coverage, fix ci_test errors

* add half precision error test

* fix No newline at end of file error by clang

* simplify endian condition, format unit-bjdata

* remove broken test due to alloc limit

* full coverage, I hope

* move bjdata new markers from default to the same level as ubjson markers

* fix ci errors, add tests for new bjdata switch structure

* make is_bjdata const after using initializer list

* remove the unwanted assert

* move is_bjdata to an optional param to write_ubjson

* pass use_bjdata via output adapter

* revert order to avoid msvc 2015 unreferenced formal param error

* update BJData Spect V1 Draft-2 URL after spec release

* amalgamate code

* code polishing following @gregmarr's feedback

* make use_bjdata a non-default parameter

* fix ci error, remove unwanted param comment

* encode and decode bjdata ndarray in jdata annotations, enable roundtrip tests

* partially fix ci errors, add tests to improve coverage

* polish patch to remove ci errors

* fix a ndarray dim vector condition

* fix clang tidy error

* add sax test cases for ndarray

* add additional sax event tests

* adjust sax event numbering

* fix sax tests

* ndarray can only be used with array containers, discard if used in object

* complete test coverage

* disable [{SHTFNZ in optimized type due to security risks in #2793 and hampered readability

* fix ci error

* move OutputIsLittleEndian from tparam to param to replace use_bjdata

* fix ci clang gcc error

* fix ci static analysis error

* update json_test_data to 3.1.0, enable file-based bjdata unit tests

* fix stack overflow error on msvc 2019 and 2022

* use https link, update sax_parse_error after rebase

* make input_format const and use initializer

* return bool for write_bjdata_ndarray

* test write_bjdata_ndarray return value as boolean

* fix ci error
2022-04-29 21:17:30 +02:00
Niels Lohmann
a6ee8bf9d9 Overwork documentation (#3444)
* 📝 overwork macro documentation

* 📝 address review comments

* 🔧 add style check to Makefile

* 🙈 overwork .gitignore

* 📌 Pygments 2.12.0 is broken

* ✏️ fix links

* 🚸 adjust output to cppcheck

* 📝 add titles to more admonitions

* ✏️ fix typos

* 📝 document future behavior change
2022-04-25 22:40:45 +02:00
Niels Lohmann
fcc36f99ba ⬆️ cpplint 1.6.0 (#3454) 2022-04-24 17:22:04 +02:00
Florian Albrechtskirchinger
1a90c9463a Disable regression test for #3070 on GCC <8.4 (#3451) 2022-04-22 14:21:16 +02:00
JungHoon Lee
a94430615d Fix typo in basic_json documentation (#3439) 2022-04-12 15:58:06 +02:00
Florian Albrechtskirchinger
616caea27a Re-template json_pointer on string type (#3415)
* Make exception context optional

Change exception context parameter to pointer and replace context with
nullptr where appropriate.

* Support escaping other string types

* Add string concatenation function

Add variadic concat() function for concatenating char *, char, and
string types.

* Replace string concatenations using + with concat()

* Template json_pointer on string type

Change json_pointer from being templated on basic_json to being
templated on string type.

* Add unit test for #3388

Closes #3388.

* Fix regression test for #2958

* Add backwards compatibility with json_pointer<basic_json>

* Update json_pointer docs

* Allow comparing different json_pointers

* Update version numbers
2022-04-12 14:18:16 +02:00
Florian Albrechtskirchinger
1deeb434c6 Exclude std::any from implicit conversion (fixes #3428) (#3437)
* Exclude std::any from implicit conversion

Fixes #3428 (MSVC) and silences compiler warning on GCC (-Wconversion).

* Exclude std::any from implicit conversion
2022-04-12 14:08:20 +02:00
Niels Lohmann
10344907ff 📝 document which version introduced the macros #3429 (#3431) 2022-04-09 18:09:23 +02:00
Florian Albrechtskirchinger
261cc4e509 Fix constraints on from_json() for strings (#3427)
Constrain from_json() overload for StringType to not accept json_ref and
require it to be assignable, instead of constructible, from
basic_json::string_t.

Re-enable C++14 tests on Clang <4.0.

Fixes #3171.
Fixes #3267.
Fixes #3312.
Fixes #3384.
2022-04-08 10:22:47 +02:00
Michael Nosthoff
15fa6a342a at.md: fix typo (#3426) 2022-04-06 15:26:35 +02:00
Niels Lohmann
448b173ccf Update CI image (#3420)
* ⬆️ use new CI image

* ⬆️ use new CI image

* 🚨 suppress Clang-Tidy warnings

* 💚 use proper scan-build version

* 🚨 suppress Clang-Tidy warnings

* ⬆️ use more recent GitHub actions

* 💚 add missing compiler

* 📝 update used compilers

* 🚨 fix duplicate inclusion
2022-04-06 15:14:14 +02:00
Niels Lohmann
52e16a9f9c 🚸 add check if different version is also included #3337 (#3418) 2022-04-06 08:29:01 +02:00
Florian Albrechtskirchinger
fa91409a73 CI: speedup AppVeyor builds by ~30% (#3422)
AppVeyor build VMs should provide at least two cores. Parallelize builds
and tests.
In addition, enable output on failure and disable verbose test output.
2022-04-06 08:26:49 +02:00
Florian Albrechtskirchinger
c2054b96b9 Restore disabled check for #3070 (except on MSVC) (#3421)
Restore the previously disabled check for regression #3070 on all
compilers but MSVC.

To summarize the issue:
Given namespace fs = std::filesystem.
On MSVC attempting to construct an fs::path from json results in an
ambiguous overload resolution because fs::path can be constructed from
both a std::string as well as another fs::path.
To the best of my knowledge there is no way to fix an ambiguous overload
situation involving a type we do not control and with json implicitly
converting to both std::string and fs::path.

Re-enabling the check where it compiles and keeping it disabled for MSVC
is the best we can do.

Closes #3377 and #3382.
2022-04-06 08:25:35 +02:00
flagarde
ab5cecb34f Report the right __cplusplus value for MSVC in basic_json meta() (#3417)
* Report the right __cplusplus value for MSVC in basic_json meta()

* Run amalgamate
2022-04-04 20:45:19 +02:00
Florian Albrechtskirchinger
33b75e513a CI: windows-2016 has been deprecated; remove jobs (#3416) 2022-04-04 13:18:00 +02:00
DarkZeros
6121dbbe02 Avoid clash with Arduino defines (#3338)
* Avoid clash with Arduino defines

* Arduino defines B0/B1 in "binary.h"
     #define B0 0
     #define B1 1
  This clashes with names of the template
  variables in conjuction

* Renaming them to "B" rather than "B1"
  Now it can be used as-is in Arduino projects

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: Daniel Ansorregui <d.ansorregui@samsung.com>
Co-authored-by: Niels Lohmann <niels.lohmann@gmail.com>
2022-04-03 18:33:33 +02:00
Krzysiek Karbowiak
3b16057ffa Refactor unit tests to use more convenient doctest assertion macros (Part 2) (#3405)
* Refactor assertion and adjust expected error message

* Refactor assertion and adjust expected error message

* Refactor assertion and remove redundant local variable

* Refactor assertion and remove redundant local variable

* Rename local variable

* Apply formatting
2022-04-01 14:38:17 +02:00
Niels Lohmann
66f6b4b6a0 🔧 overwork issue template #3348 2022-03-25 10:16:21 +01:00
Niels Lohmann
1ba736893e 🔧 overwork issue template #3348 2022-03-25 10:12:33 +01:00
Niels Lohmann
f7490e33da 🔧 overwork issue template #3348 2022-03-25 10:10:21 +01:00
Krzysiek Karbowiak
ce35256825 Refactor unit tests to use more convenient doctest assertion macros (#3393)
* Add missing check

* Refactor assertions in unit-algorithms.cpp

* Refactor assertions in unit-bson.cpp

* Refactor assertions in unit-cbor.cpp

* Refactor assertions in unit-class_const_iterator.cpp

* Refactor assertions in unit-class_iterator.cpp

* Refactor assertions in unit-class_parser.cpp

* Refactor assertions in unit-constructor1.cpp

* Refactor assertions in unit-convenience.cpp

* Refactor assertions in unit-conversions.cpp

* Refactor assertions in unit-deserialization.cpp

* Refactor assertions in unit-element_access1.cpp

* Refactor assertions in unit-element_access2.cpp

* Refactor assertions in unit-iterators1.cpp

* Refactor assertions in unit-iterators2.cpp

* Refactor assertions in unit-json_patch.cpp

* Refactor assertions in unit-json_pointer.cpp

* Refactor assertions in unit-modifiers.cpp

* Refactor assertions in unit-msgpack.cpp

* Refactor assertions in unit-reference_access.cpp

* Refactor assertions in unit-regression1.cpp

* Refactor assertions in unit-serialization.cpp

* Refactor assertions in unit-ubjson.cpp

* Refactor assertions in unit-unicode1.cpp

* Apply formatting
2022-03-24 15:55:35 +01:00
Florian Albrechtskirchinger
ad103e5b45 Improve unit testing (Part 1) (#3380)
* Refactor unit test creation

Add functions for creating tests and to supply test- and
standard-specific build settings.

Raises minimum CMake version to 3.13 in test directory.

json_test_add_test_for(
    <file>
    MAIN <main>
    [CXX_STANDARDS <version_number>...] [FORCE])

Given a <file> unit-foo.cpp, produces

    test-foo_cpp<version_number>

if C++ standard <version_number> is supported by the compiler and
thesource file contains JSON_HAS_CPP_<version_number>.  Use FORCE to
create the test regardless of the file containing
JSON_HAS_CPP_<version_number>.  Test targets are linked against <main>.
CXX_STANDARDS defaults to "11".

json_test_set_test_options(
    all|<tests>
    [CXX_STANDARDS all|<args>...]
    [COMPILE_DEFINITIONS <args>...]
    [COMPILE_FEATURES <args>...]
    [COMPILE_OPTIONS <args>...]
    [LINK_LIBRARIES <args>...]
    [LINK_OPTIONS <args>...])

Supply test- and standard-specific build settings.
Specify multiple tests using a list e.g., "test-foo;test-bar".

Must be called BEFORE the test is created.

* Use CMAKE_MODULE_PATH

* Don't undef some macros if JSON_TEST_KEEP_MACROS is defined

* Use JSON_TEST_KEEP_MACROS

Incidentally enables the regression tests for #2546 and #3070.

A CHECK_THROWS_WITH_AS in #3070 was disabled which is tracked in #3377
and a line in from_json(..., std_fs::path&) was marked with LCOV_EXCL_LINE.

* Add three-way comparison feature test macro

* Disable broken comparison if JSON_HAS_THREE_WAY_COMPARISON

* Fix redefinition of inline constexpr statics

Redelcaration of inline constexpr static data members in namespace scope
was deprecated in C++17. Fixes -Werror=deprecated compilation failures.

* Fix more test build failures due to missing noexcept

* CI: update cmake_flags test to use CMake 3.13 in test directory

Also change default for JSON_BuildTests option to depend on CMake
version.

* CI: turn *_CXXFLAGS into CMake lists

* CI: use JSON_TestStandards to set CXX_STANDARD

* CI: pass extra CXXFLAGS to standards tests
2022-03-24 07:54:07 +01:00
Florian Albrechtskirchinger
700b95f447 Make iterator operator++/--(int) equality-preserving (#3332)
Commit f28fc22 introduced const qualifiers on post-(inc-/dec-)rement
operators of iterators. These qualifiers prevent the use of basic_json
in place of std::ranges::range, which requires the post-increment
operator to be equality-preserving.

These changes appear to be the result of ICC compiler suggestions, and
no further explanation is discernible from the PR discussion (#858).
Further testing revealed, that clang-tidy also suggests adding const to
prevent "accidental mutation of a temporary object".

As an alternative, this commit partially reverts f28fc22, removing all
added const qualifiers from return types and adds lvalue reference
qualifiers to the operator member functions instead.

Unit tests ensure the operators remain equality-preserving and
accidental mutation of temporaries following post-(inc-/dec-)rement is
prohibited.

Fixes #3331.
2022-03-08 10:10:50 +01:00
Florian Albrechtskirchinger
f208a9c19b Fix C++20/gcc-12 issues (Part 1) (#3379)
* 🔧 use proper GCC binary

* 🔧 add more GCC warning flags

* ⚗️ try fix from https://github.com/nlohmann/json/issues/3138#issuecomment-1015562666

* Fix custom allocator test build failures (C++20)

Allocator tests fail to compile in C++20 mode with clang+MS STL due
to missing copy constructors.

* Fix test build failures due to missing noexcept (gcc-12)

* alt_string has multiple member functions that should be marked noexcept.
* nlohmann::ordered_map constructors can be noexcept.

Compilation failures result from the warning flag -Werror=noexcept and
gcc-12.

* Disable broken comparison tests in C++20 mode

Co-authored-by: Niels Lohmann <mail@nlohmann.me>
2022-03-07 22:19:28 +01:00
Niels Lohmann
4a6e6ca8c7 📝 update documentation 2022-03-07 13:48:24 +01:00
Andrea Cocito
8d7b5b6a28 Add clarification to avoid misunderstanding that cause #3360 (#3378)
* Update macros.md

Typos, typos
2022-03-07 13:43:50 +01:00
Florian Albrechtskirchinger
0fd95d2e28 Fix ordered_map ctor with initializer_list (#3370)
One of the ordered_map constructors was incorrectly accepting a
std::initializer_list<T> instead of std::initializer_list<value_type>.

Add regression test.

Fixes #3343.
2022-03-07 13:41:35 +01:00
Niels Lohmann
c6d8892e5d FetchContent_MakeAvailable (#3351)
* 🔧 use FetchContent_MakeAvailable

* 💚 fix test names
2022-03-06 15:33:05 +01:00
Florian Albrechtskirchinger
d1e57df48b Fix and update CI (#3368)
* CI: add workflow_dispatch trigger

* CI: change msvc2019*/clang* runners to windows-2019

GitHub updated their runners. windows-latest is now based on Windows
Server 2022 and comes with different tool versions.
MSVC 2019 is still available via the windows-2019 runner.
2022-03-06 13:54:00 +01:00
Faruk D
e4643d1f1b Fix CITATION.cff and add automatic validation of your citation metadata (#3320)
* Update CITATION.cff cffversion to 1.2.0

* Fix CITATION.cff date-released

Co-authored-by: Abel Soares Siqueira <abel.s.siqueira@gmail.com>
2022-02-18 18:11:44 +01:00
Niels Lohmann
d8a63291cb 📝 add note on parsing ordered_json #3325 (#3326) 2022-02-12 15:45:51 +01:00
Niels Lohmann
eb21824147 📝 replace Doxygen links 2022-02-08 22:12:49 +01:00
pketelsen
eec79d4e8a Add macros NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT and ..._NON_INTRUSIVE_WITH_DEFAULT (#3143)
* Added new macros NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT and NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT.

* Updated docs for NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT and NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT accordingly

* Rephrased docs for NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT and NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT

* Updated docs for NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT and NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT

* Renamed default_obj in to avoid name clashes

* Added test for serialization of default constructed object

* Add const to getters for macro tests

Co-authored-by: Chaoya Li <harry75369@gmail.com>
2022-01-30 22:06:50 +01:00
Niels Lohmann
c11f98228d 📝 document FetchContent 2022-01-30 13:05:18 +01:00
Thomas Braun
4d4c273036 .github/workflows/windows.yml: Add support for Visual Studio 2022 (#3295)
* .github/workflows/windows.yml: Add support for Visual Studio 2022

This is available in github actions since some time now [1].

[1]: https://github.com/actions/virtual-environments/issues/3949

* README.md: Add VS 2022 [skip ci]

The version and the build engine version (aka MSBuild version) were
taken from [1].

[1]: https://github.com/actions/virtual-environments/blob/win22/20220116.1/images/win/Windows2022-Readme.md
2022-01-26 09:57:23 +01:00
Niels Lohmann
b772649624 Add maintainer targets to create source archive (#3289)
* 🔨 add script to create xz archive
2022-01-25 19:53:02 +01:00
Ferry Huberts
293f67f9ff Fix a typo (#3265) 2022-01-12 21:43:22 +01:00
Niels Lohmann
c6740d7d58 📝 add documentation for default behavior for macros 2022-01-11 21:46:40 +01:00
Niels Lohmann
ef556019be 📝 overwork documentation 2022-01-09 14:32:38 +01:00
Niels Lohmann
6d8d043add ♻️ make function static 2022-01-05 21:21:46 +01:00
Niels Lohmann
4b6220acf2 ✏️ fix typo 2022-01-05 21:18:27 +01:00
Dimitris Apostolou
b785783440 Fix typo (#3249) 2022-01-05 13:35:14 +01:00
Niels Lohmann
6cd68ebd12 📝 add documentation for JSON Lines (#3247) 2022-01-05 09:51:29 +01:00
Niels Lohmann
4fc7b3dc7c 🔧 adjust docset generation script 2022-01-04 15:20:50 +01:00
Niels Lohmann
a8e86ba948 📝 improve documentation InputType and IteratorType (#3246) 2022-01-04 15:02:39 +01:00
Niels Lohmann
9e89c2fdb5 ♻️ remove stringstream (#3244) 2022-01-04 09:25:41 +01:00
Giovanni Cerretani
78ddf2bcf8 fix _MSC_VER version to check for std::filesystem (#3240) 2022-01-03 13:57:51 +01:00
Niels Lohmann
cc59ab122f Merge branch 'release/3.10.5' into develop 2022-01-03 06:40:28 +01:00
Niels Lohmann
4f8fba1406 Merge branch 'release/3.10.5' 2022-01-03 06:40:09 +01:00
Niels Lohmann
b5364faf9d 🔖 set version to 3.10.5 2022-01-02 22:35:35 +01:00
Niels Lohmann
b69713c394 Fix compilation error with NVCC (#3234) 2022-01-02 09:03:56 +01:00
Niels Lohmann
926df56ddb 🔥 remove Travis CI #3087 (#3233) 2021-12-31 11:04:29 +01:00
Niels Lohmann
1aca6cb949 Add build step for NVCC and fix a warning (#3227)
* 👷 add step for NVCC build #2676
* 🚨 fix warning (code taken from #2736)
* 👷 use version 2.2.0 of the CI image
2021-12-30 13:40:15 +01:00
Niels Lohmann
e6bf789f7d ⬆️ update cpplint (#3225) 2021-12-29 20:20:15 +01:00
Niels Lohmann
29cd970b94 Consolidate documentation (#3071)
* 🔥 consolidate documentation
* ♻️ overwork std specializations
* 🚚 move images files to mkdocs
* ♻️ fix URLs
* 🔧 tweak MkDocs configuration
* 🔧 add namespaces
* 📝 document deprecations
* 📝 document documentation generation
* 🚸 improve search
* 🚸 add examples
* 🚧 start adding documentation for macros
* 📝 add note for https://github.com/nlohmann/json/issues/874#issuecomment-1001699139
* 📝 overwork example handling
* 📝 fix Markdown tables
2021-12-29 13:41:01 +01:00
Niels Lohmann
6d3115924c Add C++17 copies of the test binaries (#3101)
* ⚗️ add C++17 copies of the test binaries
* ⚗️ use proper header for filesystem
* 🚨 fix warnings
* ⚗️ do not use too old compilers with C++17
*  add test
* 🔨 add more constraints #3097
* ⚗️ use fix from https://github.com/nlohmann/json/pull/3101#issuecomment-998788786
* ⚗️ use fix from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90050
* 👷 use published CI image
2021-12-29 09:47:05 +01:00
Maarten Becker
825d3230d1 Fix: Warning for shadowed variables (#3188) (#3193)
* Rename variable count to resolve shadowing (#3188)

* Amalgamate: Rename variable count to resolve shadowing (#3188)

Co-authored-by: Maarten Becker <maarten.becker@nuc-eng.com>
2021-12-17 07:24:59 +01:00
Prince Mendiratta
760304635d Fix FAQ hyperlink typo in readme (#3148)
Signed-off-by: Prince Mendiratta <prince.mendi@gmail.com>
2021-11-18 11:58:49 +01:00
Daniel Albuschat
ee1208aa60 Docs: Update skip_comments to ignore_comments (#3145)
In the docs, the `ignore_comments` parameter to `nlohmann::json::parse()` is described as `skip_comments`, which does not match the actual implementation. While the demo code compiles and works, the parameter name is wrong.
2021-11-17 19:21:54 +01:00
Dirk Stolle
fe230334d9 fix typos in documentation (#3140)
* fix typos in documentation

* revert changes to ChangeLog.md
2021-11-14 14:25:14 +01:00
Niels Lohmann
e9f88c2fad Add missing erase(first, last) function to ordered_map (#3109) 2021-11-09 22:24:58 +01:00
Alex Beregszaszi
834918018e Fix spelling (#3125) 2021-11-09 14:46:58 +01:00
Niels Lohmann
5c08a52fd6 ♻️ overwork std specializations (#3121) 2021-11-04 16:38:40 +01:00
Niels Lohmann
5d87c4d409 Add recursive update function (#3069)
*  add recursive update function
2021-11-03 13:52:20 +01:00
Niels Lohmann
7440786b81 Update CI (#3088)
* 👷 prepare GitHub actions for new Docker image

* 👷 use experimental docker image

* 👷 use Clang-Analyzer 14

* 🔇 suppress readability-identifier-length

* 🔇 suppress more Clang-Tidy warnings

* ♻️ simplify code

* 🔇 suppress more Clang-Tidy warnings

* 🔇 suppress more Clang-Tidy warnings

* 🚨 fix warning

* 🚨 fix warning

* 🚨 fix warning

* 👷 use new Docker image
2021-10-29 21:27:34 +02:00
Niels Lohmann
c4a4e672fd 📝 add examples for parsing from iterator pair (#3100) 2021-10-29 21:26:41 +02:00
Cristi Vîjdea
f5b3fb326c Fix typos in operator[] documentation (#3102)
* Fix typos in operator[] documentation
* Fix additional typo
2021-10-20 21:59:33 +02:00
Niels Lohmann
67c8ead923 Merge branch 'release/3.10.4' into develop 2021-10-16 14:47:23 +02:00
Niels Lohmann
fec56a1a16 Merge branch 'release/3.10.4' 2021-10-16 14:47:12 +02:00
Niels Lohmann
a09bfa5faa 🔖 set version to 3.10.4 2021-10-16 13:34:31 +02:00
Niels Lohmann
80cf9d7065 Revert invalid fix (#3082)
*  revert invalid fix
2021-10-16 13:27:28 +02:00
Niels Lohmann
ba046e4ea4 Allow to use get with explicit constructor (#3079)
*  remove "fix" that caused #3077
2021-10-14 21:01:14 +02:00
Théo DELRIEU
0e694b4060 fix std::filesystem::path regression (#3073)
* meta: rework is_compatible/is_constructible_string_type

These type traits performed an incorrect and insufficient check.

Converting to a std::filesystem::path used to work by accident thanks to
these brittle constraints, but the clean-up performed in #3020 broke them.

* support std::filesystem::path

Fixes #3070
2021-10-14 19:19:46 +02:00
Niels Lohmann
4b1cb9eee1 Merge branch 'release/3.10.3' into develop 2021-10-08 14:39:34 +02:00
Niels Lohmann
aa0e847e5b Merge branch 'release/3.10.3' 2021-10-08 14:39:21 +02:00
Niels Lohmann
ab6a2c7425 🔖 set version to 3.10.3 2021-10-08 13:58:48 +02:00
Théo DELRIEU
80df5e8de6 meta: fix is_compatible/constructible traits (#3020)
The previous version relied on the existence of an 'iterator' type.

As mentioned in comments, this is not the proper way to do it and
causes issues with certain types (e.g. views from range-v3).

Add a 'is_range' trait that properly detects the return type of
'begin'/'end', and use it in instead.
2021-10-07 12:32:25 +02:00
Carl Smedstad
62f2997b79 Fix assertion failure for JSON_DIAGNOSTICS (#3037)
* Fix assertion failure #3032
2021-10-07 12:24:09 +02:00
Niels Lohmann
ea528bbfda 📝 fixed Clang version (#3040) 2021-09-28 12:36:42 +02:00
Niels Lohmann
0b345b20c8 Allow allocators for output_vector_adapter (#2989)
* ♻️ allow allocators for vectors

*  add regression tests
2021-09-12 18:55:47 +02:00
Anthony VH
58b83b71dc Set parent pointers for values inserted via update() (fixes #3007). (#3008)
* Set parent pointers for values inserted via update() (fixes #3007).

* Moved test for #3007 to proper file.

* Enable access to private members in diagnostics unit tests.

* Make style consistent with rest of code.

* Forced amalgamate rerun.

* Refactor test for #3007 so it doesn't use private members. Also extend to test both update() functions.

* Added fix for #3007 to update(const_iterator, const_iterator) as well.

* Added failing example code from #3007 as extra test.
2021-09-12 18:51:25 +02:00
Niels Lohmann
bbdb29c658 Update docset generation script (#2967)
* 📝 update docset generation script

* 📝 update documentation
2021-09-01 08:43:10 +02:00
Niels Lohmann
fd0aa4fb0d 👷 re-add Clang 12 (#2986) 2021-08-30 10:54:14 +02:00
Niels Lohmann
e0b02c355e Use new Docker image (#2981) 2021-08-29 18:05:31 +02:00
Niels Lohmann
9dfd91695c Merge branch 'release/3.10.2' into develop 2021-08-26 09:08:33 +02:00
Niels Lohmann
626e7d61e4 Merge branch 'release/3.10.2' 2021-08-26 09:08:14 +02:00
Niels Lohmann
33b674b4b2 🔖 set version to 3.10.2 2021-08-26 08:13:04 +02:00
Giovanni Cerretani
28a169725e Fix -Wunused warnings on JSON_DIAGNOSTICS (#2976)
* Fix #2975

Define JSON_DIAGNOSTICS to 0 if not defined to fix annoying Wundef warnings.

* amalgamated
2021-08-26 07:35:01 +02:00
Niels Lohmann
1fd2213fd2 Merge branch 'release/3.10.1' into develop 2021-08-24 21:08:43 +02:00
Niels Lohmann
b488724ecd Merge branch 'release/3.10.1' 2021-08-24 21:08:29 +02:00
Niels Lohmann
8ad66e9136 🔖 set version to 3.10.1 2021-08-24 20:19:55 +02:00
mb0202
7194245a31 Fixed typo in parse.md (#2968)
Changed a potential typo: "charater" -> "character"
2021-08-24 08:08:02 +02:00
Niels Lohmann
34e2c4ab88 📝 add link to Homebrew package (#2966) 2021-08-22 21:58:37 +02:00
Niels Lohmann
c753165db6 Fix parent update for diagnostics with ordered_json (#2963)
🐛 fix parent update for diagnostics with ordered_json
2021-08-22 20:30:20 +02:00
Niels Lohmann
f03127eb69 Set stack size for some unit tests when using MSVC (#2961)
* 🏁 set stack size for some unit tests
2021-08-21 13:55:06 +02:00
Niels Lohmann
cb053bceb1 Merge pull request #2960 from nlohmann/issue2958
Add regression test
2021-08-20 16:34:38 +02:00
Niels Lohmann
97c7a35a2b add regression test 2021-08-20 14:49:58 +02:00
Niels Lohmann
eb6541a30c Merge pull request #2959 from nlohmann/issue2938
Update Travis badge
2021-08-20 13:56:16 +02:00
Niels Lohmann
e8e93ee43b 👷 update Travis badge 2021-08-20 13:53:31 +02:00
Niels Lohmann
611fd22557 Merge pull request #2957 from Hallot/bug/fix-some-clang-warnings
Fix some extra ";" clang warnings
2021-08-20 13:32:38 +02:00
Pierre Hallot
433604843d Fix extra ";" clang warnings 2021-08-19 17:04:34 +02:00
Niels Lohmann
44ffaa052c Merge pull request #2943 from amirmasoudabdol/patch-1
Updating the Homebrew Command
2021-08-19 12:03:52 +02:00
Amir Masoud Abdol
14af5d4a9f fixing the doc files 2021-08-19 09:31:39 +02:00
Niels Lohmann
273d911252 Merge pull request #2954 from nlohmann/issue2944 2021-08-19 06:37:42 +02:00
Niels Lohmann
55281e03af 📝 add documentation for integration via vcpkg 2021-08-18 21:25:23 +02:00
Niels Lohmann
23e3b622aa 📝 add documentation for integration via vcpkg 2021-08-18 20:49:13 +02:00
Niels Lohmann
abd829e6c6 Merge pull request #2950 from senyai/patch-2
🚨 fix gdb_pretty_printer failure on basic types
2021-08-18 20:07:28 +02:00
Niels Lohmann
5cf5ccd108 Merge pull request #2948 from nlohmann/missing_header
Add header to use value_t
2021-08-18 20:07:05 +02:00
Niels Lohmann
5a04042cad Merge pull request #2947 from nlohmann/issue2946
Skip some tests if JSON_Install is not set
2021-08-18 20:06:44 +02:00
Niels Lohmann
f8bc22c741 Merge pull request #2945 from nlohmann/issue2941
Remove outdated json_unit test binary
2021-08-18 20:06:00 +02:00
Niels Lohmann
de4a6346c7 Merge pull request #2952 from nlohmann/fewer_appveyor_builds
Avoid duplicate AppVeyor builds
2021-08-18 20:04:25 +02:00
Niels Lohmann
f79bed6d39 👷 avoid duplicate AppVeyor builds 2021-08-18 19:53:35 +02:00
Arseniy Terekhin
355fa6c35c 🚨 gdb_pretty_printer failure on basic types
name can be None, and `re.search` fails on `None`;
replaced `re` by `str.startswith` and `str.endswith`
2021-08-18 19:29:50 +03:00
Amir Masoud Abdol
b65748f763 Using the homebrew/core Formula
I've submitted a PR on [homebrew/core](https://github.com/Homebrew/homebrew-core/pull/83479) that updates their Formula. After that one is set, we can merge this and let users use the default formula, and we don't have to maintain two separate Formulas.
2021-08-18 16:49:51 +02:00
Niels Lohmann
cfb71ad1bf 🐛 adding missing header 2021-08-18 13:33:35 +02:00
Niels Lohmann
54d9cd5a12 🔧 guard tests with JSON_Install flag 2021-08-18 13:24:12 +02:00
Niels Lohmann
5d3ad31d7e 🔥 remove outdated json_unit binary 2021-08-18 12:41:03 +02:00
Amir Masoud Abdol
8e4996c156 Updating the Homebrew Command
This resolves a conflict, and stops Homebrew from using the default formula.
2021-08-18 11:55:25 +02:00
Niels Lohmann
f42a74b8f5 Merge branch 'release/3.10.0' into develop 2021-08-17 20:40:42 +02:00
Niels Lohmann
0b7471b0f7 Merge branch 'release/3.10.0' 2021-08-17 20:40:25 +02:00
Niels Lohmann
1de378f580 🔖 set version to 3.10.0 2021-08-17 15:23:23 +02:00
Niels Lohmann
8cae9d7cd2 Overwork warning flags (#2936)
* ⚗️ update warning flags
2021-08-17 14:43:43 +02:00
Niels Lohmann
f1e63a8322 👷 run CI for release branches 2021-08-16 15:40:57 +02:00
Niels Lohmann
fa5d3b5a9b 👷 run CI for release branches 2021-08-15 22:49:31 +02:00
Niels Lohmann
09237272bc 👥 update documentation 2021-08-15 21:05:26 +02:00
Niels Lohmann
1300d2e4c3 Merge pull request #2908 from nlohmann/issue2863
Fix binary subtypes
2021-08-14 14:27:58 +02:00
Niels Lohmann
1aceeff3fc 🚨 fix C4244 warning 2021-08-14 13:40:52 +02:00
Niels Lohmann
0a0eb7a850 Merge branch 'develop' of https://github.com/nlohmann/json into issue2863
 Conflicts:
	.github/workflows/windows.yml
2021-08-14 11:19:48 +02:00
Niels Lohmann
6ac037c1f6 Merge pull request #2930 from nlohmann/msvc_warnings_as_error 2021-08-13 21:23:24 +02:00
Niels Lohmann
e5ef44c4dd Merge pull request #2927 from fhuberts/fix-switch-enum 2021-08-13 19:32:39 +02:00
Niels Lohmann
4b0e04eb68 🚨 fix C4100 warnings 2021-08-13 17:03:55 +02:00
Ferry Huberts
cdbc50b9a8 Again forgot to amalgate (sigh)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2021-08-13 15:33:05 +02:00
Ferry Huberts
364a21be6b Add coverage exclusion comments, as requested
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2021-08-13 15:30:55 +02:00
Ferry Huberts
95b73bcd01 Forgot to amalgate
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2021-08-13 14:22:18 +02:00
Niels Lohmann
288cdf9af7 ⚗️ add -WX flag to MSVC builds 2021-08-13 14:07:17 +02:00
Ferry Huberts
e7a69b8d31 Adjust more files after actually building like the CI
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2021-08-13 14:00:00 +02:00
Niels Lohmann
fecb01858b ⚗️ add -WX flag to MSVC builds 2021-08-13 13:28:17 +02:00
Niels Lohmann
789280fcb2 🚨 fix C4309 warning 2021-08-13 13:20:26 +02:00
Niels Lohmann
e65db83448 ⚗️ add -WX flag to MSVC builds 2021-08-13 12:42:38 +02:00
Ferry Huberts
832cee5b77 Adjust warnings flags, as requested
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2021-08-12 19:49:54 +02:00
Ferry Huberts
44d60f8d14 All: fix warnings when compiling with -Wswitch-enum
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2021-08-12 16:33:50 +02:00
Niels Lohmann
910fabf8f0 Merge pull request #2925 from nlohmann/issue2924
Guard GCC pragmas
2021-08-12 07:58:50 +02:00
Niels Lohmann
e20f3f95eb 🚨 guard GCC pragmas #2924 2021-08-11 23:55:46 +02:00
Niels Lohmann
57d31d1b83 Merge pull request #2898 from nlohmann/issue2824
Add regression test
2021-08-11 13:02:49 +02:00
Niels Lohmann
8ae31a56a5 Merge branch 'develop' of https://github.com/nlohmann/json into issue2824 2021-08-11 08:06:32 +02:00
Niels Lohmann
68d8661f1b 📝 update documentation 2021-08-11 08:06:25 +02:00
Niels Lohmann
b792bf5660 ⚗️ try minimal example 2021-08-10 10:29:13 +02:00
Niels Lohmann
26569f8ecc ⚗️ try minimal example 2021-08-10 10:09:31 +02:00
Niels Lohmann
edc203a837 ⚗️ try minimal example 2021-08-10 08:35:14 +02:00
Niels Lohmann
0d530c9de8 ⚗️ try minimal example 2021-08-10 08:22:21 +02:00
Niels Lohmann
36394cc262 ⚗️ try minimal example 2021-08-09 21:58:05 +02:00
Niels Lohmann
83c005f881 ⚗️ try minimal example 2021-08-09 21:43:03 +02:00
Niels Lohmann
523f7c2c9d 💡 update documentation 2021-08-08 13:24:17 +02:00
Niels Lohmann
db7ccafbda 💚 fix MSVC build 2021-08-07 13:55:25 +02:00
Niels Lohmann
a4c3cf7798 💚 fix MSVC build 2021-08-07 13:40:01 +02:00
Niels Lohmann
346c9c1a19 💚 fix MSVC build 2021-08-07 13:37:17 +02:00
Niels Lohmann
c5928501b0 💚 fix MSVC build 2021-08-07 13:19:25 +02:00
Niels Lohmann
176e9bf0ab add tests for CBOR 2021-08-07 13:14:08 +02:00
Niels Lohmann
b74474e3fd 💚 fix MSVC build 2021-08-07 13:14:00 +02:00
Niels Lohmann
89c98dfc20 add option to process binary subtypes in CBOR 2021-08-06 16:41:01 +02:00
Niels Lohmann
51a9880022 add tests for CBOR 2021-08-06 15:31:11 +02:00
Niels Lohmann
b7db1d68d9 ♻️ fix CBOR and BSON 2021-08-06 14:36:38 +02:00
Niels Lohmann
046df035fa ♻️ change type of binary subtype 2021-08-06 13:45:35 +02:00
Niels Lohmann
3eb1fb6be7 ♻️ change type of binary subtype 2021-08-06 13:26:00 +02:00
Niels Lohmann
5c38e76c11 Merge branch 'develop' of https://github.com/nlohmann/json into issue2863 2021-08-06 13:23:26 +02:00
Niels Lohmann
359f6723fc Merge pull request #2911 from Finkman/develop
Supress -Wfloat-equal on intended float comparisions
2021-08-06 12:58:34 +02:00
Sven Fink
3f5545f99b Remove -Wfloat-equal suppressions on tests 2021-08-04 09:14:45 +02:00
Sven Fink
353d59717e Add more suppressions on float comparisons 2021-08-04 08:34:53 +02:00
Sven Fink
095aae19fe Supress -Wfloat-equal on intended float comparisions 2021-08-03 08:58:38 +02:00
Niels Lohmann
7c19aa2210 ♻️ overwork byte_container_with_subtype 2021-08-01 22:00:57 +02:00
Niels Lohmann
eb488bb4d9 📝 add note for wstring handling 2021-08-01 20:54:02 +02:00
Niels Lohmann
c3df4ffd5a 🚨 fix warning 2021-08-01 14:08:14 +02:00
Niels Lohmann
5a1bc76f34 ⚗️ switch off exceptions 2021-08-01 13:34:55 +02:00
Niels Lohmann
e7260f07f5 Merge branch 'develop' of https://github.com/nlohmann/json into issue2824 2021-08-01 13:07:43 +02:00
Niels Lohmann
a54403290e 📄 add CITATION file 2021-08-01 12:42:59 +02:00
Niels Lohmann
9ed027ac10 Merge pull request #2902 from nlohmann/issue2893
Fix useless-cast warnings
2021-07-31 20:42:55 +02:00
Niels Lohmann
8676f6745e add regression test #2824 2021-07-30 21:18:25 +02:00
Niels Lohmann
f4716a0d42 🚨 fix useless-cast warnings 2021-07-30 21:12:55 +02:00
Niels Lohmann
9a459e1bd5 🚨 fix useless-cast warnings 2021-07-30 15:20:22 +02:00
Niels Lohmann
c7822840eb add regression test #2824 2021-07-30 15:00:54 +02:00
Niels Lohmann
7feb2c20cf 🚨 fix useless-cast warnings 2021-07-30 14:48:25 +02:00
Niels Lohmann
2c030bac2c add regression test #2824 2021-07-30 14:41:06 +02:00
Niels Lohmann
1c030cccf1 add regression test #2824 2021-07-29 15:23:21 +02:00
Niels Lohmann
a563338039 Merge pull request #2825 from ldionne/ldionne-lazy
Properly constrain the basic_json conversion operator
2021-07-22 12:24:56 +02:00
Niels Lohmann
19a5e12136 CMake cleanup (#2885)
* 🔥 clean CMake files and Makefile
* 💡 update documentation
2021-07-22 09:25:55 +02:00
Niels Lohmann
eba82ecd62 Refactor Unicode tests (#2889)
* ♻️ split Unicode tests
2021-07-21 21:17:01 +02:00
Louis Dionne
b0e5965d71 Properly constrain the basic_json conversion operator
Fixes #2491
2021-07-19 11:16:27 -04:00
Niels Lohmann
03270ef090 👥 update contributors 2021-07-19 16:57:15 +02:00
Niels Lohmann
45016c4429 ⬆️ update Doxyfile 2021-07-19 16:56:43 +02:00
Niels Lohmann
7066ab128f 🎨 reindent code 2021-07-19 16:56:28 +02:00
Niels Lohmann
926fab47d0 📝 fix GIF examples #2457 2021-07-17 14:43:01 +02:00
Niels Lohmann
a0863b8c20 📝 add support section 2021-07-17 13:44:54 +02:00
Niels Lohmann
517aeec299 Merge remote-tracking branch 'origin/develop' into develop 2021-07-17 12:39:45 +02:00
Niels Lohmann
8f0a880c89 Merge pull request #2879 from nlohmann/issue2598
Avoid string in case of empty CBOR objects
2021-07-17 12:38:33 +02:00
Niels Lohmann
3db8903f29 📝 restructure README 2021-07-16 15:00:11 +02:00
Niels Lohmann
fb1ee4f94b 📝 update documentation 2021-07-16 14:41:14 +02:00
Niels Lohmann
835749efcc add test for JSON_SystemInclude flag 2021-07-16 12:34:15 +02:00
Niels Lohmann
fb31616a61 Merge remote-tracking branch 'origin/develop' into develop 2021-07-16 12:27:53 +02:00
Niels Lohmann
b2d21067d1 Merge pull request #2762 from jpl-mac/no.tidy.warnings.dev
Add a cmake option to use SYSTEM in target_include_directories
2021-07-16 12:06:26 +02:00
Niels Lohmann
c65369acbe 👷 fix Codacity badge 2021-07-16 11:44:07 +02:00
Niels Lohmann
f907f9502d Merge pull request #2875 from nlohmann/issue2592
Suppress C4127 warning in unit-json_pointer.cpp
2021-07-16 10:11:29 +02:00
Niels Lohmann
b7cc47089f avoid string in case of empty objects 2021-07-16 09:27:18 +02:00
Niels Lohmann
c89e23c69b Merge pull request #2874 from nlohmann/issue2572
Fix truncation warning
2021-07-16 07:54:48 +02:00
Niels Lohmann
f883ddd1c2 Merge pull request #2872 from nlohmann/issue2865
Fix memory leak in to_json
2021-07-16 06:52:28 +02:00
Niels Lohmann
92ec35735c Merge branch 'develop' of https://github.com/nlohmann/json into issue2592 2021-07-15 22:28:03 +02:00
Niels Lohmann
953dcfb611 🚨 fix warning #2572 2021-07-15 22:00:16 +02:00
Niels Lohmann
996ac1c017 Merge branch 'develop' of https://github.com/nlohmann/json into issue2572
 Conflicts:
	include/nlohmann/detail/output/serializer.hpp
	single_include/nlohmann/json.hpp
2021-07-15 21:57:52 +02:00
Niels Lohmann
3e4723a49f 🔨 remove noexcept annotation 2021-07-15 21:49:09 +02:00
Niels Lohmann
ecaac22656 💡 add comment to describe j.m_value.destroy(j.m_type) calls 2021-07-15 20:34:50 +02:00
Niels Lohmann
f6863e062c 🐛 fix leak for all types 2021-07-15 20:32:37 +02:00
Niels Lohmann
0011cd1b72 🐛 fix leak for strings 2021-07-15 13:12:21 +02:00
Niels Lohmann
0f8666ecdc 🐛 fix leak for strings 2021-07-15 13:03:20 +02:00
Niels Lohmann
c1298e69a6 🐛 fix leak for strings 2021-07-15 12:52:17 +02:00
Niels Lohmann
6cbdc83994 🐛 fix leak for strings 2021-07-15 12:47:15 +02:00
Niels Lohmann
149ded856f ♻️ simplify destroy() function for primitive types 2021-07-15 12:46:48 +02:00
Niels Lohmann
db98073930 add regression test 2021-07-15 09:02:24 +02:00
Niels Lohmann
c9c5c016a2 Merge pull request #2866 from nlohmann/issue2838 2021-07-14 12:04:37 +02:00
Niels Lohmann
4e92a61784 Merge pull request #2795 from turintech/develop
Specified git branch for google benchmark fetch in benchmark test
2021-07-13 16:58:25 +02:00
Niels Lohmann
a711e1f5a7 🚨 fix warnings 2021-07-13 15:37:57 +02:00
Niels Lohmann
3bb9467073 ♻️ move capacity check to set_parent function 2021-07-13 15:27:27 +02:00
Niels Lohmann
bc7e8faa4f 🔥 remove duplicated line 2021-07-12 19:21:07 +02:00
Niels Lohmann
b0730f29cf 🐛 fix logics 2021-07-12 15:24:06 +02:00
Niels Lohmann
d40e98ecef 🐛 fix assertion failure #2838 2021-07-12 13:38:28 +02:00
Niels Lohmann
9426074ce8 Merge pull request #2861 from nlohmann/documentation
Update documentation
2021-07-11 14:15:41 +02:00
Niels Lohmann
249688037f ⚗️ fix coverage 2021-07-11 09:33:43 +02:00
Niels Lohmann
7442c24662 🚨 suppress missingReturn warnings 2021-07-10 13:44:13 +02:00
Niels Lohmann
a82f66beed 📝 document JSON_NO_IO macro #2842 2021-07-10 12:51:18 +02:00
Niels Lohmann
5c8d0af5ce 📝 add comment for handling of negative zeros #2854 2021-07-10 12:50:59 +02:00
Niels Lohmann
098bbab029 Merge remote-tracking branch 'origin/develop' into develop 2021-07-06 08:46:51 +02:00
Niels Lohmann
71fd9bd954 📝 fix documentation (#2845) 2021-07-06 08:46:17 +02:00
Rafail Giavrimis
b7e493e98a Specified git branch for google benchmark fetch
The default branch was renamed from "master" to "main", which breaks the cloning process.
2021-06-27 17:52:28 +03:00
Niels Lohmann
6471a63115 Merge pull request #2729 from theShmoo/without-io
Possibility to use without the dependency to file io and streams to use in intel sgx enclaves
2021-06-26 12:50:06 +02:00
Niels Lohmann
624f59eacb Merge pull request #2826 from justanotheranonymoususer/patch-1
Consistency with `using` in README.md
2021-06-21 14:48:39 +02:00
justanotheranonymoususer
e970f31066 Update arbitrary_types.md 2021-06-18 12:44:27 +03:00
justanotheranonymoususer
c3d7fcb76c Update README.md 2021-06-18 11:04:53 +03:00
justanotheranonymoususer
9710108d6a Consistency with using in README.md 2021-06-17 21:39:29 +03:00
David Pfahler
572343be63 Merge branch 'nlohmann:develop' into without-io 2021-06-15 12:24:19 +02:00
Niels Lohmann
18a5f4c7ca Merge pull request #2790 from nlohmann/macos_standards
Add C++ standards to macOS matrix
2021-06-14 20:23:21 +02:00
David Pfahler
aa849a2275 Merge branch 'nlohmann:develop' into without-io 2021-06-14 08:22:49 +02:00
Niels Lohmann
71a514a651 Merge pull request #2770 from jasmcaus/patch-1
Keep consistent formatting
2021-06-14 07:18:46 +02:00
Niels Lohmann
fde6e1f800 Merge branch 'develop' of https://github.com/nlohmann/json into macos_standards 2021-06-14 07:17:47 +02:00
Niels Lohmann
95ad4ae071 Merge pull request #2817 from nlohmann/fix_ci
Fix CI
2021-06-14 07:16:32 +02:00
Niels Lohmann
802895b483 👷 remove Clang 10 2021-06-13 14:14:10 +02:00
Niels Lohmann
032f32ebe4 👷 add Clang 12 2021-06-13 14:04:20 +02:00
David Pfahler
e939b59683 fixed amalgation file for #2728 2021-05-31 14:27:23 +02:00
David Pfahler
ae9bbbc941 include io only if JSON_NO_IO is not set for #2728 2021-05-31 14:26:45 +02:00
Niels Lohmann
30e52eb046 👷 execute all tests 2021-05-30 13:28:58 +02:00
Niels Lohmann
2b685c744b 👷 reduce load 2021-05-29 13:10:28 +02:00
Niels Lohmann
9f5ee3f145 👷 fix syntax 2021-05-28 22:27:46 +02:00
Niels Lohmann
311730bc3d 👷 add C++ standards to macOS matrix #2491 2021-05-28 22:23:50 +02:00
Niels Lohmann
e10a3fac8a Merge pull request #2789 from TotalCaesar659/patch-2
Update URLs to HTTPS
2021-05-28 10:31:04 +02:00
TotalCaesar659
9a599ae63a Update URLs to HTTPS 2021-05-28 00:53:17 +03:00
Jason Dsouza
f118091eaa Update CMakeLists.txt 2021-05-15 23:39:15 +05:30
Niels Lohmann
0972f7ff0e Merge pull request #2771 from offa/conan_package_url
Link to Conan Center package added
2021-05-15 19:26:34 +02:00
offa
7935a683f5 link to conan package in readme 2021-05-12 16:46:32 +02:00
Jason Dsouza
6d7959e05d Keep consistent formatting 2021-05-12 19:25:06 +05:30
Niels Lohmann
7cafc5c63f 📝 document Drone CI 2021-05-10 14:23:27 +02:00
Niels Lohmann
e856b50791 🔥 remove arm build 2021-05-09 14:22:46 +02:00
Niels Lohmann
a44b29ecf1 🔧 fix paths 2021-05-09 13:52:16 +02:00
Niels Lohmann
014724f362 ⚗️ change path 2021-05-09 13:49:42 +02:00
Niels Lohmann
0c62748b75 🔧 change repository 2021-05-09 13:46:48 +02:00
Niels Lohmann
c73bd8b251 🔧 ignore certificate 2021-05-09 13:44:21 +02:00
Niels Lohmann
3685dbdcfd 🔧 checkout cmake via git 2021-05-09 13:41:40 +02:00
Niels Lohmann
9746f72d71 🔨 do not check certificate 2021-05-09 13:34:28 +02:00
Niels Lohmann
df6fa6c11c 👷 arm and arm64 2021-05-09 13:32:50 +02:00
Niels Lohmann
e6e7309514 👷 arm and arm64 2021-05-09 13:31:27 +02:00
Niels Lohmann
42f2512290 🔧 skip slow tests 2021-05-09 13:00:35 +02:00
Niels Lohmann
f3193e1e94 🔧 build ctest 2021-05-09 11:07:57 +02:00
Niels Lohmann
9ec8f4efa8 🔧 fix ctest path 2021-05-09 10:39:37 +02:00
Niels Lohmann
27a71ccdd8 🔧 fix path 2021-05-08 20:42:24 +02:00
Niels Lohmann
a6e2fd1b15 🔧 use built CMake 2021-05-08 14:41:43 +02:00
Niels Lohmann
77a5cd247e 🔧 build cmake 2021-05-08 13:56:19 +02:00
Niels Lohmann
1d8869f8bc 👷 add Drone CI 2021-05-08 13:33:30 +02:00
Jean-Philippe Lemieux
afbb84b2c8 Add a cmake option to use SYSTEM in target_include_directories
Without SYSTEM static analysis like clang-tidy raise warnings on
json.hpp.  This is not desirable for projects embedding nlohmann_json

Tests:
- Validated that without the option OFF the warnings are raised as
  before
- Validated that with the option ON the warnings are silenced
2021-05-05 16:19:24 -04:00
Niels Lohmann
fc2f7116fe Merge pull request #2756 from nlohmann/issue2755
replace EOF with std::char_traits<char>::eof()
2021-05-04 12:56:46 +02:00
Niels Lohmann
b08139ea4b ♻️ replace EOF with std::char_traits<char>::eof() 2021-05-04 10:22:34 +02:00
Niels Lohmann
d4f446592f Merge pull request #2754 from mortenfyhn/patch-1
Fix typo in README
2021-05-03 12:24:55 +02:00
Morten Fyhn Amundsen
193bf9d6b6 Fix typo in README 2021-05-03 09:46:00 +02:00
Niels Lohmann
b2e784c33b Merge pull request #2749 from nlohmann/docs 2021-04-29 23:05:33 +02:00
Niels Lohmann
d0ab2b86c3 📝 update documentation 2021-04-29 17:19:57 +02:00
Niels Lohmann
8a29a6ecf4 Merge pull request #2731 from theShmoo/custom-cpp-version
Fixes #2730
2021-04-29 09:55:16 +02:00
Niels Lohmann
07344fdd09 Merge pull request #2747 from nlohmann/docs
Add documentation for numbers
2021-04-28 22:06:25 +02:00
Niels Lohmann
cdfe865486 📝 add documentation for numbers 2021-04-28 20:33:05 +02:00
David Pfahler
d140a1c777 fixed amalgamation file 2021-04-26 08:39:24 +02:00
David Pfahler
5a77314c5e replaced define
JSON_VERSION_IS_PREDEFINED with JSON_HAS_CPP_11
2021-04-26 08:09:36 +02:00
Niels Lohmann
a34e011e24 Merge pull request #2576 from AnthonyVH/non_default_constructable_stl_containers
Add support for deserialization of STL containers of non-default constructable types (fixes #2574).
2021-04-25 15:22:37 +02:00
Niels Lohmann
f1600cd26b Merge pull request #2737 from nlohmann/upgrade_ci
Use Clang 12 in CI
2021-04-25 15:20:42 +02:00
Niels Lohmann
f6e9654aaa 🔇 suppress unsigned integer warnings 2021-04-25 14:33:12 +02:00
Niels Lohmann
52717b7473 👷 add clang 11 2021-04-24 14:27:13 +02:00
Niels Lohmann
608fbffcb1 📝 update compiler versions 2021-04-24 13:51:53 +02:00
Niels Lohmann
0638a27ed3 👷 add step for Infer 2021-04-24 13:50:30 +02:00
Niels Lohmann
10fc5162e7 ⬆️ use Clang 12 where available 2021-04-24 13:24:36 +02:00
Niels Lohmann
9774e53cd6 Merge pull request #2707 from raduteo/patch-2
Update json.hpp
2021-04-23 09:48:38 +02:00
David Pfahler
0a2de2f5b9 fixed amalgation file for #2728 2021-04-21 12:54:55 +02:00
David Pfahler
6b267e3cb1 fixed amalgation file for #2730 2021-04-21 12:53:58 +02:00
David Pfahler
38952643c5 generate amalgation to fix CI for #2730 2021-04-21 12:46:37 +02:00
David Pfahler
31c4c8f36c Fixes #2730
Added define JSON_VERSION_IS_PREDEFINED
for skipping automatic JSON_HAS_CPP_* detection
2021-04-21 11:03:28 +02:00
David Pfahler
1a1381f071 Fixes #2728
includes some macros to be defined for using without file io.
2021-04-21 10:24:01 +02:00
raduteo
35d79203ec Update json.hpp 2021-04-12 19:47:02 -04:00
raduteo
e8dbd7be86 Update json.hpp
Proposed fix for #2706
2021-04-09 09:35:58 -04:00
Niels Lohmann
7126d88803 Merge pull request #2690 from doronbehar/patch-1
pkg-config.pc.in: Don't concatenate paths
2021-03-30 07:50:28 +02:00
Doron Behar
53a9850eeb pkg-config.pc.in: Don't concatenate paths
See: https://github.com/jtojnar/cmake-snips#assuming-cmake_install_dir-is-relative-path
2021-03-29 21:43:49 +00:00
Niels Lohmann
3f33c21725 Merge pull request #2689 from nlohmann/ci_matrix
add more CI steps
2021-03-29 09:25:04 +02:00
Niels Lohmann
d927f44576 💚 fix build 2021-03-28 15:30:37 +02:00
Niels Lohmann
077fe41a82 🚧 do not check pushes to non-default branches 2021-03-28 14:59:42 +02:00
Niels Lohmann
ae99a31bea 🚧 add more CI tests 2021-03-28 14:48:58 +02:00
Niels Lohmann
f268035946 👷 consolidate CI 2021-03-28 13:37:04 +02:00
Niels Lohmann
1f1fa9f30e 🔥 remove some Travis builds 2021-03-27 14:44:39 +01:00
Niels Lohmann
c591b6ca6c 👷 move some MSVC jobs from AppVeyor to GitHub Actions 2021-03-27 10:43:05 +01:00
Niels Lohmann
5213ae56ac Merge pull request #2687 from musicinmybrain/nonconstant-sigstksz
Update doctest from 2.4.4 to 2.4.6 (fixes #2686)
2021-03-27 07:06:04 +01:00
Benjamin A. Beasley
ef826b6fba Update doctest from 2.4.4 to 2.4.6 (fixes #2686) 2021-03-25 13:16:04 -04:00
Niels Lohmann
823801879a Merge pull request #2683 from nlohmann/license_fix
License fix
2021-03-25 13:04:55 +01:00
Niels Lohmann
4a344e1ef0 Merge pull request #2375 from karzhenkov/fix-travis-release
Properly select "Release" build for Travis
2021-03-25 12:14:22 +01:00
Anthony VH
2b865131d8 Fixing CI errors. 2021-03-24 23:33:21 +01:00
Niels Lohmann
9d57351175 🐛 set correct value for JSON_ImplicitConversions in ci_test_noimplicitconversions 2021-03-24 20:27:12 +01:00
Alexander Karzhenkov
bf75a1b91d Merge branch 'develop' into #2375
# Conflicts:
#	.travis.yml
2021-03-24 20:33:35 +05:00
Anthony VH
8e79917d32 Fix clang-tidy complaints. 2021-03-24 13:27:59 +01:00
Niels Lohmann
41dbd50313 📄 use code from Google Abseil 2021-03-24 13:27:00 +01:00
Anthony VH
322bc99d8e Reran amalgamate. 2021-03-24 13:03:36 +01:00
Niels Lohmann
ca9a1f2fd4 📝 add note to outdated exceptions 2021-03-24 12:46:34 +01:00
Anthony VH
333612ce35 Merge remote-tracking branch 'upstream/develop' into non_default_constructable_stl_containers 2021-03-24 12:33:57 +01:00
Niels Lohmann
6f551930e5 🚨 add new CI and fix warnings (#2561)
* ⚗️ move CI targets to CMake
* ♻️ add target for cpplint
* ♻️ add target for self-contained binaries
* ♻️ add targets for iwyu and infer
* 🔊 add version output
* ♻️ add target for oclint
* 🚨 fix warnings
* ♻️ rename targets
* ♻️ use iwyu properly
* 🚨 fix warnings
* ♻️ use iwyu properly
* ♻️ add target for benchmarks
* ♻️ add target for CMake flags
* 👷 use GitHub Actions
* ⚗️ try to install Clang 11
* ⚗️ try to install GCC 11
* ⚗️ try to install Clang 11
* ⚗️ try to install GCC 11
* ⚗️ add clang analyze target
* 🔥 remove Google Benchmark
* ⬆️ Google Benchmark 1.5.2
* 🔥 use fetchcontent
* 🐧 add target to download a Linux version of CMake
* 🔨 fix dependency
* 🚨 fix includes
* 🚨 fix comment
* 🔧 adjust flags for GCC 11.0.0 20210110 (experimental)
* 🐳 user Docker image to run CI
* 🔧 add target for Valgrind
* 👷 add target for Valgrind tests
* ⚗️ add Dart
*  remove Dart
* ⚗️ do not call ctest in test subdirectory
* ⚗️ download test data explicitly
* ⚗️ only execute Valgrind tests
* ⚗️ fix labels
* 🔥 remove unneeded jobs
* 🔨 cleanup
* 🐛 fix OCLint call
*  add targets for offline and git-independent tests
*  add targets for C++ language versions and reproducible tests
* 🔨 clean up
* 👷 add CI steps for cppcheck and cpplint
* 🚨 fix warnings from Clang-Tidy
* 👷 add CI steps for Clang-Tidy
* 🚨 fix warnings
* 🔧 select proper binary
* 🚨 fix warnings
* 🚨 suppress some unhelpful warnings
* 🚨 fix warnings
* 🎨 fix format
* 🚨 fix warnings
* 👷 add CI steps for Sanitizers
* 🚨 fix warnings
*  add optimization to sanitizer build
* 🚨 fix warnings
* 🚨 add missing header
* 🚨 fix warnings
* 👷 add CI step for coverage
* 👷 add CI steps for disabled exceptions and implicit conversions
* 🚨 fix warnings
* 👷 add CI steps for checking indentation
* 🐛 fix variable use
* 💚 fix build
*  remove CircleCI
* 👷 add CI step for diagnostics
* 🚨 fix warning
* 🔥 clean Travis
2021-03-24 07:15:18 +01:00
Niels Lohmann
6b74772fe8 Merge pull request #2673 from remyjette/remove-exception-annotation
Remove HEDLEY annotation from exception::what()
2021-03-23 07:48:00 +01:00
Niels Lohmann
80e7d6fd9f Merge pull request #2679 from frasermarlow/patch-1
Update parse_exceptions.md - correct `json::exception::parse_error`
2021-03-23 07:44:32 +01:00
Niels Lohmann
098dd6bf34 Merge pull request #2659 from abbaswasim/patch-1
Fix amount of entries in the json object
2021-03-23 07:22:44 +01:00
Fraser
90d51b9205 Update parse_exceptions.md
Referring to https://github.com/nlohmann/json/blob/develop/doc/examples/parse_error.cpp  and https://json.nlohmann.me/home/exceptions/
(and also based on testing), the catch command should reference `catch (json::parse_error& ex)` and not `catch (json::exception::parse_error& ex)`
2021-03-18 12:25:12 -04:00
Remy Jette
0a9ec38f44 Remove HEDLEY annotation from exception::what()
The latest MSVC compiler throws the following warning on
nlohmann::detail::exception::what() if /analyze is enabled:

```
vcruntime_exception.h(93) : warning C28204: 'what' has an override at
`nlohmann\json\develop\single_include\nlohmann\json.hpp(2644)`
and only the override is annotated for return: when an override is
annotated, the base (this function) should be similarly annotated.
```

See https://godbolt.org/z/r331h4
2021-03-15 17:45:40 -07:00
abbaswasim
ddbdb65834 Fix amount of entries in the json object
After the initial j.push_back() calls there is another j.emplace_back() call that makes the size == 4 not 3.
2021-03-02 01:42:33 +00:00
Niels Lohmann
176d8e261a Merge pull request #2562 from nlohmann/diagnostics
Better diagnostics
2021-02-10 07:20:54 +01:00
Niels Lohmann
bb90e34d22 ⬆️ Hedley v15 2021-02-07 17:47:08 +01:00
Niels Lohmann
56a6dec0de 🔀 merge develop branch 2021-02-07 17:46:11 +01:00
Niels Lohmann
4917e7c259 Merge branch 'develop' of https://github.com/nlohmann/json into diagnostics
 Conflicts:
	include/nlohmann/detail/input/parser.hpp
	single_include/nlohmann/json.hpp
2021-02-07 17:45:09 +01:00
Niels Lohmann
e754ef7087 Merge pull request #2625 from wawiesel/patch-1
Fix missing 1.78 in example in README.md
2021-02-07 14:26:38 +01:00
William A. Wieselquist
567e2e3412 Fix missing 1.78 in example in README.md 2021-02-06 14:48:12 -05:00
Niels Lohmann
6d4eed5aeb 🚨 fix warning 2021-01-30 12:51:54 +01:00
Niels Lohmann
27b44cb17b Merge branch 'issue2615' of https://github.com/nlohmann/json into develop 2021-01-28 14:47:28 +01:00
Niels Lohmann
9f6b78ee5a 📝 add documentation 2021-01-27 14:34:10 +01:00
Niels Lohmann
5b0c804630 🐛 properly assign two labels to one test case #2596 2021-01-27 14:22:58 +01:00
Niels Lohmann
ffdeb77468 🚨 fix warnings #2615 2021-01-27 12:54:46 +01:00
Niels Lohmann
3b63a47270 🚨 suppress warning 2021-01-26 20:53:02 +01:00
Niels Lohmann
524eea5887 👌 remove unused template parameter 2021-01-26 17:49:15 +01:00
Niels Lohmann
74cc0ab470 ♻️ remove diagnostics_t class 2021-01-25 13:47:50 +01:00
Anthony VH
130382f2a9 Remove comment about GCC commit which didn't really relate to the code. 2021-01-24 20:02:24 +01:00
Niels Lohmann
e8dba10f53 add test 2021-01-24 17:45:48 +01:00
Niels Lohmann
c190a72f3d 👌 apply suggestion
Co-authored-by: Alexander Karzhenkov <karzhenkov@mail.ru>
2021-01-24 17:45:08 +01:00
Niels Lohmann
b83fe5dbf2 Merge pull request #2607 from nlohmann/issue1952
Add GDB pretty printer
2021-01-24 13:58:20 +01:00
Niels Lohmann
380a613f2b 🐛 fix bug in diagnostics_t 2021-01-23 20:58:59 +01:00
Anthony VH
848927ae90 Updated comments as requested. 2021-01-23 18:24:47 +01:00
Niels Lohmann
312a998873 🚸 add GDB pretty printer 2021-01-23 13:26:44 +01:00
Niels Lohmann
7b7da08fb6 📝 update documentation 2021-01-23 10:04:19 +01:00
Niels Lohmann
42218cac1b ⚗️ try 9 bytes 2021-01-21 22:01:09 +01:00
Niels Lohmann
d00ad33e46 📝 update documentation 2021-01-21 21:47:19 +01:00
Niels Lohmann
51ac6000d2 improve coverage 2021-01-21 13:36:23 +01:00
Niels Lohmann
d6ff059a90 👌 addressed review comments 2021-01-20 15:05:07 +01:00
Niels Lohmann
33379684b4 improve coverage 2021-01-17 22:52:40 +01:00
Niels Lohmann
5ec0980514 💚 fix build 2021-01-17 16:51:14 +01:00
Niels Lohmann
65107f7c9d 💚 fix build 2021-01-17 13:32:36 +01:00
Niels Lohmann
e23af7434d 🚨 fix warnings 2021-01-17 13:32:26 +01:00
Niels Lohmann
aeecc09ba1 add tests for diagnostics 2021-01-16 15:33:19 +01:00
Niels Lohmann
e9d641130d 🐛 proper JSON Pointer escape in diagnostic messages 2021-01-16 15:33:05 +01:00
Niels Lohmann
29f7abf57d 🚨 fix format-truncation warning #2572 2021-01-15 17:01:47 +01:00
Niels Lohmann
7633a21e6c 💚 fix build 2021-01-15 16:58:05 +01:00
Niels Lohmann
b0d8628c49 👌 address comments 2021-01-15 16:54:00 +01:00
Niels Lohmann
1a467a8c4e Merge branch 'develop' of https://github.com/nlohmann/json into diagnostics 2021-01-15 16:48:50 +01:00
Niels Lohmann
f8037660d0 ♻️ add iterator set_parent function 2021-01-14 22:43:52 +01:00
Niels Lohmann
92fa1d9582 Merge pull request #2582 from bl-ue/patch-1
readme: fix tilde character display
2021-01-14 22:11:33 +01:00
Niels Lohmann
0d1fb383b7 👌 address comment 2021-01-14 22:05:08 +01:00
bl-ue
c9d325b64b readme: fix tilde character display 2021-01-14 15:59:28 -05:00
Niels Lohmann
a77621687a 📝 fix comment 2021-01-14 21:56:19 +01:00
Niels Lohmann
b9d3aa4067 ♻️ split set_parent function 2021-01-14 21:55:49 +01:00
Niels Lohmann
10751d1189 Merge branch 'develop' of https://github.com/nlohmann/json into diagnostics 2021-01-14 21:38:48 +01:00
Anthony VH
6eb37e9b78 Only add conditional constexpr to get() for >= C++14 to work around errors on older compilers. 2021-01-14 12:41:30 +01:00
Anthony VH
d7c0f157c5 Merged from_json for pair and tuple to try to fix C2995 error in old MSVC versions. 2021-01-13 20:47:03 +01:00
Anthony VH
fbf6df63d9 Enable member function calls in trailing return decltype expressions for older compilers. 2021-01-13 00:12:51 +01:00
Anthony VH
fc8c584288 Regenerated single include. 2021-01-12 18:29:05 +01:00
Anthony VH
6ef1614fa9 Refactor json::get() to use priority_tag. 2021-01-12 18:28:47 +01:00
Anthony VH
6278f31d23 Simplify from_json overloads. 2021-01-12 18:28:29 +01:00
Anthony VH
6ebf274ca0 Add internal version of is_default_constructible to work around LWG 2367. 2021-01-12 18:28:00 +01:00
Anthony VH
672e8bfc1d Fixed std::pair trying to deserialize via array functions. 2021-01-11 18:16:15 +01:00
Niels Lohmann
14be8c69fe 💰 add sponsor 2021-01-11 08:00:49 +01:00
Niels Lohmann
ff57bdcc8b 🐛 fix invariants 2021-01-10 22:40:50 +01:00
Anthony VH
23f462b598 Reduced code duplication, renamed tag to identity_tag. 2021-01-10 19:23:32 +01:00
Niels Lohmann
9d0150c234 ♻️ simplify code 2021-01-10 15:04:14 +01:00
Niels Lohmann
1d6ba22f15 ♻️ simplify code 2021-01-10 14:10:59 +01:00
Niels Lohmann
a83404525e 🚨 fix warnings 2021-01-10 13:39:36 +01:00
Niels Lohmann
e160749003 ♻️ move diagnostic code in header 2021-01-09 19:21:18 +01:00
Anthony VH
1b113f73c2 Added extra tests to improve coverage. 2021-01-09 17:54:56 +01:00
Anthony VH
c0a8b45bbb Renamed template parameter and added some comments. 2021-01-09 17:45:56 +01:00
Anthony VH
1e825e4f92 Add support for deserialization of STL containers of non-default constructable types (fixes #2574). 2021-01-09 00:08:27 +01:00
Niels Lohmann
43cd5c8a4d 👌 fix constructor 2021-01-08 18:00:23 +01:00
Niels Lohmann
d4a91b7445 👌 clean operator[] 2021-01-08 11:29:28 +01:00
Niels Lohmann
e4af1ddb18 👌 fix operator[] 2021-01-08 11:21:41 +01:00
Niels Lohmann
04a0a07159 👌 fix move constructor and move assignment 2021-01-08 11:21:03 +01:00
Niels Lohmann
0617bd248d 👌 fix operator[] 2021-01-08 11:10:24 +01:00
Niels Lohmann
ddc3bb1992 👌 remove unnecessary assignment from destructor 2021-01-08 11:09:58 +01:00
Niels Lohmann
7cdf34b21e Merge branch 'develop' of https://github.com/nlohmann/json into diagnostics 2021-01-08 10:20:34 +01:00
Niels Lohmann
01f6b2e741 📄 update copyright year 2021-01-03 20:54:17 +01:00
Niels Lohmann
085d497bf7 📄 update copyright year 2021-01-03 20:28:06 +01:00
Niels Lohmann
294fa343d5 🐛 fix bug in move constructor 2021-01-03 20:06:32 +01:00
Niels Lohmann
ec0b1798bc 🚧 implement more parent relations 2021-01-02 21:36:11 +01:00
Niels Lohmann
7323a8eb4e 🚧 add tests 2021-01-02 16:13:04 +01:00
Niels Lohmann
09cd4ed125 🚧 fix preprocessor check 2021-01-02 14:10:40 +01:00
Niels Lohmann
c6e7fa21ed 🚧 fix preprocessor check 2021-01-02 13:58:05 +01:00
Niels Lohmann
ecaab32ef0 🚧 add switch for diagnostics 2021-01-02 13:45:00 +01:00
Niels Lohmann
7b047861b0 🚧 add diagnostics to exceptions 2021-01-02 13:44:41 +01:00
Niels Lohmann
a4d491e22d 🚧 better diagnostics 2021-01-01 17:23:10 +01:00
Niels Lohmann
68c3696382 Merge pull request #2560 from nlohmann/issue2324
Add switch to skip non-reproducible tests.
2020-12-31 14:35:45 +01:00
Niels Lohmann
1587acdb1d 📝 adjust wording 2020-12-31 14:34:37 +01:00
Niels Lohmann
be32cd0196 Merge branch 'develop' of https://github.com/nlohmann/json into issue2324 2020-12-31 14:33:09 +01:00
Niels Lohmann
00e3f69a26 ⬆️ update Doxyfile for doxygen 1.9.0 2020-12-30 20:31:16 +01:00
Niels Lohmann
581f92b601 Merge branch 'develop' of https://github.com/nlohmann/json into issue2324 2020-12-30 20:23:07 +01:00
Niels Lohmann
a8398a7151 Merge pull request #2550 from nlohmann/std_bytes
Allow parsing from std::byte containers
2020-12-30 08:33:52 +01:00
Niels Lohmann
fc7e181cbf ⚗️ fix string representation 2020-12-29 22:21:31 +01:00
Niels Lohmann
bdb2469c31 🚨 fix warnings 2020-12-29 21:36:30 +01:00
Niels Lohmann
c886646707 🚨 fix warning 2020-12-29 21:04:41 +01:00
Niels Lohmann
4402176df5 add regression test 2020-12-29 20:52:57 +01:00
Niels Lohmann
e4fc598466 ⚗️ add C++20 build 2020-12-29 20:45:56 +01:00
Niels Lohmann
77be4f6aaf ⚗️ add C++20 build 2020-12-29 20:32:07 +01:00
Niels Lohmann
91d7aa571f ⚗️ add C++20 build 2020-12-29 20:30:50 +01:00
Niels Lohmann
ca51dc62f2 ⚗️ try to use Clang 10 2020-12-29 20:21:43 +01:00
Niels Lohmann
433da31334 ⚗️ try to use GCC 10 2020-12-29 20:16:51 +01:00
Niels Lohmann
7b98df515f add regression test 2020-12-29 14:48:18 +01:00
Niels Lohmann
98b2152452 Merge branch 'develop' of https://github.com/nlohmann/json into std_bytes 2020-12-29 14:37:46 +01:00
Niels Lohmann
ff3863dc1d Merge pull request #2553 from jasujm/jasujm/input_adapter_custom_container
Fix compilation of input_adapter(container) in edge cases
2020-12-29 14:37:20 +01:00
Jaakko Moisio
467f622c65 Fix compilation of input_adapter(container) in edge cases
This fixes a compilation issue with the library if trying to use containers that
don't have non-member `begin()` and `end()` functions via ADL.

This patch extends the `using std::begin` and `using std::end` declarations to
also cover the return type deduction of the input_adapter() template
specialization for containers. The previous implementation only enabled the
detection of `std::begin()` and `std::end()` in the function body, making the
specialization unusable for container types that only have member `begin()` and
`end()` functions.

It is not typical to have `using` declarations in the namespace scope in a
header file. But a C++11 implementation can't rely on fully automatic return
type deduction, and needs to rely on ADL enabled helper templates. To prevent
the using declarations leaking, they are enclosed in another nested namespace.
2020-12-28 22:21:02 +01:00
Niels Lohmann
5dd06714b1 🐛 allow parsing from std::byte containers #2546 2020-12-28 11:31:21 +01:00
Niels Lohmann
dfedefb993 🚨 fix warnings 2020-12-26 17:56:16 +01:00
Alexander Karzhenkov
903b8a6e04 Build as "Debug" for coverage test 2020-12-26 21:14:16 +05:00
Niels Lohmann
f15d447522 🚨 fix warnings 2020-12-26 14:55:19 +01:00
Alexander Karzhenkov
10db9184a3 Configure Travis to build "Release" instead of "Debug" 2020-12-23 20:56:13 +05:00
Alexander Karzhenkov
7092890ff1 Properly select the build type for Travis 2020-12-22 18:24:00 +05:00
Niels Lohmann
f78d456075 Merge pull request #2540 from karzhenkov/disrupt-cxx17-tests
Travis doesn't run any tests in C++17 mode
2020-12-21 20:58:06 +01:00
Alexander Karzhenkov
9493f4beb1 Advance gcc library version for clang++-7 2020-12-20 23:50:28 +05:00
Alexander Karzhenkov
cd7acc1dc5 Include <string_view> in "nlohmann/json.hpp" when C++17 is used 2020-12-20 19:40:36 +05:00
Alexander Karzhenkov
39b8d6bd33 Restore intentionally disrupted C++17 tests 2020-12-20 12:43:35 +05:00
Alexander Karzhenkov
aae0e4959e Fix travis configuration to enable C++17 tests 2020-12-20 10:18:41 +05:00
Alexander Karzhenkov
8247a217bb Disrupt all C++17 tests to check if they are executed 2020-12-19 18:58:49 +05:00
Niels Lohmann
c3c574cf96 Merge pull request #2538 from YarikTH/feature/doctest_v2.4.3
Doctest is updated to v2.4.3
2020-12-18 22:10:42 +01:00
Krylov Yaroslav
a1772743a1 Doctest is updated to v2.4.3 2020-12-18 07:27:22 +03:00
Niels Lohmann
8593260044 Merge pull request #2537 from nlohmann/fix_warnings
Fix warnings
2020-12-17 21:48:16 +01:00
Niels Lohmann
c026e1a475 🚨 fix warnings 2020-12-16 21:44:35 +01:00
Niels Lohmann
af8c6e7aa9 Merge pull request #2533 from nlohmann/c++_future
Do not unconditionally redefine C++14 constructs
2020-12-16 20:54:09 +01:00
Niels Lohmann
5c1a5bc9c1 Merge pull request #2534 from nlohmann/clarify_license
Clarify license of is_complete_type implementation
2020-12-16 20:53:38 +01:00
Niels Lohmann
45810082d4 Merge pull request #2536 from nlohmann/shadowing
Fix a shadowing warning
2020-12-16 20:52:46 +01:00
Niels Lohmann
5cc5285fe8 🚨 fix shadowing warning 2020-12-15 22:15:36 +01:00
Niels Lohmann
94d177e09a 📄 clarify license 2020-12-14 14:58:59 +01:00
Niels Lohmann
467986fe98 ♻️ do not unconditionally redefine C++14 constructs 2020-12-14 14:31:27 +01:00
Niels Lohmann
2fc1f694ad Merge pull request #2514 from globberwops/develop
Add MAIN_PROJECT check for test and install options
2020-12-14 13:41:46 +01:00
Martin Stump
1771e9249f Remove comment on CTest inclusion
Co-authored-by: Niels Lohmann <niels.lohmann@gmail.com>
2020-12-14 10:59:38 +01:00
Niels Lohmann
85ffc85a29 🎨 amalgamate code 2020-12-14 10:38:49 +01:00
Martin Stump
ea759d0360 Compare to CMAKE_CURRENT_SOURCE_DIR for main project check 2020-12-13 20:34:51 +01:00
Niels Lohmann
97fe455ad5 Merge branch 'develop' of https://github.com/nlohmann/json into develop 2020-12-12 17:17:43 +01:00
Niels Lohmann
d028eff9e1 📦 add license to include.zip #2487 2020-12-12 17:17:38 +01:00
Niels Lohmann
be32cc4f5e Merge pull request #2525 from YarikTH/feature/doctest_v2.4.1
Doctest is updated to v2.4.1
2020-12-12 15:08:55 +01:00
Niels Lohmann
47c2004f7f Merge branch 'develop' of https://github.com/nlohmann/json into develop 2020-12-12 14:10:05 +01:00
Niels Lohmann
fc4040ce9d 🔨 clean up CI 2020-12-12 14:09:50 +01:00
Krylov Yaroslav
6390fca71a Doctest is updated to v2.4.1 2020-12-12 05:27:03 +03:00
Niels Lohmann
260be043ba Merge pull request #2406 from leozz37/develop
📝  add CPM.Cmake example
2020-12-11 14:47:18 +01:00
Niels Lohmann
5026acd70c Merge pull request #2444 from linev/fix_gcc48_warn
Change argument name "subtype" in byte_container_with_subtype
2020-12-11 13:46:41 +01:00
Sergey Linev
30dd0c0f09 Change underscore placement 2020-12-11 13:43:17 +01:00
Niels Lohmann
3ad6992f50 Merge pull request #2405 from karzhenkov/fix-json_ref-move
Fix move constructor of json_ref
2020-12-11 13:36:33 +01:00
Niels Lohmann
e3643aadf7 Merge pull request #2447 from jbzdarkid/develop
Add asserts to suppress C28020
2020-12-11 13:27:52 +01:00
Niels Lohmann
d9e2b191ad Merge pull request #2512 from YarikTH/issue2490
Ranged insert test section is added in unit-ordered_json.cpp
2020-12-11 13:21:33 +01:00
Martin Stump
790508887e Set MAIN_PROJECT=OFF initially 2020-12-09 12:39:44 +01:00
Martin Stump
5c589dd138 Add MAIN_PROJECT check for test and install options 2020-12-09 11:37:01 +01:00
Krylov Yaroslav
972c15f26e ordered_map::insert(InputIt first, InputIt last) is added 2020-12-07 20:15:41 +03:00
Krylov Yaroslav
5155cc2c48 Ranged insert test section is added in unit-ordered_json.cpp 2020-12-07 19:47:41 +03:00
Niels Lohmann
d8d8cbf6e0 🔨 fix site URL 2020-12-07 15:30:28 +01:00
Niels Lohmann
3322c9df6e 🔒 use HTTPS 2020-12-06 14:41:48 +01:00
jbzdarkid
cde29b3a11 Merge branch 'develop' of https://github.com/nlohmann/json into develop 2020-12-03 12:47:34 -08:00
Niels Lohmann
eaac918034 👷 remove clang9 CI 2020-12-02 08:58:45 +01:00
Joseph Blackman
9f45d314d5 Apply suggestions from code review
Co-authored-by: Niels Lohmann <niels.lohmann@gmail.com>
2020-11-24 11:02:58 -08:00
jbzdarkid
64ff1cf90d Add asserts to suppress C28020 2020-10-26 13:57:38 -07:00
Sergey Linev
71cb7d12da Change argument name "subtype" in byte_container_with_subtype
Fix warnings on older g++ 4.8

declaration of ‘subtype’ shadows a member of 'this'
2020-10-23 13:52:24 +02:00
Alexander Karzhenkov
42a9dc0bc3 Improve json_ref implementation 2020-09-27 10:45:21 +05:00
leozz37
b273f28dae 📝 add CPM.Cmake example 2020-09-26 19:16:03 -03:00
Niels Lohmann
fd7a9f6007 💰 add sponsor 2020-09-23 19:55:03 +02:00
Niels Lohmann
1bcabd9e83 📝 fix URLs to documentation 2020-09-02 22:25:32 +02:00
Niels Lohmann
1047d09b2a annotate non-reproducible tests #2324 2020-08-30 13:23:34 +02:00
Niels Lohmann
d9843fc9fc 📝 add note for Intel compilers #2346 2020-08-29 12:46:47 +02:00
Niels Lohmann
6030a11051 Merge pull request #2367 from nlohmann/hedley14
Update Hedley
2020-08-26 08:13:43 +02:00
Niels Lohmann
14f8be11ce Merge branch 'develop' of https://github.com/nlohmann/json into hedley14 2020-08-24 16:12:11 +02:00
Niels Lohmann
b9d76516a2 Merge pull request #2363 from nlohmann/issue2360
Fix and extend documentation of discarded values
2020-08-20 11:38:43 +02:00
Niels Lohmann
9d81eedb42 📝 fix and extend documentation of discarded values 2020-08-19 20:26:30 +02:00
Niels Lohmann
b386f4de0b 📝 fix and extend documentation of discarded values 2020-08-19 20:26:06 +02:00
Niels Lohmann
3be6ee3525 🚚 remove < from filename to fix Windows build 2020-08-16 21:39:40 +02:00
Niels Lohmann
fe507a7ee8 🚚 remove < from filename to fix Windows build 2020-08-16 21:36:21 +02:00
Niels Lohmann
6b04f05eba 📝 add more API documentation 2020-08-16 21:23:44 +02:00
Niels Lohmann
5c4cc20ed8 📝 add more API documentation 2020-08-16 20:48:10 +02:00
Niels Lohmann
a430d25f22 📝 add more API documentation 2020-08-16 14:48:48 +02:00
Niels Lohmann
fb5c20134f 📝 add more API documentation 2020-08-16 14:27:26 +02:00
Niels Lohmann
d8ed98a7af 📝 add more API documentation 2020-08-15 15:18:07 +02:00
Niels Lohmann
1ce0ed5a52 👷 ignore gh-pages branch in CircleCI 2020-08-14 13:58:55 +02:00
Niels Lohmann
0c2088823d 👷 ignore gh-pages branch in CircleCI 2020-08-14 13:56:42 +02:00
Niels Lohmann
fb8adb8e93 👷 ignore gh-pages branch in CircleCI 2020-08-14 13:52:42 +02:00
Niels Lohmann
f6c2947f1e 📝 add more API documentation 2020-08-14 13:47:54 +02:00
Niels Lohmann
0356e0c75b 📝 add more API documentation 2020-08-14 13:05:16 +02:00
Niels Lohmann
6674561d6a 📝 add more API documentation 2020-08-14 10:48:32 +02:00
Niels Lohmann
772f37c12d Merge pull request #2354 from rbuch/develop
Fix typos in documentation
2020-08-14 06:04:56 +02:00
Ronak Buch
67d822d951 Fix typos in documentation 2020-08-13 15:44:58 -04:00
Niels Lohmann
298420263b 🚚 remove quotes from filename to fix Windows build 2020-08-13 15:12:41 +02:00
Niels Lohmann
dd2fb3b454 📝 add more API documentation 2020-08-13 15:03:28 +02:00
Niels Lohmann
ce6adc447a 📝 add more API documentation 2020-08-13 14:04:08 +02:00
Niels Lohmann
d360fec216 📝 add offline pages for docset 2020-08-13 13:35:05 +02:00
Niels Lohmann
178125ff9b 📝 add docset 2020-08-13 10:52:20 +02:00
Niels Lohmann
8d0aa09ab5 Merge pull request #2352 from nlohmann/private_macro
Remove "#define private public" from tests
2020-08-13 10:06:59 +02:00
Niels Lohmann
874f49e945 📝 add more API documentation 2020-08-12 14:29:25 +02:00
Niels Lohmann
fe89049aee 📝 add more API documentation 2020-08-12 13:41:59 +02:00
Niels Lohmann
9d726c25d5 ♻️ remove "#define private public" 2020-08-12 13:30:06 +02:00
Niels Lohmann
411fc3249b ⬆️ Hedley 14 (dev branch) 2020-08-12 13:00:57 +02:00
Niels Lohmann
b888afe5f4 Merge pull request #2349 from nlohmann/issue2348
Remove -Wimplicit-fallthrough warning
2020-08-11 09:05:02 +02:00
Niels Lohmann
37ce871eeb Merge pull request #2347 from nlohmann/no_exceptions
Fix code to work without exceptions
2020-08-10 22:47:27 +02:00
Niels Lohmann
dd8cb2acc1 🚨 remove -Wimplicit-fallthrough warning #2348 2020-08-10 20:48:39 +02:00
Niels Lohmann
4080d0b1a4 add test to compile without exceptions 2020-08-10 09:48:11 +02:00
Niels Lohmann
1b28a58280 Merge remote-tracking branch 'origin/develop' into develop 2020-08-10 09:24:25 +02:00
Niels Lohmann
824d55bf26 📝 fix documentation #1668 2020-08-10 09:24:11 +02:00
Niels Lohmann
e030d26089 Merge pull request #2344 from ongjunjie/fix-cmake-overwrite-compiler
fix cmake script overwriting compiler path
2020-08-08 12:15:10 +02:00
Jun Jie
41a99567e0 fix cmake script overwriting compiler path
This fixes #2343
2020-08-07 16:08:02 +08:00
Niels Lohmann
db78ac1d77 Merge branch 'release/3.9.1' into develop 2020-08-06 13:49:29 +02:00
Niels Lohmann
350ff4f7ce Merge branch 'release/3.9.1' into master 2020-08-06 13:49:17 +02:00
Niels Lohmann
b3e5cb7f20 🔖 set version to 3.9.1 2020-08-06 13:45:29 +02:00
Niels Lohmann
f4155e4727 Merge pull request #2333 from nlohmann/fallthrough
Fix fallthrough warning
2020-08-01 15:32:21 +02:00
Niels Lohmann
8a54617240 Merge pull request #2332 from nlohmann/issue2330
Fix lexer to properly cope with repeated comments
2020-08-01 12:29:33 +02:00
Niels Lohmann
0326e4e2a6 🚨 fix fallthrough warning 2020-07-31 19:24:03 +02:00
Niels Lohmann
3888b1642a 🐛 fix lexer to properly cope with repeated comments #2330 2020-07-31 18:59:22 +02:00
Niels Lohmann
1da931730a Merge pull request #2327 from nlohmann/issue2326
Fix name of Homebrew formula in documentation
2020-07-31 08:00:08 +02:00
Niels Lohmann
1eedee5e4e Merge pull request #2319 from nlohmann/issue2315
Fix a bug due to missing overloads in ordered_map container
2020-07-31 07:59:18 +02:00
Niels Lohmann
501ad6fc59 📝 fix name of Homebrew formula #2326 2020-07-30 13:31:00 +02:00
Niels Lohmann
35daa5c00b Merge pull request #2320 from wx257osn2/fix-typo
fix typo
2020-07-30 12:27:16 +02:00
Niels Lohmann
2326abc547 ♻️ split regression tests 2020-07-30 12:13:05 +02:00
Niels Lohmann
f13af83a94 🐛 add more functions from std::map to nlohmann::ordered_map 2020-07-28 21:47:06 +02:00
I
2d3fe9d135 fix typo 2020-07-28 21:54:53 +09:00
Niels Lohmann
e590604822 🐛 fix a bug due to missing overloads in ordered_map container 2020-07-28 14:20:31 +02:00
Niels Lohmann
1b8efed06f Merge pull request #2318 from eli-schwartz/installfix
cmake: install pkg-config file relative to current_binary_dir
2020-07-28 13:25:04 +02:00
Niels Lohmann
7d01a9e875 Merge branch 'develop' into installfix 2020-07-28 13:24:54 +02:00
Niels Lohmann
b3da8b325a Merge pull request #2314 from xvitaly/fix-path
Fixed installation of pkg-config file on other than Ubuntu
2020-07-28 13:24:08 +02:00
Eli Schwartz
aa06a4761e cmake: install pkg-config file relative to current_binary_dir
When the testsuite is enabled, the "cmake_add_subdirectory" test
adds a second copy of the project into the build configuration, and the
project files are installed twice.

This becomes super problematic when it tries to install a file from
CMAKE_BINARY_DIR which is only available in CMAKE_CURRENT_BINARY_DIR
and bombs out with the following error message:

```
[...]
-- Installing: <DESTDIR>/usr/lib/cmake/nlohmann_json/nlohmann_jsonTargets.cmake
CMake Error at test/cmake_add_subdirectory/nlohmann_json/cmake_install.cmake:73 (file):
  file INSTALL cannot find
  "......./nlohmann-json/builddir/test/cmake_add_subdirectory/nlohmann_json.pc":
  No such file or directory.
Call Stack (most recent call first):
  test/cmake_add_subdirectory/cmake_install.cmake:47 (include)
  test/cmake_install.cmake:49 (include)
  cmake_install.cmake:94 (include)
```
2020-07-27 18:15:18 -04:00
Vitaly Zaitsev
8f9dc7eabe Fixed installation of pkg-config file on other than Ubuntu
distributions.

Signed-off-by: Vitaly Zaitsev <vitaly@easycoding.org>
2020-07-27 16:54:16 +02:00
Niels Lohmann
d34771cafc Merge branch 'release/3.9.0' into develop 2020-07-27 15:54:39 +02:00
Niels Lohmann
36e5ecf66d Merge branch 'release/3.9.0' 2020-07-27 15:54:24 +02:00
Niels Lohmann
e110667d21 🔖 set version to 3.9.0 2020-07-27 15:48:09 +02:00
Niels Lohmann
c006fc9bec 📝 add more documentation 2020-07-27 14:07:13 +02:00
Niels Lohmann
84c0c76849 🚧 add Clang-Tidy configuration 2020-07-27 09:15:57 +02:00
Niels Lohmann
2f05f5175c 🚧 add Clang-Tidy configuration 2020-07-26 22:38:14 +02:00
Niels Lohmann
1b06184f22 👥 update list of contributors 2020-07-26 20:50:04 +02:00
Niels Lohmann
84a899f511 👥 update list of contributors 2020-07-26 14:54:51 +02:00
Niels Lohmann
7a4841a42a 📝 add binary() function to SAX documentation 2020-07-26 14:40:46 +02:00
Niels Lohmann
bbcdf18ba5 🚚 move test utils header file 2020-07-26 14:07:34 +02:00
Niels Lohmann
e22cbacc41 🚨 fix warning 2020-07-26 12:12:17 +02:00
Niels Lohmann
67ed63b196 Merge pull request #2312 from nlohmann/docs
Update documentation
2020-07-26 10:06:01 +02:00
Niels Lohmann
a34070d36a fix test for meta() function 2020-07-25 22:28:14 +02:00
Niels Lohmann
9c75c7eace 🔧 clean generated XML files 2020-07-25 22:04:42 +02:00
Niels Lohmann
7bd6242f04 📝 add more documentation 2020-07-25 22:00:28 +02:00
Niels Lohmann
808aca41aa Merge pull request #2305 from AODQ/develop
fixes unused variable 'ex' for #2304
2020-07-25 21:51:54 +02:00
Niels Lohmann
63e7c40e35 Merge pull request #2297 from nlohmann/issue2286
Add support for high-precision numbers in UBJSON encoding
2020-07-25 21:50:53 +02:00
Niels Lohmann
1816aae862 Merge branch 'develop' of https://github.com/nlohmann/json into docs 2020-07-25 21:48:51 +02:00
Niels Lohmann
980f8c6f61 🔀 merge develop branch 2020-07-25 21:45:47 +02:00
Niels Lohmann
42f8708940 Merge branch 'develop' of https://github.com/nlohmann/json into issue2286
 Conflicts:
	single_include/nlohmann/json.hpp
2020-07-25 21:44:58 +02:00
Niels Lohmann
40b78d3847 Merge pull request #2308 from nlohmann/cbor_tags
Fix bug in CBOR tag handling
2020-07-25 19:43:11 +02:00
Niels Lohmann
fad14aabe7 📝 update output of meta function 2020-07-25 14:41:06 +02:00
Niels Lohmann
6e5be17b62 📝 add more documentation 2020-07-25 14:40:50 +02:00
Niels Lohmann
62f98b7537 Merge branch 'develop' of https://github.com/nlohmann/json into docs 2020-07-25 11:20:13 +02:00
Niels Lohmann
a1dbfcd736 Merge pull request #2306 from jwittbrodt/develop
added inline to NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE macro
2020-07-25 10:52:56 +02:00
Niels Lohmann
c00c3162b2 Merge branch 'develop' into develop 2020-07-25 10:52:42 +02:00
Niels Lohmann
448ceb2e12 Merge pull request #2303 from nlohmann/cleanup
Cleanup
2020-07-25 05:41:51 +02:00
aodq
15ec0fe150 change c-style cast to static_cast for #2304 2020-07-24 16:21:30 -04:00
Niels Lohmann
58167173a2 📝 add more documentation 2020-07-24 15:25:53 +02:00
Niels Lohmann
d8d499ce9b 📝 add more documentation 2020-07-24 14:35:52 +02:00
Niels Lohmann
480ad529e3 🐛 fix bug in CBOR tag handling 2020-07-24 14:18:39 +02:00
Niels Lohmann
a84370c61f 📝 add more documentation 2020-07-24 14:04:58 +02:00
Niels Lohmann
33662417c1 improve coverage 2020-07-24 09:32:03 +02:00
Jonas Wittbrodt
0f22ed0b5b added inline to DEFINE_TYPE macro 2020-07-23 19:24:21 +02:00
aodq
12885446d8 fixes unused variable 'ex' for #2304 2020-07-23 13:21:38 -04:00
Niels Lohmann
3c7dc635e7 🙈 extend ignore list 2020-07-23 14:19:57 +02:00
Niels Lohmann
27232455c8 📝 update documentation 2020-07-23 14:17:02 +02:00
Niels Lohmann
59cb7674be 📝 update documentation 2020-07-23 14:15:20 +02:00
Niels Lohmann
0cd120f7e1 🚨 fix UBSAN warning 2020-07-23 14:06:09 +02:00
Niels Lohmann
bba57cc4af 🚨 fix UBSAN warning 2020-07-23 14:02:49 +02:00
Niels Lohmann
e571c67c0d 🚨 fix implicit conversion warning when opening binary file 2020-07-23 14:02:12 +02:00
Niels Lohmann
43e07bb92d Merge pull request #2301 from nlohmann/regression2281
Add test with multiple translation units
2020-07-23 13:14:24 +02:00
Niels Lohmann
fb22233f34 🔊 add message if implicit conversions are switched off 2020-07-23 13:11:48 +02:00
Niels Lohmann
f9b71afebf 🚚 unify cmake build dir names 2020-07-23 13:02:53 +02:00
Niels Lohmann
8159091d8f 🔀 rename variable to avoid shadowing 2020-07-23 12:58:09 +02:00
Niels Lohmann
230dcfb7a3 🚨 add prefix to avoid shadowing 2020-07-23 12:57:52 +02:00
Niels Lohmann
b315fe484a 🔀 merge develop branch 2020-07-23 12:30:26 +02:00
Niels Lohmann
a33c3fdf25 Merge branch 'develop' of https://github.com/nlohmann/json into issue2286
 Conflicts:
	single_include/nlohmann/json.hpp
2020-07-23 12:30:07 +02:00
Niels Lohmann
88122467bd ♻️ pull code into function 2020-07-23 12:16:18 +02:00
Niels Lohmann
a048b72fe1 Merge pull request #1559 from theodelrieu/feat/explicit_conversion_operator
Feat/explicit conversion operator
2020-07-23 08:52:51 +02:00
Niels Lohmann
484029b51c Merge pull request #2299 from nlohmann/fix_warnings
Fix unused parameter
2020-07-22 18:43:33 +02:00
Niels Lohmann
a6d112ffbf add regression test for #2281 2020-07-22 13:39:40 +02:00
Niels Lohmann
2301bd1177 add regression test for #2281 2020-07-22 13:24:07 +02:00
Niels Lohmann
c4356c68e0 add regression test for #2281 2020-07-22 12:38:39 +02:00
Niels Lohmann
4d63252c6c add regression test for #2281 2020-07-22 12:23:58 +02:00
Niels Lohmann
a7c4c84d68 add regression test for #2281 2020-07-22 12:03:37 +02:00
Théo DELRIEU
797329315a add a CI job for explicit conversions on every os 2020-07-22 10:49:01 +02:00
Théo DELRIEU
74b446f5fd add a switch to enable implicit conversions (defaults to true)
wrap implicit conversions tests around the JSON_USE_IMPLICIT_CONVERSIONS
macro
2020-07-22 10:49:01 +02:00
Niels Lohmann
2cd10a7405 Merge pull request #2300 from nlohmann/gihub_actions
Merge Gitlab actions
2020-07-22 09:45:55 +02:00
Niels Lohmann
6bd38a2cb9 👷 merge Gitlab actions 2020-07-22 09:02:55 +02:00
Niels Lohmann
8b14c9b305 🚨 fix warnings 2020-07-21 23:00:56 +02:00
Niels Lohmann
3bb43ecd51 🔀 merge develop branch 2020-07-21 22:02:14 +02:00
Niels Lohmann
3249a4d821 Merge branch 'develop' of https://github.com/nlohmann/json into issue2286
 Conflicts:
	single_include/nlohmann/json.hpp
2020-07-21 22:01:32 +02:00
Niels Lohmann
96e9f66025 🔇 remove debug output 2020-07-21 22:01:15 +02:00
Niels Lohmann
8046754c15 🔊 add debug output to tests 2020-07-21 12:44:38 +02:00
Niels Lohmann
b1903fff1f 💚 fix build 2020-07-21 09:09:30 +02:00
Niels Lohmann
1339d6b683 🐛 add missing EOF check 2020-07-20 22:40:28 +02:00
Niels Lohmann
a9117828e1 🚨 fix warnings 2020-07-20 22:38:00 +02:00
Niels Lohmann
8344857764 Merge pull request #2287 from pfeatherstone/develop
Serialisation macros: increase upper bound on number of member variables
2020-07-20 21:35:55 +02:00
Niels Lohmann
4a5277d09d 📝 update documentation 2020-07-20 14:11:43 +02:00
Niels Lohmann
8aa6da61dc 🚧 support for UBJSON high-precision numbers #2286 2020-07-20 13:57:19 +02:00
Niels Lohmann
7360e09830 🚧 support for UBJSON high-precision numbers #2286 2020-07-20 13:12:20 +02:00
pf
35b899e988 [JSON] initialise all member variables. Maybe this will shut valgrind up. std::tie probably wasn't the problem initially 2020-07-20 10:51:43 +01:00
Niels Lohmann
7cf2fe149c 🚧 support for UBJSON high-precision numbers #2286 2020-07-20 09:42:37 +02:00
pf
7660ea12f6 [JSON] drop use of std::tie and std::tupe for operator== overload. valgrind and clang < 4 complain 2020-07-20 08:31:56 +01:00
Niels Lohmann
893eda8353 Merge pull request #2294 from jprochazk/develop
fix eof for get_binary and get_string
2020-07-20 08:02:03 +02:00
pf
678d310b85 [JSON] don't know why CHECK doesn't like "CHECK(obj1 == obj2)". So using a temporary bool. 2020-07-19 21:29:39 +01:00
pf
e83ddb185d [JSON] use CHECK from doctest 2020-07-19 21:25:27 +01:00
pf
254f0e3cee [JSON] CHECK in doctest only accepts std::string ? Use assert statement instead. Does the job 2020-07-19 18:22:16 +01:00
pf
578217eaa3 [JSON] doctest: need another section ? 2020-07-19 18:17:03 +01:00
pf
6d9b2040ab [JSON] as per Nlohmann's suggestion, added unit tests for the (de)serialisation macros 2020-07-19 18:12:13 +01:00
pf
75a6888d55 [JSON] since we no longer use a netbeans project for the (de)serialisation macro building code, can revert the changes made to the .gitignore file 2020-07-19 18:11:37 +01:00
pf
8f14aaa13f [JSON] as per Nlohmann's suggestion, moved the macro builder code to third_party directory 2020-07-19 18:10:08 +01:00
jprochazk
851315c878 add regression test 2020-07-19 18:35:58 +02:00
pf
f7374c9a8d Merge branch 'develop' of https://github.com/pfeatherstone/json into develop 2020-07-19 17:32:35 +01:00
pf
0a158ee830 [JSON] rough and ready code for generating (de)serialisation macros. Current upper bound on number of member variables is set to 64 2020-07-19 17:32:16 +01:00
pf
21bd6e971b [JSON] - dirty code for building intrusive and non-intrusive serialisation/deserialisation macros for custom types
- updated .gitignore file to ignore private netbeans project configurations
2020-07-19 17:26:56 +01:00
pf
0b744e1ed0 [JSON] - dirty code for building intrusive and non-intrusive serialisation/deserialisation macros for custom types
- used code to increase the upper bound on number of member variables to 64
2020-07-19 17:26:56 +01:00
pf
8a045713ed [JSON] - dirty code for building intrusive and non-intrusive serialisation/deserialisation macros for custom types
- used code to increase the upper bound on number of member variables to 64
2020-07-19 17:26:56 +01:00
pf
a575008c48 [JSON] - dirty code for building intrusive and non-intrusive serialisation/deserialisation macros for custom types
- updated .gitignore file to ignore "dist" and "build" directories in netbeans project
2020-07-19 17:26:56 +01:00
pf
5eb739a585 [JSON] - dirty code for building intrusive and non-intrusive serialisation/deserialisation macros for custom types
- netbeans project configurations
2020-07-19 17:26:56 +01:00
pf
68122fe0ed [JSON] dirty code for building intrusive and non-intrusive serialisation/deserialisation macros for custom types 2020-07-19 17:26:56 +01:00
Niels Lohmann
b1da58b76b Merge pull request #2282 from nlohmann/missing_sax_check
Add static assertion for missing binary function in SAX interface
2020-07-19 18:09:08 +02:00
Niels Lohmann
1fd6c5882a Merge pull request #2285 from T0b1-iOS/develop
add inline specifier for detail::combine
2020-07-19 17:55:51 +02:00
jprochazk
d371a5283c run amalgamate 2020-07-19 10:57:17 +02:00
jprochazk
ab25de05f7 fix: return -> result.push_back 2020-07-19 10:51:13 +02:00
jprochazk
a3a9d5665e add break to binary_reader::get_binary and get_string 2020-07-19 09:35:49 +02:00
pf
0d2d088b97 [JSON] - dirty code for building intrusive and non-intrusive serialisation/deserialisation macros for custom types
- updated .gitignore file to ignore private netbeans project configurations
2020-07-18 16:13:56 +01:00
pf
c122d8a94f [JSON] - dirty code for building intrusive and non-intrusive serialisation/deserialisation macros for custom types
- used code to increase the upper bound on number of member variables to 64
2020-07-18 16:12:49 +01:00
pf
4706d6e976 [JSON] - dirty code for building intrusive and non-intrusive serialisation/deserialisation macros for custom types
- used code to increase the upper bound on number of member variables to 64
2020-07-18 16:12:27 +01:00
pf
9afe757648 [JSON] - dirty code for building intrusive and non-intrusive serialisation/deserialisation macros for custom types
- updated .gitignore file to ignore "dist" and "build" directories in netbeans project
2020-07-18 16:11:34 +01:00
pf
8730af0788 [JSON] - dirty code for building intrusive and non-intrusive serialisation/deserialisation macros for custom types
- netbeans project configurations
2020-07-18 16:10:32 +01:00
pf
beb1fb48f0 [JSON] dirty code for building intrusive and non-intrusive serialisation/deserialisation macros for custom types 2020-07-18 16:08:29 +01:00
T0b1-iOS
88243b3f8c run amalgamate 2020-07-18 07:09:56 +02:00
T0b1-iOS
281349d0d6 add inline specifier for detail::combine 2020-07-18 06:28:11 +02:00
Niels Lohmann
43ab8a2357 Merge pull request #2279 from nlohmann/issue1818
Add test for target_include_directories
2020-07-18 06:12:57 +02:00
Niels Lohmann
7fc4b2901a 🚸 add static assertion for missing binary function in SAX interface 2020-07-17 20:41:11 +02:00
Niels Lohmann
2fd57d3ed1 add test for target_include_directories #1818 2020-07-17 14:26:22 +02:00
Niels Lohmann
a10d486e36 Merge pull request #2244 from matthewbauer/tag-cbor
Tag binary values in cbor if set
2020-07-17 14:05:48 +02:00
Niels Lohmann
e65cc9dccb Merge pull request #2274 from nlohmann/analyzers
Clean up maintainer Makefiles and fix some linter warnings
2020-07-17 14:01:19 +02:00
Niels Lohmann
548e7e54c9 Merge pull request #2273 from nlohmann/issue1968
Add option to ignore CBOR tags
2020-07-17 13:59:55 +02:00
Niels Lohmann
6023a7ccd9 Merge branch 'develop' into analyzers 2020-07-17 13:59:32 +02:00
Niels Lohmann
270f1ae482 Merge pull request #2269 from nlohmann/hash
Hash function without allocation
2020-07-17 13:57:47 +02:00
Niels Lohmann
d047b3d495 🚨 remove linter warning 2020-07-16 14:45:39 +02:00
Niels Lohmann
26196f25f6 🔥 remove test Makefile targets (all handled by CMake) 2020-07-16 13:38:25 +02:00
Niels Lohmann
3d60befde3 🔧 adjust analysis targets 2020-07-16 12:14:06 +02:00
Niels Lohmann
7f6ea47bdb 🔧 adjust analysis targets 2020-07-16 09:44:07 +02:00
Niels Lohmann
4c59d6aaef 🔥 remove leftover 2020-07-16 09:43:35 +02:00
Niels Lohmann
23c97f4aa5 Merge pull request #2268 from t-b/feature/add-clang-cl
Add ClangCL for MSVC
2020-07-16 07:40:58 +02:00
Niels Lohmann
93cdf05928 add tests 2020-07-15 14:23:22 +02:00
Niels Lohmann
01e196f6b6 Merge branch 'develop' of https://github.com/nlohmann/json into issue1968 2020-07-15 13:50:00 +02:00
Niels Lohmann
b821ed074f 💡 add documentation 2020-07-15 13:45:16 +02:00
Niels Lohmann
496ddd127c 💚 make test deterministic 2020-07-15 12:14:30 +02:00
Niels Lohmann
9449dfcc6a 💚 add test cases for hash 2020-07-15 09:27:01 +02:00
Thomas Braun
25a59b59f2 Github Actions: Add ClangCL on Windows
MS Visual Studio 2019 has builtin support for other compiler toolsets [1].

This commit adds support for compiling using LLVM/Clang 10 using Visual
Studio.

ClangCL pretends to be MSVC so the usual MSVC flags apply, see also [2].
For detecting if ClangCL is used, newer cmake verisons (>= 3.15) have
builtin support using CMAKE_CXX_COMPILER_FRONTEND_VARIANT [3], for older
ones a workaround is available using CMAKE_CXX_SIMULATE_ID [4].

[1]: https://devblogs.microsoft.com/cppblog/clang-llvm-support-in-visual-studio/
[2]: https://clang.llvm.org/docs/UsersManual.html#clang-cl
[3]: https://stackoverflow.com/a/10055571
[4]: 4fe34b2d29
2020-07-14 16:02:44 +02:00
Thomas Braun
6d7f8b3793 README.md: Remove trailing whitespace 2020-07-14 15:36:42 +02:00
Niels Lohmann
33b0bed7fe 💚 fix compilation 2020-07-14 14:34:55 +02:00
Niels Lohmann
5b229f4cce hash function without allocation 2020-07-14 14:31:19 +02:00
Niels Lohmann
1a521cbd36 Merge pull request #2264 from t-b/feature/use-proper-SED-in-makefile
Makefile: Always use SED variable
2020-07-14 14:07:33 +02:00
Niels Lohmann
8921e5e5db Merge pull request #2262 from nlohmann/more_ci
Add Xcode 12 CI
2020-07-13 21:04:57 +02:00
Thomas Braun
88adffdaba Makefile: Always use SED variable
We need to have a proper sed, even on MacOSX. So let's use the variable
introduced in 191aa0fd (🔧 overworked maintaner targets,
2019-03-28) in more places.
2020-07-13 14:44:40 +02:00
Niels Lohmann
938b867450 📝 add Xcode 12 to CI list 2020-07-12 21:45:00 +02:00
Niels Lohmann
3952739189 add CBOR tag handler #1968 2020-07-12 16:51:43 +02:00
Niels Lohmann
a244531627 ♻️ overwork Travis YAML 2020-07-12 15:33:16 +02:00
Niels Lohmann
cf741313b3 📝 add Clang on Windows to CI list 2020-07-12 15:31:17 +02:00
Niels Lohmann
e316f5c5b6 Merge pull request #2258 from nlohmann/issue2179
Add ordered_json specialization with ordered object keys
2020-07-12 13:11:23 +02:00
Niels Lohmann
486812904f Merge pull request #2259 from nlohmann/clang_windows
Make library work with Clang on Windows
2020-07-12 13:09:35 +02:00
Niels Lohmann
4d28694756 ♻️ replace further alternative operators 2020-07-11 19:28:58 +02:00
Niels Lohmann
738c83d6af 💚 add test for ordered_map 2020-07-11 19:24:32 +02:00
Niels Lohmann
8d295235a5 🔥 remove unused boolean_operators.hpp header 2020-07-11 19:20:44 +02:00
Niels Lohmann
6477b9b20a ♻️ replace further alternative operators 2020-07-11 14:09:06 +02:00
Niels Lohmann
7f923424b3 🔀 merge develop branch and resolve conflicts 2020-07-11 14:05:02 +02:00
Niels Lohmann
dc06f100be Merge branch 'develop' of https://github.com/nlohmann/json into clang_windows
 Conflicts:
	include/nlohmann/detail/input/binary_reader.hpp
	include/nlohmann/detail/input/json_sax.hpp
	include/nlohmann/detail/input/lexer.hpp
	include/nlohmann/detail/input/parser.hpp
	include/nlohmann/detail/json_pointer.hpp
	include/nlohmann/detail/output/serializer.hpp
	include/nlohmann/json.hpp
	single_include/nlohmann/json.hpp
2020-07-11 14:04:40 +02:00
Niels Lohmann
889f269a6c ♻️ replace further alternative operators 2020-07-11 13:51:25 +02:00
Niels Lohmann
b2240f7508 🏁 remove failing code for Clang/Windows 2020-07-11 13:46:04 +02:00
Niels Lohmann
609a0046c4 ♻️ replace further alternative operators 2020-07-11 13:39:14 +02:00
Niels Lohmann
3a80823ff8 🔀 merge develop branch and resolve conflicts 2020-07-11 13:21:13 +02:00
Niels Lohmann
9c21285133 Merge branch 'develop' of https://github.com/nlohmann/json into issue2179
 Conflicts:
	single_include/nlohmann/json.hpp
2020-07-11 13:20:16 +02:00
Niels Lohmann
5f146cb853 Merge pull request #2206 from gatopeich/issue2179
Simple ordered_json that works on all supported compilers
2020-07-11 13:15:40 +02:00
gatopeich
47d154dd49 Remove redundant comment 2020-07-11 00:34:12 +01:00
gatopeich
f9a1fec272 Remove redundant comment 2020-07-11 00:34:02 +01:00
Niels Lohmann
cbafed3494 ⬇️ require CMake 3.1 2020-07-10 12:53:48 +02:00
gatopeich
f62b4626be Removing comment about AllocatorType per review request 2020-07-09 21:12:14 +01:00
gatopeich
0eb7b0a991 Update README.md per review comments
Co-authored-by: Niels Lohmann <niels.lohmann@gmail.com>
2020-07-09 20:47:19 +01:00
Niels Lohmann
75d5d05993 Merge pull request #2253 from ericonr/pkgconf
Add pkg-config file
2020-07-09 20:42:42 +02:00
Niels Lohmann
4c7bd014d9 Merge pull request #2242 from nlohmann/issue2239
Make assert configurable via JSON_ASSERT
2020-07-09 15:13:12 +02:00
Niels Lohmann
d740622f96 📝 add documentation for macros 2020-07-09 13:23:33 +02:00
Érico Rolim
251fce819c README: add explanation on how to use pkg-config. 2020-07-09 03:59:53 -03:00
Palmer Dabbelt
c7d18c1625 cmake: Generate and install a pkg-config file.
The meson builds install a pkg-config file, but the cmake builds don't.
This adds a pkg-config file to the cmake builds that is functionally
equivalent to the one generated from meson.
2020-07-09 03:59:53 -03:00
Niels Lohmann
0306525cdb Merge pull request #2251 from nlohmann/fix_2181
Fix regression from #2181
2020-07-09 07:33:03 +02:00
Niels Lohmann
f774a32d2b fix test 2020-07-08 14:47:22 +02:00
Niels Lohmann
e3e9ccfc02 🚑 fix regression from #2181 2020-07-08 14:02:28 +02:00
Niels Lohmann
1b04092c5c fix test 2020-07-08 12:38:46 +02:00
Niels Lohmann
d019ddfcdb 👷 add code scanning 2020-07-08 12:25:53 +02:00
Matthew Bauer
dd08f7705f Add simple test for cbor byte 2020-07-06 18:06:10 -04:00
Niels Lohmann
28ef87370b 🚨 fix warning 2020-07-06 13:19:06 +02:00
Niels Lohmann
99fc6b16ab Merge branch 'develop' of https://github.com/nlohmann/json into issue2239 2020-07-06 12:52:59 +02:00
Niels Lohmann
ba8174041e add test case for JSON_ASSERT 2020-07-06 12:52:48 +02:00
Niels Lohmann
efcc826ecb 🚨 fix warning 2020-07-06 12:37:39 +02:00
Niels Lohmann
98b1c6d302 🚩 use JSON_ASSERT(x) instead of assert(x) 2020-07-06 12:22:31 +02:00
Niels Lohmann
b04dc055b2 Merge pull request #2233 from nlohmann/issue2175
Add specialization of get_to
2020-07-06 07:58:52 +02:00
Niels Lohmann
197c3d4fb0 Merge pull request #2232 from nlohmann/ignore_documentation
Refine documentation of error_handler parameter
2020-07-06 07:58:28 +02:00
Agustín F. Pozuelo
803c16e5af Clean-up unintended changes to whitespace 2020-07-03 10:26:05 +01:00
Agustín F. Pozuelo
25f5d75e6e Fix compilation for xcode 9.x 2020-07-03 01:44:18 +01:00
Agustín F. Pozuelo
93770467a1 Precisely 4 template arguments for the sake of clang 3.6 (?) 2020-07-03 01:28:54 +01:00
Agustín F. Pozuelo
0fc261f0f2 Make ordered_map compatible with GCC 5.5 2020-07-03 00:33:31 +01:00
Matthew Bauer
e54f03f73b Tag binary values in cbor if set
CBOR has tags, which work similarly to "subtype"s:

https://www.iana.org/assignments/cbor-tags/cbor-tags.xhtml

Unsure if this makes sense. Note that the subtype must just be one
byte wide.
2020-07-02 17:40:02 -04:00
Niels Lohmann
f59f4a2b61 💚 fix build 2020-06-30 19:55:40 +02:00
Niels Lohmann
c7e079cc98 🚑 add specialization of get_to #2175 2020-06-30 14:26:52 +02:00
Niels Lohmann
ad6eadeb70 📝 refine documentation of error_handler parameter 2020-06-30 13:59:43 +02:00
gatopeich
49f26a0250 Have 4 template parameters for ordered_map 2020-06-29 17:32:55 +01:00
Niels Lohmann
eb7376bb13 Merge pull request #2225 from nlohmann/issue2175
Simplify conversion from/to custom types
2020-06-29 14:41:09 +02:00
Niels Lohmann
470f7c0c68 📝 add documentation 2020-06-29 13:43:06 +02:00
Niels Lohmann
1b4ea8f89b Merge pull request #2224 from nlohmann/issue2221
Remove unused typedefs
2020-06-28 15:08:18 +02:00
Niels Lohmann
d7a2956b24 🔀 merge from develop 2020-06-27 13:16:20 +02:00
Niels Lohmann
ac3922c7aa Merge branch 'develop' of https://github.com/nlohmann/json into clang_windows
 Conflicts:
	include/nlohmann/detail/input/binary_reader.hpp
	include/nlohmann/detail/input/input_adapters.hpp
	include/nlohmann/detail/input/lexer.hpp
	include/nlohmann/detail/output/binary_writer.hpp
	include/nlohmann/json.hpp
	single_include/nlohmann/json.hpp
2020-06-27 13:14:48 +02:00
Niels Lohmann
fa9f4040df 🔥 remove unused typedefs #2221 2020-06-27 13:07:02 +02:00
Niels Lohmann
5ba0f65c34 🔧 remove feature request template 2020-06-27 12:55:41 +02:00
Niels Lohmann
aefa0b3e86 🔧 use Github discussions for questions 2020-06-27 12:54:42 +02:00
Niels Lohmann
3948b5b091 Merge pull request #2212 from nlohmann/comments
Add option to ignore comments in parse/accept functions
2020-06-27 12:44:51 +02:00
Niels Lohmann
1af4f5f360 Merge pull request #2222 from alexreinking/patch-1
Enable CMake policy CMP0077
2020-06-27 12:43:52 +02:00
Niels Lohmann
c5ee222982 Merge pull request #2211 from nlohmann/fix_warnings
Fix Clang-Tidy warnings
2020-06-27 12:34:18 +02:00
Alex Reinking
ec43371e07 Enable CMake policy CMP0077
Projects that import json via [FetchContent](https://cmake.org/cmake/help/latest/module/FetchContent.html) or `add_subdirectory` pointed at a git submodule may want to set `JSON_BuildTests` to "NO". However, this doesn't work without creating an identical `option()` in the importing project. Enabling CMP0077 in supported versions of CMake changes the behavior of `option()` to allow importing projects to set default values for the variables without touching the cache.

See the documentation for CMP0077 here: https://cmake.org/cmake/help/latest/policy/CMP0077.html
2020-06-26 11:47:36 -07:00
Niels Lohmann
635b9a0ae4 Merge pull request #2193 from dota17/issue#2059
Fix consistency in function `int_to_string()`
2020-06-24 11:46:48 +02:00
gatopeich
cf18ba2394 Test initialization with dup keys 2020-06-23 17:50:51 +01:00
gatopeich
08963d6826 Revert types.md 2020-06-23 15:48:02 +01:00
gatopeich
d08fca2bb9 Use const Key in ordered map
(forgotten in previous commit!)
2020-06-23 15:44:46 +01:00
gatopeich
5e7bdf1cab Roll-back to hard-coded object_t::value_type 2020-06-23 15:39:00 +01:00
gatopeich
fb8c11f25c Re-implement ordered_map::erase,
so that it can handle pair<const Key,...>
2020-06-23 15:01:20 +01:00
gatopeich
acd748e16f Use std::map default allocator as a placeholder
to extract the actual ObjectType::value_type
Still fails on older compilers (GCC <= 5.5)
2020-06-23 12:03:21 +01:00
gatopeich
49623a75ee Revert "Using ordered_json instead of fifo_map in test-regression"
This reverts commit 5fe3d3929a.
2020-06-23 11:30:52 +01:00
Niels Lohmann
8575fdf9ad Merge pull request #2181 from dota17/issue#1275
Fix issue#1275
2020-06-23 09:23:03 +02:00
Niels Lohmann
4bfe4add20 Merge pull request #2203 from t-b/use-unsigned-indizies-for-array-index-in-json-pointer
Use unsigned indizies for array index in json pointer
2020-06-23 09:16:01 +02:00
chenguoping
0ecf297457 drop std::enable_if part 2020-06-23 09:14:55 +08:00
Niels Lohmann
a9809f3381 🏁 revert change that breaks with MSVC 2020-06-22 23:02:28 +02:00
Niels Lohmann
8b3d2399a4 🚨 remove warnings 2020-06-22 22:32:21 +02:00
gatopeich
5fe3d3929a Using ordered_json instead of fifo_map in test-regression
This is more comprehensive and the "my_workaround_fifo_map" wrapper does not allow to infer value type as required in this branch.

This reverts commit 064a9c9212.
2020-06-22 19:10:35 +01:00
gatopeich
064a9c9212 Fix regression test 2020-06-22 18:59:19 +01:00
gatopeich
ddf0a45abb Use AllocatorType<ObjectType::value_type>,
instead of hard-coding it for std::map's value_type
2020-06-22 18:35:46 +01:00
chenguoping
aeef50709e to allow for ADL in int_to_string() function 2020-06-22 20:17:56 +08:00
Thomas Braun
ecbb2756fd json_pointer::array_index: Use unsigned values for the array index when parsing
The current code uses std::stoi to convert the input string to an int
array_index. This limits the maximum addressable array size to ~2GB on
most platforms.

But all callers immediately convert the result of array_index to
BasicJsonType::size_type.

So let's parse it as unsigned long long, which allows us to have as
big arrays as available memory. And also makes the call sites nicer to
read.

One complication arises on platforms where size_type is smaller than
unsigned long long. We need to bail out on these if the parsed array
index does not fit into size_type.
2020-06-22 13:42:55 +02:00
Niels Lohmann
65e8ee985a 🔨 clean up 2020-06-22 08:59:03 +02:00
gatopeich
15337b2cc3 Ignore allocator hardcoded to match std::map 2020-06-22 00:03:48 +01:00
gatopeich
27aaf6f845 Clean-up ordered_map declarations 2020-06-21 22:28:03 +01:00
Niels Lohmann
29ad2178c6 Merge pull request #2176 from gracicot/cpp20-support-no-std-fct-templ-specialization
C++20 support by removing swap specialization
2020-06-21 20:39:58 +02:00
Niels Lohmann
e22ce45065 🚸 improve diagnostics 2020-06-21 13:28:00 +02:00
Niels Lohmann
139a0258cc Merge branch 'develop' of https://github.com/nlohmann/json into comments 2020-06-21 12:40:21 +02:00
Niels Lohmann
8dade80499 Merge pull request #2202 from nlohmann/issue2189
Add option to not rely on Internet connectivity during test stage
2020-06-21 08:41:48 +02:00
Thomas Braun
f0e73163f2 json_pointer.hpp: Mention more exception in documentation
Forgotten in dcd3a6c6 (move the catch of std::invalid_argument into
array_index(), 2020-03-23).
2020-06-20 15:27:22 +02:00
Niels Lohmann
0fe9f23254 add macros from #2175 2020-06-20 14:11:37 +02:00
Niels Lohmann
6ee9e5f402 ⚗️ remove const from value type 2020-06-20 13:23:44 +02:00
Niels Lohmann
24992003d9 📝 add notes from #2189 2020-06-20 09:55:11 +02:00
Niels Lohmann
e4675887a6 Merge branch 'develop' of https://github.com/nlohmann/json into issue2189 2020-06-20 09:47:12 +02:00
Niels Lohmann
74c6e4295f Merge pull request #2201 from nlohmann/issue2196
Serialize floating-point numbers with 32 bit when possible (MessagePack)
2020-06-20 09:31:02 +02:00
Niels Lohmann
4fd0d02b6f 🚧 toward an ordered_json type 2020-06-19 15:27:05 +02:00
Niels Lohmann
b64002bbca ♻️ extract common code to function 2020-06-19 13:24:08 +02:00
Niels Lohmann
0585ecc56b add tests for comment skipping 2020-06-19 13:10:35 +02:00
Niels Lohmann
cd115cbc33 update test suite 2020-06-18 12:50:32 +02:00
Niels Lohmann
74520d8bb0 🚧 extend API 2020-06-17 22:03:14 +02:00
Niels Lohmann
88a37010d6 🐛 serialize 32-bit floating-point numbers as float 32 in MessagePack (0xCA) #2196 2020-06-17 21:14:23 +02:00
Niels Lohmann
e9bfcf7255 improve comment parsing 2020-06-17 14:59:47 +02:00
chenguoping
4a6c68c7eb drop new blank line 2020-06-17 20:44:31 +08:00
chenguoping
da8fa3535a drop testcase 2020-06-17 20:41:31 +08:00
Niels Lohmann
e86b3fae98 🔧 add label to tests that require a git checkout 2020-06-17 12:35:59 +02:00
chenguoping
f466919ec2 change test cases 2020-06-17 15:07:25 +08:00
chenguoping
8aaa4013a3 remove overload function, change default_value to rvalue 2020-06-17 15:05:28 +08:00
Niels Lohmann
4d96f4cf6a 🔧 overwork CMake files 2020-06-16 20:23:01 +02:00
Niels Lohmann
f4c4bab600 add option JSON_TestDataDirectory to set path with test data #2189 2020-06-16 12:55:36 +02:00
Niels Lohmann
b53c6e2f81 ignore comments 2020-06-16 12:28:59 +02:00
chenguoping
691fb0c57a fix issue#2059 2020-06-16 15:35:26 +08:00
Niels Lohmann
e7452d8778 Merge branch 'release/3.8.0' into develop 2020-06-14 17:44:18 +02:00
Niels Lohmann
fbec662afa Merge branch 'release/3.8.0' 2020-06-14 17:44:01 +02:00
Niels Lohmann
5f862710fe 🔖 set version to 3.8.0 2020-06-14 17:16:45 +02:00
Niels Lohmann
1ecb7884d1 👥 update contributor list 2020-06-14 15:22:08 +02:00
Niels Lohmann
c05bd90467 Merge pull request #2182 from tanuj208/develop
Improve parse_ubjson_fuzzer
2020-06-12 09:37:44 +02:00
Tanuj Garg
c3c5c03ea3 added fuzzing with different values to default argument in to_ubjson method 2020-06-10 20:50:25 +05:30
chenguoping
a3df26b771 add some test cases 2020-06-10 19:27:57 +08:00
chenguoping
71830be06d fix issue#1275 2020-06-10 19:27:28 +08:00
Niels Lohmann
27f5a6e827 🙈 ignore __pycache__ directory 2020-06-09 16:59:03 +02:00
Niels Lohmann
262d9cc67d 🚨 fix a maybe-uninitialized warning 2020-06-09 16:57:06 +02:00
Niels Lohmann
14881cf901 Merge pull request #2178 from nlohmann/input_adapter_tests
Add input adapter tests
2020-06-09 08:46:32 +02:00
Niels Lohmann
ae04426c85 🏁 fix for MSVC (see https://github.com/nlohmann/json/pull/2178#issuecomment-640622532) 2020-06-08 20:07:15 +02:00
Niels Lohmann
2cf16625ac add test for character types 2020-06-07 22:49:39 +02:00
Niels Lohmann
d4bc0c39af add test for character types 2020-06-07 22:47:54 +02:00
Niels Lohmann
6d73126ea9 🚨 fix warnings 2020-06-07 22:47:25 +02:00
Niels Lohmann
28048d8207 Merge branches 'develop' and 'mkdocs' of https://github.com/nlohmann/json into develop
 Conflicts:
	doc/examples/swap__binary_t.link
2020-06-07 21:02:08 +02:00
Niels Lohmann
eca5490b94 📝 add example link for swap function 2020-06-07 21:01:13 +02:00
Niels Lohmann
8c1d26e186 📝 add documentation and example for accept function 2020-06-07 20:59:43 +02:00
Niels Lohmann
543dcee3a7 Merge pull request #2174 from nlohmann/fix_warnings
Fix warnings
2020-06-07 20:35:05 +02:00
Niels Lohmann
907803189b 🏁 fix MSVC 2015 compilation 2020-06-07 12:51:33 +02:00
Niels Lohmann
e6a7e7a16a 🚑 hotfix for #2177 2020-06-07 12:41:36 +02:00
Guillaume Racicot
82fbbeeac5 Adapted unit tests to use ADL calls for swap like the new swappable concept 2020-06-06 12:28:52 -04:00
Guillaume Racicot
225c8f150a Disable std::swap specialization in C++20 and added a friend swap function 2020-06-06 11:36:39 -04:00
Niels Lohmann
bf2e714e96 🚨 fix warnings 2020-06-06 14:30:17 +02:00
Niels Lohmann
7444c7fa25 Merge pull request #2145 from FrancoisChabot/1813-user-input
Fix Issue#1813: user defined input adapters
2020-06-05 14:30:39 +02:00
Niels Lohmann
dd7e25927f 🚨 fix warning 2020-06-05 08:27:15 +02:00
Niels Lohmann
5fe6b83c26 Merge pull request #2158 from dota17/output_adapter
Fix PR#1006
2020-06-05 08:25:19 +02:00
chenguoping
ad2b4ff23b recover original blank line 2020-06-05 14:23:00 +08:00
chenguoping
0f67c5849f undo: remove comment 2020-06-05 10:09:15 +08:00
Niels Lohmann
2df5f107a9 📝 add page on parsing and exceptions 2020-06-04 14:01:57 +02:00
Niels Lohmann
32bda1a7af Merge branches 'develop' and 'mkdocs' of https://github.com/nlohmann/json into mkdocs 2020-06-04 13:07:20 +02:00
Niels Lohmann
24e8562664 👷 remove Clang 8 2020-06-04 12:48:03 +02:00
Niels Lohmann
a53e3a5443 👷 try Clang 8 2020-06-04 12:34:56 +02:00
Niels Lohmann
dc323314d5 👷 try Clang 10 2020-06-04 12:29:53 +02:00
Niels Lohmann
402c34c526 👷 try Clang 10 2020-06-04 12:27:37 +02:00
Niels Lohmann
65c4b07451 🎨 replace alternative operators (and, not, or) 2020-06-03 21:22:07 +02:00
Niels Lohmann
0498202a03 🎨 replace alternative operators (and, not, or) 2020-06-03 14:20:36 +02:00
Niels Lohmann
4f04ea1bef Merge branches 'clang_windows' and 'develop' of https://github.com/nlohmann/json into clang_windows 2020-06-03 14:01:18 +02:00
Niels Lohmann
9212590764 👥 update contributor list 2020-06-03 13:56:01 +02:00
Niels Lohmann
9708b1e9c3 🔥 remove Code Inspector 2020-06-03 13:49:46 +02:00
Niels Lohmann
68fd772fdf 👷 add Code Inspector via GitHub Action 2020-06-03 13:44:33 +02:00
Niels Lohmann
9bc2a7fa25 👷 add Code Inspector via GitHub Action 2020-06-03 13:39:56 +02:00
Niels Lohmann
c24218afe8 Merge remote-tracking branch 'origin/develop' into develop 2020-06-03 13:38:15 +02:00
Niels Lohmann
2c4be7d65c Merge pull request #2152 from TotalCaesar659/patch-1
Update URLs to HTTPS
2020-06-03 12:31:33 +02:00
Niels Lohmann
2ad847f21b 🔨 fix doxygen link 2020-06-03 12:30:42 +02:00
Niels Lohmann
fdf5a63dfd 🔨 fix Doxygen link 2020-06-03 12:30:10 +02:00
Niels Lohmann
309acb445a Merge pull request #2153 from dota17/issue#1972
Fix issue#1972
2020-06-03 12:26:17 +02:00
chenguoping
eca4b8785c fix test case in PR#1006 2020-06-02 15:44:26 +08:00
chenguoping
fff1499963 add comment about PR#1006 2020-06-02 15:43:57 +08:00
chenguoping
8cd39578e3 add test case 2020-06-01 11:34:03 +08:00
Niels Lohmann
5ea205f570 👷 install clang 2020-05-30 18:17:54 +02:00
Niels Lohmann
5f10d5d156 👷 install clang 2020-05-30 18:15:13 +02:00
Niels Lohmann
7c0c522b96 👷 install clang 2020-05-30 18:11:54 +02:00
Niels Lohmann
522ec5d7bd 👷 install clang 2020-05-30 18:06:52 +02:00
Niels Lohmann
7e5c2a480a 👷 install clang 2020-05-30 18:04:07 +02:00
Niels Lohmann
9c971c2d2f 👷 install clang 2020-05-30 17:40:27 +02:00
Niels Lohmann
4ba8c95794 👷 install clang 2020-05-30 13:41:18 +02:00
Niels Lohmann
fbd3e8f677 👷 install clang 2020-05-30 13:35:19 +02:00
Niels Lohmann
0309025b45 👷 set full path 2020-05-30 13:28:44 +02:00
Niels Lohmann
9191926fff 👷 use Makefiles 2020-05-30 13:23:13 +02:00
Niels Lohmann
42ef2a5adb 👷 use Clang compiler 2020-05-30 13:15:56 +02:00
Niels Lohmann
2182935397 👷 add Clang/Windows step 2020-05-30 13:07:23 +02:00
chenguoping
4350c5ed97 fix bug in issue#1972 2020-05-30 17:15:56 +08:00
TotalCaesar659
0aa13599f0 Update URLs to HTTPS 2020-05-30 06:02:25 +03:00
Francois Chabot
0da131d717 minor readme correction 2020-05-28 17:12:26 -04:00
Francois Chabot
b715a70673 changed macro order to satisfy clang 2020-05-28 12:26:29 -04:00
Francois Chabot
7646253940 fix inconsistent fwd declaration 2020-05-28 12:20:02 -04:00
Francois Chabot
ce3143a038 use correct deprecation macro 2020-05-28 12:16:10 -04:00
Francois Chabot
d575534471 brought back the from_*(ptr, len) syntax with a deprecation warning 2020-05-28 12:13:43 -04:00
Francois Chabot
248f310215 cleaned up custom iterator example 2020-05-28 10:14:55 -04:00
Francois Chabot
897061c434 amalgamate 2020-05-28 10:11:19 -04:00
Francois Chabot
7ceb06baac Merge branch '1813-user-input' of https://github.com/FrancoisChabot/json into 1813-user-input 2020-05-28 09:30:07 -04:00
Francois Chabot
dcf6175978 use the correct convention for boolean operators 2020-05-28 09:29:38 -04:00
Niels Lohmann
23c8ab95da 👥 update contributor list 2020-05-28 14:24:08 +02:00
Niels Lohmann
53ef076715 🔧 add more warning flags from GCC 10 2020-05-28 13:46:56 +02:00
Niels Lohmann
2edb5cb999 👷 fix -DJSON_BuildTests=On parameter placement 2020-05-28 13:46:47 +02:00
Niels Lohmann
61832afe15 Merge pull request #2144 from XyFreak/gcc10_type_limits
Fix issue#1939: Cast character to unsigned for comparison
2020-05-28 12:59:57 +02:00
Niels Lohmann
5ff4d7b7ff Merge branch 'develop' of https://github.com/nlohmann/json into develop 2020-05-28 12:54:13 +02:00
Niels Lohmann
fcda998ee2 🔧 add more warning flags from GCC 10 2020-05-28 12:53:22 +02:00
Francois Chabot
d3caf93ab0 Merge branch 'develop' into 1813-user-input 2020-05-28 03:40:34 -04:00
Francois Chabot
bfcd32c099 removed clang-format 2020-05-28 03:16:24 -04:00
Francois Chabot
3a91a05db6 added custom input to readme 2020-05-28 03:13:39 -04:00
Francois Chabot
a4f1cf4d00 better parse documentation 2020-05-28 02:50:58 -04:00
Francois Chabot
76b49f9ee6 misc formatting fixes 2020-05-28 02:29:53 -04:00
Niels Lohmann
9ec0e4c25b Merge pull request #2140 from nlohmann/issue1715
Respect allow_exceptions=false for binary formats
2020-05-28 07:52:26 +02:00
Niels Lohmann
a01759af0f Merge pull request #2143 from quentin-dev/develop
Fix issue#2142: readme: fix typo in CMake FetchContent example
2020-05-28 07:50:27 +02:00
Francois Chabot
377995f495 forcefully exclude arrays from being interpreted as pointers 2020-05-27 18:21:38 -04:00
Francois Chabot
b9416a26aa correct ADL lookup of arrays on Mac and Windows 2020-05-27 13:21:23 -04:00
Francois Chabot
f1969e60a3 reamalgamate 2020-05-27 12:56:26 -04:00
Francois Chabot
5684d9a498 unified input API 2020-05-27 12:40:04 -04:00
Quentin Barbarat
e44418ea26 readme: fix typo in CMake FetchContent example 2020-05-27 13:51:13 +02:00
Niels Lohmann
bb9619ef8b 📝 request more details in question template 2020-05-27 13:22:34 +02:00
Niels Lohmann
325e8ab8ab 🔧 explicitly switch on tests in CI 2020-05-27 13:22:14 +02:00
Tobias Kux
23051df2c7 Cast character to unsigned for comparison 2020-05-27 13:15:31 +02:00
Niels Lohmann
ed5c28d00c 👥 update contributor list 2020-05-27 13:07:24 +02:00
Niels Lohmann
d70d06ae41 Merge pull request #2137 from dota17/MSC_VER
Fix issue 2112
2020-05-27 08:49:19 +02:00
Niels Lohmann
e3d9b3d755 📝 add documentation of parser callbacks 2020-05-26 14:16:13 +02:00
Niels Lohmann
ace594da6a Merge branches 'develop' and 'mkdocs' of https://github.com/nlohmann/json into mkdocs 2020-05-26 13:17:55 +02:00
Niels Lohmann
3c60a66c4c Merge pull request #2104 from dota17/issue#2086
Fix issue#2086: disallow json::value_t type parameter in value()
2020-05-26 13:15:06 +02:00
Niels Lohmann
27fe50dc92 📝 add example for contains #2133
Closes #2133.
2020-05-26 12:46:04 +02:00
Niels Lohmann
25aab7ee41 Merge pull request #2136 from aokellermann/CircleCI_GCC_BleedingEdge
Add bleeding edge GCC to CI
2020-05-26 12:39:42 +02:00
chenguoping
eb50fbf926 fix issue 2112 2020-05-26 16:43:16 +08:00
Antony Kellermann
49000cd77d Update documentation to reflect addition of Arch Linux CI testing. 2020-05-25 20:46:39 -04:00
Antony Kellermann
5a72cfa0c3 Add base and base-devel to list of arch linux programs to install. 2020-05-25 20:43:15 -04:00
Antony Kellermann
1d57ddd2d4 Add -y flag to pacman to sync repos. 2020-05-25 20:24:54 -04:00
Antony Kellermann
41a84b1202 Add workflows for CircleCI so that build_stable and build_bleeding_edge jobs can run concurrently. 2020-05-25 20:17:02 -04:00
Antony Kellermann
eff2f51071 Add build_bleeding_edge job to CircleCI, mimicking the original job except using the latest Arch Linux docker image. 2020-05-25 20:14:49 -04:00
Antony Kellermann
bf4a090075 Rename build job to build_stable to be more descriptive. 2020-05-25 20:12:54 -04:00
Niels Lohmann
413df0fd88 📝 add more content to iterator page 2020-05-25 14:03:11 +02:00
Niels Lohmann
95a3c76643 📝 make examples collapsible 2020-05-24 22:45:38 +02:00
Niels Lohmann
ddf92606ab 📝 add PlantUML 2020-05-24 21:05:35 +02:00
Niels Lohmann
3400af21cd 📝 add release page 2020-05-24 13:40:43 +02:00
Niels Lohmann
a8f0cd15df 📝 add mkdocs 2020-05-24 13:03:04 +02:00
Niels Lohmann
c92a696852 📝 update documentation 2020-05-22 18:21:37 +02:00
Niels Lohmann
88292d9499 🚨 remove redundant assertions 2020-05-22 14:19:07 +02:00
Niels Lohmann
225fa58f16 🚧 add fix from #1715 2020-05-20 22:20:40 +02:00
Niels Lohmann
a82c80e9af Merge pull request #2125 from nlohmann/binary_type
Clean up implementation of binary type
2020-05-20 18:58:29 +02:00
Niels Lohmann
ae29456b3f 🚸 overwork report templates 2020-05-20 18:57:21 +02:00
Niels Lohmann
a861bdb81f Merge pull request #2121 from gistrec/fix_compilation_error_msvc
Fixed a compilation error in MSVC
2020-05-19 13:55:37 +02:00
Niels Lohmann
4d39644bd0 💚 fix build 2020-05-19 13:45:52 +02:00
Niels Lohmann
21b1680ea1 🚚 rename binary_array() to binary() 2020-05-19 13:30:22 +02:00
Niels Lohmann
86b053e916 Merge branches 'binary_type' and 'develop' of https://github.com/nlohmann/json into binary_type 2020-05-19 13:10:35 +02:00
Niels Lohmann
952a87a4f4 🚚 move byte container outside detail namespace 2020-05-19 13:08:18 +02:00
Niels Lohmann
79347b484b improve test coverage 2020-05-19 12:40:32 +02:00
Niels Lohmann
5cfa8a586e 👷 run workflows on pull requests 2020-05-18 14:01:54 +02:00
Niels Lohmann
b7ff40029a 💥 change serialization of binary values 2020-05-18 13:53:20 +02:00
Niels Lohmann
9eb19bcc27 add more tests for binary type 2020-05-18 12:33:26 +02:00
gistrec
9e765f5aed Fixed std::numeric_limit::max() call 2020-05-18 10:25:55 +00:00
gistrec
3f0cf26f7a changes to the single header were applied 2020-05-18 10:17:45 +00:00
gistrec
454480f581 fixed a compilation error in MSVC 2020-05-18 14:57:04 +07:00
Niels Lohmann
5dec7166ea Merge branches 'binary_type' and 'develop' of https://github.com/nlohmann/json into binary_type 2020-05-18 09:13:22 +02:00
Niels Lohmann
16d78a82e0 👷 add link to GitHub workflows 2020-05-18 09:12:18 +02:00
Niels Lohmann
c237aa3a68 Merge pull request #2119 from nlohmann/release_cleanup
Overwork CI
2020-05-18 09:07:36 +02:00
Niels Lohmann
904642f261 ♻️ rename internal_binary_t with binary_t 2020-05-17 22:50:27 +02:00
Niels Lohmann
1ce8a5be87 Merge branch 'develop' of https://github.com/nlohmann/json into release_cleanup 2020-05-17 14:11:49 +02:00
Niels Lohmann
dead99eb0e 🔨 overwork binary subtypes 2020-05-17 13:51:59 +02:00
Niels Lohmann
ab6e76dd05 Merge branches 'binary_type' and 'develop' of https://github.com/nlohmann/json into binary_type 2020-05-17 12:27:58 +02:00
Niels Lohmann
3799b3f8dd Merge pull request #2116 from nlohmann/issue2113
Fix warnings from Clang 10 and GCC 9
2020-05-17 12:19:06 +02:00
Niels Lohmann
6154d50a9f Merge pull request #2115 from nlohmann/issue2089
Do not include <ciso646> when using C++17
2020-05-17 12:17:17 +02:00
Niels Lohmann
28e20bd9e4 🚨 fix warnings #2113 2020-05-16 14:26:17 +02:00
Niels Lohmann
ad32f576bd Merge branch 'develop' of https://github.com/nlohmann/json into release_cleanup 2020-05-16 13:22:23 +02:00
Niels Lohmann
c0cf67ead3 Merge branch 'develop' of https://github.com/nlohmann/json into binary_type 2020-05-16 12:58:13 +02:00
Niels Lohmann
f40a9f876a Merge pull request #2044 from dota17/issue#1719
Fix issue#1719
2020-05-16 12:57:00 +02:00
Niels Lohmann
3ed059f6ff revert faulty changes 2020-05-16 12:56:18 +02:00
Niels Lohmann
bc1886fb60 ♻️ refine interface of wrapped_binary_t 2020-05-15 23:21:49 +02:00
Niels Lohmann
a452e8a0a1 💚 fix GCC 4.9 compilation 2020-05-15 22:38:18 +02:00
chenguoping
ed9c205b5d add somes test cases 2020-05-15 21:48:29 +08:00
chenguoping
5dd27f1a9f compare against max float and min float before converting 2020-05-15 21:47:59 +08:00
Niels Lohmann
daf2d296dd ♻️ move wrapped binary type to separate file 2020-05-15 14:12:32 +02:00
chenguoping
779a0ec7df update 2020-05-15 17:35:43 +08:00
Niels Lohmann
bcf4f3ce9a 📝 add warning for items() on temporary objects #2040 2020-05-14 19:06:48 +02:00
Niels Lohmann
fc267af909 📝 update CI list 2020-05-14 17:53:00 +02:00
chenguoping
e175150f5b fix UBSAN 2020-05-14 20:54:47 +08:00
Niels Lohmann
f4cc729054 🔊 add compiler version output 2020-05-14 13:37:59 +02:00
Niels Lohmann
e91236e6d3 🔊 add compiler version output 2020-05-14 13:33:10 +02:00
chenguoping
8f5b5c7469 use json_test_data version 2.0.0 2020-05-14 15:11:38 +08:00
chenguoping
47c6570470 Add some test cases about to_cbor() 2020-05-14 15:11:38 +08:00
chenguoping
44fe284f9d Enhace to_cbor() to support +/-Infinity, NaN, and single-precision float 2020-05-14 15:10:44 +08:00
Niels Lohmann
c4c23f34c5 Merge branch 'develop' of https://github.com/nlohmann/json into release_cleanup 2020-05-14 07:55:09 +02:00
Niels Lohmann
33ae93beed 📝 update CI list 2020-05-14 07:55:01 +02:00
Niels Lohmann
0857140839 Merge pull request #1950 from FrancoisChabot/issues/1457
templated input adapters
2020-05-14 07:52:02 +02:00
chenguoping
cdf5327ace Fix issue#2086 2020-05-14 12:44:30 +08:00
Niels Lohmann
d7b032f565 add tests to improve coverage 2020-05-13 21:28:43 +02:00
Niels Lohmann
ec68bb3387 📝 update CI list 2020-05-13 20:18:56 +02:00
Niels Lohmann
f6f350a5c7 🔊 add operating system output 2020-05-13 14:25:51 +02:00
Niels Lohmann
a4266bbb7d Merge branch 'develop' into issues/1457 2020-05-13 12:48:46 +02:00
Niels Lohmann
855d25a76c Merge branches 'develop' and 'release_cleanup' of https://github.com/nlohmann/json into release_cleanup 2020-05-13 12:41:22 +02:00
Niels Lohmann
a414e35971 🚨 add newline to end of file 2020-05-13 12:35:11 +02:00
Niels Lohmann
def8aeb141 Merge branches 'develop' and 'release_cleanup' of https://github.com/nlohmann/json into release_cleanup 2020-05-13 07:57:03 +02:00
Niels Lohmann
9265ca7a08 Merge pull request #2099 from nlohmann/issue2082
Add tests for binary values
2020-05-13 07:56:11 +02:00
Niels Lohmann
6778ad8b0a 📝 update year 2020-05-12 22:26:55 +02:00
Niels Lohmann
7dbe5cf904 📝 update badges 2020-05-12 21:43:33 +02:00
Niels Lohmann
94115a302e 🏁 exclude slow Unicode test 2020-05-12 21:22:47 +02:00
Niels Lohmann
8c44c7b6de 🏁 set Windows CI to Release mode 2020-05-12 21:18:08 +02:00
Niels Lohmann
44a2158b18 👷 make debug build 2020-05-12 20:51:45 +02:00
Niels Lohmann
77e0ba8750 👷 parallelize builds 2020-05-12 20:45:18 +02:00
Niels Lohmann
6e59c8301a 👷 simplify CMake invocations 2020-05-12 20:37:50 +02:00
Niels Lohmann
ab02b08296 👷 rename workflows 2020-05-12 20:30:11 +02:00
Niels Lohmann
cd76f59af6 👷 add more GitHub actions workflows 2020-05-12 20:26:17 +02:00
Niels Lohmann
b1c1eb145e 🔧 fix maintainer target 2020-05-12 19:36:33 +02:00
Niels Lohmann
abeb80411b 📝 fix example 2020-05-12 16:28:26 +02:00
Niels Lohmann
52f5f3d29f 📝 fix example 2020-05-12 16:27:55 +02:00
Niels Lohmann
e9a845f08a 📝 fix example output 2020-05-12 16:13:33 +02:00
Niels Lohmann
8e0ae9b46f ⬆️ update Doxyfile 2020-05-12 14:37:35 +02:00
Niels Lohmann
afc30a14a7 🔧 set Wandbox script to use HTTPS 2020-05-12 14:37:22 +02:00
Niels Lohmann
6014419818 Merge branches 'develop' and 'issue2082' of https://github.com/nlohmann/json into issue2082 2020-05-12 12:28:34 +02:00
Niels Lohmann
1de30bc611 Merge pull request #2100 from nlohmann/fix_coveralls
Fix Coveralls integration
2020-05-12 12:26:22 +02:00
Niels Lohmann
76c01501f7 🔧 fix pedantic maintainer targets 2020-05-11 20:03:13 +02:00
Niels Lohmann
66dfa22de2 ⚗️ try to fix SSL issue 2020-05-11 14:24:38 +02:00
Niels Lohmann
0ad595709d ⚗️ try to fix SSL issue 2020-05-11 13:40:43 +02:00
Niels Lohmann
cbb2d4e4d8 ⚗️ try to fix SSL issue 2020-05-11 13:29:40 +02:00
Niels Lohmann
8389c1961b ⚗️ try to fix SSL issue 2020-05-11 13:19:22 +02:00
Niels Lohmann
19b21e61e5 ⚗️ try to fix SSL issue 2020-05-11 13:05:53 +02:00
Niels Lohmann
697305819f ⚗️ try to fix SSL issue 2020-05-11 12:37:24 +02:00
Niels Lohmann
18cbcc4135 ⚗️ try to fix SSL issue 2020-05-11 12:25:41 +02:00
Niels Lohmann
a3a803a389 📝 add FOSSA status badge 2020-05-10 13:49:26 +02:00
Niels Lohmann
5c42847011 add tests for binary type 2020-05-10 13:23:18 +02:00
Niels Lohmann
fff46ea98c add tests for binary type 2020-05-09 23:18:12 +02:00
Niels Lohmann
34430994bf add tests for binary type 2020-05-09 14:16:57 +02:00
Niels Lohmann
b036ace235 🐛 fix bug in binary constructor 2020-05-09 14:16:49 +02:00
Niels Lohmann
3fa94f0755 add tests for binary type 2020-05-09 13:46:24 +02:00
Niels Lohmann
f0c6ab4d3b 🐛 fix bug in SAX callback parser 2020-05-08 14:21:11 +02:00
Niels Lohmann
5bfb27c865 🚨 fix some warnings 2020-05-08 12:32:28 +02:00
Niels Lohmann
8c2b26de4a ⚗️ do not include <ciso646> with C++20 #2089 2020-05-07 10:17:32 +02:00
Niels Lohmann
9adb1c0235 🏁 do not include <ciso646> unless old MSVC is used #2089 2020-05-07 09:43:41 +02:00
Niels Lohmann
cf4a6552f3 add tests for binary serialization 2020-05-06 22:24:48 +02:00
Niels Lohmann
3cd2a977ae add test for get_ptr<binary_t*> 2020-05-06 22:13:55 +02:00
Niels Lohmann
1d6f7b0d4e add tests for binary serialization 2020-05-06 22:13:31 +02:00
Niels Lohmann
c10bc7efdd 🔥 remove pretty-print code for binary values 2020-05-06 22:13:08 +02:00
Niels Lohmann
ddff459fa3 add test for BSON binary subtype 2020-05-06 21:24:00 +02:00
Niels Lohmann
421a084396 add convenience function to create binary value with given subtype 2020-05-06 21:23:45 +02:00
Niels Lohmann
2b39efd545 add tests for binary type 2020-05-05 12:59:57 +02:00
Niels Lohmann
6dee8866a8 🐛 fix binary comparison 2020-05-05 12:40:04 +02:00
Niels Lohmann
908941b87d fix test cases 2020-05-05 07:47:20 +02:00
Niels Lohmann
2a34f4cd63 add tests for binary type 2020-05-04 22:07:50 +02:00
Niels Lohmann
48aa441661 add swap function for binary type 2020-05-04 22:07:36 +02:00
Niels Lohmann
a50a14088c Merge pull request #2081 from nlohmann/external_test_data
Use external test data
2020-05-04 20:58:02 +02:00
Niels Lohmann
2304629a3f 📌 use JSON test data v1.0.0 2020-05-04 16:00:00 +02:00
Niels Lohmann
e7a88b2d7f 💚 fix AppVeyor and Travis builds 2020-05-03 19:33:01 +02:00
Niels Lohmann
634fa87e5a Merge pull request #2080 from nlohmann/remove_doozer
Remove Doozer CI
2020-05-03 13:58:29 +02:00
Niels Lohmann
24237af983 🎨 fix format 2020-05-03 13:40:23 +02:00
Niels Lohmann
2f0d37d7d2 🔥 remove fastcov 2020-05-02 23:48:11 +02:00
Niels Lohmann
9c0c58d948 🔥 remove Doozer CI 2020-05-02 23:41:28 +02:00
Niels Lohmann
929f5d398c 🔨 fix coverage tests 2020-05-02 23:24:21 +02:00
Niels Lohmann
752c62b4bd 🔨 remove double tests 2020-05-02 16:07:09 +02:00
Niels Lohmann
f0050c9ba0 Merge pull request #2019 from dota17/contains_v2
fix #1982:json_pointer.contains() exception is incorrectly raised
2020-05-02 11:04:57 +02:00
Niels Lohmann
bec554936c 🔨 fix paths 2020-05-02 10:56:01 +02:00
Niels Lohmann
08c9472184 🔨 simplify workflow 2020-05-01 21:06:41 +02:00
Niels Lohmann
3ae7237f5a 🔨 clean up 2020-05-01 21:01:47 +02:00
Niels Lohmann
cfb2f34ebb 🔨 fix benchmarks 2020-05-01 20:59:47 +02:00
Niels Lohmann
d0ef591ce2 Merge branches 'develop' and 'external_test_data' of https://github.com/nlohmann/json into external_test_data 2020-05-01 20:23:08 +02:00
Niels Lohmann
ec5cfdd307 🔨 properly find and use Git 2020-05-01 16:18:04 +02:00
Niels Lohmann
d144459f1e add git 2020-05-01 16:14:13 +02:00
Niels Lohmann
f58383b8ee 🔊 output on failure 2020-05-01 15:22:18 +02:00
Niels Lohmann
7ade3a0efb remove dependency to FetchContent 2020-05-01 15:14:37 +02:00
Niels Lohmann
dbf1a1f413 ♻️ download test data from external repository 2020-05-01 14:32:37 +02:00
Niels Lohmann
2251741b53 Merge pull request #2077 from ArthurSonzogni/develop-2
Fix README.md. Missing ```
2020-05-01 14:08:59 +02:00
ArthurSonzogni
f26689e006 Fix README.md
About pull request:
https://github.com/nlohmann/json/pull/2074

An error has been introduced by accepting the suggestions:
4be4a038cc

One was about removing ~~~, but it was meant to be replaced by ``` in
reality. This caused the README.md to be slightly broken.
2020-05-01 13:55:24 +02:00
Niels Lohmann
798dbb5c19 📝 add detail 2020-05-01 13:19:49 +02:00
Niels Lohmann
c9f404dc98 Merge pull request #2076 from rmisev/patch-1
Fix error message about invalid surrogate pairs
2020-05-01 12:47:39 +02:00
Niels Lohmann
b27d8a3253 Merge pull request #2074 from ArthurSonzogni/develop
Add CMake fetchcontent documentation and tests
2020-05-01 12:42:29 +02:00
Rimas Misevičius
6f1800889a Fix tests 2020-05-01 00:59:12 +03:00
Rimas Misevičius
4c053e3ec9 Fix tests 2020-05-01 00:48:24 +03:00
Rimas Misevičius
6815968a42 Fix error message about invalid surrogate pairs
I tested following strings with invalid surrogate pair and unpaired surrogate in files:

1. `"a\uD800\uD800x"`
2. `"a\uD800x"`

The error messge was: "... invalid string: surrogate U+DC00..U+DFFF must be followed by U+DC00..U+DFFF; ..."

I think it must be: "... invalid string: surrogate U+D800..U+DBFF must be followed by U+DC00..U+DFFF; ..."
2020-05-01 00:23:04 +03:00
Arthur Sonzogni
4be4a038cc Apply suggestions from code review
Co-Authored-By: Niels Lohmann <niels.lohmann@gmail.com>
2020-04-29 21:08:39 +02:00
Niels Lohmann
db013c9428 Merge pull request #2071 from nlohmann/issue2067
Properly pass serialize_binary to dump function
2020-04-29 19:39:58 +02:00
ArthurSonzogni
c331706644 Add CMake fetchcontent documentation and tests
Github issue:
https://github.com/nlohmann/json/issues/2073

nlohmann::json documents 2 way of depending on it using CMake
1) Copy-paste the project/source into your own project.
2) Install nlohman::json and then use find_package.

(1) pollutes your git repository, (2) requires everyone to install the
dependencies themselves.

Since 2018, CMake provide some kind of 'package manager' features using
[FetchContent](https://cmake.org/cmake/help/v3.17/module/FetchContent.html)
It gives the following:
~~~cmake
include(FetchContent)

FetchContent_Declare(json
  GIT_REPOSITORY https://github.com/nlohmann/json
  GIT_TAG v3.7.3)

FetchContent_GetProperties(json)
if(NOT json_POPULATED)
  FetchContent_Populate(json)
  add_subdirectory( ${json_SOURCE_DIR} ${json_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
~~~

Then declares the dependency in the target using it:
~~~cmake
target_link_library(my_project PRIVATE nlohmann_json::nlohmann_json
~~~

This patch updates the documentation and provides tests.
2020-04-29 18:28:06 +02:00
Niels Lohmann
b1fe6ee0d1 Merge pull request #2069 from nlohmann/issue2064
Fix returning reference to local temporary object
2020-04-28 20:56:48 +02:00
Niels Lohmann
2e5727d778 🐛 properly pass serialize_binary to dump function #2067 2020-04-27 15:10:23 +02:00
Niels Lohmann
9e0180b698 🐛 fix returning reference to local temporary object #2064 2020-04-27 14:43:49 +02:00
Niels Lohmann
d9d1279a94 Merge pull request #2060 from alexandermyasnikov/develop
updated wandbox link
2020-04-24 09:18:23 +02:00
Alexander Myasnikov
b01bc05b2b updated wandbox link 2020-04-23 13:32:42 +03:00
Niels Lohmann
63afc8e3f8 Merge pull request #2043 from dota17/unit-constructor1
Add missing testcase about NaN in unit-constructor1.cpp
2020-04-21 07:35:44 +02:00
Niels Lohmann
a29e3b1318 Merge pull request #2054 from nlohmann/feature/issue1983
Fix bug in diff function
2020-04-20 19:44:35 +02:00
Niels Lohmann
c0a39b22a6 🚨 fix compiler warning 2020-04-20 19:42:58 +02:00
chenguoping
8bfc692602 update condition 2020-04-20 16:00:55 +08:00
Niels Lohmann
3607687a14 Merge pull request #2053 from nlohmann/gcc10warnings
Fix GCC compiler warnings
2020-04-20 08:05:42 +02:00
Niels Lohmann
721a1a0b5d Merge pull request #2051 from nlohmann/clang10warnings
Fix Clang compiler warnings
2020-04-20 08:04:23 +02:00
Niels Lohmann
f14a7d8af7 Merge pull request #2050 from nlohmann/doctest_update
Update doctest to 2.3.7
2020-04-20 08:02:58 +02:00
chenguoping
c379d02b3e Add missing testcase about NaN in unit-constructor1.cpp 2020-04-20 10:25:44 +08:00
Niels Lohmann
e8356928bd 🚨 fix compiler warnings #2052 2020-04-19 13:25:02 +02:00
Niels Lohmann
4fb0795ec1 🚨 fix compiler warnings #2049 2020-04-19 13:01:36 +02:00
Niels Lohmann
45d5b09425 ⬆️ doctest 2.3.7 #2048 2020-04-19 12:33:42 +02:00
Niels Lohmann
be137609df Merge pull request #1746 from uhoreg/cmake_arch_indep
make CMake's version config file architecture-independent
2020-04-19 10:09:28 +02:00
Hubert Chathi
2b0e4c7a94 add comments 2020-04-17 15:44:12 -04:00
Niels Lohmann
3bc9e053c9 Merge pull request #1969 from dota17/dota17-warning
fix warnings in serializer.hpp for VS2019
2020-04-17 10:10:38 +02:00
Niels Lohmann
69ac336042 Merge pull request #1967 from dota17/dota17-disable
Fix C26451 warnnings in to_chars.hpp
2020-04-17 10:08:21 +02:00
Niels Lohmann
f2b43a36b2 Merge pull request #1662 from OmnipotentEntity/develop
Add binary type support to all binary file formats, as well as an internally represented binary type
2020-04-16 11:14:32 +02:00
Michael Reilly
012c9665ac Add binary type support to all binary file formats, as well as an internally represented binary type 2020-04-14 10:22:45 -04:00
Niels Lohmann
dd04a32918 🐛 fix bug in diff function #1983 2020-04-13 14:35:36 +02:00
chenguoping
f5a487d1b4 fix issue1982: contains() exceptions are incorrectly raised 2020-04-13 19:41:13 +08:00
Niels Lohmann
b7be613b6e Merge pull request #1990 from dota17/json_pointer
catch exceptions for json_pointer : ..../+99
2020-04-13 13:29:33 +02:00
Niels Lohmann
84f19d6333 Merge pull request #2034 from ArtemSarmini/gh-1920-gcc-10-incomplete-types
Templatize basic_json constructor from json_ref
2020-04-13 13:19:28 +02:00
Niels Lohmann
b0a3883081 🎨 fix format 2020-04-13 13:11:26 +02:00
Niels Lohmann
3483d923d4 Merge pull request #2033 from nlohmann/feature/issue1913
Replace deprecated std::is_pod
2020-04-13 12:32:37 +02:00
Artöm Bakri Al-Sarmini
70be9751cd typo fix 2020-04-12 23:42:26 +03:00
Artöm Bakri Al-Sarmini
ec955f08b4 Templatize basic_json ctor from json_ref 2020-04-12 22:32:39 +03:00
Niels Lohmann
7fcc860329 🔥 remove WhiteSource 2020-04-12 16:35:41 +02:00
Niels Lohmann
4396a68d2d Merge pull request #1984 from dota17/document-fix
Modify the document about operator==
2020-04-11 18:55:18 +02:00
Niels Lohmann
062fd3842c Merge pull request #2004 from wsjcpp/develop
Added wsjcpp.yml
2020-04-11 11:48:04 +02:00
Niels Lohmann
9154e991b8 Merge branch 'develop' into feature/issue1913 2020-04-11 11:33:46 +02:00
Evgenii Sopov
d164a2bf09 Added wsjcpp.yml: C++ Source Package Manager 2020-04-11 16:30:04 +07:00
Niels Lohmann
6121fc52cf 🎨 fix indentation 2020-04-10 13:22:58 +02:00
Niels Lohmann
ea0a7c7b4f Merge pull request #2025 from ArtemSarmini/issue-1971-basic_json-push_back
Fixes #1971 (memory leak in basic_json::push_back)
2020-04-10 13:19:14 +02:00
Niels Lohmann
d01193a4e4 🎨 run "make amalgamate" 2020-04-10 13:18:12 +02:00
Niels Lohmann
299feb13e7 Merge pull request #1958 from t-b/add-zc-flag-for-msvc
appveyor.yml: Compile and test with latest version for __cplusplus ma…
2020-04-10 13:12:34 +02:00
Artöm Bakri Al-Sarmini
8db02bcc55 Fix for gcc 2020-04-08 15:53:14 +03:00
Artöm Bakri Al-Sarmini
fec0bdd93b still fixing 2020-04-08 00:42:03 +03:00
Artöm Bakri Al-Sarmini
4ce31695f1 Fixed formatting, trying to fix msvc build error in appveyor 2020-04-08 00:26:43 +03:00
Niels Lohmann
c6b298799a 👷 remove failing Travis workers 2020-04-07 09:09:44 +02:00
chenguoping
34cf7b7a48 just restart ci 2020-04-07 10:00:21 +08:00
Thomas Braun
5607dfb48a appveyor.yml: Compile and test with latest version for __cplusplus macro on MSVC
According to [1] the C++ macro __cplusplus has always the value 199711L
even if you enable later version of C++ support via /std.

Use one job with /Zc:__cplusplus defined so that we know that it
compiles.

[1]: https://docs.microsoft.com/en-us/cpp/build/reference/zc-cplusplus?view=vs-2019
2020-04-06 11:56:33 +02:00
Niels Lohmann
6a53a95c32 ⬆️ Hedley 13 2020-04-06 11:56:33 +02:00
Niels Lohmann
3884d33c60 Merge pull request #1980 from linev/fix_warning
Rename argument array_index to array_indx in json_pointer methods
2020-04-05 22:00:41 +02:00
Niels Lohmann
554e8c7356 Merge pull request #2002 from alexandermyasnikov/develop
fix error 'setw' is not a member of 'std' in Wandbox example
2020-04-05 21:58:21 +02:00
Niels Lohmann
5c00308de7 Merge pull request #2010 from magamig/patch-1
Update LICENSE.MIT
2020-04-05 21:55:47 +02:00
Niels Lohmann
83e36f314f Merge pull request #2008 from garethsb-sony/implicit-cast-vs2019
PR for #2006 to test in AppVeyor.
2020-04-05 21:53:47 +02:00
Niels Lohmann
379ed1f67e 💰 add sponsor 2020-04-05 15:23:00 +02:00
Artöm Bakri Al-Sarmini
a74a031bba Fix build error 2020-04-02 15:47:08 +03:00
Artöm Bakri Al-Sarmini
e4d8dc02e8 Fixes #1971 (memory leak in basic_json::push_back) 2020-04-02 15:20:25 +03:00
Miguel Magalhães
3df622a417 Update LICENSE.MIT 2020-03-25 17:24:23 +00:00
chenguoping
e07686f0c7 update array_index() and add testcases 2020-03-25 15:57:20 +08:00
chenguoping
2e7d340dad docs:modify the document about operator== 2020-03-25 10:18:04 +08:00
garethsb-sony
7fe16f9400 PR for #2006 to test in AppVeyor. 2020-03-24 12:53:59 +00:00
chenguoping
dcd3a6c62b move the catch of std::invalid_argument into array_index() 2020-03-23 17:24:47 +08:00
chenguoping
59cb4c93be fix C26451 warnning in serializer.hpp for VS2019 2020-03-23 16:08:47 +08:00
chenguoping
0a8216890d fix C26451 warnnings in to_chars.hpp 2020-03-23 15:27:35 +08:00
Alexander Myasnikov
4df7dc04f6 fix error 'setw' is not a member of 'std' in Wandbox example 2020-03-21 18:34:40 +03:00
Sergey Linev
78e911b8c3 Use array_idx as methods args
Avoid mix-up with array_index member

Co-Authored-By: Niels Lohmann <niels.lohmann@gmail.com>
2020-03-19 11:52:40 +01:00
Niels Lohmann
19843b038c Merge pull request #1933 from dota17/dota17-FAQ
Update README.md : add a FAQ about memory release
2020-03-19 11:25:47 +01:00
Niels Lohmann
ebb5a4c09f 💰 add sponsor 2020-03-19 11:14:50 +01:00
chenguoping
bfc003cadf catch exceptions for json_point : /xx/+99 2020-03-17 20:49:28 +08:00
chenguoping
2ccdfebaa7 fix typo 2020-03-14 18:10:55 +08:00
Niels Lohmann
54656ef279 Merge pull request #1956 from dota17/dota17-fix-typo
Fix typo in examples
2020-03-13 17:26:24 +01:00
Niels Lohmann
d102da61ad Merge pull request #1979 from alex-weej/patch-2
README: Fix string representation of `dump`ed `json`
2020-03-13 16:49:13 +01:00
Sergey Linev
00049c20d0 Rename argument array_index to array_indx in json_pointer methods
Fixes gcc48 warning:

declaration of ‘array_index’ shadows a member of 'this' [-Wshadow]
2020-03-11 07:41:53 +01:00
Alexander “weej” Jones
5fdb1d08aa README: Fix string representation of dumped json
As is it's confusing and inconsistent with the indented form right below. The backslash escapes make it confusing.
2020-03-10 19:37:20 +00:00
Francois Chabot
41b0704ce1 removed move assignments from input adapters 2020-03-02 23:50:01 -05:00
Francois Chabot
7eadd6daef added back forward declaration to address warnings 2020-02-28 18:15:11 -05:00
dota17
699e0a923c fix typo in examples 2020-02-26 13:44:08 +08:00
Francois Chabot
c7282d5b1e simpler endian detection for older gcc versions 2020-02-20 10:19:29 -05:00
Francois Chabot
770ae6e9da accomodate older gcc 2020-02-19 16:54:09 -05:00
Francois Chabot
de35fad88e fixed missing return arg of operator=() 2020-02-19 15:23:49 -05:00
Francois Chabot
2e2cf02cfd duck-typed object input adapters 2020-02-19 14:59:31 -05:00
Francois Chabot
a0c4fc945a fixed bad friend class declaration 2020-02-19 11:23:02 -05:00
Francois Chabot
617b3cf42e templated input adapters 2020-02-19 10:32:49 -05:00
Chen
42566c6bef Update README.md 2020-02-17 15:40:52 +08:00
Niels Lohmann
61b46a56fb 🏗️ replace is_pod by is_trivial 2020-02-15 10:12:27 +01:00
Chen
88097a250f Update README.md : add a FAQ about memory release 2020-02-10 21:03:57 +08:00
Niels Lohmann
973c52dd4a Merge pull request #1923 from Coeur/typos
Some typos
2020-02-02 14:48:07 +01:00
Antoine Cœur
8d92ca865f Some typos 2020-02-02 17:29:37 +08:00
Niels Lohmann
6a6790ab68 Merge pull request #1917 from jothepro/update-links-to-hunter
Readme: Updated links to hunter repo & docs
2020-01-31 11:47:42 +01:00
Niels Lohmann
3eb6b0e7a2 Merge pull request #1918 from kastiglione/patch-1
Fix link to parse function in README
2020-01-31 11:46:53 +01:00
Dave Lee
f25a1287f9 Fix link to parse function in README 2020-01-29 14:19:00 -08:00
jothepro
0257533866 Updated links to hunter repo & docs
hunter was recently passed over to a new maintainer, this is why the github url & the link to the documentation have changed.
2020-01-29 22:33:59 +01:00
Niels Lohmann
6ca5338a0c Merge pull request #1909 from Klaim/patch-1
Adds instruction for using Build2's package manager
2020-01-28 19:00:45 +01:00
Joël Lamotte
ab538ba523 Formatting
(proper naming suggested by `build2`'s author)
2020-01-21 17:49:23 +01:00
Joël Lamotte
708e107d8e Adds instruction for using Build2's package manager
I created a `nlohmann-json` package for `build2` (https://build2.org) that have been published on the central public repository https://cppget.org : https://cppget.org/nlohmann-json (at the moment you can see that there is only one version: 3.7.3).

The repository of the package code is there: https://github.com/build2-packaging/nlohmann-json and is owned by the build2 community now. (with build2 you can use either a repository like cppget.org or a git repository so both are useful to users for different use cases).

This patch just add the basic information as to how to use this library with build2.
2020-01-20 14:50:15 +01:00
Niels Lohmann
ad383f66bc Merge pull request #1907 from pauljurczak/patch-1
Update README.md
2020-01-19 22:45:53 +01:00
Paul Jurczak
bc95563814 Update README.md 2020-01-18 14:25:03 -07:00
Niels Lohmann
7acf6218b6 📝 fix typo #1903 2020-01-15 17:40:03 +01:00
Niels Lohmann
0feea6168d 📝 fix scanner documentation 2020-01-12 10:22:11 +01:00
Niels Lohmann
bde5712418 Merge pull request #1871 from sonulohani/develop
Fix warning: ignoring return value
2019-12-16 15:06:47 +01:00
Sonu Lohani
4c1ebb4413 Fix warning: ignoring return value 2019-12-16 14:22:41 +05:30
Niels Lohmann
b568619c4a 💰 add sponsor section 2019-12-15 19:26:51 +01:00
Niels Lohmann
bccc8f0577 Merge pull request #1857 from gocarlos/develop
docs: add central repository as conan source to readme
2019-12-01 11:53:24 +01:00
Carlos Gomes Martinho
ac9df48453 style: format readme 2019-12-01 10:23:24 +01:00
Carlos Gomes Martinho
f44e8ac090 revert: adding conan badge 2019-12-01 10:22:48 +01:00
Carlos Gomes Martinho
134a5faa2b docs: add central repository as conan source to readme 2019-11-29 13:49:53 +01:00
Niels Lohmann
c3270ac734 Merge pull request #1853 from podsvirov/readme-msys2-package-rename
README: Package in MSYS2 renamed to nlohmann-json
2019-11-23 09:21:52 +01:00
Konstantin Podsvirov
f586bc014f README: Package in MSYS2 renamed to nlohmann-json
This is done to correctly match with the
corresponding package in Archlinux.
2019-11-23 05:02:20 +03:00
Niels Lohmann
c0f52edbc3 📝 add badges 2019-11-22 21:17:31 +01:00
Niels Lohmann
a4c01f3380 👥 add GitHub Sponsors 2019-11-22 20:58:44 +01:00
Niels Lohmann
3f044dad81 📝 add Xocde 11.2.1 to CI list 2019-11-22 08:00:41 +01:00
Niels Lohmann
28b1448508 👷 add Xcode 11.2.1
https://twitter.com/travisci/status/1197625080119021568
2019-11-21 22:22:06 +01:00
Niels Lohmann
7439cfe5c8 Merge pull request #1844 from Tridacnid/develop
Update tests that generate CMake projects to use main project's C++ compiler
2019-11-19 19:27:14 +01:00
Niels Lohmann
b2bec943d1 Merge pull request #1846 from Mike-Bal/fix_warnings
Fix msvc warnings
2019-11-19 19:24:36 +01:00
Michael Balszun
25e0175bc3 Remove unnecessary warning suppressions in test cmake file 2019-11-19 11:26:35 +01:00
Michael Balszun
5c045f7d0a Use correct accumulator type in binary_writer if size_t != ul
- Also fixes warning in msvc about possible loss of data in
  that size computation.
2019-11-19 11:06:45 +01:00
Joe Burzinski
fbb0bd7556 Update tests that generate CMake projects to use the CMAKE_CXX_COMPILER the main project was CMake'd with. Fixes #1747. 2019-11-18 21:46:34 -06:00
Niels Lohmann
e7b3b40b5a Merge branch 'release/3.7.3' into develop 2019-11-17 12:21:44 +01:00
Niels Lohmann
456478b3c5 Merge branch 'release/3.7.3' 2019-11-17 12:21:32 +01:00
Niels Lohmann
c5eafe74e8 🔖 set version to 3.7.3 2019-11-17 12:09:12 +01:00
Niels Lohmann
c6e1e26018 Merge pull request #1838 from nickaein/fix-quadratic-destruction
Fix quadratic destruction complexity
2019-11-15 07:02:12 +01:00
Isaac Nickaein
efa13c663d Reserve stack only for top-level items 2019-11-13 15:23:08 +03:30
Isaac Nickaein
948f98cf4a Cleanups
Make our intent more clear in destruction
2019-11-12 22:24:11 +03:30
Isaac Nickaein
0f3ec003bb Remove harmful vector::reserve during destruction (#1837) 2019-11-12 22:22:55 +03:30
Niels Lohmann
be61ad1470 🎨 fix inconsistent operator style 2019-11-11 21:37:32 +01:00
Niels Lohmann
411158d896 Merge branch 'release/3.7.2' into develop 2019-11-10 21:39:14 +01:00
Niels Lohmann
5f09b502b6 Merge branch 'release/3.7.2' 2019-11-10 21:39:02 +01:00
Niels Lohmann
56109eacd7 🔖 set version to 3.7.2 2019-11-10 21:23:39 +01:00
Niels Lohmann
7b0c50b9a5 🔨 add path 2019-11-10 19:09:48 +01:00
Niels Lohmann
0a513a35cb Merge pull request #1436 from nickaein/iterate-on-destruction
Prevent stackoverflow caused by recursive deconstruction
2019-11-10 11:57:06 +01:00
Isaac Nickaein
7e2445a0f4 Move deep JSON test to a separate unit-test 2019-11-09 21:42:39 +03:30
Isaac Nickaein
68d0a7b246 Reduce depth in unit-test to avoid choking valgrind 2019-11-09 21:19:12 +03:30
Isaac Nickaein
eec1974218 Merge remote-tracking branch 'nlohmann/develop' into iterate-on-destruction 2019-11-09 14:50:48 +03:30
Niels Lohmann
67259d698f Merge pull request #1830 from nlohmann/whitesource/configure
Configure WhiteSource Bolt for GitHub
2019-11-08 14:04:27 +01:00
whitesource-bolt-for-github[bot]
760076abca Add .whitesource configuration file 2019-11-08 13:01:29 +00:00
Niels Lohmann
1a9de88117 🚨 fix a linter warning
Coverity detected two "Memory - illegal accesses  (OVERRUN)" issues. Resizing the buffer should silence this warning.
2019-11-07 08:00:21 +01:00
Niels Lohmann
d98bf0278d Merge branch 'release/3.7.1' into develop 2019-11-06 20:34:07 +01:00
Niels Lohmann
43e4db6141 Merge branch 'release/3.7.1' 2019-11-06 20:33:52 +01:00
Niels Lohmann
aacdc6bbe3 🔖 set version to 3.7.1 2019-11-06 18:37:26 +01:00
Niels Lohmann
0f6a58eeaf 👥 update contributors 2019-11-06 17:35:04 +01:00
Niels Lohmann
1e9f16dff0 🚨 fix linter errors 2019-11-05 20:25:53 +01:00
Niels Lohmann
c0ae88bf50 🚨 fix linter errors 2019-11-05 20:23:17 +01:00
Niels Lohmann
62dada05ca 🐛 fix conversion to std::valarray
closes #1824
2019-11-05 19:28:00 +01:00
Niels Lohmann
7bcaba0ca9 Merge pull request #1821 from AnthonyVH/develop
Fix for #1647
2019-11-05 19:15:54 +01:00
Niels Lohmann
1ca6f2901b Merge pull request #1826 from cbegue/develop
Add restriction for tuple specialization of to_json
2019-11-05 19:14:37 +01:00
Niels Lohmann
abccafa5c5 ⬆️ upgrade Doctest to 2.3.5 2019-11-05 19:11:54 +01:00
Anthony VH
c4923e3d05 Merge remote-tracking branch 'upstream/develop' into develop 2019-11-04 20:50:43 +01:00
Anthony VH
ec9647ae63 Moved test for #1647 regression to regressions file. 2019-11-04 20:45:24 +01:00
Camille Bégué
8b686b30eb Add restriction for tuple specialization of to_json
This commit fix the issue #1825

Signed-off-by: Camille Bégué <c.begue@samsung.com>
2019-11-04 09:57:16 +01:00
Niels Lohmann
3790bd9ae0 👷 add Xcode 10.2 2019-11-04 06:22:39 +01:00
Niels Lohmann
42e9ad32c6 🔨 remove full path 2019-11-03 21:49:22 +01:00
Niels Lohmann
e779714dd8 👷 add Xcode 10.2 2019-11-03 20:45:21 +01:00
Niels Lohmann
bf2afaeee6 🔊 add version output 2019-11-03 20:27:07 +01:00
Niels Lohmann
6a4cc29f01 📝 update examples 2019-11-03 19:40:38 +01:00
Niels Lohmann
dfe53c36da 🚨 fix UBSAN warnings 2019-11-03 13:48:25 +01:00
Niels Lohmann
0db1692f45 👥 update contributors 2019-11-02 10:24:06 +01:00
Niels Lohmann
1307862b1d Merge pull request #1694 from eli-schwartz/release-include-meson
release: add singleinclude and meson.build to include.zip
2019-11-02 09:28:51 +01:00
Niels Lohmann
4d1e4c6d93 Merge pull request #1780 from t-b/add-msvc-16-2019
appveyor.yml: Add MSVC 16 2019 support
2019-11-02 08:16:53 +01:00
Niels Lohmann
a1828bbf57 Merge pull request #1806 from cbegue/develop
Fix issue #1805
2019-11-01 19:46:19 +01:00
Camille Bégué
794a3d411a Fix issue #1805
* Add some restriction on pair partial specialization of to_json

Signed-off-by: Camille Bégué <camille.begue.pro@gmail.com>
2019-10-31 18:04:15 +01:00
Anthony Van Herrewege
ddda67a096 Don't capture json input by value (fixed #1822). 2019-10-30 16:16:34 +01:00
Anthony Van Herrewege
fb9a2643c8 Add test for #1647. 2019-10-30 15:46:31 +01:00
Anthony Van Herrewege
27d0dfc17a Fix #1647: non-member operator== breaks enum (de)serialization. 2019-10-30 14:54:52 +01:00
Niels Lohmann
f272ad533d 👥 add CODEOWNERS file 2019-10-23 21:41:12 +02:00
Niels Lohmann
f7e7a62358 📝 add comment on JSON_THROW_USER, JSON_TRY_USER, and JSON_CATCH_USER 2019-10-23 20:58:06 +02:00
Niels Lohmann
507d5676ad 🚨 fix warning 2019-10-23 20:57:10 +02:00
Niels Lohmann
00cb98a3d1 Merge pull request #1803 from flopp/spelling
Fix some spelling errors - mostly in comments & documentation.
2019-10-21 20:50:13 +02:00
Florian Pigorsch
b93d414a35 Fix some spelling errors - mostly in comments & documentation.
I did not touch the Changelog file and any third party stuff.

additonal -> additional (1)
apppend -> append (2)
constuctor -> constructor (2)
contect -> context (2)
dobulequote -> doublequote (1)
elemnts -> elements (1)
exakt -> exact (2)
exluded -> exclude (1)
explicitely -> explicitly (2)
narcissic -> narcissistic (1)
ocurred -> occurred (1)
occuring -> occurring (2)
preceeds -> preceded (1)
ot -> to (2)
wehther -> whether (2)
2019-10-19 11:59:51 +02:00
Eli Schwartz
f4332d4097 README: describe how to use json as a meson subproject
Also call out to the guidelines for using pkg-config dependencies first,
and reference it for other build systems as well.

Although the possibility of installing with a pkg-config file is
somewhat hidden away in the meson docs, it's been deemed less invasive
due to not distracting away from cmake. So it will have to do.
2019-10-17 15:38:06 -04:00
Eli Schwartz
84faa36ec5 release: add singleinclude and meson.build to include.zip
This serves as a minimal release-only way to embed json into a project.
Add meson support to this directly, to make it usable standalone as a
meson subproject.

Implements #1672
2019-10-17 15:26:51 -04:00
Niels Lohmann
0245ae5157 Merge pull request #1797 from t-b/fix-integer-truncation
iteration_proxy: Fix integer truncation from std::size_t to int
2019-10-17 21:02:48 +02:00
Niels Lohmann
4c06191836 Merge pull request #1799 from nemequ/develop
Update Hedley to v11.
2019-10-17 20:59:49 +02:00
Evan Nemerson
fbcbc76d10 Update Hedley to v11. 2019-10-16 13:39:40 -07:00
Thomas Braun
c6cbdf96a9 appveyor.yml: Add debug build on x64 and VS 2019 2019-10-16 22:34:33 +02:00
Thomas Braun
01e486bb55 appveyor.yml: Add MSVC 16 2019 support 2019-10-16 22:34:33 +02:00
Thomas Braun
35b47c2793 iteration_proxy: Fix integer truncation from std::size_t to int
Bug introduced in 0f073e26 (Allow items() to be used with custom string,
2019-09-26).
2019-10-16 20:00:05 +02:00
Thomas Braun
5541a2bd25 test/cmake_import: Pass the generator platform required by MSVC 2019 2019-10-16 17:10:19 +02:00
Thomas Braun
7a521150aa appveyor: Pass the generator platform explicitly
In a future commit we want to add support for MSVC 2019. For that
version cmake requires us to pass in the architecture not part of the
generator but explicitly.

So let's pass that in always like that. This also removes the doubling
of the platform/architecture.
2019-10-16 17:10:19 +02:00
Niels Lohmann
ed5541440a Merge pull request #1779 from t-b/avoid-using-glob-in-cmake
test/CMakeLists.txt: Use an explicit list instead of GLOB
2019-10-09 07:37:43 +02:00
Thomas Braun
eb6fe421ae test/CMakeLists.txt: Use an explicit list instead of GLOB
Using GLOB is slow and considered bad practice.

From https://cmake.org/cmake/help/latest/command/file.html:

> We do not recommend using GLOB to collect a list of source files from
> your source tree. If no CMakeLists.txt file changes when a source is
> added or removed then the generated build system cannot know when to ask
> CMake to regenerate. The CONFIGURE_DEPENDS flag may not work reliably on
> all generators, or if a new generator is added in the future that cannot
> support it, projects using it will be stuck. Even if CONFIGURE_DEPENDS
> works reliably, there is still a cost to perform the check on every
> rebuild.
2019-10-07 21:13:09 +02:00
Niels Lohmann
d187488e0d Merge pull request #1765 from crazyjul/fix/items-with-alt-string
Allow items() to be used with custom string
2019-10-05 22:11:14 +02:00
Niels Lohmann
dae0fe79af Merge pull request #1769 from chris0x44/json_pointer
Make json_pointer::back const (resolves #1764)
2019-10-03 10:35:34 +02:00
Niels Lohmann
d826282f53 Merge pull request #1767 from 0xflotus/patch-1
did you mean 'serialization'?
2019-10-01 11:32:05 +02:00
Julien Hamaide
4615f5a980 Provide default implementation for int_to_string, but allow for overloaded function 2019-10-01 10:34:21 +02:00
christian
7476f5ee0c Make json_pointer::back const (resolves #1764) 2019-10-01 00:57:27 +02:00
0xflotus
d7579b8cbf did you mean 'serialization'? 2019-09-30 18:11:44 +02:00
Julien Hamaide
0f073e26eb Allow items() to be used with custom string 2019-09-26 13:20:57 +02:00
Niels Lohmann
99d7518d21 📝 add OSS Fuzz status badge 2019-09-24 21:01:06 +02:00
Niels Lohmann
e2c531a1f7 Merge pull request #1760 from Xav83/cppcheckFixes
Cppcheck fixes
2019-09-24 20:42:38 +02:00
Xav83
87afee1c39 Runs make amalgamate on the project. 2019-09-20 11:45:38 +02:00
Xav83
13a7c60257 Correct a warning from cppcheck:
binary_writer.hpp:869: (style) Consider using std::accumulate algorithm instead of a raw loop.

910a7d2b87/checks (step):5:107

Signed-off-by: Xav83 <x.jouvenot@gmail.com>
2019-09-20 11:45:38 +02:00
Xav83
b9dfdbe6be Correct a warning from cppcheck:
binary_reader.hpp:650: (style) Unsigned expression 'mant' can't be negative so it is unnecessary to test it

910a7d2b87/checks (step):5:84

Signed-off-by: Xav83 <x.jouvenot@gmail.com>
2019-09-19 19:25:55 +02:00
Niels Lohmann
771d5dadc6 Merge pull request #1741 from tete17/Fix-SFINAE
Fix and add test's for SFINAE problem
2019-09-16 22:39:42 +02:00
Hubert Chathi
cade804c1a make CMake's version config file architecture-independent 2019-09-10 23:41:38 -04:00
Miguel Sacristan
e26a2904fc Fix and add test's for SFINAE problem 2019-09-10 21:36:23 +02:00
Niels Lohmann
06ccd43a2a Merge pull request #1722 from t-b/fix-int64-min-issue
Fix int64 min issue
2019-09-10 07:58:02 +02:00
Niels Lohmann
a6bd798bfa Merge pull request #1728 from t-b/fix-clang-sanitizer-invocation
Fix clang sanitizer invocation
2019-09-10 07:50:02 +02:00
Thomas Braun
8067c3ca5b Add serialization unit tests for extreme integer values 2019-09-03 13:55:19 +02:00
Thomas Braun
70aa8a31a2 Add regression test for dumping the minimum value of int64_t 2019-09-03 13:55:19 +02:00
Thomas Braun
6ce2f35ba8 Fix outputting extreme integer values in edge cases
For some gcc version (Ubuntu 5.5.0-12ubuntu1~16.04) the existing code
crashes when the minimum value of int64_t is outputted.

Resurrect the code from before 546e2cbf (🚨 fixed some warnings,
2019-03-13) but delegate the sign removal so that the compilers don't
complain about taking the negative value of an unsigned value.

In addition we also rewrite the expression so that we first increment
and then negate.

The definition of remove_sign(number_unsigned_t) is never called as
unsigned values are never negative.
2019-09-03 13:55:15 +02:00
Thomas Braun
6d701b29df .travis.yml: Increase the timeout to 45 minutes
The clang sanitizer tests, and there especially the unicode tests, can
hit the default timeout of 25 minutes (1500 seconds) quite easily, so
let's raise the timeout to 45 minutes (2700 seconds).
2019-09-03 13:32:25 +02:00
Thomas Braun
d5c0d52f37 external_constructor<std::valarray>: Handle empty array properly
Clang UBSAN complains with the following message when an empty std::valarray is passed in:

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /usr/lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/valarray:571:14 in

2/2 Test #68: test-regression_all ..............***Failed    4.68 sec
/usr/lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/valarray:571:14: runtime error: reference binding to null pointer of type 'const do
uble'
    #0 0x6fbe57 in std::valarray<double>::operator[](unsigned long) const /usr/lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/valarray:
571:7
    #1 0x6fbe57 in double const* std::begin<double>(std::valarray<double> const&) /usr/lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/v
alarray:1207
    #2 0x6fbe57 in void nlohmann::detail::external_constructor<(nlohmann::detail::value_t)2>::construct<nlohmann::basic_json<std::map, std::vector, s
td::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::adl_seri
alizer>, double, 0>(nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool
, long, unsigned long, double, std::allocator, nlohmann::adl_serializer>&, std::valarray<double> const&) /home/firma/devel/json/include/nlohmann/deta
il/conversions/to_json.hpp:157
    #3 0x5e3fe3 in void nlohmann::detail::to_json<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>
, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer>, double, 0>(nlohmann::basic_json<std::map, std
::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohman
n::adl_serializer>&, std::valarray<double> const&) /home/firma/devel/json/include/nlohmann/detail/conversions/to_json.hpp:270:5
    #4 0x5e3fe3 in decltype((to_json(fp, std::forward<std::valarray<double>&>(fp0))) , ((void)())) nlohmann::detail::to_json_fn::operator()<nlohmann:
:basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double
, std::allocator, nlohmann::adl_serializer>, std::valarray<double>&>(nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std
::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer>&, std::valarray<double>&) c
onst /home/firma/devel/json/include/nlohmann/detail/conversions/to_json.hpp:334
    #5 0x5e3fe3 in decltype((nlohmann::(anonymous namespace)::to_json(fp, std::forward<std::valarray<double>&>(fp0))) , ((void)())) nlohmann::adl_ser
ializer<std::valarray<double>, void>::to_json<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, st
d::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer>, std::valarray<double>&>(nlohmann::basic_json<std:
:map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator
, nlohmann::adl_serializer>&, std::valarray<double>&) /home/firma/devel/json/include/nlohmann/adl_serializer.hpp:45
    #6 0x5e3fe3 in nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool,
 long, unsigned long, double, std::allocator, nlohmann::adl_serializer>::basic_json<std::valarray<double>&, std::valarray<double>, 0>(std::valarray<d
ouble>&) /home/firma/devel/json/include/nlohmann/json.hpp:1257
    #7 0x5e3fe3 in _DOCTEST_ANON_FUNC_2() /home/firma/devel/json/test/src/unit-regression.cpp:1377
    #8 0x77313e in doctest::Context::run() /home/firma/devel/json/test/thirdparty/doctest/doctest.h:5938:21
    #9 0x777ae0 in main /home/firma/devel/json/test/thirdparty/doctest/doctest.h:6016:71
    #10 0x7fae220532e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)
    #11 0x4a6479 in _start (/home/firma/devel/json/build/test/test-regression+0x4a6479)

The important thing to note here is that a std::valarray is *not* a STL
container, so the usual containter and iterator semantics don't apply.

Therefore we have to check if the container is non-empty before.
2019-09-03 13:22:03 +02:00
Thomas Braun
61fe5f1eee input_buffer_adapter: Fix handling of nullptr input
Clang UBSAN currently complains that the char * to input_buffer_adapter
is a nullptr.

Turns out it is actually required to accept nullptr, see for example
line 415 in input_adapters.hpp

  ...
  // the address of first cannot be used: use nullptr
  ia = std::make_shared<input_buffer_adapter>(nullptr, len);
  ....

Therefore we have to handle it gracefully here. We now also ignore the
length parameter l if b is a nullptr.
2019-09-03 13:22:03 +02:00
Thomas Braun
9ea3e19121 .travis/cmake: Rework clang sanitizer invocation
- Switch to clang-7
- Adapt PATH so that llvm-symbolizer can be found for useful stacktraces
- Adapt compile flags
  "-O0" ensures much faster compile times
  "-fno-sanitize-recover=all
  -fsanitize-recover=unsigned-integer-overflow" this fails the build on
  all issues except unsigned integer overflows. Not failing in this case
  is required in combination with the sanitizer suppression file as only
  recoverable errors can be suppressed.

The UBSAN suppression file ignores errors from stl_bvector.h (which
holds std::vector<bool>).

Clang reports that error as

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /usr/lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/stl_bvector.h:158:20 in

      Start 34: test-deserialization_all
28/88 Test #71: test-testsuites_default .............***Failed    0.32 sec
/usr/lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/stl_bvector.h:158:20: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'unsigned int'
    #0 0x628f72 in std::_Bit_iterator_base::_M_bump_down() /usr/lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/stl_bvector.h:158:20
    #1 0x628d16 in std::_Bit_iterator::operator--() /usr/lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/stl_bvector.h:251:7
    #2 0x634aac in std::vector<bool, std::allocator<bool> >::pop_back() /usr/lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/stl_bvector.h:1010:7
    #3 0x61eff0 in bool nlohmann::detail::parser<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer> >::sax_parse_internal<nlohmann::detail::json_sax_dom_parser<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer> > >(nlohmann::detail::json_sax_dom_parser<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer> >*) /home/firma/devel/json/include/nlohmann/detail/input/parser.hpp:439:28
    #4 0x604864 in nlohmann::detail::parser<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer> >::parse(bool, nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer>&) /home/firma/devel/json/include/nlohmann/detail/input/parser.hpp:116:13
    #5 0x5f8079 in nlohmann::operator>>(std::istream&, nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer>&) /home/firma/devel/json/include/nlohmann/json.hpp:6356:42
    #6 0x5e1d92 in _DOCTEST_ANON_FUNC_21() /home/firma/devel/json/test/src/unit-testsuites.cpp:343:9
    #7 0x7207fe in doctest::Context::run() /home/firma/devel/json/test/thirdparty/doctest/doctest.h:5938:21
    #8 0x72681a in main /home/firma/devel/json/test/thirdparty/doctest/doctest.h:6016:71
    #9 0x7f75d22362e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)
    #10 0x4c28b9 in _start (/home/firma/devel/json/build/test/test-testsuites+0x4c28b9)

The pop_back() in parser.hpp

      assert(not states.empty());
  ->  states.pop_back();

triggers the UBSAN report. But the assertion above ensure that we only
call pop_back() on an non-empty vector, therefore this is a STL library
bug and thus must be ignored for us.
2019-09-03 13:22:03 +02:00
Thomas Braun
f0bff49ffd test/CMakeLists.txt: Remove trailing whitespace 2019-09-03 13:22:03 +02:00
Niels Lohmann
eab68e7750 👷 add test step 2019-09-02 22:15:11 +02:00
Niels Lohmann
90c1c24ccb 👷 try GitHub Actions 2019-09-02 21:35:53 +02:00
Niels Lohmann
bf4156056b ✏️ fix a typo 2019-08-27 20:18:04 +02:00
Niels Lohmann
b6ee34cc99 Merge branch 'develop' of https://github.com/nlohmann/json into develop 2019-08-27 20:03:05 +02:00
Niels Lohmann
7dccfa5355 Merge pull request #1724 from t-b/enhance-travis
Add gcc 9 and compile with experimental C++20 support
2019-08-27 19:57:23 +02:00
Thomas Braun
a4eaaa56d1 .travis.yml: Add gcc 9 and compile with experimental C++20 support 2019-08-26 12:38:36 +02:00
Niels Lohmann
fe618ac246 👷 adjust maintainer scripts 2019-07-29 18:49:21 +02:00
Niels Lohmann
a015b78e81 🔒 add security policy 2019-07-28 21:46:32 +02:00
Niels Lohmann
6291803f59 👥 update contributors 2019-07-28 21:31:17 +02:00
Niels Lohmann
53c3eefa2c Merge branch 'release/3.7.0' into develop 2019-07-28 21:23:36 +02:00
Niels Lohmann
ea60d40f4a Merge branch 'release/3.7.0' 2019-07-28 21:23:24 +02:00
Niels Lohmann
d275d05514 📝 update documentation 2019-07-28 20:54:02 +02:00
Niels Lohmann
ddb7f70a12 📝 update documentation 2019-07-28 20:53:18 +02:00
Niels Lohmann
48e1fe03b5 🔖 set version to 3.7.0 2019-07-28 20:20:41 +02:00
Niels Lohmann
66d63abe6d Update Makefile 2019-07-28 18:40:11 +02:00
Niels Lohmann
d4fd731f1f 🔨 fix release target 2019-07-28 17:55:01 +02:00
Niels Lohmann
d80f8b09f5 🔨 adjust version 2019-07-28 15:20:07 +02:00
Niels Lohmann
7bf8a86090 🔨 adjust paths 2019-07-28 14:30:17 +02:00
Niels Lohmann
65e4b973bd 🔥 remove leftover file 2019-07-21 14:10:37 +02:00
Niels Lohmann
323cf95d8c 🚨 fix linter warning 2019-07-21 14:04:49 +02:00
Niels Lohmann
3c4c69a24e 🚨 fix linter warning 2019-07-21 13:56:13 +02:00
Niels Lohmann
ffe0e3d70f Merge pull request #1673 from remyabel/gnuinstalldirs
Use GNUInstallDirs instead of hard-coded path.
2019-07-17 06:28:38 +02:00
Tommy Nguyen
3184e9bd8b Use GNUInstallDirs instead of hard-coded path. 2019-07-16 11:44:32 -04:00
Niels Lohmann
cf8251eb54 🚑 fix compiler errors 2019-07-14 21:19:55 +02:00
Niels Lohmann
6c7cde181c Merge branch 'develop' of https://github.com/nlohmann/json into develop 2019-07-14 20:58:29 +02:00
Niels Lohmann
a501365ea2 Merge branch 'feature/hedley' into develop 2019-07-14 20:58:08 +02:00
Niels Lohmann
8d059b96a1 Merge pull request #1670 from podsvirov/readme-package-managers-msys2
Package Manager: MSYS2 (pacman)
2019-07-13 17:58:08 +02:00
Konstantin Podsvirov
6a3cdb281e Package Manager: MSYS2 (pacman)
Add a package installation instructions for MSYS2 software distro.
2019-07-12 22:27:17 +03:00
Niels Lohmann
b17440c12f 🚨 fix compiler warnings 2019-07-12 21:05:16 +02:00
Niels Lohmann
104c5c1996 Merge branch 'feature/json_pointer_contains' into develop 2019-07-09 08:08:56 +02:00
Niels Lohmann
7a23aa1c0d Merge branch 'feature/emplace_back' into develop 2019-07-09 08:06:27 +02:00
Niels Lohmann
24fa285edb 📝 remove HEDLEY annotation from documentation 2019-07-02 21:15:52 +02:00
Niels Lohmann
947656544d 🚨 fix warnings 2019-07-02 21:06:42 +02:00
Niels Lohmann
346e9813c5 🚧 add more annotations 2019-07-02 20:25:51 +02:00
Niels Lohmann
9289a23a76 Merge pull request #1643 from kevinlul/develop
Fix json.hpp compilation issue with other typedefs with same name (Issue #1642)
2019-07-01 22:57:04 +02:00
Niels Lohmann
90798caa62 🚚 rename Hedley macros 2019-07-01 22:37:30 +02:00
Niels Lohmann
025f4cea42 🚨 fix warning 2019-07-01 22:29:21 +02:00
Niels Lohmann
897362191d 🔨 add NLOHMANN_JSON prefix and undef macros 2019-07-01 22:24:39 +02:00
Niels Lohmann
1720bfedd1 ⚗️ add Hedley annotations 2019-06-30 22:14:02 +02:00
kevinlul
e616d095ab Remove boolean regression test for #1642 2019-06-30 11:57:57 -04:00
Niels Lohmann
1be63431f3 make emplace_back return a reference #1609 2019-06-30 12:19:41 +02:00
Niels Lohmann
258fa798f1 add contains function for JSON pointers 2019-06-30 10:03:08 +02:00
kevinlul
855156b5e8 Add regression tests for #1642 2019-06-29 19:26:38 -04:00
Niels Lohmann
9a775bcb14 Merge pull request #1570 from nickaein/msvc-regression-tests
Regression tests for MSVC
2019-06-25 07:05:53 +02:00
Isaac Nickaein
5b2e2305a0 CI: Skip test-unit_all on MSVC Debug builds 2019-06-24 21:21:58 +04:30
Isaac Nickaein
3db14cbfae 📝 Improve doc on const_inter constructor 2019-06-24 15:40:01 +04:30
Isaac Nickaein
0a137b78ac Appveyor: Set timeout of unit-tests in appveyor.yml instead of CMake 2019-06-22 22:14:40 +04:30
Isaac Nickaein
f559142008 Appveyor: Set build mode explicitly 2019-06-22 21:15:17 +04:30
Isaac Nickaein
eba8244ead Avoid collision of ::max with windows.h macro 2019-06-22 21:15:13 +04:30
Isaac Nickaein
798e83a038 Workaround msvc2015 bug with explicit copy-constructor for const_iterator 2019-06-22 21:15:11 +04:30
Isaac Nickaein
d28b4b900e Add a separate build with Windows.h included 2019-06-22 21:15:07 +04:30
Isaac Nickaein
4ac0fe2628 Increase timeout of test-unicode_all in Debug build 2019-06-22 21:15:03 +04:30
Isaac Nickaein
ec43d27f9f Add Debug builds for AppVeyor 2019-06-22 21:14:51 +04:30
Niels Lohmann
39011a1759 📝 mention json type in documentation start page #1616 2019-06-22 09:54:59 +02:00
Niels Lohmann
3b82a350ed 📝 mention 302 exception in value() documentation #1601 2019-06-22 09:44:12 +02:00
Niels Lohmann
13d4f8f5ad Merge pull request #1639 from taylorhoward92/develop
Add explicit conversion from json to std::string_view in conversion unit test
2019-06-22 09:25:02 +02:00
kevinlul
f4fca2d59a Fix #1642
While in our case, only the string case was affected, to be safe and allow the library to work with other unforeseen cases, all of the cases have been wrapped with parentheses.

Thank you @DyXel and @edo9300
2019-06-16 18:22:40 -04:00
Taylor Howard
2f389cdde7 Added explicit converstion to std::string_view. Fixes failing test with GCC 8.3 2019-06-16 14:49:01 +10:00
Niels Lohmann
4fc98e0b34 Merge pull request #1625 from nickaein/fix-docs
Minor fixes in docs
2019-06-05 20:25:48 +02:00
Isaac Nickaein
0c214949f5 ✏️ Fix links to create an issue page 2019-06-04 11:27:25 +04:30
Isaac Nickaein
b22c577e83 ✏️ Fix brew instructions in README 2019-06-04 11:25:44 +04:30
Isaac Nickaein
0d55ddc5bf ✏️ Fix a typo in README 2019-06-04 11:24:22 +04:30
Niels Lohmann
17c0849a63 Merge pull request #1585 from Macr0Nerd/iss916
Added to_string and added basic tests
2019-05-24 09:20:15 +02:00
Niels Lohmann
9f2179deb1 Merge pull request #1598 from nickaein/patch-2
Fix broken links to documentation
2019-05-24 09:16:38 +02:00
Isaac Nickaein
40c3d5024a Fix broken links to documentation
Fixes #1597 and some other links
2019-05-12 22:04:01 +04:30
Macr0Nerd
26952500b8 Merge branch 'iss916' of https://github.com/Macr0Nerd/json into iss916 2019-04-26 18:15:52 -05:00
Macr0Nerd
aa4c45ee4d Added to_string (with ugly macro) and tests 2019-04-26 18:10:45 -05:00
Macr0Nerd
293cd6b794 Added to_string and added basic tests 2019-04-25 22:12:15 -05:00
Niels Lohmann
ee4028b8e4 Merge branch 'feature/fastcov' into develop 2019-04-06 09:15:43 +02:00
Niels Lohmann
cf6b6692aa Merge branch 'develop' into feature/fastcov 2019-04-06 09:03:35 +02:00
Niels Lohmann
f0bc16d899 🔨 overworked coverage targets 2019-04-06 09:02:17 +02:00
Niels Lohmann
b4b06d89b5 ⬆️ updated fastcov 2019-04-06 00:24:19 +02:00
Niels Lohmann
e65cff2a8f 🔨 small cleanup 2019-04-05 23:31:04 +02:00
Niels Lohmann
63fe1cbbcf 📝 updated README 2019-04-05 18:29:57 +02:00
Niels Lohmann
0bdadb12c7 Merge branch 'feature/circleci' into develop 2019-04-05 17:50:48 +02:00
Niels Lohmann
0a1ddd6882 ⬆️ updated fastcov 2019-04-05 07:54:46 +02:00
Niels Lohmann
4676f759e8 ⬆️ updated fastcov 2019-04-04 09:50:27 +02:00
Niels Lohmann
da279234d5 Merge branch 'develop' into feature/fastcov 2019-04-04 09:03:11 +02:00
Niels Lohmann
f05614b240 🏗️ adding anonymous namespace 2019-04-04 08:56:36 +02:00
Niels Lohmann
0da99027b7 🚨 silenced a warning 2019-04-03 17:44:09 +02:00
Niels Lohmann
1f03395e2c Merge branch 'develop' of https://github.com/nlohmann/json into develop 2019-04-03 17:28:50 +02:00
Niels Lohmann
2f9095ddab 🔨 relaxed requirements to coverage 2019-04-03 17:28:47 +02:00
Niels Lohmann
ee8732c359 Merge pull request #1555 from theodelrieu/fix/1511
Fix/1511
2019-04-03 17:24:25 +02:00
Niels Lohmann
d1ef75316e Merge pull request #1439 from onqtam/doctest
moved from Catch to doctest for unit tests
2019-04-03 17:01:48 +02:00
Théo DELRIEU
d66abda4ee tests: fix coverage 2019-04-03 12:34:15 +02:00
Théo DELRIEU
e6e6805c6c add built-in array support in get_to 2019-04-01 17:47:45 +02:00
Théo DELRIEU
2806b201a8 make sure values are overwritten in from_json overloads
Caused unexpected behaviors when using get_to with values previously
set.

Fixes !1511
2019-04-01 17:47:42 +02:00
onqtam
da5b7833a0 fixing the remaining of the pedantic gcc/clang target warnings 2019-03-31 13:57:44 +03:00
Viktor Kirilov
64873fb5b8 Merge branch 'develop' into doctest 2019-03-30 23:23:33 +02:00
Niels Lohmann
80daa19331 👷 Ninja seems not to work 2019-03-30 17:39:50 +01:00
Niels Lohmann
0a57c51a69 👷 adding concurrency 2019-03-30 17:32:52 +01:00
Niels Lohmann
a5e00f2cf7 👷 fixed path 2019-03-30 17:19:27 +01:00
Niels Lohmann
5ebe722045 👷 full workflow 2019-03-30 17:14:50 +01:00
Niels Lohmann
ecf4d5e91d 👷 trying CircleCI 2019-03-30 17:05:43 +01:00
Niels Lohmann
53001414c7 🔨 using --exclude-gcov to exclude files 2019-03-30 17:00:30 +01:00
Niels Lohmann
b12287b362 ⚗️ trying fastcov 2019-03-30 09:12:32 +01:00
Niels Lohmann
b21c04c938 🔥 removed unsupported flag 2019-03-29 17:34:58 +01:00
Niels Lohmann
c7878173f9 🔨 minor changes to maintainer targets 2019-03-29 13:10:11 +01:00
Niels Lohmann
b52c3638f5 Merge pull request #1551 from heavywatal/fix-1535-nodiscard-clang
Remove C++17 extension warning from clang; #1535
2019-03-29 09:14:25 +01:00
Niels Lohmann
d21d298397 🎨 fixed indentation 2019-03-28 14:23:26 +01:00
Niels Lohmann
23635704c3 ⬆️ added script to update cpplint 2019-03-28 14:23:07 +01:00
Niels Lohmann
191aa0fd6f 🔧 overworked maintaner targets 2019-03-28 14:22:48 +01:00
Watal M. Iwasaki
5ccdaf643f Remove C++17 extension warning from clang; #1535
- Switch off `nodiscard` for clang unless C++17 is detected.
- Detect C++ standard before the switch.
2019-03-28 14:38:58 +09:00
onqtam
b4def6dcba tabs instead of spaces... 2019-03-27 01:13:10 +02:00
onqtam
a0000c3235 finished the last of the warnings 2019-03-27 01:09:47 +02:00
onqtam
5d511a6e96 fixed a bunch of warnings from the Makefile from the root of the repo 2019-03-27 00:58:53 +02:00
Viktor Kirilov
82af0ecdc1 Merge branch 'develop' into doctest 2019-03-26 23:32:32 +02:00
Niels Lohmann
d79c16801a Merge branch 'feature/doozer' into develop 2019-03-26 10:49:56 +01:00
Niels Lohmann
24d91cf36f 📝 added Doozer to README 2019-03-26 10:49:14 +01:00
Niels Lohmann
0991824584 👷 version output 2019-03-26 10:41:05 +01:00
onqtam
0caf986505 reverted the removal of this if/else branching - this is the easiest way to get -std=c++0x support 2019-03-25 22:04:37 +02:00
Niels Lohmann
9d2f0391e0 👷 fixed timeout 2019-03-25 12:30:45 +01:00
Niels Lohmann
af9da22b87 👷 adding xenial-armhf 2019-03-25 07:15:03 +01:00
Niels Lohmann
0a67b51fce 👷 forgot path to ctest 2019-03-25 07:03:41 +01:00
Niels Lohmann
e27b282033 👷 skip certificate check 2019-03-25 06:45:35 +01:00
Niels Lohmann
cde0b24389 👷 fixed required packages 2019-03-25 06:43:14 +01:00
Niels Lohmann
f091fe31bc 👷 increased timeout 2019-03-25 06:39:41 +01:00
Niels Lohmann
28dfbedda7 👷 fixed timeout 2019-03-24 18:14:59 +01:00
onqtam
ff51a32be1 updated doctest to version 2.3.1 released today 2019-03-24 17:28:52 +02:00
onqtam
2b346099df Merge branch 'develop' of https://github.com/nlohmann/json into doctest 2019-03-24 17:21:44 +02:00
Niels Lohmann
dcbc028b5b 👷 fixed syntax 2019-03-24 09:02:46 +01:00
Niels Lohmann
842d42b135 👷 unified paths 2019-03-24 09:02:06 +01:00
Niels Lohmann
1e86976cfe 👷 fixed paths 2019-03-24 08:53:30 +01:00
Niels Lohmann
30211477b7 👷 fixed package name 2019-03-24 08:36:01 +01:00
Niels Lohmann
5e1cae0a7d 👷 install g++ 2019-03-24 08:24:50 +01:00
Niels Lohmann
c871c9a01c 👷 install correct g++ 2019-03-24 06:51:10 +01:00
Niels Lohmann
63d619e21f 👷 need to install g++ 2019-03-24 00:48:59 +01:00
Niels Lohmann
c94b764a6e 👷 fixed installation 2019-03-24 00:43:01 +01:00
Niels Lohmann
65cdccfa8a 👷 fixed syntax error 2019-03-24 00:36:46 +01:00
Niels Lohmann
a72ac18514 👷 use recent cmake 2019-03-24 00:36:05 +01:00
Niels Lohmann
4327ae0bef 👷 need more recent cmake for CentOS 2019-03-24 00:15:57 +01:00
Niels Lohmann
fabf953305 👷 fixed a typo 2019-03-24 00:12:36 +01:00
Niels Lohmann
6e3e2ee2e4 👷 fixed buildenv values 2019-03-24 00:11:20 +01:00
Niels Lohmann
bc5089e803 👷 add test output to avoid timeout 2019-03-24 00:02:41 +01:00
Niels Lohmann
7dd3e6384b 👷 added Fedora and CentOS 2019-03-23 23:42:29 +01:00
Niels Lohmann
490c6e926e 👷 using raspbian 2019-03-23 23:27:39 +01:00
Niels Lohmann
2fcca259b0 👷 added cmake 2019-03-23 23:21:17 +01:00
Niels Lohmann
72dd6f349e 👷 trying doozer 2019-03-23 23:18:27 +01:00
Niels Lohmann
baaa2a4d0f 🏁 trying to use constructors from std::allocator #1536 2019-03-21 14:09:29 +01:00
Niels Lohmann
1126c9ca74 Merge branch 'release/3.6.1' into develop 2019-03-20 21:03:43 +01:00
Niels Lohmann
295732a817 Merge branch 'release/3.6.1' 2019-03-20 21:03:30 +01:00
Niels Lohmann
efa1b9a7bb 🔖 set version to 3.6.1 2019-03-20 20:50:05 +01:00
Niels Lohmann
b33093d610 🐛 fixed regression #1530 2019-03-20 14:40:23 +01:00
Niels Lohmann
9d6ab9014f 🏁 fixed a compilation error in MSVC #1531 2019-03-20 14:13:29 +01:00
Niels Lohmann
c790b9f8c0 🐛 fixed regression #1530 2019-03-20 12:41:08 +01:00
Niels Lohmann
483a086562 ⚗️ added funding link 2019-03-20 11:42:24 +01:00
Niels Lohmann
d2a08ddafd Merge branch 'develop' of https://github.com/nlohmann/json into develop 2019-03-20 11:06:55 +01:00
Niels Lohmann
7c55510f76 🚨 fixed some warnings #1527 2019-03-20 11:06:39 +01:00
Niels Lohmann
3ac5fa31c5 💬 update issue templates 2019-03-20 01:27:37 +01:00
Niels Lohmann
51e1564c9e Merge branch 'release/3.6.0' into develop 2019-03-20 00:38:29 +01:00
Niels Lohmann
944267f522 Merge branch 'release/3.6.0' 2019-03-20 00:38:16 +01:00
Niels Lohmann
0abf0f80c9 🔖 set version to 3.6.0 2019-03-20 00:22:12 +01:00
Niels Lohmann
b37392b7ac 🔖 set version to 3.6.0 2019-03-20 00:19:07 +01:00
Niels Lohmann
002addabd8 🚨 fixed a warning 2019-03-19 23:10:21 +01:00
Niels Lohmann
a6f9b4e36d 👥 added contributors 2019-03-19 17:18:33 +01:00
Niels Lohmann
18cc7ddd62 📝 completed documentation index page 2019-03-19 16:03:02 +01:00
Niels Lohmann
e07e8e7912 📝 updated documentation 2019-03-19 15:40:23 +01:00
Niels Lohmann
710f26f95c 📝 added documentation 2019-03-19 10:06:35 +01:00
Niels Lohmann
b224c52376 🎨 cleanup 2019-03-19 09:17:14 +01:00
Niels Lohmann
37a72dac48 💚 forgot two semicolons 2019-03-18 17:23:34 +01:00
Viktor Kirilov
155d196bfa Update CMakeLists.txt 2019-03-18 17:58:35 +02:00
Viktor Kirilov
365944b0bc Merge branch 'develop' into doctest 2019-03-18 16:59:36 +02:00
Niels Lohmann
8d3f4f21bc 🔨 clean up 2019-03-18 13:53:48 +01:00
Niels Lohmann
9fc093c9e0 👷 added targets for infer and oclint 2019-03-18 00:19:28 +01:00
Niels Lohmann
22c733e6fe 📝 added documentation 2019-03-17 22:25:18 +01:00
Niels Lohmann
56f6d1d68e 💚 fix CI and #1521 2019-03-17 15:20:22 +01:00
Niels Lohmann
df0f7f2b5d 👷 overworked clang-tidy target 2019-03-17 12:02:23 +01:00
Niels Lohmann
9f26dac9b3 ⬆️ updated Doxyfile 2019-03-17 12:02:05 +01:00
Niels Lohmann
b8451c236f 🚨 fixed warnings 2019-03-17 12:01:49 +01:00
Niels Lohmann
d6c4cd3b6d 🚨 adding targets for static analyzers 2019-03-17 00:30:08 +01:00
Niels Lohmann
baf8b4be7c adding cpplint 2019-03-17 00:28:14 +01:00
Niels Lohmann
34f8b4f711 🚨 fixed more warnings 2019-03-17 00:27:44 +01:00
Niels Lohmann
02b3494711 🔥 removing unstable macOS builds on Traivs 2019-03-16 08:28:44 +01:00
Niels Lohmann
b02ee16721 🚨 fixed warnings 2019-03-15 15:55:52 +01:00
Niels Lohmann
8d6c033f80 Merge branch 'develop' of https://github.com/nlohmann/json into develop 2019-03-15 14:55:15 +01:00
Niels Lohmann
27011e3718 🚨 fixed warnings 2019-03-15 14:55:13 +01:00
Niels Lohmann
9dc3552931 Merge pull request #1514 from naszta/macrofix
Change macros to numeric_limits
2019-03-15 12:46:42 +01:00
Ferenc Nasztanovics
0067ea8f9e Change macros to numeric_limits #1483 2019-03-13 23:44:34 +01:00
Niels Lohmann
0c65ba960e Merge branch 'develop' of https://github.com/nlohmann/json into develop 2019-03-13 22:14:57 +01:00
Niels Lohmann
546e2cbf5e 🚨 fixed some warnings 2019-03-13 22:14:53 +01:00
Niels Lohmann
c6fc902184 Merge pull request #1489 from andreas-schwab/develop
Do proper endian conversions
2019-03-13 11:57:58 +01:00
Niels Lohmann
d39842e68f Merge pull request #1330 from ax3l/topic-installEmbed
CMake: Optional Install if Embedded
2019-03-13 11:13:09 +01:00
Niels Lohmann
670f42b561 🔥 removing Xcode 6.4 builder 2019-03-11 22:59:22 +01:00
Niels Lohmann
c983b67112 Merge pull request #1469 from garethsb-sony/json_pointer-append
Add operator/= and operator/ to construct a JSON pointer by appending two JSON pointers
2019-03-11 22:47:08 +01:00
Niels Lohmann
c11bead2ae 👷 removing more retired Travis images 2019-03-11 21:22:30 +01:00
Niels Lohmann
3cd1dac653 🚨 fix MSVC warning #1502 2019-03-11 15:33:23 +01:00
Niels Lohmann
cabe2357b8 Merge pull request #1492 from stac47/fix_gcc9_allocator
Fix gcc9 build error test/src/unit-allocator.cpp (Issue #1472)
2019-03-11 15:21:54 +01:00
Niels Lohmann
16d9cdce45 📝 updated documentation of CI 2019-03-11 15:19:50 +01:00
Niels Lohmann
e3729ba0a5 💚 fix compiler selection 2019-03-11 07:44:40 +01:00
Niels Lohmann
e5c7fd488d 👷 trying new Travis workers 2019-03-10 22:56:14 +01:00
Niels Lohmann
5047c7a217 🐛 added missing include #1500 2019-03-10 22:26:57 +01:00
Niels Lohmann
8eb7db7277 Merge pull request #1441 from iwanders/support-cmake-older-than-3-8-with-if
Use C++11 features supported by CMake 3.1.
2019-03-10 22:08:16 +01:00
Niels Lohmann
393410e61a Merge pull request #1495 from njlr/patch-1
Update Buckaroo instructions in README.md
2019-03-10 22:03:49 +01:00
Niels Lohmann
30edcaab3a Merge pull request #1496 from lieff/develop
fix GCC 7.1.1 - 7.2.1 on CentOS
2019-03-10 22:01:52 +01:00
lieff
7b31e56fbf fix GCC 7.1.1 - 7.2.1 on CentOS
closes https://github.com/nlohmann/json/issues/670
2019-02-25 16:38:22 +03:00
Andreas Schwab
bb22b1003f Do proper endian conversions
This fixes all testsuite failures on big endian hosts.
2019-02-25 12:09:13 +01:00
njlr
8aeee4f7e3 Update README.md
* Updates Buckaroo instructions to v2
2019-02-25 09:44:38 +00:00
garethsb-sony
d183bd0456 Tests for json_pointer::empty and json_pointer::parent_pointer 2019-02-25 09:26:08 +00:00
garethsb-sony
08de9eeaca Add json_pointer::parent_pointer (cf. std::filesystem::path::parent_path) 2019-02-25 09:26:08 +00:00
garethsb-sony
164e0e54d9 Rename private json_pointer::is_root as public json_pointer::empty for consistency with std::filesystem::path 2019-02-25 09:26:07 +00:00
Laurent Stacul
ddc9f201f4 Fix gcc9 build error test/src/unit-allocator.cpp (Issue #1472) 2019-02-22 16:05:41 +00:00
Niels Lohmann
21516f2bae Merge pull request #1491 from nickaein/patch-1
Fix typo in README.md
2019-02-22 09:50:45 +01:00
Isaac Nickaein
088a245218 Fix typo in README.ME
Fixes https://github.com/nlohmann/json/issues/1486.
2019-02-22 01:05:00 +03:30
Niels Lohmann
e326df211b Merge pull request #1474 from nickaein/develop
Implement contains() member function
2019-02-13 13:05:21 +01:00
Niels Lohmann
c55cacee1e Merge pull request #1477 from nickaein/fix-doc
Fix documentation
2019-02-13 13:03:46 +01:00
Isaac Nickaein
e93f305494 Add unit-test for contains() member function 2019-02-13 13:21:54 +03:30
Isaac Nickaein
6a5db00951 Implement contains() to check existence of a key 2019-02-13 13:21:54 +03:30
Isaac Nickaein
fb5ceb26ac Fix documentation
Remove two instance of duplicate paragraphs.
2019-02-11 17:00:48 +03:30
Niels Lohmann
46ff13d39e Merge pull request #1468 from past-due/disable_Wmismatched_tags_on_tuple
Disable Clang -Wmismatched-tags warning on tuple_size / tuple_element
2019-02-10 21:50:12 +01:00
Niels Lohmann
eee3bc0c79 Merge pull request #1464 from elvisoric/update_meson_install_step
Disable installation when used as meson subproject. #1463
2019-02-10 21:48:20 +01:00
garethsb-sony
5da757bbb3 Attempt to satisfy Coveralls by adding a test for (unchanged) operator std::string 2019-01-31 23:39:57 +00:00
garethsb-sony
c850e9d82d Add operator/= and operator/ to construct a JSON pointer by appending two JSON pointers, as well as convenience op/= and op= to append a single unescaped token or array index; inspired by std::filesystem::path 2019-01-31 19:15:50 +00:00
past-due
45819dce54 Disable -Wmismatched-tags warning on tuple_size / tuple_element 2019-01-30 12:59:50 -05:00
Elvis Oric
77d1d37290 Disable installation when used as meson subproject. #1463 2019-01-30 11:40:14 +01:00
Isaac Nickaein
372c4d2125 Merge branch 'develop' into iterate-on-destruction 2019-01-28 02:41:22 +03:30
Niels Lohmann
68ec3eb8d6 Merge pull request #1451 from Afforix/Afforix-fix-extra-semicolon
remove extra semicolon from readme
2019-01-25 13:36:18 +01:00
Niels Lohmann
de14b5ee2f Merge pull request #1455 from wythe/patch-2
docs: README typo
2019-01-25 13:36:07 +01:00
Mark Beckwith
cca6d0dbae docs: README type
Just another small typo I found in the README.
2019-01-24 10:49:45 -06:00
Patrick Boettcher
a06e7f5d80 JSON-pointer: add operator+() returning a new json_pointer 2019-01-24 16:46:51 +01:00
Matěj Plch
dc21cbb751 remove extra semicolon
in example of NLOHMANN_JSON_SERIALIZE_ENUM
2019-01-22 10:13:12 +01:00
Niels Lohmann
e89c946451 Merge branch 'feature/nodiscard' into develop 2019-01-20 15:41:30 +01:00
Niels Lohmann
6de4df23e4 🐛 fixed integer overflow in dump function #1447
Closes #1447.
2019-01-20 12:26:01 +01:00
Niels Lohmann
e17e0d031f Merge pull request #1446 from scinart/develop
attempt to fix #1445, flush buffer in serializer::dump_escaped in UTF8_REJECT case.
2019-01-20 12:18:02 +01:00
Niels Lohmann
e36593e960 🔨 trying code from https://godbolt.org/z/-tLO1K 2019-01-20 11:12:20 +01:00
scinart
20db020c1f move newly-added tests in unit-regression.cpp 2019-01-19 11:36:50 -05:00
Niels Lohmann
d359fd3a8d 🚧 trying nodiscard attribute #1433 2019-01-19 17:32:23 +01:00
Niels Lohmann
b9a39b38bf Merge pull request #1434 from pboettch/develop
allow push_back() and pop_back() calls on json_pointer
2019-01-19 17:07:36 +01:00
scinart
83e84446d6 fix typo 2019-01-18 20:55:01 -05:00
scinart
899bd94b43 flush buffer in serializer::dump_escaped case UTF8_REJECT
serializer use fixed buffer. Whenever it is nearly full, it is flushed to `output_adapter_t<char> o`
But the code forgets to flush when there is a invalid utf8 code point
So there will be buffer overflow.
2019-01-18 20:35:48 -05:00
Ivor Wanders
4fd9b52fc2 Use C++11 features supported by CMake 3.1. 2019-01-16 08:50:58 -05:00
Niels Lohmann
dffae1082f Merge pull request #1435 from pboettch/warning-fix
🚨 fixed unused variable warning
2019-01-15 22:18:13 +01:00
Niels Lohmann
851fe8a5ef Merge pull request #1430 from nicoddemus/conda-docs
Add instructions about using nlohmann/json with the conda package manager
2019-01-15 22:16:49 +01:00
onqtam
a2c074fd4d this should really fix the XCode 6/7 builds 2019-01-15 22:58:12 +02:00
onqtam
3340162efd fixing osx builds - had forgotten to define this for the object file where the test runner is compiled 2019-01-15 22:48:37 +02:00
onqtam
2f44ac1def moved from Catch to doctest for unit tests 2019-01-15 22:02:16 +02:00
Isaac Nickaein
f0883dda8f During destruction, flatten children of objects to avoid recursion 2019-01-15 20:29:51 +03:30
Isaac Nickaein
47fe4b9cee Add unit test for parsing deeply-nested array 2019-01-15 20:22:11 +03:30
Patrick Boettcher
d0c0d16110 🚨 fixed unused variable warning
Since 6503e83e74 "Improve dump_integer performance by implementing a more efficient int2ascii"
an unused variable and thus a warning existed.
2019-01-15 15:21:02 +01:00
Patrick Boettcher
9225cf2f57 allow push_back() and pop_back() calls on json_pointer
Putting pop_back() to public and creating a trivial push_back()
method allows users of nlohmann::json_pointer to manipulate an
existing json-pointer by adding or removing keys at the end.

This is useful for traversing a JSON-instance and keeping track
of its "absolute path" at any moment.

In my case for a schema-validator error-handler.
2019-01-15 14:43:46 +01:00
Bruno Oliveira
b025d66eb5 Add instructions about using nlohmann/json with the conda package manager 2019-01-15 11:06:26 -02:00
Niels Lohmann
e5753b14a8 🚨 fixed another linter warning #1400
Closes #1400.
2019-01-13 15:40:49 +01:00
Niels Lohmann
5c04cc1009 🔨 fixed includes 2019-01-13 15:31:22 +01:00
Niels Lohmann
8e9ad346d9 🚨 fixed another linter warning 2019-01-13 13:00:54 +01:00
Niels Lohmann
ad01736d55 💡 improved documentation for parsing without exceptions #1405
Closes #1405
2019-01-13 11:46:05 +01:00
Niels Lohmann
06731b14d7 ⬆️ upgraded Catch and Google Benchmark
- Catch 1.12.0 -> 1.12.2
- Google Benchmark 1.3.0 -> 1.4.1
2019-01-13 11:29:39 +01:00
Niels Lohmann
daeb48b01a Merge pull request #1411 from nickaein/develop
Improve dump_integer performance
2019-01-13 11:11:51 +01:00
Niels Lohmann
29a03f465e Merge pull request #1414 from nickaein/mydevel-appveyor-x64
Fix x64 target platform for appveyor
2019-01-12 23:09:19 +01:00
Isaac Nickaein
c9dd260a4c Add unit tests for dump_integer
Add some unit tests for formatting integers
to keep code coverage as before.
2019-01-12 08:58:30 -08:00
Isaac Nickaein
be9b4cbd60 Add benchmark for small integers
This benchmark is a sample of 1 million "small" integers
in range [-1000000 1000000) sampled from uniform distribution.
2019-01-12 08:58:30 -08:00
Isaac Nickaein
6503e83e74 Improve dump_integer performance by implementing a more efficient int2ascii
This commits implements a faster int2ascii inspired by "Fastware" talk given
by Andrei Alexandrescu.
See: https://www.youtube.com/watch?v=o4-CwDo2zpg
2019-01-12 08:58:30 -08:00
Isaac Nickaein
f16432832c Increase stack size for VS2017 Win x64 on Appveyor 2019-01-12 19:27:26 +03:30
Niels Lohmann
b39f34e046 Merge pull request #1425 from hijxf/patch-1
Updated year in README.md
2019-01-12 10:23:31 +01:00
Jef LeCompte
7f73915d4f Updated year in README.md 2019-01-11 08:54:03 -05:00
Niels Lohmann
df460c96cf Merge pull request #1423 from skypjack/patch-1
Fixed broken links in the README file
2019-01-10 13:52:52 +01:00
Michele Caini
6546cad7bf Fixed broken links in the README file 2019-01-10 08:54:53 +01:00
Niels Lohmann
847dd2a954 Merge pull request #1420 from skypjack/patch-1
Fixed broken links in the README file
2019-01-09 22:33:40 +01:00
Niels Lohmann
937b642e0e 📝 added description on how to use NuGet package #1132
Closes #1132.
2019-01-09 21:08:06 +01:00
Niels Lohmann
975dc970d1 Merge pull request #1417 from wythe/patch-1
docs: typo in README
2019-01-09 20:35:49 +01:00
Michele Caini
b8be0f64ae Fixed broken links to operator[]() and at() 2019-01-09 15:11:54 +01:00
Michele Caini
619bf9c20d Fixed broke links to RFC7159 2019-01-09 15:05:09 +01:00
Mark Beckwith
a559ff8fc6 typo in README
inintended -> unintended
2019-01-08 13:24:07 -06:00
Isaac Nickaein
2c0c2ca698 Specify target platform in generator name 2019-01-05 14:15:33 -08:00
Niels Lohmann
676c847c55 Merge pull request #1409 from yann-morin-1998/yem/cmake-version
buildsystem: relax requirement on cmake version
2019-01-01 17:17:38 +01:00
Yann E. MORIN
e8b6b7adc1 buildsystem: relax requirement on cmake version
Commit 73cc5089 (Using target_compile_features to specify C++ 11
standard) bumped the required cmake version, from 3.0 to 3.8, so
as to get the definition of target_compile_features().

However, target_compile_features() was introduced in cmake-3.1:
    https://cmake.org/cmake/help/v3.1/command/target_compile_features.html

And using cmake-3.1 is indeed sufficient to properly build.

As such, relax the minimum required version down to cmake-3.1,
so we can build on oldish, entreprise-grade distributions that
only have cmake-3.1 (or at least, don't have up to cmake-3.8).

Reported-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2018-12-31 18:52:04 +01:00
Niels Lohmann
c682b9879b 🚨 fixed PVS V567 warning
"V567 The modification of the 'position.chars_read_current_line' variable is unsequenced relative to another operation on the same variable. This may lead to undefined behavior."
2018-12-30 23:00:15 +01:00
Niels Lohmann
6f89613acd 🚨 fixed some warnings 2018-12-23 13:56:18 +01:00
Niels Lohmann
db53bdac19 Merge branch 'release/3.5.0' into develop 2018-12-22 00:01:28 +01:00
Niels Lohmann
cebb4e052a Merge branch 'release/3.5.0' 2018-12-22 00:01:18 +01:00
Niels Lohmann
78348afeb6 🔖 set version to 3.5.0 2018-12-21 23:52:29 +01:00
Niels Lohmann
1107f8cd82 📝 updated documentation for items() function 2018-12-21 22:51:12 +01:00
Niels Lohmann
98f4e31c3e 📝 formatted picture 2018-12-21 18:33:46 +01:00
Niels Lohmann
58c269b039 📝 updated documentation 2018-12-21 18:27:56 +01:00
Niels Lohmann
2182157dc1 📝 update documentation 2018-12-21 09:32:35 +01:00
Niels Lohmann
45f5611d9b 🚨 fixed two warnings 2018-12-20 22:41:48 +01:00
Niels Lohmann
117c1d14fb 📝 added contributors to 3.5.0 2018-12-20 22:20:47 +01:00
Niels Lohmann
d584ab269a 🎨 fixed header 2018-12-20 21:58:16 +01:00
Niels Lohmann
45a8a093d7 🚨 fixed a warning 2018-12-20 21:40:47 +01:00
Niels Lohmann
85849940ba Merge pull request #1391 from pratikpc/develop
Added Support for Structured Bindings
2018-12-20 08:58:08 +01:00
Pratik Chowdhury
ebd3f45808 Added Support for Structured Bindings
For further details, read https://github.com/nlohmann/json/issues/1388 and https://blog.tartanllama.xyz/structured-bindings/
2018-12-19 20:17:52 +05:30
Niels Lohmann
4f270e38cc Merge pull request #1342 from davedissian/bugfix/sfinae-iterator-traits
Add a SFINAE friendly iterator_traits and use that instead.
2018-12-19 08:24:18 +01:00
David Avedissian
f1080d7c39 Code review. 2018-12-18 20:44:37 +00:00
Niels Lohmann
5d390e91ff Merge pull request #1392 from mtalliance/feature/addFileInputAdapter
Feature/add file input adapter
2018-12-16 22:10:03 +01:00
Jonathan Dumaresq
c1c85b025c Forget one std::FILE 2018-12-14 07:33:28 -05:00
Jonathan Dumaresq
635a4fc344 use namespace std when possible. Change the name of private variable. 2018-12-12 16:33:25 -05:00
Jonathan Dumaresq
cf31193de2 create single json.hpp file 2018-12-12 14:46:52 -05:00
Jonathan Dumaresq
a794cfdba3 refactor unit test in case of throw, the fclose will not be called. using unique_ptr with custom destructor will ensure that 2018-12-12 14:46:17 -05:00
Jonathan Dumaresq
91ff96a737 remove the const attribute 2018-12-12 14:16:12 -05:00
Jonathan Dumaresq
b7a2642fba remove comment 2018-12-12 14:15:49 -05:00
Jonathan Dumaresq
fa7f1a524e new unified json.hpp generated with make amalgamate 2018-12-12 10:19:22 -05:00
Jonathan Dumaresq
ef283e0cf8 add tests to cover the new input adapter 2018-12-12 10:18:37 -05:00
Jonathan Dumaresq
3335da622a remove non usefull code. 2018-12-12 09:32:52 -05:00
Jonathan Dumaresq
ae48acbb23 remove non usefull code. Add small description 2018-12-12 09:28:42 -05:00
Jonathan Dumaresq
52f6fd1d91 Add the possibility of using FILE * from cstdio library to read a file. This enable the possibility of using low eand device with this library. 2018-12-11 13:17:13 -05:00
Jonathan Dumaresq
67b0daf27b Add the possibility of using FILE * from cstdio library to read a file. This enable the possibility of using low eand device with this library. 2018-12-11 09:33:30 -05:00
David Avedissian
2c23f0a346 Changes requested from code review. 2018-12-08 15:46:33 +00:00
Niels Lohmann
e73dfef6e5 Merge pull request #1382 from kjpus/patch-1
Link to issue #958 broken
2018-12-04 20:02:38 +01:00
kjpus
767a3a327d Link to issue #958 broken 2018-12-04 10:03:10 -05:00
Niels Lohmann
d53873a251 Merge pull request #1363 from theodelrieu/doc/implicit_conversions
recommend using explicit from JSON conversions
2018-12-02 17:27:46 +01:00
Niels Lohmann
7a56f5a42b Merge pull request #1380 from manu-chroma/patch-1
readme: fix typo
2018-12-02 17:25:38 +01:00
Manvendra Singh
5de184b8fb readme: fix typo 2018-12-02 01:50:57 +05:30
Niels Lohmann
ef90d62ddf 🚨 fixed warning #1364 2018-11-21 21:17:38 +01:00
Théo DELRIEU
7b961368d5 recommend using explicit from JSON conversions 2018-11-20 14:14:07 +01:00
Niels Lohmann
da81e7be22 🏁 adding parentheses around std::snprintf calls #1337 2018-11-09 21:18:02 +01:00
Niels Lohmann
f80efd3954 💄 cleanup 2018-11-09 21:10:32 +01:00
Niels Lohmann
35829928da Merge pull request #1343 from mefyl/develop
Set eofbit on exhausted input stream.
2018-11-09 21:07:36 +01:00
Niels Lohmann
f86090aafc Merge pull request #1345 from mpoquet/feature/meson-install-pkgconfig
Allow installation via Meson
2018-11-08 18:39:26 +01:00
Niels Lohmann
30e1cbb0df Merge pull request #1346 from ax3l/fix-mergePatchShadowParam
Fix merge_patch shadow warning
2018-11-08 18:38:40 +01:00
mefyl
aa10382629 Set eofbit on exhausted input stream.
Fix issue #1340.

        The eofbit is set manually since we don't go through the
	stream interface. We could maybe use the stream interface
	instead, but there are some assumptions regarding which
	exception go through, so this seems to be the most prudent
	approach for now.
2018-11-08 11:41:17 +01:00
Axel Huebl
798754dfb6 Amalgamate Headers 2018-11-08 10:35:45 +01:00
Axel Huebl
97b81da840 merge_patch: rename parameter
Avoid shadowing a member of `this` by choosing the same name as
parameter (`-Wshadow`). Instead, make name of parameter more
expressive.
2018-11-08 10:31:47 +01:00
Millian Poquet
ffe08983dd :meson: install headers + pkg-config 2018-11-08 00:25:42 +01:00
David Avedissian
f665a92330 Implement SFINAE friendly iterator_traits and use that instead. 2018-11-07 18:39:25 +00:00
Niels Lohmann
d2e6e1bf58 Merge pull request #1329 from ax3l/fix-typosWhitespaces
Fix EOL Whitespaces & CMake Spelling
2018-11-02 18:23:42 +01:00
Axel Huebl
a7567bc596 Remove EOL whitespaces in natvis 2018-11-02 10:42:48 +01:00
Axel Huebl
f049836d68 CMake: Optional Install if Embedded
When adding this library as embedded library with private
"target link", e.g. only used inside private source files, the
library does not need to be installed when the main project gets
installed.

This adds an additional option `JSON_Install` similar to the
test-build control switch in order to skip installing headers and
CMake config files if requested.

Avoids using
```cmake
add_subdirectory(path/to/nlohmann_json EXCLUDE_FROM_ALL)
```

which has further side-effects:
https://cmake.org/cmake/help/v3.0/command/add_subdirectory.html
2018-11-02 10:18:00 +01:00
Axel Huebl
689382a722 Fix EOL Whitespaces & CMake Spelling
Fix little leftover EOL whitespaces in `CMakeLists.txt` and
a spelling of CMake in README.md
2018-11-02 09:35:17 +01:00
Niels Lohmann
2f73a4d1f3 🚨 fixed a linter warning 2018-10-31 20:30:24 +01:00
Niels Lohmann
e3c28afb61 Merge branch 'release/3.4.0' into develop 2018-10-30 22:20:29 +01:00
Niels Lohmann
6708f22cd4 Merge branch 'release/3.4.0' 2018-10-30 22:20:12 +01:00
Niels Lohmann
0f3c74d821 🔖 set version to 3.4.0 2018-10-30 22:18:45 +01:00
Niels Lohmann
7b2f8cce03 🔖 set version to 3.4.0 2018-10-30 21:30:20 +01:00
Niels Lohmann
8cee0e38d9 🚑 fixed #1319 2018-10-30 17:29:05 +01:00
Niels Lohmann
856fc31d0a 💄 fixed indentation 2018-10-29 19:44:19 +01:00
Niels Lohmann
39419cd5c4 🚨 fixed another linter warning 2018-10-29 18:51:30 +01:00
Niels Lohmann
86b5ce953a 📝 added examples for BSON functions 2018-10-28 15:09:26 +01:00
Niels Lohmann
d2e4f0b0d9 ✏️ fixed some typos 2018-10-28 14:20:20 +01:00
Niels Lohmann
f0c1459554 🐛 fixed a bug parsing BSON strings #1320 2018-10-28 09:16:40 +01:00
Niels Lohmann
24946f67f1 🚨 fixed some more linter warnings 2018-10-28 09:15:41 +01:00
Niels Lohmann
7d0dc10169 🚨 fixed a linter warning 2018-10-27 18:34:35 +02:00
Niels Lohmann
45a761bd60 Merge branch 'develop' of https://github.com/nlohmann/json into develop 2018-10-27 18:31:06 +02:00
Niels Lohmann
4e765596f7 🔨 small improvements 2018-10-27 18:31:03 +02:00
Niels Lohmann
1308ea055d Merge pull request #1315 from nlohmann/feature/convert_char
Properly convert constants to CharType
2018-10-27 16:56:00 +02:00
Niels Lohmann
0e7be06bef Merge pull request #1323 from nlohmann/feature/enum_json_mapping
Add macro to define enum/JSON mapping
2018-10-27 16:55:39 +02:00
Niels Lohmann
85aaf91b85 Merge branch 'develop' into feature/enum_json_mapping 2018-10-27 16:52:59 +02:00
Niels Lohmann
5a6bdf5934 Merge branch 'develop' into feature/convert_char 2018-10-27 16:48:48 +02:00
Niels Lohmann
037e93f5c0 Merge pull request #1320 from nlohmann/julian-becker-feature/bson
Add BSON support
2018-10-27 16:37:54 +02:00
Niels Lohmann
9f48bb6937 replaced vector by array #1323 2018-10-27 09:58:23 +02:00
Niels Lohmann
6384fe28db 🚨 fixed another linter warning 2018-10-26 23:12:41 +02:00
Niels Lohmann
ad639ad5e6 added NLOHMANN_JSON_SERIALIZE_ENUM marco #1208 2018-10-26 14:48:20 +02:00
Niels Lohmann
544150d5a5 🚨 fixed another linter warning 2018-10-26 11:10:49 +02:00
Niels Lohmann
c2e175763c 👌 added another conversion function #1315 2018-10-25 22:47:08 +02:00
Niels Lohmann
d97fa30795 👌 fixed comment #1320 2018-10-25 22:29:27 +02:00
Niels Lohmann
7ce720b700 🚨 fixed coverage 2018-10-25 18:21:50 +02:00
Niels Lohmann
19647e083c 🚨 fixed compiler warnings 2018-10-25 14:27:55 +02:00
Niels Lohmann
62126278a6 🔨 added fix for arrays 2018-10-25 13:01:18 +02:00
Niels Lohmann
1968e5c793 🎨 clean up binary formats 2018-10-24 23:39:30 +02:00
Niels Lohmann
4d1eaace8c 🔨 fixed fuzz code to avoid false positives in case of discarded values 2018-10-24 18:55:08 +02:00
Niels Lohmann
e2c5913a50 🚧 some changes to the BSON code
- added fuzz testers
- added some reference files
- made an exception text more clear
2018-10-24 15:43:37 +02:00
Niels Lohmann
bba159121f Merge branch 'feature/bson' of https://github.com/julian-becker/json into julian-becker-feature/bson 2018-10-24 15:03:15 +02:00
Niels Lohmann
f102df3cba 📝 updated documentation #1314 2018-10-24 09:28:57 +02:00
Niels Lohmann
7b501de054 Merge pull request #1314 from nlohmann/feature/codec_errors
Allow to set error handler for decoding errors
2018-10-24 08:40:58 +02:00
Niels Lohmann
20038e2703 📝 added a note to the discussion #1286 2018-10-23 23:00:43 +02:00
Niels Lohmann
87ef3f25f2 ✏️ fixed a typo #1314 2018-10-23 22:56:10 +02:00
Niels Lohmann
b49f76931f 👌 replaced static_cast to CharType by conversion function #1286 2018-10-23 17:49:04 +02:00
Niels Lohmann
2343d9caeb 💚 additional tests from the Unicode spec #1198
Thanks @abolz!
2018-10-23 17:22:13 +02:00
Niels Lohmann
951a7a6455 🚧 fixed test cases #1198 2018-10-22 18:20:45 +02:00
Niels Lohmann
c51b1e6fab 🚧 fixed an issue with ensure_ascii #1198 2018-10-22 15:53:36 +02:00
Niels Lohmann
c7af027cbb 🚧 respect ensure_ascii parameter #1198 2018-10-22 09:18:16 +02:00
Niels Lohmann
e5dce64115 💚 added tests #1198
Test every prefix of Unicode sequences against the different dump functions.
2018-10-21 23:26:25 +02:00
Niels Lohmann
c5821d91e5 🚧 overworked error handlers #1198 2018-10-21 11:49:37 +02:00
Julian Becker
ad11b6c35e BSON: Improved exception-related tests and report location of U+0000 in the key-string as part of out_of_range.409-message 2018-10-18 20:05:46 +02:00
Niels Lohmann
9294e25c98 Merge pull request #1301 from theodelrieu/fix/1299
add new is_constructible_* traits used in from_json
2018-10-18 19:18:48 +02:00
Niels Lohmann
b553a8a93c Merge pull request #1305 from koponomarenko/add-meson-info
Add Meson related info to README
2018-10-18 10:55:25 +02:00
Julian Becker
5ba812d518 BSON: fixed incorrect casting in unit-bson.cpp 2018-10-18 06:38:34 +02:00
Julian Becker
8de10c518b BSON: Hopefully fixing ambiguity (on some compilers) to call to string::find() 2018-10-17 21:47:01 +02:00
Kostiantyn Ponomarenko
f0c55ce0e0 Add Meson related info to README
Add more information about how one can get a Meson wrap file.

Signed-off-by: Kostiantyn Ponomarenko <konstantin.ponomarenko@gmail.com>
2018-10-17 21:46:45 +03:00
Julian Becker
2a63869159 Merge branch 'develop' of https://github.com/nlohmann/json into feature/bson
Conflicts:
	include/nlohmann/detail/input/binary_reader.hpp
	single_include/nlohmann/json.hpp
	src/unit-bson.cpp
2018-10-17 20:26:00 +02:00
Niels Lohmann
4b2a00641c Merge pull request #1303 from nlohmann/feature/binary_errors
Improve diagnostic messages for binary formats
2018-10-17 17:54:14 +02:00
Niels Lohmann
dbb0b63187 improved error messages for binary formats #1288
This commit is the equivalent of #1282 for CBOR, MessagePack, and UBJSON.
2018-10-17 12:15:58 +02:00
Théo DELRIEU
a946dfc19c add a note to maintainers in type_traits.hpp 2018-10-17 12:03:10 +02:00
Julian Becker
978c3c4116 BSON: throw json.exception.out_of_range.409 in case a key to be serialized to BSON contains a U+0000 2018-10-16 20:42:00 +02:00
Niels Lohmann
0671e92ced 🚧 proposal for different error handlers #1198
Proof of concept; currently only as parameter to the internal dump_escaped function; that is, not yet exposed to the dump function.
2018-10-16 20:38:50 +02:00
Julian Becker
daa3ca8a2e BSON: Adjusted documentation of binary_writer::to_bson() 2018-10-16 19:29:42 +02:00
Julian Becker
5bccacda30 BSON: throw json.exception.out_of_range.407 in case a value of type std::uint64_t is serialized to BSON. Also, added a missing EOF-check to binary_reader. 2018-10-16 19:13:07 +02:00
Théo DELRIEU
45c8af2c46 add new is_constructible_* traits used in from_json
is_compatible_* traits were used in from_json, but it made no sense
whatsoever.

It used to work because of non-SFINAE correctness + json_ref
unconstrained variadic template constructor.

SFINAE checks are becoming quite complex, we need a specification of
some sort describing:

* which concepts the library uses
* how the conversion to/from json works in detail

Having such a specification would really help simplifying the current
code (as well as having meaningful checks).

Fixes !1299
2018-10-16 14:00:34 +02:00
Niels Lohmann
dd672939a0 Merge pull request #1294 from theodelrieu/fix/json_ref_ctor
add constraints for variadic json_ref constructors
2018-10-12 17:35:41 +02:00
Théo DELRIEU
11fecc25af add constraints for variadic json_ref constructors
Fixes #1292
2018-10-12 10:54:58 +02:00
Niels Lohmann
e426219256 Merge pull request #1282 from nlohmann/feature/lines_columns
Improve diagnostic messages
2018-10-08 22:17:33 +02:00
Niels Lohmann
adfa961ed0 Merge pull request #1280 from nlohmann/feature/linter
Removed linter warnings
2018-10-08 21:05:33 +02:00
Niels Lohmann
6d34d64bfd 🚑 fixed compilation error 2018-10-08 06:54:51 +02:00
Niels Lohmann
74a31075e3 improved parse error messages 2018-10-07 22:39:17 +02:00
Niels Lohmann
6e49d9f5ff 🚑 fixed compilation error 2018-10-07 21:34:40 +02:00
Niels Lohmann
f8158997b5 📝 fixed documentation 2018-10-07 21:30:58 +02:00
Julian Becker
df0f612d1b BSON: allow and discard values and object entries of type value_t::discarded 2018-10-07 20:08:05 +02:00
Niels Lohmann
3abb788139 🚨 fixed some more clang-tidy warnings 2018-10-07 19:07:58 +02:00
Niels Lohmann
858e75c4df 🚨 fixed some clang-tidy warnings 2018-10-07 18:39:18 +02:00
Julian Becker
062aeaf7b6 BSON: Reworked the binary_writer such that it precomputes the size of the BSON-output.
This way, the output_adapter can work on simple output iterators and no longer requires random access iterators.
2018-10-07 18:02:51 +02:00
Niels Lohmann
6d09cdec34 🐛 fixed a bug in the unget function 2018-10-07 16:48:45 +02:00
Niels Lohmann
011b15dd08 added line positions to error messages
This is a follow-up to #1210.
2018-10-07 12:27:24 +02:00
Julian Becker
81f4b34e06 BSON: Improved documentation and error handling/reporting 2018-10-07 09:57:55 +02:00
Niels Lohmann
ac38e95780 Merge pull request #1277 from performous/fix-clang-detection
Thirdparty benchmark: Fix Clang detection.
2018-10-06 16:29:26 +02:00
Niels Lohmann
fa722d5ac3 🚨 fixed another linter warning 2018-10-06 16:26:47 +02:00
Niels Lohmann
ec95438a59 🚨 fixed some linter warnings 2018-10-06 13:49:02 +02:00
Niels Lohmann
f1768a540a Merge branch 'release/3.3.0' into develop 2018-10-05 12:59:41 +02:00
Niels Lohmann
aafad2be1f Merge branch 'release/3.3.0' 2018-10-05 12:59:28 +02:00
Niels Lohmann
cdfe6ceda6 🔖 set version to 3.3.0 2018-10-05 11:20:10 +02:00
Niels Lohmann
b968faa882 🔖 set version to 3.3.0 2018-10-05 10:59:33 +02:00
Niels Lohmann
cd518fbbab 📝 small update to pass test suite 2018-10-05 08:58:38 +02:00
Gregorio Litenstein
e8427061a0 Thirdparty benchmark: Fix Clang detection.
CMake 3.0+ refers to macOS’ Clang as AppleClang, which would fail a STREQUAL check. Fixed by changing it to MATCHES.
2018-10-05 02:01:43 -03:00
Niels Lohmann
b911654857 📝 updated contributor list 2018-10-04 22:30:18 +02:00
Niels Lohmann
bb55885215 💄 cleaned code 2018-10-04 20:42:19 +02:00
Niels Lohmann
5c7d27c338 Merge pull request #1272 from antonioborondo/fix_warning
Fix warning C4127: conditional expression is constant
2018-10-04 20:33:26 +02:00
Antonio Borondo
b6fdad9acd Remove anonymous namespace 2018-10-03 13:51:49 +01:00
Antonio Borondo
7c385a4844 Fix error: 'wide_string_input_helper' was not declared in this scope 2018-10-03 12:41:34 +01:00
Antonio Borondo
9ba3f79667 Fix error: explicit specialization in non-namespace scope 2018-10-03 12:26:24 +01:00
Antonio Borondo
8d1585f065 Change implementation to use templates 2018-10-03 11:44:02 +01:00
Antonio Borondo
ad3c216bb5 Generate header 2018-10-03 11:27:53 +01:00
Antonio Borondo
0231059290 Fix warning 2018-10-03 11:27:53 +01:00
Niels Lohmann
9f18e17063 Merge pull request #1270 from chuckatkins/add-more-cmake-docs
docs: Add additional CMake documentation
2018-10-03 10:11:27 +02:00
Niels Lohmann
53ec0a16f3 Merge pull request #1271 from chuckatkins/cleanup-deprecated-warnings
Turn off additional deprecation warnings for GCC.
2018-10-02 22:07:18 +02:00
Chuck Atkins
4c617611e2 docs: Add additional CMake documentation 2018-10-02 14:28:20 -04:00
Chuck Atkins
829571ab5c Turn off additional deprecation warnings for GCC.
In follow up from the conversation in #1269, this adds the
`-Wno-deprecate-declarations` flag to unit tests to allow them to
test deprecated APIs without all the noisy compiler warnings.
This also refactors the setting of build properties for test targets
to use `target_<...>` commands instead of `set_target_properties()`.
2018-10-02 13:01:19 -04:00
Niels Lohmann
c8231eff75 Merge pull request #1260 from chuckatkins/fix-cmake-target-alias
Fix broken cmake imported target alias
2018-10-01 17:44:50 +02:00
Chuck Atkins
02e653bdf7 docs: add a note in the readme about using the CMake imported target 2018-09-30 22:52:54 -04:00
Chuck Atkins
564506a885 cmake: add import config tests 2018-09-30 22:52:47 -04:00
Chuck Atkins
1729db85c1 cmake: fix package config to deal with versioning and namespaces 2018-09-30 09:56:33 -04:00
Niels Lohmann
910a895027 Merge pull request #1238 from theodelrieu/fix/1237
Fix issue #1237
2018-09-29 14:50:54 +02:00
Niels Lohmann
1fae82b7a7 Merge branch 'develop' into fix/1237 2018-09-29 14:50:36 +02:00
Niels Lohmann
22e55349a6 📝 added Wandbox link #1227 2018-09-29 14:33:39 +02:00
Niels Lohmann
70e587c3da 📝 added Wandbox link #1227 2018-09-29 14:33:21 +02:00
Niels Lohmann
d26f39466e Merge pull request #1231 from theodelrieu/feature/get_with_parameter
Add a get overload taking a parameter.
2018-09-29 14:30:04 +02:00
Niels Lohmann
c61a9071ae 🚨 fixed a compilation issue with ICPC #755
Closes #1222
2018-09-29 11:50:14 +02:00
Julian Becker
e8730e5e82 BSON: Reworked binary_reader::get_bson_cstr() 2018-09-29 11:50:01 +02:00
Niels Lohmann
b59a58406e Merge branch 'develop' of https://github.com/nlohmann/json into develop 2018-09-29 11:48:52 +02:00
Niels Lohmann
4e54c9a13d 🚨 fixed a compilation issue with ICPC #755
Closes #1222
2018-09-29 11:48:49 +02:00
Julian Becker
0a09db9cc2 BSON: Extend binary_reader::get_number to be able to hanlde little endian input to get rid of binary_reader::get_number_little_endian 2018-09-29 11:33:01 +02:00
Niels Lohmann
95432c34f9 Merge pull request #1262 from knilch0r/patch-1
unit-testsuites.cpp: fix hangup if file not found
2018-09-29 10:58:10 +02:00
knilch
8c1387cfb3 unit-testsuites.cpp: fix hangup if file not found
If run from the wrong directory, std::ifstream f("test/data/big-list-of-naughty-strings/blns.json"); will not find the file and thus f.eof() will never return true.
Use canonical C++ file reading loop from https://gehrcke.de/2011/06/reading-files-in-c-using-ifstream-dealing-correctly-with-badbit-failbit-eofbit-and-perror/ instead.
2018-09-28 11:33:23 +02:00
Théo DELRIEU
521fe49fec Add basic_json::get_to function.
Takes an lvalue reference, and returns the same reference.

This allows non-default constructible types to be converted without
specializing adl_serializer.
This overload does not require CopyConstructible either.

Implements #1227
2018-09-28 11:25:23 +02:00
Niels Lohmann
680a4ab672 Merge pull request #1257 from henryiii/gcc48
GCC 48
2018-09-28 10:05:17 +02:00
Henry Fredrick Schreiner
7a37ba0c02 Adding 4.8 test to travis 2018-09-27 22:31:39 +02:00
Julian Becker
ef358ae695 BSON: Fixed hangup in case of incomplete bson input and improved test coverage 2018-09-25 20:34:25 +02:00
Chris Harris
99b7c7c8ef Patch nlohmann/json for GCC 4.8
See https://github.com/nlohmann/json/pull/212 for details
2018-09-25 18:10:20 +02:00
Julian Becker
bce4816275 BSON: Added test case for the different input/output_adapters 2018-09-24 23:35:19 +02:00
Julian Becker
763705c2a7 Fix: Add missing begin() and end() member functions to alt_string 2018-09-24 19:50:28 +02:00
Niels Lohmann
e184b6ecf2 Merge pull request #1252 from koponomarenko/fix-meson-build
Add version and license to meson.build
2018-09-22 14:49:03 +02:00
Niels Lohmann
88b055c2df Merge pull request #1249 from LEgregius/clang-3.4.2-crash-workaround
#1179 Reordered the code. It seems to stop clang 3.4.2 in RHEL 7 from crash…
2018-09-22 14:14:56 +02:00
Kostiantyn Ponomarenko
8799759b85 Add version and license to meson.build 2018-09-20 21:54:10 +03:00
Théo DELRIEU
4e52277b70 Fix issue #1237
* Make the conversion operator SFINAE correct.
* Workaround a GCC bug with some traits in type_traits.hpp

The first bullet-point implies that every `get`/`get_ptr` be SFINAE
correct as well.
2018-09-20 10:33:14 +02:00
Niels Lohmann
e4bc98d036 Merge pull request #1245 from chuckatkins/fix-target-namespace-backward-compatibility
Use a version check to provide backwards comatible CMake imported target names
2018-09-19 20:46:51 +02:00
David Guthrie
4d780b091b Reordered the code. It seems to stop clang 3.4.2 in RHEL 7 from crashing intermittently. 2018-09-18 16:38:59 -04:00
Chuck Atkins
3b1a5cafad Use a version check to provide backwards comatible imported target names. 2018-09-18 13:59:19 -04:00
Niels Lohmann
99939d6340 📝 added lgtm.com badge
See https://lgtm.com/projects/g/nlohmann/json
2018-09-18 19:27:52 +02:00
Niels Lohmann
4e2f35d4c2 👷 adding Xcode 10 worker
See https://blog.travis-ci.com/2018-09-13-xcode-10-is-now-available?utm_source=twitter&utm_medium=web&utm_campaign=xcode10_gm
2018-09-18 19:22:30 +02:00
Niels Lohmann
7fa3b8865c Merge pull request #1221 from rivertam/better-error-305
Better error 305
2018-09-18 12:49:07 +02:00
Ben Berman
8f07ab6392 Replace "key-style argument" with "string argument" 2018-09-17 15:36:38 -04:00
Julian Becker
df33a90774 BSON: Bugfix for non-empty arrays 2018-09-15 14:08:38 +02:00
Julian Becker
cf485c2907 BSON: Support for arrays 2018-09-15 13:54:08 +02:00
Julian Becker
120d1d77d4 BSON: test case for a more complex document 2018-09-15 13:41:05 +02:00
Julian Becker
5ce7d6bdd7 BSON: support objects with objects as members 2018-09-15 13:03:42 +02:00
Julian Becker
83b427ad67 BSON: unsigned integers 2018-09-15 12:20:30 +02:00
Julian Becker
c0d8921a67 BSON: support objects with int64 members 2018-09-15 12:00:53 +02:00
Julian Becker
7ee361f7ad BSON: support objects with int32 members 2018-09-15 11:54:17 +02:00
Julian Becker
c5ef023171 BSON: support objects with null members 2018-09-15 11:39:12 +02:00
Julian Becker
6c447de076 BSON: Support objects with string members 2018-09-15 11:33:24 +02:00
Julian Becker
0c0f2e44b5 BSON: support doubles 2018-09-15 10:32:03 +02:00
Julian Becker
9a0dddc5d2 BSON: Object with single boolean 2018-09-15 03:08:50 +02:00
Julian Becker
5f5836ce1c BSON: Support empty objects 2018-09-15 00:43:39 +02:00
Julian Becker
f06c8fd8e3 BSON: serialization of non-objects is not supported 2018-09-15 00:20:03 +02:00
Niels Lohmann
186c747a19 Merge pull request #1230 from mandreyel/lambda-unevaluated-context-fix
Move lambda out of unevaluated context
2018-09-10 20:52:11 +02:00
mandreyel
6b5334c167 Move lambda out of unevaluated context 2018-09-10 13:34:59 +02:00
Niels Lohmann
ebb3c03293 🎨 cleanup after #1228 2018-09-09 18:19:33 +02:00
Niels Lohmann
d3428b35c5 Merge pull request #1228 from theodelrieu/remove_static_asserts
Remove static asserts
2018-09-09 18:12:43 +02:00
Théo DELRIEU
aea648bb7a remove now-useless traits. check for is_basic_json where needed 2018-09-07 14:10:39 +02:00
Théo DELRIEU
4b4bbceebf make from_json SFINAE-correct 2018-09-07 14:10:37 +02:00
Théo DELRIEU
f7971f04a5 make to_json SFINAE-correct 2018-09-07 12:18:04 +02:00
Théo DELRIEU
f7c8a2145a refactor from/to_json(CompatibleArrayType) 2018-09-07 12:18:04 +02:00
Théo DELRIEU
628f76729e do not check for compatible_object_type in compatible_array_type 2018-09-07 12:18:03 +02:00
Théo DELRIEU
29f72966c3 refactor is_compatible_type, remove conjunction & co 2018-09-07 12:18:03 +02:00
Théo DELRIEU
77967e6548 refactor is_compatible_integer_type 2018-09-07 12:18:03 +02:00
Théo DELRIEU
13760857ff refactor is_compatible_array_type 2018-09-07 12:18:02 +02:00
Théo DELRIEU
924e95c6e8 refactor is_compatible_string_type 2018-09-07 12:18:02 +02:00
Théo DELRIEU
e84195ab7b refactor is_compatible_object_type 2018-09-07 12:18:02 +02:00
Théo DELRIEU
b59c3367c9 use detected instead of has_* traits 2018-09-07 12:17:59 +02:00
Théo DELRIEU
1ea8cd128c fix void_t for older compilers 2018-09-07 12:17:33 +02:00
Niels Lohmann
eb30ff0615 🚨 fixed a compiler warning #1224 2018-09-06 07:25:19 +02:00
Ben Berman
ad053ef09c Fix tests for improved error 305(hopefully) 2018-08-30 13:21:55 -04:00
Ben Berman
bbdfe7dea6 Improve error messages for error 305
Addresses #1220
2018-08-30 12:35:51 -04:00
Niels Lohmann
d713727f22 Merge pull request #1202 from dennisfischer/develop
Export package to allow builds without installing
2018-08-25 10:56:30 +02:00
Niels Lohmann
04597c3a66 Merge pull request #1214 from devsisters/fix-1213
Fix #1213
2018-08-24 17:54:28 +02:00
Hyeon Kim
aada309f61 Fix #1213 2018-08-24 21:55:13 +09:00
Niels Lohmann
359f98d140 Merge branch 'release/3.2.0' into develop 2018-08-20 19:36:25 +02:00
Niels Lohmann
8c20571136 Merge branch 'release/3.2.0' 2018-08-20 19:36:10 +02:00
Dennis Fischer
dfe607c6ff Export package to allow builds without installing 2018-08-20 09:23:12 +02:00
Niels Lohmann
9f3857ef6f 🔖 set version to 3.2.0 2018-08-18 18:46:15 +02:00
Niels Lohmann
7608a64e1e 🔨 fixed amalgamation 2018-08-18 18:14:12 +02:00
Niels Lohmann
a7b02bdce0 🔖 preparing 3.2.0 release 2018-08-18 17:48:49 +02:00
Niels Lohmann
c6a482b16c 📝 added example for sax_parse 2018-08-18 15:42:18 +02:00
Niels Lohmann
5ad52f4167 ⬆️ Catch 1.12.0 2018-08-18 12:02:12 +02:00
Niels Lohmann
3811daa8a3 📝 release preparation 2018-08-18 12:00:14 +02:00
Niels Lohmann
6899fa304c Merge branch 'develop' of https://github.com/nlohmann/json into develop 2018-08-18 08:15:06 +02:00
Niels Lohmann
57faaf42ca 🚨 fixed a compiler warning 2018-08-18 08:15:03 +02:00
Niels Lohmann
f78ac4fbd3 Merge pull request #1200 from thyu/develop
Fix -Wno-sometimes-uninitialized by initializing "result" in parse_sax
2018-08-18 08:14:04 +02:00
Tsz-Ho Yu
3004a73951 Fix -Wno-sometimes-uninitialized by initializing "result" in parse_sax
The function parse_sax() returns sometimes-uninitialized warnings in
some compilers. This commit fixes that.
2018-08-18 01:12:19 +01:00
Niels Lohmann
e33b31e6aa 🐛 fixed callback-related issue (https://github.com/nlohmann/json/issues/971#issuecomment-413678360) 2018-08-17 23:09:45 +02:00
Niels Lohmann
b5c54b41fd 📝 overworked documentation 2018-08-16 21:53:47 +02:00
Niels Lohmann
07494e06d7 🚨 fixed some compiler warnings 2018-08-16 18:20:30 +02:00
Niels Lohmann
d5b21b051c Merge pull request #1153 from theodelrieu/refactor/no_virtual_sax
Refactor/no virtual sax
2018-08-16 17:47:55 +02:00
Théo DELRIEU
0cc3db4f15 add static_asserts on SAX interface 2018-08-16 11:59:57 +02:00
Théo DELRIEU
38f8a51a8f use abstract sax class in parser tests 2018-08-16 11:59:49 +02:00
Théo DELRIEU
9bbb133094 remove no_limit constant and default values 2018-08-16 11:59:05 +02:00
Théo DELRIEU
442886d040 use templates in the sax interface instead of virtuals 2018-08-16 11:58:52 +02:00
Théo DELRIEU
f6febbe359 split meta.hpp, add detected_t (used to define concepts) 2018-08-16 11:58:42 +02:00
Niels Lohmann
3ac2d81a95 🔨 fixed a MinGW error #1193 2018-08-14 22:13:56 +02:00
Niels Lohmann
be2065dce9 🚨 fixing a MinGW warning #1192 2018-08-14 22:11:47 +02:00
Niels Lohmann
fed70f6bff 🎨 reindented code 2018-08-14 22:11:08 +02:00
Niels Lohmann
0e748f2f8c Merge pull request #1187 from devsisters/json-internal-catch
[RFC] Introduce a new macro function: JSON_INTERNAL_CATCH
2018-08-14 21:56:29 +02:00
Niels Lohmann
861ee400cc Merge pull request #1176 from grembo/develop
Fix unit tests that were silently skipped or crashed (depending on the compiler)
2018-08-14 21:48:49 +02:00
Niels Lohmann
3ce4325350 📝 updated documentation of used compilers 2018-08-01 22:31:51 +02:00
Niels Lohmann
ba4a19d4af 👷 added more CI workers 2018-08-01 20:59:58 +02:00
Niels Lohmann
043eff5ba8 👷 added more CI workers 2018-07-31 21:18:33 +02:00
Michael Gmelin
05b27e83b7 Exclude bytewise comparison in certain tests.
These tests never worked - they weren't run before
d5aaeb4.

Note that these tests would fail because of this library
ordering dictionary keys (which is legal). So changing the
input files (or modifying stored cbor/msgpack/ubjson files)
would make the tests work and they could get removed from
"exclude_packaged".

Also move parsing of files in these unit tests to within
the inner sections, so that they're only parsed
number_of_files * number_of_sections instead of
number_of_files * number_of_files * number_of_sections
(so, instead of close to 100k parses about 700).
2018-07-29 14:52:52 +02:00
Michael Gmelin
d5aaeb4cce Make section names unique in loops, as catch doesn't support duplicate
sections, see also https://github.com/catchorg/Catch2/issues/816#issuecomment-278268122

As a result, when built with gcc, loop iterations were skipped. When
built with clang, the test aborted with an assertion in catch.hpp
line 6222.

This also addresses the issues discussed here:
https://github.com/nlohmann/json/issues/1032#issuecomment-378707696

and here:
https://github.com/catchorg/Catch2/issues/1241

Please note that this introduces new problems, as some of
the unit tests fail now - the library stores keys in
lexographical order, while the cbor/msgpack/ubjson examples
store them in original order.
2018-07-29 10:44:36 +02:00
Niels Lohmann
3760a38b7e 🏁 implicit conversion is not allowed with MSVC 2018-07-21 11:47:05 +02:00
Niels Lohmann
5b14411669 🏁 trying to fix C2440 error
Error in AppVeyor:

unit-conversions.cpp(441): error C2440: 'initializing': cannot convert from 'nlohmann::json' to 'std::nullptr_t'

(https://ci.appveyor.com/project/nlohmann/json/build/2838/job/wo7im01sq6tvhe9m)
2018-07-21 10:59:00 +02:00
Niels Lohmann
347e77bdc1 🚑 fix for #1169 2018-07-21 10:31:55 +02:00
Niels Lohmann
04372a8c56 🏁 fix for #1168 2018-07-19 17:31:50 +02:00
Hyeon Kim
d0e60de433 Add new JSON_INTERNAL_CATCH macro function 2018-07-19 15:43:41 +09:00
Niels Lohmann
7bfc406ded 📝 added note about CocoaPods #1148 2018-07-05 21:18:46 +02:00
Niels Lohmann
d456a2d777 Merge pull request #1151 from sonulohani/bigObjFix
Fixed compiler error in VS 2015 for debug mode
2018-06-29 09:03:43 +02:00
Sonu Lohani
b8ad3388ec Fixed compiler error in VS 2015 for debug mode
https://github.com/nlohmann/json/issues/1114
2018-06-29 09:34:41 +05:30
Niels Lohmann
39dd775e38 🔨 cleanup after #1134 2018-06-28 21:32:32 +02:00
Niels Lohmann
86a96b059d Merge pull request #1134 from Daniel599/feature/items_iterator
fixed compile error for #1045
2018-06-28 21:21:17 +02:00
Niels Lohmann
396a914f9e 🔨 added macro to disable compiler check #1128 2018-06-26 22:47:40 +02:00
Niels Lohmann
bab5826504 Merge pull request #1144 from jrakow/cppreference-link-fix
Fix links to cppreference named requirements (formerly concepts)
2018-06-26 07:58:45 +02:00
Niels Lohmann
515cfc2d89 Merge pull request #1142 from jrakow/develop
meson: fix include directory
2018-06-24 23:33:30 +02:00
Julius Rakow
963d06a13c 📝 fix links to cppreference named requirements
"Concepts" have been renamed to "named requirements".
This is because P0898R3 Standard Library Concepts has been merged into
C++20.
Cppreference have moved their links accordingly.
2018-06-24 22:36:19 +02:00
Julius Rakow
9f00db48d9 📝 link to cppreference via HTTPS 2018-06-24 22:34:47 +02:00
Julius Rakow
ec2ebd5ec9 meson: add multiple headers target 2018-06-24 18:07:30 +02:00
Julius Rakow
0bb36bb140 meson: fix include directory 2018-06-24 18:07:30 +02:00
Niels Lohmann
62457729e8 📝 mentioned MinGW in README 2018-06-24 18:03:59 +02:00
Niels Lohmann
09c0df4a21 👷 choosing correct image 2018-06-24 17:40:16 +02:00
Niels Lohmann
1bbc4a0859 👷 using Ninja to speed up build 2018-06-24 17:10:13 +02:00
Niels Lohmann
d8fe13fc83 🔨 fixed escaping for MinGW 2018-06-24 16:57:53 +02:00
Niels Lohmann
e59b930927 👷 trying a more recent compiler 2018-06-24 16:40:47 +02:00
Niels Lohmann
937d68e2e5 👷 forgot old PATH 2018-06-24 16:37:02 +02:00
Niels Lohmann
989ad9b759 👷 using help from https://stackoverflow.com/a/48509334/266378 2018-06-24 16:35:16 +02:00
Niels Lohmann
067e288289 👷 set build type 2018-06-24 16:29:03 +02:00
Niels Lohmann
7bbc06b487 👷 forgot quotes 2018-06-24 16:18:44 +02:00
Niels Lohmann
441e5d87e6 👷 experimenting with AppVeyor and MinGW 2018-06-24 16:17:06 +02:00
Niels Lohmann
7fa4ddf93e 💄 fixed indentation 2018-06-23 17:27:40 +02:00
Niels Lohmann
bf348ca8a4 Merge pull request #1028 from gracicot/develop
Added support for string_view in C++17
2018-06-23 17:10:04 +02:00
Niels Lohmann
ed6a0686df 🔨 small refactoring to improve branch coverage
The branch coverage reported by lcov is weird. The code before and after has the same Godbolt assembler, but the code with the lambda has a better branch coverage.
2018-06-23 17:05:04 +02:00
Niels Lohmann
c8bfdfd961 👷 tryping different platforms for AppVeyor 2018-06-23 11:12:32 +02:00
Niels Lohmann
c02de445bf 🚨 fixed more compiler warnings 2018-06-23 11:00:42 +02:00
Niels Lohmann
66dd1a846d 🚨 fixed more compiler warnings 2018-06-23 10:47:55 +02:00
Niels Lohmann
850922269d 🚨 removed compiler warnings 2018-06-23 10:28:04 +02:00
Niels Lohmann
0460b90977 📝 fix for #1052 #1139 2018-06-22 22:35:48 +02:00
Niels Lohmann
85f35a1d59 📝 documentation fix 2018-06-22 22:34:42 +02:00
Niels Lohmann
e7c1638d11 💄 cleanup 2018-06-18 22:03:46 +02:00
Niels Lohmann
1c81e9f5ae Merge pull request #1130 from agrianius/develop
test (non)equality for alt_string implementation
2018-06-18 22:01:53 +02:00
Niels Lohmann
d505ed7b31 Merge pull request #1138 from theodelrieu/feature/unordered_map_conversion
Feature/unordered map conversion
2018-06-18 21:59:46 +02:00
Théo DELRIEU
2c920a1032 run make amalgamate 2018-06-18 15:14:10 +02:00
Théo DELRIEU
2b37d7ed86 from_json: add overload for std::unordered_map
Fixes #1133
2018-06-18 15:14:10 +02:00
Théo DELRIEU
299469cfd5 from_json: add missing template arguments for std::map 2018-06-18 10:52:11 +02:00
Danielc
1566ad4053 fixed compile error for #1045; to_json for iternation_proxy_internal was needed 2018-06-16 12:01:49 +03:00
Vitaliy
f574d7e084 simplify templates for operators, add more checks 2018-06-14 15:07:06 +03:00
Vitaliy
cd28d872e7 forward declarations to make new compilers happy 2018-06-11 20:50:39 +03:00
Vitaliy
3d3055909c define global operator< for const char* and alt_string 2018-06-11 19:09:57 +03:00
Vitaliy
4feb8211ca test (non)equality for alt_string implementation 2018-06-11 18:03:46 +03:00
Guillaume Racicot
14e6278c2f Merge branch 'develop' of github.com:gracicot/json into develop 2018-06-04 11:18:25 -04:00
Guillaume Racicot
7acd90b651 Fixed check for compatible string type 2018-06-04 11:18:19 -04:00
Guillaume Racicot
5676a2a076 Aligned template declaration 2018-06-03 23:51:07 -04:00
Guillaume Racicot
e0e7fa39e7 Re-added external_constructor with string compatible types 2018-06-03 23:49:13 -04:00
Guillaume Racicot
4778c02ab5 Set MSVC version from 1514 and older 2018-06-01 14:42:25 -04:00
Guillaume Racicot
714c592680 Disabled implicit conversion to string_view on MSVC 15.13 and older 2018-06-01 14:22:57 -04:00
Niels Lohmann
e830bc502f Merge pull request #1117 from TinyTinni/develop
remove stringstream dependency
2018-06-01 08:05:45 +02:00
Matthias Möller
ecadcdb593 added char cast
should fix the GCC unittest
2018-05-31 16:36:16 +02:00
Matthias Möller
48656a49f5 typo 2018-05-31 15:32:21 +02:00
Matthias Möller
64acb42aa7 remove stringstream dependency 2018-05-31 13:45:58 +02:00
Niels Lohmann
8efbf8d7bb 📝 documentation to avoid future issues like #1108 2018-05-28 18:14:44 +02:00
Niels Lohmann
e5a67fc3f8 Merge branch 'develop' of https://github.com/nlohmann/json into develop 2018-05-28 17:57:46 +02:00
Niels Lohmann
a49644ab74 🚑 adjusted Fuzzer to new parser
out_of_range exceptions where unexpected before - the parser used to crash in these situations...
2018-05-28 17:57:22 +02:00
Niels Lohmann
0efaf891e5 Merge pull request #1089 from theodelrieu/feature/map_conversion
Provide a from_json overload for std::map
2018-05-28 14:53:23 +02:00
Théo DELRIEU
c5e63fd684 Provide a from_json overload for std::map
This overload is chosen only when BasicJsonType::string_t
is not constructible from std::map::key_type.

Currently, converting a map to json treats it as an array of pairs.

fixes #1079
2018-05-28 11:06:24 +02:00
Niels Lohmann
db03d09312 Merge branch 'feature/key_ref' into develop (fixes #1098) 2018-05-27 22:26:00 +02:00
Niels Lohmann
cf9299d222 Merge branch 'feature/sax2' into develop #971 2018-05-27 18:12:59 +02:00
Niels Lohmann
3cdc4d784b 📝 added documentation 2018-05-27 18:07:53 +02:00
Niels Lohmann
adf09726b0 Merge branch 'develop' into feature/sax2 2018-05-27 14:26:13 +02:00
Niels Lohmann
481ace65c4 🔨 only calculate array index string when needed #1098 2018-05-27 12:04:22 +02:00
Niels Lohmann
1c6b332dcd 👌 mitigating cppcheck bug #1101 2018-05-26 14:10:13 +02:00
Niels Lohmann
90eb0a91e0 keys are now returned as const reference #1098 2018-05-26 13:26:40 +02:00
Niels Lohmann
1f84cc2c88 adjusted test cases 2018-05-17 16:50:37 +02:00
Niels Lohmann
717301d1bc Merge branch 'testsuite' into feature/sax2 2018-05-17 16:36:43 +02:00
Niels Lohmann
4639bb2c8f added more tests from recent nst's JSONTestSuite 2018-05-17 10:10:01 +02:00
Niels Lohmann
e94862a649 🚑 fixed error in callback logic 2018-05-06 19:00:49 +02:00
Niels Lohmann
ae213721b1 🔨 removed unget function for wstring parsers 2018-05-06 14:05:29 +02:00
Niels Lohmann
5ff2abb90d Merge branch 'develop' into feature/sax2 2018-05-06 13:29:23 +02:00
Niels Lohmann
567fe9b7a0 Merge pull request #1078 from martin-mfg/patch-1
fix typo in README
2018-05-04 17:04:35 +02:00
martin-mfg
377e956655 fix typo in readme
The README says:
> "The library itself contains of a single header file ..."

I guess "consists of a" is the wording that was intended here. Alternatively, "contains a" might also be what was intended. Either way, I think both versions work equally well and thus choose the one that I believe was intended.
2018-05-03 22:42:52 +02:00
Niels Lohmann
5da596385b Update issue templates 2018-05-03 18:35:56 +02:00
Niels Lohmann
7bbe7bb98f 🔥 removed old issue template 2018-05-03 18:35:21 +02:00
Niels Lohmann
14f01e1981 🔧 update issue templates 2018-05-03 18:32:53 +02:00
Niels Lohmann
86b0732a10 📝 added public key used for commits and releases 2018-05-03 18:11:42 +02:00
Niels Lohmann
ed69e50ad2 📄 added SPDX-License-Identifier 2018-05-03 17:41:45 +02:00
Niels Lohmann
5bc4ff9da3 Merge branch 'feature/wstring' into develop 2018-04-29 17:29:57 +02:00
Niels Lohmann
fa3e42f826 Merge branch 'develop' into feature/wstring 2018-04-29 13:16:12 +02:00
Niels Lohmann
b5d1755dfb 🔥 removed commented-out test cases #1060 2018-04-22 15:41:42 +02:00
Niels Lohmann
0ab8fab338 Merge pull request #1058 from dns13/patch-1
Fix typo
2018-04-17 23:26:00 +05:30
Jan Schöppach
65b4d8251b Fix typo in single_include, too 2018-04-17 13:02:36 +02:00
Jan Schöppach
53fb230098 Fix typo 2018-04-17 12:08:44 +02:00
Niels Lohmann
46ec2fddf8 📝 updated THANKS list 2018-04-10 18:13:37 +02:00
Niels Lohmann
b8bfd1140d Merge pull request #1048 from chuckatkins/misc-cmake-packaging-enhancements
Misc cmake packaging enhancements
2018-04-10 17:57:21 +02:00
Chuck Atkins
33a2154f8d Enable target namespaces and build dir project config
CMake convention is to use a project namespace, i.e. Foo::, for imported
targets.  When multiple targets are imported from a project, this looks
like Foo::Bar1 Foo::Bar2, etc.  This adds the nlohmann_json:: namespace to
the exported target names.

This also allows the generated project config files to be used from the
build directory instead of just the install directory.
2018-04-10 09:08:38 -04:00
Niels Lohmann
29362c6ace Merge pull request #1047 from jammehcow/patch-1
Fixed incorrect LLVM version number in README
2018-04-10 08:39:58 +02:00
Niels Lohmann
c02a3155d4 👷 added Xcode 9.3 builder
See https://blog.travis-ci.com/2018-04-09-say-bonjour-to-xcode-93-and-macos-high-sierra.
2018-04-10 08:39:28 +02:00
Niels Lohmann
8d8f890771 💩 first try on #1045 2018-04-10 08:29:07 +02:00
James Upjohn
7f20e9ddc7 Fixed incorrect version number in README
clang-900.0.39.2 is from LLVM 9.0.0, not 8.1.0
2018-04-10 17:16:44 +12:00
Chuck Atkins
031b88d315 Make the CMake install dir user-configurable 2018-04-09 11:31:25 -04:00
Guillaume Racicot
aaee18ce90 Added test for string conversion with string_view 2018-04-09 11:15:33 -04:00
Niels Lohmann
7c503c64b7 Merge pull request #1043 from coryan/patch-1
Fix trivial typo in comment.
2018-04-09 08:19:56 +02:00
Carlos O'Ryan
4286b16b71 Fix trivial typo in comment.
Not really important, but since I saw it.
2018-04-08 15:46:25 -04:00
Niels Lohmann
cf91b4f2bb Merge branch 'develop' into feature/wstring 2018-04-08 11:36:58 +02:00
Niels Lohmann
f924df1835 Merge branch 'develop' into feature/sax2 2018-04-08 11:36:44 +02:00
Niels Lohmann
acf10d9af7 Merge pull request #1041 from ax3l/topic-spack
Package Manager: Spack
2018-04-08 11:32:35 +02:00
Niels Lohmann
e1ea8369ad Merge branch 'develop' into feature/sax2 2018-04-08 09:31:59 +02:00
Niels Lohmann
40f279c59d Merge branch 'feature/issue1021' into develop 2018-04-08 09:28:37 +02:00
Niels Lohmann
18a0271a95 Merge branch 'develop' into feature/issue1021 2018-04-08 09:21:43 +02:00
Axel Huebl
1ae9896387 Package Manager: Spack
I contributed a package to the Spack package manager.

Spack is a flexible package manager that supports multiple versions,
configurations, platforms, and compilers. It is popular in
high-performance computing.
2018-04-08 01:12:49 +02:00
Niels Lohmann
83b143382e Merge pull request #1040 from ax3l/topic-debugViewMSVCcmakeMin
CMake: 3.8+ is Sufficient
2018-04-07 15:14:59 +02:00
Axel Huebl
e439a1a9a7 CMake: 3.8+ is Sufficient
The current CMake scripts depend on CMake 3.8+.
This allows us to remove previous work-arounds.
2018-04-07 13:15:44 +02:00
Niels Lohmann
495436a5d5 Merge pull request #1026 from ktonon/develop
Added public target_compile_features for auto and constexpr
2018-04-03 17:34:42 +02:00
Kevin Tonon
a35d414c39 Update CMake to latest on Travis 2018-04-03 08:28:07 -04:00
Niels Lohmann
08a7233d1b 🚑 fixed commit 1e08654 2018-04-02 22:38:44 +02:00
Niels Lohmann
1e08654f99 🔨 cleanup 2018-04-02 22:25:17 +02:00
Niels Lohmann
aa89c5e048 🔨 removing unget_character() function from input adapters #834 2018-04-02 21:10:48 +02:00
Niels Lohmann
6678eb2b4a improved test coverage #1031 2018-04-02 15:38:49 +02:00
Niels Lohmann
16c5bfeaad 👌 fixed compiler warnings #1031 2018-04-02 13:01:56 +02:00
Niels Lohmann
727dd4664b 🔨 trying to make tests run with MSVC #1031 2018-04-02 12:27:07 +02:00
Niels Lohmann
ab89ae4e50 🔨 trying to make tests run with MSVC #1031 2018-04-02 11:34:36 +02:00
Niels Lohmann
eb06d0531a 🚧 added input adapter for wide strings #1031 2018-04-01 19:12:36 +02:00
Niels Lohmann
ba6edd5634 🔨 cleanup 2018-03-30 00:38:18 +02:00
Niels Lohmann
850671b9f1 🔨 using a vector<bool> for the parser hierarchy 2018-03-29 18:45:43 +02:00
Niels Lohmann
4efa8cdb4c 💚 fixed Valgrind options #1030 2018-03-29 17:19:21 +02:00
Niels Lohmann
830c93fd09 📝 fixed example for operator> #1029 2018-03-29 17:07:55 +02:00
Guillaume Racicot
c78dbc366c Added test for conversion to string_view 2018-03-29 01:03:57 -04:00
Guillaume Racicot
53d8d57921 Amalgamate single include 2018-03-29 01:03:36 -04:00
Niels Lohmann
5f723bbec6 🔨 realized callback parser wirh SAX interface #971 2018-03-28 23:39:39 +02:00
Niels Lohmann
896a9db461 🔨 improved code #1021 2018-03-28 19:37:21 +02:00
Kevin Tonon
73cc5089e3 Using target_compile_features to specify C++ 11 standard 2018-03-28 13:11:49 -04:00
Niels Lohmann
a9baab76c2 🚑 fix for #1021 2018-03-28 18:20:55 +02:00
Niels Lohmann
4f6b2b6429 🔨 changed SAX interface 2018-03-21 20:12:06 +01:00
Niels Lohmann
2537677e4c improved test coverage 2018-03-20 23:40:01 +01:00
Niels Lohmann
9e1abb4842 improved coverage 2018-03-20 22:39:08 +01:00
Niels Lohmann
1e38ffc014 more tests 2018-03-20 20:04:11 +01:00
Niels Lohmann
25f56ff207 📝 updated documentation 2018-03-20 19:22:18 +01:00
Niels Lohmann
99ecca55c4 improved test coverage 2018-03-20 18:49:10 +01:00
Niels Lohmann
9e07e9b4ec implemented non-throwing binary reader 2018-03-19 22:48:13 +01:00
Niels Lohmann
a271ee5f16 ♻️ proper use of SAX parser for binary formats 2018-03-18 23:00:45 +01:00
Niels Lohmann
943d641054 🔨 some refactoring 2018-03-18 16:07:21 +01:00
Niels Lohmann
22929fe189 🚧 started a SAX/DOM/callback parser 2018-03-18 15:13:53 +01:00
Niels Lohmann
375b05a17d 🔨 cleanup 2018-03-17 23:31:18 +01:00
Niels Lohmann
606a25195f improved test coverage 2018-03-17 19:15:59 +01:00
Niels Lohmann
c87ffad45c ♻️ implemented a non-recursive parser 2018-03-17 14:46:50 +01:00
Guillaume Racicot
2a5506ed98 Amalgamated headers 2018-03-16 13:16:10 -04:00
Guillaume Racicot
8165707990 basic_json now supports getting many type of strings 2018-03-15 15:35:00 -04:00
Niels Lohmann
27cf05af8d Merge branch 'develop' into feature/sax2 2018-03-14 22:02:19 +01:00
Niels Lohmann
d2dd27dc3b Merge branch 'release/3.1.2' into develop 2018-03-14 21:48:03 +01:00
Niels Lohmann
183390c10b Merge branch 'release/3.1.2' 2018-03-14 21:47:50 +01:00
Niels Lohmann
8a6c8cb0f7 🔖 set version to 3.1.2 2018-03-14 21:32:03 +01:00
Niels Lohmann
afef474c0d 🔖 set version to 3.1.2 2018-03-14 21:09:27 +01:00
Niels Lohmann
a52e8355b8 oops 2018-03-14 17:32:48 +01:00
Niels Lohmann
21410d50af 🏁 moved /Wall to CMake 2018-03-14 17:21:31 +01:00
Niels Lohmann
829ed74d66 🏁 experimenting with /Wall 2018-03-14 07:38:22 +01:00
Niels Lohmann
1262d474eb 🏁 fixed an MSVC warning 2018-03-14 07:32:28 +01:00
Niels Lohmann
282bafae4f 🔨 fixed compilation error 2018-03-14 07:18:42 +01:00
Niels Lohmann
abac6a0e84 Merge branch 'develop' into feature/sax2 2018-03-13 23:58:17 +01:00
Niels Lohmann
919d1fef8f Merge pull request #1009 from nlohmann/user_string_parser
Allowing for user-defined string type in lexer/parser
2018-03-13 14:52:59 +01:00
Niels Lohmann
8557151d90 ♻️ adjusting lexer/parser in symmetry to #1006 2018-03-12 19:15:11 +01:00
Niels Lohmann
b56ac86471 📝 thanks for #1006 2018-03-12 18:44:19 +01:00
Niels Lohmann
0cab3b2c8e Merge pull request #1006 from agrianius/dump-template
dump to alternative string type, as defined in basic_json template
2018-03-12 18:41:59 +01:00
Niels Lohmann
3d4f6a2940 🔨 cleaner exception interface 2018-03-11 22:47:25 +01:00
Niels Lohmann
ad47b0fbde ♻️ refactored binary readers to use a SAX parser 2018-03-11 18:47:38 +01:00
Vitaliy Manushkin
392c033805 test refactoring 2018-03-11 00:29:04 +03:00
Vitaliy Manushkin
51349537fc add unit test: checking dump to alternative string type 2018-03-10 23:59:10 +03:00
Vitaliy Manushkin
830f3e5290 forward alternative string class from output_adapter to output_string_adapter 2018-03-10 23:58:16 +03:00
Vitaliy Manushkin
ed6b1464f9 dump to alternate implementation of string, as defined in basic_json template (changes to amalgamated code) 2018-03-10 17:36:51 +03:00
Vitaliy Manushkin
faccc37d0d dump to alternate implementation of string, as defined in basic_json template 2018-03-10 17:19:28 +03:00
Niels Lohmann
149d2fd09c 💚 improved test coverage 2018-03-10 11:24:00 +01:00
Niels Lohmann
6399cd3039 Merge branch 'develop' into feature/sax2 2018-03-10 11:07:36 +01:00
Niels Lohmann
6151dfaed7 👌 made changes proposed in #1001 2018-03-10 11:02:58 +01:00
Niels Lohmann
35e43df625 Merge branch 'develop' into feature/sax2 2018-03-09 21:56:30 +01:00
Niels Lohmann
9918523077 📝 cleanup after #1001 2018-03-09 21:31:46 +01:00
Niels Lohmann
e737de8941 Merge pull request #1001 from nlohmann/leak
Fix memory leak during parser callback
2018-03-09 21:23:00 +01:00
Niels Lohmann
aa8fc2a41c 🚑 hopefully fixed the memory leak 2018-03-08 17:11:15 +01:00
Niels Lohmann
7c1a788893 Merge branch 'develop' into feature/sax2 2018-03-08 07:39:37 +01:00
Niels Lohmann
cf60e18c89 🔥 removing failing test (work on this in branch "leak") 2018-03-08 07:39:21 +01:00
Niels Lohmann
97559bb1b2 🔨 trying to fix the leak
Part 1: properly use forwarding
2018-03-08 07:36:56 +01:00
Niels Lohmann
38345fd06c 👌 fixed some more warnings 2018-03-07 22:51:22 +01:00
Niels Lohmann
8b379948d0 🔥 replaced acceptor with SAX parser 2018-03-07 22:40:48 +01:00
Niels Lohmann
303a0c5843 Merge branch 'develop' into feature/sax2 2018-03-07 22:26:01 +01:00
Niels Lohmann
d183d34b96 💚 added another test case 2018-03-07 22:25:25 +01:00
Niels Lohmann
d2d65bb25b ♻️ refined SFINAE to fix some warnings 2018-03-07 22:01:44 +01:00
Niels Lohmann
476b2e09be 💚 added regression tests for #972 and #977 2018-03-06 20:13:31 +01:00
Niels Lohmann
62030615a0 Merge pull request #986 from theodelrieu/fix/basic_json_conversion
Fix/basic json conversion
2018-03-06 19:27:39 +01:00
Niels Lohmann
5beab80553 🔨 using the SAX-DOM parser 2018-03-06 18:17:07 +01:00
Niels Lohmann
faf2546a15 🔨 simplified SAX-DOM parser 2018-03-06 07:19:05 +01:00
Niels Lohmann
5b9d03cfdb 🔨 added SAX-DOM-Parser 2018-03-05 21:06:00 +01:00
Niels Lohmann
9d27429527 🔨 added error messages to SAX interface 2018-03-05 16:46:35 +01:00
Niels Lohmann
86991d5204 Merge branch 'develop' into feature/sax2 2018-03-05 16:16:43 +01:00
Niels Lohmann
fdecbf6e1e Merge pull request #992 from bogemic/pvs_studio_fix_misprinted_condition
fixed misprinted condition detected by PVS Studio.
2018-03-05 15:57:57 +01:00
Mike Bogdanov
fd30ad8a14 did make amalgamate 2018-03-02 11:47:35 +03:00
Mike Bogdanov
2a2ed799b1 pvs_studio fix. misprinted condition 2018-03-02 11:12:44 +03:00
Niels Lohmann
8d104e6fe3 💚 fixed test case 2018-02-28 22:40:48 +01:00
Niels Lohmann
5773e164bb 🚨 fixed a linter warning 2018-02-28 19:59:54 +01:00
Théo DELRIEU
8711ec6034 support construction from other basic_json types
Before this patch, `basic_json` types with different template arguments
were treated as `CompatibleArrayType`. Which sometimes leads to recursive
calls and stack overflows.

This patch adds a constructor and a `get` overload to deal with
different `basic_json` types.
2018-02-27 16:48:09 +01:00
Théo DELRIEU
c22f2d41f3 missing CHECK_NOTHROW in unit-udt 2018-02-27 11:09:53 +01:00
Niels Lohmann
3ff9455332 🔨 added a SAX-DOM-Parser 2018-02-26 23:39:23 +01:00
Niels Lohmann
21352c4d8e ♻️ refactored SAX parser 2018-02-26 20:08:12 +01:00
Niels Lohmann
981e226ca2 Merge branch 'develop' into feature/sax2 2018-02-26 20:07:52 +01:00
Niels Lohmann
1f3d2a3be7 📝 overworked README 2018-02-26 17:37:24 +01:00
Niels Lohmann
13ca723c38 Merge pull request #981 from wla80/develop
Make integration section concise
2018-02-26 16:51:51 +01:00
Wilson
05d3bf1699 Make integration section concise 2018-02-25 22:12:44 -08:00
Niels Lohmann
8d6b3d44d6 👌 fixed some compiler warnings 2018-02-25 18:35:16 +01:00
Niels Lohmann
8c7f46f7d0 🔨 removed a logic error and improved coverage 2018-02-25 17:10:30 +01:00
Niels Lohmann
922f7a3d0e added more tests for SAX parsing 2018-02-25 14:21:30 +01:00
Niels Lohmann
ac230e8b4b 🔨 fixed test cases to be more robust 2018-02-25 10:44:47 +01:00
Niels Lohmann
374ebacc51 added a SAX parser #971 2018-02-24 18:04:07 +01:00
Niels Lohmann
8968adcd53 Merge branch 'release/3.1.1' into develop 2018-02-13 19:36:35 +01:00
Niels Lohmann
c8ea63a31b Merge branch 'release/3.1.1' 2018-02-13 19:36:20 +01:00
Niels Lohmann
8424d10e45 🔖 set version to 3.1.1 2018-02-13 15:59:32 +01:00
Niels Lohmann
938c861a09 🔖 set version to 3.1.1 2018-02-12 22:59:36 +01:00
Niels Lohmann
94b7a8da66 💄 fixed indentation 2018-02-12 20:46:14 +01:00
Niels Lohmann
20b5f4d89c Merge pull request #969 from theodelrieu/fix/924
Fix constraints on from_json(CompatibleArrayType)
2018-02-12 18:17:59 +01:00
Théo DELRIEU
01d6118828 Fix constraints on from_json(CompatibleArrayType)
Fixes #924
2018-02-12 15:37:33 +01:00
Niels Lohmann
b02e3bb0b6 Merge pull request #957 from theodelrieu/fix_coveralls
Make coveralls watch the include folder
2018-02-12 15:02:21 +01:00
Théo DELRIEU
41db7cd818 Make the coveralls job use the multiple header version 2018-02-12 10:23:33 +01:00
Niels Lohmann
447f5421eb 🔨 overworked release target 2018-02-11 16:50:01 +01:00
Niels Lohmann
61f0bfb15c 🔨 enforce using Python 2 for the wandbox script 2018-02-11 14:46:15 +01:00
Niels Lohmann
548f488941 🔨 overworked Makefile 2018-02-10 14:46:39 +01:00
Niels Lohmann
865ff00de0 📝 updated documentation wrt. objects #963 2018-02-09 23:37:20 +01:00
Niels Lohmann
addbbbe136 Merge branch 'develop' of https://github.com/nlohmann/json into develop 2018-02-09 23:32:37 +01:00
Niels Lohmann
0a64982e86 📝 cleanup after #954 2018-02-09 23:32:28 +01:00
Niels Lohmann
e5d538c5ea Merge pull request #954 from pfultz2/patch-1
Add a note about installing the library with cget
2018-02-09 23:28:54 +01:00
Niels Lohmann
2dda87c3b7 Merge branch 'feature/coverage_multi' into develop 2018-02-09 23:01:56 +01:00
Paul Fultz II
5731695d7b Clarify dev version and add space after the word flag. 2018-02-09 15:45:20 -06:00
Niels Lohmann
74675dd69c back to the original version 2018-02-09 22:40:52 +01:00
Paul Fultz II
50863c5a09 Latest updates based on feedback 2018-02-09 15:35:46 -06:00
Niels Lohmann
ab05df3a48 🔨 another try 2018-02-09 22:27:08 +01:00
Niels Lohmann
b455154cc9 🔨 another try 2018-02-09 22:18:51 +01:00
Niels Lohmann
1e8f4d6ab3 🔨 more trying 2018-02-09 22:11:05 +01:00
Niels Lohmann
316634e129 🔨 added quotes around parameters 2018-02-09 21:54:32 +01:00
Niels Lohmann
0111f3187e 🔨 working on #953 2018-02-09 21:30:15 +01:00
Niels Lohmann
83db7876c5 🏁 removing test case that fails on MSVC #962 2018-02-09 18:32:12 +01:00
Niels Lohmann
33a9b00ce6 🐛 fix for #962
Added out_of_range exception for UBJSON containers with sizes that exceed the target container's max_size.
2018-02-06 22:38:53 +01:00
Niels Lohmann
8b457ace25 🐛 fixing CBOR's indefinity length strings #961
Beside the fix discussed in #961, we also had to re-adjust a test case. It seems that it was failing before, and I "fixed" it to work with the broken implementation...
2018-02-06 20:43:03 +01:00
Niels Lohmann
556e30f759 Merge pull request #955 from patrikhuber/patch-1
Fix links in README.md
2018-02-06 20:18:14 +01:00
Patrik Huber
ee76436592 Change to angle brackets 2018-02-06 11:29:37 +00:00
Niels Lohmann
737cffe0cb 🔨 fixed directory for lcov coverage 2018-02-04 20:58:50 +01:00
Patrik Huber
ae688016f6 Changed links from master to develop branch 2018-02-04 12:41:46 +00:00
Niels Lohmann
2b7b39c72d 🚀 added release target #956 2018-02-04 13:29:23 +01:00
Patrik Huber
44b40d7c6a Fix links in README.md 2018-02-03 15:48:02 +00:00
Paul Fultz II
3402260983 Add a note about installing the library with cget 2018-02-02 11:13:13 -06:00
Niels Lohmann
3a887dc9fe 👷 fixed coveralls 2018-02-02 07:56:30 +01:00
Niels Lohmann
5c2a0a511e 👷 fixed coveralls 2018-02-02 07:31:57 +01:00
Niels Lohmann
b779666916 👷 re-added homebrew tests 2018-02-02 00:20:04 +01:00
Niels Lohmann
97309f0da9 Merge branch 'release/3.1.0' into develop 2018-02-02 00:06:17 +01:00
Niels Lohmann
15acf260ca Merge branch 'release/3.1.0' 2018-02-02 00:05:55 +01:00
Niels Lohmann
a8fcfd9880 👷 fixed travis file 2018-02-01 22:34:14 +01:00
Niels Lohmann
f5c03999d0 🔨 fixed benchmark compilation 2018-02-01 22:26:26 +01:00
Niels Lohmann
0258484626 🔖 set version to 3.1.0
- updated documentation wrt. new repository layout
- temporarily switched off Homebrew --HEAD building (can only be switched on after release)
- set copyright date to 2018
2018-02-01 22:20:26 +01:00
Niels Lohmann
ce7d0ebf5d Merge pull request #944 from theodelrieu/fix/cmake_install
fix cmake install directory (for real this time)
2018-02-01 18:39:07 +01:00
Théo DELRIEU
14cd019861 fix cmake install directory (for real this time)
* Rename 'develop' folder to 'include/nlohmann'
* Rename 'src' folder to 'single_include/nlohmann'
* Use <nlohmann/*> headers in sources and tests
* Change amalgamate config file
2018-02-01 11:06:51 +01:00
Niels Lohmann
9958dde3da Merge pull request #950 from kaidokert/develop
Templatize std::string in binary_reader #941
2018-02-01 09:29:53 +01:00
Kaido
aed4a080bf Templatize std::string in binary_reader #941 2018-01-31 23:01:01 -08:00
Niels Lohmann
e8bf1f62f7 added define for library version #948 #943 2018-01-31 22:36:18 +01:00
Niels Lohmann
552d153842 📝 added more statistics on binary formats 2018-01-31 21:54:38 +01:00
Niels Lohmann
60e2d28eb7 🐛 fix for #947 2018-01-31 20:53:13 +01:00
Niels Lohmann
51c774f208 📝 added documentation for binary formats 2018-01-31 17:23:11 +01:00
Niels Lohmann
57e6fddd90 🚨 fixed warnings 2018-01-30 23:57:49 +01:00
Niels Lohmann
f7131715b1 Merge branch 'develop' of https://github.com/nlohmann/json into develop 2018-01-30 23:20:39 +01:00
Niels Lohmann
ce273af9b6 📝 added documentation for binary formats 2018-01-30 23:20:36 +01:00
Niels Lohmann
ae235139b9 Merge pull request #940 from kaidokert/develop
Allow overriding THROW/CATCH/TRY macros with no-exceptions #938
2018-01-29 22:04:26 +01:00
Niels Lohmann
8049442c2a 🔨 rename yytext to token_buffer (fixes #933) 2018-01-29 21:56:13 +01:00
Kaido
d0c9e5fffc Allow overriding THROW/CATCH/TRY macros with no-exceptions (redo) #938 2018-01-28 14:42:13 -08:00
Niels Lohmann
b3bd3b726b 📝 added link to OSS-Fuzz project repository 2018-01-28 21:02:02 +01:00
Niels Lohmann
52e9449563 📝 added more functions to overview 2018-01-28 20:44:45 +01:00
Niels Lohmann
cb4a9c85cb 🔨 excluded code from coverage 2018-01-28 17:55:40 +01:00
Niels Lohmann
1483d39c91 🔨 moved class json_pointer into separate file #920 2018-01-28 15:36:56 +01:00
Niels Lohmann
e95578f884 📝 documented JSON Merge Patch (RFC 7386) 2018-01-28 14:36:17 +01:00
Niels Lohmann
102c474397 🔨 clean up 2018-01-28 14:13:02 +01:00
Niels Lohmann
6855bbb902 🔨 split "parsing" directory to "input" and "output" 2018-01-28 13:15:03 +01:00
Niels Lohmann
05f49fa401 added roundtrip tests for UBJSON 2018-01-27 18:47:32 +01:00
Niels Lohmann
f0b26c8f38 added fuzzer for UBJSON input 2018-01-27 18:38:11 +01:00
Niels Lohmann
b0a68f540f added roundtrip tests for UBJSON 2018-01-27 18:37:55 +01:00
Niels Lohmann
1be3935e9d 📝 cleanup after #936 2018-01-27 17:43:44 +01:00
Niels Lohmann
7aace7c976 Merge pull request #936 from zerodefect/improvement/fix_kmin_compiler_warning
Removed compiler warning about unused variable 'kMinExp'
2018-01-27 16:51:52 +01:00
Niels Lohmann
0e2211df0e Merge pull request #925 from zerodefect/improvement/improve_readme_json_fwd
Howto installation of json_fwd.hpp (fixes #923)
2018-01-25 17:11:21 +01:00
zerodefect
95cf1fefaa Removed compiler warning about unused variable 'kMinExp'. 2018-01-25 12:51:48 +00:00
Niels Lohmann
355c1e946b 👷 added task to check amalgamation #906
- Builds and runs test cases from individual sources rather than from amalgamation.
- Checks whether amalgamation would create the same single-header file as checked in.
2018-01-23 18:00:12 +01:00
Niels Lohmann
dbfd7e532b Merge branch 'develop' of https://github.com/nlohmann/json into develop 2018-01-23 16:33:10 +01:00
Niels Lohmann
3c68a796df 🔥 deprecated iterator_wrapper #874
Also fixed some warnings from GCC.
2018-01-23 16:33:08 +01:00
Niels Lohmann
f05c3edc21 Merge pull request #930 from Pipeliner/develop
Fix a typo in README.md
2018-01-23 07:32:23 +01:00
Niels Lohmann
f5c4e9f3a1 Merge pull request #919 from theodelrieu/fix/sfinae_for_incomplete_types
fix sfinae on basic_json UDT constructor
2018-01-23 07:32:06 +01:00
Niels Lohmann
7eabb6ba36 📝 updated documentation for UBJSON functions 2018-01-22 23:23:17 +01:00
Vadim Evard
fc32b8a9bc Fix a typo in README.md 2018-01-22 13:14:39 +03:00
Niels Lohmann
3cca630836 🔨 cleanup after #915 2018-01-21 15:55:35 +01:00
Niels Lohmann
010e596001 Merge pull request #915 from abolz/dtoa
Floating-point formatting
2018-01-21 15:02:57 +01:00
Niels Lohmann
3d776b0582 📝 updated README 2018-01-21 14:13:42 +01:00
Niels Lohmann
9e5d901f55 Merge branch 'feature/ubjson' into develop 2018-01-21 14:04:29 +01:00
Niels Lohmann
327b8bb09e Merge branch 'feature/strings' into develop 2018-01-21 13:55:52 +01:00
zerodefect
d2b3fd156e Updated README.md to explain how installation of json_fwd.hpp can be achieved as part of install step. 2018-01-19 11:42:53 +00:00
Niels Lohmann
b406e3704b using Google Benchmark #921 2018-01-18 22:00:32 +01:00
Niels Lohmann
a8f711a2f1 using Google Benchmark #921 2018-01-18 21:57:21 +01:00
Niels Lohmann
6402077ac2 Merge pull request #876 from nlohmann/feature/rfc7396
JSON Merge Patch (RFC 7396)
2018-01-18 06:49:31 +01:00
Théo DELRIEU
dcee778c1e fix sfinae on basic_json UDT constructor
Avoid compiler errors when performing SFINAE checks on basic_json
and incomplete types.
2018-01-17 12:17:38 +01:00
Niels Lohmann
7456f1d87b ♻️ re-used existing UTF-8 decoder to simplfy string serialization 2018-01-16 20:42:00 +01:00
Niels Lohmann
afe4571309 🔨 cleanup + some noexcept 2018-01-16 20:41:04 +01:00
Niels Lohmann
b182308eff 🔨 cleanup 2018-01-16 20:40:24 +01:00
abolz
9b9919d460 Use max_digits10 in dump_float for float->text->float round-trip 2018-01-15 21:26:03 +01:00
abolz
810f81bbd9 Regenerate src/json.hpp 2018-01-15 21:24:59 +01:00
abolz
787204f076 Add unit-tests for detail::to_chars 2018-01-15 21:13:17 +01:00
abolz
9f7c2c04c8 Use the Grisu2 algorithm for formatting 'float's and 'double's 2018-01-15 21:07:26 +01:00
abolz
332f352033 Add an implementation of the Grisu2 algorithm for binary to decimal floating-point conversion
This is an attempt to fix #360. The algorithm produces
decimal representations which are guaranteed to roundtrip
and in ~99.8% actually produces the shortest possible
representation. So this is a nice compromise between using
a precision of digits10 and max_digits10.

Note 1:

The implementation only works for IEEE single/double precision
numbers. So the old implementation is kept for compatibility
with non-IEEE implementations and 'long double'.

Note 2:

If number_float_t is 'float', not all serialized numbers can
be recovered using strtod (strtof works, though). (There is
exactly one such number and the result is off by 1 ulp.)
This can be avoided by changing the implementation (the fix
is trivial), but then the resulting decimal numbers are not
exactly short.
2018-01-15 21:07:26 +01:00
abolz
0695ac4001 Add tests for #360 2018-01-15 21:07:25 +01:00
abolz
68a9736738 Tests: Re-enable some round-trip tests 2018-01-15 21:07:25 +01:00
abolz
6e2e466c27 Tests: Don't rely on the format used for floating-point formatting 2018-01-15 21:07:25 +01:00
abolz
107c21a488 Tests: Exponents are formatted with a leading '+' sign 2018-01-15 21:07:25 +01:00
abolz
3ae82d91a2 Tests: Floating-point formatting uses lower case 'e' 2018-01-15 21:07:24 +01:00
Niels Lohmann
92f7295063 🔨 cleanup 2018-01-15 13:21:33 +01:00
Niels Lohmann
3ac674562f 🔨 clean up 2018-01-14 22:26:20 +01:00
Niels Lohmann
d9446b0e6e Merge pull request #911 from theodelrieu/fix/cmake_install
Fix/cmake install
2018-01-14 20:08:49 +01:00
Niels Lohmann
9d6b3731b9 improved test coverage 2018-01-14 20:07:38 +01:00
Niels Lohmann
06cddd371b 🔨 removed failing amalgamation test 2018-01-14 17:22:42 +01:00
Niels Lohmann
f85f4967fe improved test coverage 2018-01-14 17:22:06 +01:00
Niels Lohmann
6965ff00c8 Merge branch 'develop' into feature/ubjson 2018-01-14 13:58:06 +01:00
Niels Lohmann
411c16cbb2 📝 overworked documentation wrt. amalgamation #906 2018-01-14 13:08:28 +01:00
Niels Lohmann
fea5f3792b 📝 it's 2018 2018-01-14 10:41:59 +01:00
Niels Lohmann
541b46132d ♻️ adjusted code to split headers 2018-01-14 10:34:43 +01:00
Niels Lohmann
0e8f01a963 Merge branch 'develop' into feature/rfc7396 2018-01-14 10:28:09 +01:00
Niels Lohmann
c772c01a48 ♻️ refactored code to split headers 2018-01-14 10:27:30 +01:00
Niels Lohmann
1b54d4a5aa Merge branch 'develop' into feature/ubjson 2018-01-14 10:10:56 +01:00
Niels Lohmann
420dcf1f25 🚧 added check whether code is amalgamated 2018-01-14 10:10:23 +01:00
Théo DELRIEU
5775084ffc cmake: add option to use/install the non-amalgamated version 2018-01-13 13:07:03 +01:00
Théo DELRIEU
84bffd5d36 move amalgamate tool to third_party folder 2018-01-13 13:05:42 +01:00
Théo DELRIEU
922b56e492 cmake: add back trailing slash to NLOHMANN_JSON_SOURCE_DIR 2018-01-13 12:27:33 +01:00
Niels Lohmann
a66b2d20c6 🚨 removed linter warnings for Python code 2018-01-13 11:15:23 +01:00
Niels Lohmann
f4a55f26b0 added amalgamate Python script 2018-01-13 10:59:49 +01:00
Niels Lohmann
241eea0c0e 📝 documentation 2018-01-12 09:23:33 +01:00
Niels Lohmann
10bad9381d 🚧 added size benchmark for binary formats 2018-01-10 23:13:48 +01:00
Niels Lohmann
3a7585e738 added more tests 2018-01-10 22:47:07 +01:00
Niels Lohmann
31bfabc4c0 🔨 optimized input format 2018-01-10 16:14:43 +01:00
Niels Lohmann
965a70e38d 🔨 optimized output format 2018-01-10 11:22:19 +01:00
Niels Lohmann
85173f5627 🔨 some clean up 2018-01-10 10:18:31 +01:00
Niels Lohmann
ce53537ba2 replaces amalgamation tool
The tool used before created a lot of duplicates inside the generated amalgamation. The new tool is a single Python file which seems to do the same job.
2018-01-09 23:15:06 +01:00
Niels Lohmann
0a2920e0fd ♻️ reorganized code 2018-01-09 18:30:02 +01:00
Niels Lohmann
b67e00b9b5 Merge pull request #700 from theodelrieu/refactor/split_it
Refactor/split it
2018-01-09 07:57:01 +01:00
Niels Lohmann
fd04967676 🐛 fixed copy-paste error 2018-01-08 21:37:51 +01:00
Niels Lohmann
fb1154c237 🚧 debug 2018-01-08 21:26:41 +01:00
Niels Lohmann
97e0d20ce9 🚧 debug 2018-01-08 21:16:20 +01:00
Niels Lohmann
ebf28a26ee 🚧 another try 2018-01-08 20:49:02 +01:00
Théo DELRIEU
7e4ee23f40 add single_header CMake target 2018-01-08 20:09:43 +01:00
Théo DELRIEU
57d822b6e2 add missing includes, put back include comments 2018-01-08 20:09:41 +01:00
Théo DELRIEU
9cab30cfce add adl_serializer.hpp 2018-01-08 20:09:38 +01:00
Théo DELRIEU
8e9714fe3d add detail/json_ref.hpp 2018-01-08 20:09:35 +01:00
Théo DELRIEU
a3473fda6a add detail/serializer.hpp 2018-01-08 20:09:33 +01:00
Théo DELRIEU
c117515e31 add detail/parsing/binary_writer.hpp 2018-01-08 20:09:29 +01:00
Théo DELRIEU
d620f76f0d add detail/parsing/binary_reader.hpp 2018-01-08 20:09:27 +01:00
Théo DELRIEU
4dbb433a79 add detail/parsing/output_adapters.hpp 2018-01-08 20:09:24 +01:00
Théo DELRIEU
ae6f66048c add detail/iterators/json_reverse_iterator.hpp 2018-01-08 20:09:21 +01:00
Théo DELRIEU
5fc9ef2b90 add detail/iterators/iteration_proxy.hpp 2018-01-08 20:09:18 +01:00
Théo DELRIEU
bf06cf6c22 add detail/iterators/iter_impl.hpp 2018-01-08 20:09:15 +01:00
Théo DELRIEU
3e65a65290 add detail/iterators/internal_iterator.hpp 2018-01-08 20:09:13 +01:00
Théo DELRIEU
51ecc31db7 add detail/iterators/primitive_iterator.hpp 2018-01-08 20:09:10 +01:00
Théo DELRIEU
9ea25685a8 add detail/parsing/parser.hpp 2018-01-08 20:09:06 +01:00
Théo DELRIEU
3a0743db97 add detail/parsing/lexer.hpp 2018-01-08 20:09:04 +01:00
Théo DELRIEU
7ab3e8d7b3 add detail/parsing/input_adapters.hpp 2018-01-08 20:09:01 +01:00
Théo DELRIEU
21881606f2 add detail/conversions/to_json.hpp 2018-01-08 20:08:58 +01:00
Théo DELRIEU
e0c02c14f0 add detail/conversions/from_json.hpp 2018-01-08 20:08:55 +01:00
Théo DELRIEU
7056b375c4 add detail/value_t.hpp 2018-01-08 20:08:52 +01:00
Théo DELRIEU
8c555db970 add detail/exceptions.hpp 2018-01-08 20:08:50 +01:00
Théo DELRIEU
f364f5ac5a add detail/meta.hpp 2018-01-08 20:08:47 +01:00
Théo DELRIEU
d686713f91 add detail/macro_{un}scope.hpp 2018-01-08 20:08:44 +01:00
Théo DELRIEU
5bffc95773 add json_fwd.hpp 2018-01-08 20:08:38 +01:00
Niels Lohmann
3d7658da89 🚧 working on AppVeyor's errors 2018-01-08 19:48:18 +01:00
Niels Lohmann
126ce2e56c 🚧 further UBJSON 2018-01-08 18:54:17 +01:00
Niels Lohmann
c9938ea838 🚧 started UBJSON implementation 2018-01-07 22:09:12 +01:00
Niels Lohmann
15b6421d07 added UTF-8 decoder capability and stress test
As described in http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt; Markus Kuhn <http://www.cl.cam.ac.uk/~mgk25/> - 2015-08-28 - CC BY 4.0
2018-01-05 23:26:22 +01:00
Niels Lohmann
78f8f837e6 added items() function #874 2018-01-05 18:34:10 +01:00
Niels Lohmann
96b40b27a5 📝 fixed Doxygen warnings
Apparently, using "\n" inside an alias is an error now, but "^^" basically means the same.
2018-01-05 18:33:42 +01:00
Niels Lohmann
337e9824ea Merge pull request #900 from Dobiasd/patch-1
fix link to the documentation of the emplace function
2018-01-04 17:11:18 +01:00
Tobias Hermann
ba2316372a fix link to the documentation of the emplace function 2018-01-03 11:06:32 +01:00
Niels Lohmann
a43347e1f9 Merge branch 'develop' 2017-12-29 20:35:02 +01:00
Niels Lohmann
ce1dccf347 Merge branch 'release/3.0.1' into develop 2017-12-29 20:24:49 +01:00
Niels Lohmann
5681e55da8 Merge branch 'release/3.0.1' 2017-12-29 20:24:20 +01:00
Niels Lohmann
92484f0caf 🔖 set version to 3.0.1 2017-12-29 18:31:13 +01:00
Niels Lohmann
ebc6849b71 added test for #894 2017-12-29 16:53:04 +01:00
Niels Lohmann
3c76ff353d 📝 updated docs after PRs 2017-12-29 16:52:09 +01:00
Niels Lohmann
d45183d426 Merge branch 'develop' of https://github.com/nlohmann/json into develop 2017-12-28 13:52:26 +01:00
Niels Lohmann
3b3b6e8e69 🚑 fix for #894
- Implemented "copy" in terms of "add".
- Added check for JSON Pointer array indices to make sure the complete reference token was processed.
- Added test suite from https://github.com/json-patch/json-patch-tests
2017-12-28 13:52:23 +01:00
Niels Lohmann
f28fc2261a Merge pull request #858 from mattismyname/develop
🔧 Fix up a few more effc++ items
2017-12-28 12:13:19 +01:00
Matthew K. Gumbel
72bff90ed9 🔧 Fix up a few more effc++ items 2017-12-24 10:03:36 -08:00
Niels Lohmann
3113a52a7d 📝 added exception 403 to documentation of at (#888)
The at function throws json::out_of_range.403 when a nonexistent object key is provided (just like the usual at function). This was not documented and users could assume json::out_of_range.404 would be thrown instead.

- Updated documentation.
- Added example code.
2017-12-23 18:38:18 +01:00
Niels Lohmann
184e9c6aa7 Merge pull request #885 from TinyTinni/develop
Includes CTest module/adds BUILD_TESTING option
2017-12-23 11:09:46 +01:00
Matthias Möller
d1cda6888e includes CTest module resp. BUILD_TESTING option 2017-12-20 17:54:45 +01:00
Niels Lohmann
88ddb12afc 📝 fix for #883
- Adjusted table to user-defined exceptions. This was forgotten in the 3.0.0 update.
- Added update function to the table.
2017-12-18 19:46:53 +01:00
Niels Lohmann
e54b6ace94 Merge pull request #882 from erengy/fix-msvc-c4819
Fix MSVC warning C4819
2017-12-17 19:52:57 +01:00
Eren Okka
ab0e8b2f3a Fix MSVC warning C4819
Replaces a U+00A0 character with regular space, and fixes a typo.
2017-12-17 18:02:55 +03:00
Niels Lohmann
1ca6ec1dc0 Merge pull request #880 from nlohmann/coverity_scan
Merge branch 'develop' into coverity_scan
2017-12-17 11:24:40 +01:00
Niels Lohmann
1856f38c85 📝 removed paragraph on version 3.0.0 2017-12-17 11:22:35 +01:00
Niels Lohmann
afebb6a3bb Merge branch 'release/3.0.0' into develop 2017-12-17 11:04:53 +01:00
Niels Lohmann
9f81beb5e2 Merge branch 'release/3.0.0' 2017-12-17 11:04:04 +01:00
Niels Lohmann
106f9f5436 ⬆️ updated git-update-ghpages script 2017-12-17 10:20:30 +01:00
Niels Lohmann
9eb5e2c271 🔖 set version to 3.0.0 2017-12-17 08:40:19 +01:00
Niels Lohmann
9e3c4ad11f 🔖 set version to 3.0.0 2017-12-17 08:31:18 +01:00
Niels Lohmann
314e4e7699 📝 improved documentation for dump and iterator_wrapper 2017-12-16 23:58:10 +01:00
Niels Lohmann
9a51fb4da2 🚨 fixed some warnings 2017-12-16 22:19:30 +01:00
Niels Lohmann
7bf007f2bc Merge pull request #879 from nlohmann/feature/algorithms
 re-added tests for algorithms
2017-12-16 12:41:07 +01:00
Niels Lohmann
980795b644 ✏️ fixed typos 2017-12-16 12:37:44 +01:00
Niels Lohmann
f3bd755cab removing <iomanip> header 2017-12-16 12:37:25 +01:00
Niels Lohmann
4c871c58f8 re-added tests for algorithms 2017-12-16 11:16:34 +01:00
Niels Lohmann
c23f5dcea6 📝 fixed year 2017-12-15 23:49:37 +01:00
Niels Lohmann
2e1b1061cd Merge pull request #875 from nlohmann/feature/spelling
Overworked library toward 3.0.0 release
2017-12-14 22:31:19 +01:00
Niels Lohmann
261caec2de 👥 added contributor image 2017-12-14 22:29:39 +01:00
Niels Lohmann
f80827d068 Merge pull request #873 from nlohmann/feature/issue872
🚨 remove C4996 warnings #872
2017-12-14 09:35:48 +01:00
Niels Lohmann
9a70c60fa5 Revert "⬆️ updated to Catch 2.0.1"
This reverts commit 920f64c01c.
2017-12-14 07:49:16 +01:00
Niels Lohmann
fb8482db76 👌 fixed some issues from the last commit #875 2017-12-13 23:44:53 +01:00
Niels Lohmann
c6e7eae394 implemented JSON Merge Patch (RFC 7396)
SQLite's json1 extension (https://www.sqlite.org/json1.html) supports JSON Merge Patch (https://tools.ietf.org/html/rfc7396). As the implementation is trivial and we already support JSON Patch, I think this could be a nice extension to the library.
2017-12-13 23:36:22 +01:00
Niels Lohmann
920f64c01c ⬆️ updated to Catch 2.0.1
Update required all CHECK_THROWS_AS macros to pass the exception type without reference, because this is now done by Catch2.
2017-12-13 22:18:05 +01:00
Niels Lohmann
293748a9a9 📝 overworked README
- Added recent contributors to thanks list.
- Linked PGP key for private mails.
- Updated compiler list.
2017-12-13 22:17:02 +01:00
Niels Lohmann
e8d9963abe 👌 cosmetic changes and overworked spelling
- All hex literals use upper case letters after the x.
- Fixed sime typos.
- Documented some more functions.
2017-12-13 22:15:53 +01:00
Niels Lohmann
a9a4ff61c6 🚨 remove C4996 warnings #872
These were the remaining direct calls to alloc.
2017-12-13 17:01:39 +01:00
Niels Lohmann
f7ae143a93 Merge pull request #870 from nlohmann/feature/issue838
💥 throwing an exception in case dump encounters a non-UTF-8 string #838
2017-12-13 06:34:11 +01:00
Niels Lohmann
8419bfbbd2 improved test coverage
As we guarantee proper UTF-8 before, we do not need to cope with it later.
2017-12-12 20:44:57 +01:00
Niels Lohmann
569d275f65 💥 throwing an exception in case dump encounters a non-UTF-8 string #838
We had a lot of issues with failing roundtrips (i.e., parse errors from serializations) in case string were stored in the library that were not UTF-8 encoded. This PR adds an exception in this case.
2017-12-11 22:38:05 +01:00
Niels Lohmann
383743c6c0 Merge pull request #868 from nlohmann/feature/issue867
📝 fixing documentation #867
2017-12-11 08:55:26 +01:00
Niels Lohmann
7de009edd1 ✏️ fixing typos #869 2017-12-10 13:07:47 +01:00
Niels Lohmann
772bb3cc20 📝 fixing documentation #867
The example in the documentation on how to "force" an array of arrays was wrong since the first release. Fixed the documentation and added checks for the README unit tests.
2017-12-10 12:32:20 +01:00
Niels Lohmann
0693945230 Merge pull request #860 from bogemic/std_iterator_conformance_cpp17
iter_impl template conformance with C++17
2017-12-08 07:55:47 +01:00
Mike Bogdanov
64d6daa76e iter_impl template conformance with C++17 2017-12-07 11:30:17 +03:00
Niels Lohmann
7c2d4f1852 👷 added Xcode 9.1 and 9.2 2017-12-06 22:32:03 +01:00
Niels Lohmann
9e2f185ac6 💄 reformatted code after PRs 2017-12-06 22:21:11 +01:00
Niels Lohmann
c5e731774a Merge pull request #856 from bogemic/std_allocator_conformance_cpp17
Std allocator conformance cpp17
2017-12-06 21:52:52 +01:00
Niels Lohmann
25d205c16d 📝 clarified difference between serialization and string value retrieval #853 2017-12-06 21:42:36 +01:00
Niels Lohmann
fa76f2efd7 Merge pull request #855 from theodelrieu/fix/cmake_include_directories
cmake: use BUILD_INTERFACE/INSTALL_INTERFACE
2017-12-06 20:47:38 +01:00
Mike Bogdanov
8890b935fd fixed merge conflicts 2017-12-06 12:24:50 +03:00
Mike Bogdanov
daba1b6a0b fixed conformance with C++17, some members of allocator are depricated and should be used via allocator_traits 2017-12-06 11:20:42 +03:00
Niels Lohmann
0e3a0b730b Merge pull request #854 from theodelrieu/fix/force_msvc_stacktrace
to/from_json: add a MSVC-specific static_assert to force a stacktrace
2017-12-05 19:36:31 +01:00
Théo DELRIEU
541ee62a05 cmake: use BUILD_INTERFACE/INSTALL_INTERFACE in target_include_directories 2017-12-05 11:27:03 +01:00
Théo DELRIEU
c9a02cbc59 to/from_json: add a MSVC-specific static_assert to force a stacktrace 2017-12-05 10:52:55 +01:00
Niels Lohmann
f4c01601fa Merge pull request #844 from TinyTinni/develop
Add .natvis for MSVC debug view
2017-12-04 21:43:22 +01:00
Matthias Möller
24fe572d98 missing new line 2017-11-30 13:37:58 +01:00
Matthias Möller
8e9a8792a9 moved natis to root dir 2017-11-30 13:26:45 +01:00
Matthias Möller
af775ddbb8 add compiler & cmake version check 2017-11-28 23:43:39 +01:00
Matthias Möller
48d7a32daa add .natvis for MSVC debug view 2017-11-26 10:31:33 +01:00
Matthias Möller
5b4855dea2 fix targetname 2017-11-26 10:29:51 +01:00
Niels Lohmann
cc937deaf6 🚑 the last commit contained a bug #821 2017-11-26 10:15:23 +01:00
Niels Lohmann
430f03512c 🚨 fixed some warnings #821 2017-11-25 22:06:18 +01:00
Niels Lohmann
ea5aed0769 Merge branch 'feature/to_array' into develop 2017-11-25 19:41:11 +01:00
Niels Lohmann
de75cf89f7 improved test coverage 2017-11-25 19:41:02 +01:00
Niels Lohmann
52ca35b2b0 Merge pull request #829 from jowr/patch-1
Updated hunter package links
2017-11-18 13:35:21 +01:00
Jorrit Wronski
7b8ddadd83 removed hunter badge 2017-11-16 21:01:27 +01:00
Jorrit Wronski
b5ddd99adf Updated hunter package links 2017-11-15 08:48:11 +01:00
Niels Lohmann
4c4f60f438 📝 fixes #820 2017-11-06 20:35:05 +01:00
Niels Lohmann
1af5601a2a Merge pull request #811 from Itja/patch-1
Typos README
2017-10-31 18:23:42 +01:00
Itja
e423aea64a Typos README
Hey, thanks for this great library which I've used in many occasions now. I know it's not much, but I wanted to contribute at least a tiny bit back to you by this PR :-) Keep up the good work!
2017-10-31 16:31:14 +01:00
Niels Lohmann
5696660eba 🔨 another try to fix #714
adding std::ios_base::binary when opening all_unicode.json.cbor
2017-10-31 15:04:14 +01:00
Niels Lohmann
c4d6626745 🚀 installed Request Info Bot 2017-10-30 16:04:34 +01:00
Niels Lohmann
6d2981db82 📝 overworked templates 2017-10-29 16:32:23 +01:00
Niels Lohmann
87df1d6708 Merge branch 'develop' of https://github.com/nlohmann/json into develop 2017-10-29 11:55:04 +01:00
Niels Lohmann
fa1425b87c 🚀 installed Sentiment Bot 2017-10-29 11:54:53 +01:00
Niels Lohmann
73d0095154 Merge pull request #807 from theodelrieu/fix/805
add forwarding references to json_ref constructor
2017-10-28 15:33:22 +02:00
Théo DELRIEU
4b46abf97c add forwarding references to json_ref constructor
fixes #805
2017-10-28 14:22:57 +02:00
Niels Lohmann
8e067c0c3c 🔨 set bidirectional iterator tag #593 2017-10-28 09:41:35 +02:00
Niels Lohmann
cea3f24ff9 📝 comment to address #561 2017-10-27 16:39:52 +02:00
Niels Lohmann
61cc07ff38 📝 some documentation 2017-10-27 16:07:04 +02:00
Niels Lohmann
734e2b73cf 🔨 cleanup 2017-10-27 11:49:24 +02:00
Niels Lohmann
7820b5eccb 📝 thanks for #795 2017-10-27 11:49:17 +02:00
Niels Lohmann
77f8e2f987 Merge pull request #795 from jseward/develop
Add transparent comparator and perfect forwarding support to find() and count()
2017-10-27 11:47:23 +02:00
Niels Lohmann
c215b77936 🚀 installed Stale Bot 2017-10-25 11:37:33 +02:00
Jamie Seward
992c836b30 Add missing spaces 2017-10-24 00:14:25 -07:00
Jamie Seward
715c98b404 Remove extra spaces 2017-10-24 00:06:22 -07:00
Jamie Seward
6c9a401ebc Remove old non-perfect forwarding find and count 2017-10-24 00:01:56 -07:00
Jamie Seward
16ffdbcb20 Remove c++17 support flag in cmake
Already covered by AppVeyor
2017-10-23 23:50:06 -07:00
Jamie Seward
73b1629a15 Remove tabs for spaces 2017-10-23 23:45:39 -07:00
Niels Lohmann
1b1bd0e3e6 #714 is still not fixed 2017-10-23 12:01:50 +02:00
Jamie Seward
33c6511dd0 Remove JSON_HAS_STRING_VIEW
Instead implement @gregmarr's PR comments that perfect forwarding should be used. Also cleaned up cpp language standard detection.
2017-10-23 00:43:26 -07:00
Niels Lohmann
89650c99dd 🚧 checking if #714 is now fixed with MSVC
Hopefully, #764 fixed this.
2017-10-22 11:16:33 +02:00
Niels Lohmann
b0c380b0f8 📝 cleanup after the last PRs 2017-10-22 09:12:35 +02:00
Niels Lohmann
be4fba7baf Merge branch 'develop' of https://github.com/nlohmann/json into develop 2017-10-22 08:53:46 +02:00
Niels Lohmann
f193427e91 🔨 some simplifications 2017-10-22 08:53:43 +02:00
Niels Lohmann
24b6e028a9 improved test coverage 2017-10-22 08:53:27 +02:00
Niels Lohmann
3094640446 Merge pull request #764 from pjkundert/develop-simplify-istream
Simplified istream handing #367
2017-10-22 08:52:28 +02:00
Niels Lohmann
ef40673acb Merge branch 'develop' into develop-simplify-istream 2017-10-22 08:52:15 +02:00
Jamie Seward
d468f8c4e6 Use consistent logic to determine if string_view exists 2017-10-21 16:36:05 -07:00
Jamie Seward
59cde1ad6e Fix for _HAS_CXX17 == 0
Copied from solution to https://github.com/nlohmann/json/issues/464
2017-10-21 16:29:37 -07:00
Jamie Seward
1a66679929 Add string_view support
This avoids unnecessary string copies on often used
find().
2017-10-21 15:20:13 -07:00
Niels Lohmann
33df3250c3 Merge pull request #793 from sonulohani/develop
Error : 'identifier "size_t" is undefined' in linux
2017-10-21 10:58:27 +02:00
Sonu Lohani
92da334862 Error : 'identifier "size_t" is undefined' in linux 2017-10-21 12:52:44 +05:30
Niels Lohmann
2e281ba64b Merge pull request #788 from jseward/develop
Fix Visual Studio 2017 warnings
2017-10-18 15:04:24 +02:00
Jamie Seward
a99fcb4e7d Add comments and newline 2017-10-17 22:53:35 -07:00
Jamie Seward
917d9d8bc3 Fix Visual Studio 2017 warnings 2017-10-16 23:23:55 -07:00
Niels Lohmann
7c8f0a4186 Merge pull request #785 from jseward/develop
Fix warning C4706 on Visual Studio 2017 - fixes #784
2017-10-16 19:48:17 +02:00
Niels Lohmann
b27a142ec0 Merge pull request #783 from eld00d/patch-1
Set GENERATE_TAGFILE in Doxyfile
2017-10-16 17:54:28 +02:00
Perry Kundert
a8cc7a1bc8 Consistently use std::char_traits int_type-->char conversion intrinsics 2017-10-16 08:06:10 -07:00
Jamie Seward
af99090742 Disable warning C4389: '==': signed/unsigned mismatch
Lots of tests have this warning.

Also moved out of for loop, doesn't need to be done every loop.
2017-10-16 01:02:48 -07:00
Jamie Seward
8ba7f69ab4 Fix whitespace 2017-10-16 00:49:59 -07:00
Jamie Seward
8a4af820c7 Fix warning C4706 2017-10-16 00:41:58 -07:00
Jamie Seward
19f8f1c075 Add missing "u8"
This causes test-udt to crash due to bad iterator
2017-10-16 00:21:38 -07:00
Jamie Seward
5ec44fe9e3 Add /W4 for MSVS 2017-10-15 22:56:38 -07:00
Nate Vargas
727ee7d03e Set GENERATE_TAGFILE in Doxyfile
Allows documentation to be linked from other projects to https://nlohmann.github.io/json using Doxygen with the tag:
TAGFILES = $(SOME_PATH)/nlohmann_json.tag=https://nlohmann.github.io/json
2017-10-14 19:06:38 -05:00
Niels Lohmann
d300a8e268 🚨 fixed warnings #776 2017-10-13 08:46:29 +02:00
Perry Kundert
0b803d0a5f Simplify the json/src/benchmarks.cpp to allow more optimal code gen.
o For some unknown reason, the complexity of the benchmark platform
  prevented some C++ compilers from generating optimal code, properly
  reflective of the real performance in actual deployment.
o Added the json_benchmarks_simple target, which performs the same
  suite of tests as json_benchmarks.
o Simplified the benchmark platform, and emit an "Average" TPS
  (Transactions Per Second) value reflective of aggregate parse/output
  performance.
2017-10-07 15:50:19 -07:00
Perry Kundert
23440eb86e Remove outdated commentary about the value of eof(), retain input type
o We assume the same character int_type as the unerlying std::istream
o There are no assumptions on the value of eof(), other than that it
  will not be a valid unsigned char value.
o To retain performance, we do not allow swapping out the underlying
  std::streambuf during our use of the std::istream for parsing.
2017-10-06 12:54:43 -07:00
Perry Kundert
45e1e3d48a Revert some unnecessary member initializer changes. 2017-10-06 07:53:31 -07:00
Perry Kundert
5e480b56d8 Further simplify character type handling 2017-10-06 07:37:49 -07:00
Perry Kundert
1b43a45bec Implement correct handling of std::streambuf int_type, eof()
o Make no assumptions about eof(), other than that it is somewhere
  outside of the valid range of char_type.
2017-10-05 16:16:41 -07:00
Perry Kundert
184dab60e6 Accelerate access to underlying std::istream streambuf 2017-10-05 16:16:41 -07:00
Perry Kundert
f775922ca8 Specify initializers for yytest, token_string using initializer-lists
o We can retain -Weffc++ and specify default initializers by using
  initializer lists.  The risks are low (of additional non-conformat
  compilers), because there is already one other such initialization
  used in the code-base.
2017-10-05 16:16:41 -07:00
Perry Kundert
546e148b24 Further performance improvements, and corrections in get_token_string
o An (-'ve valued, typically -1) EOF must never be allowed in
  token_string, as it be converted to 255 -- a legitimate value.
o Comparing against a specific eof() (-1, typically) is more costly than
  detecting +'ve/-'ve.  Since EOF is the only non-positive value allowed
  we can use the simpler test.
o Removed unnecessary test for token_string size, as it is already
  tested in the method, and must never occur in correct code; used an
  assert instead.
2017-10-05 16:16:41 -07:00
Perry Kundert
8665e25942 Rename get_string to move_string to imply side-effect 2017-10-05 16:16:41 -07:00
Perry Kundert
e0d890cc23 Corrected unnnecessary const restriction on returned std::string 2017-10-05 16:16:41 -07:00
Perry Kundert
97a388802d Improve performance by constructing yytext as a std::string
o Return its contents when necessary.  In many cases, this avoids
  construction of multiple copies of the yytext token.  Exceeds
  performance of current develop branch.
2017-10-05 16:15:46 -07:00
Perry Kundert
7c523338c5 Remove unnnecessary NUL termination of yytext (as it may contain NULs) 2017-10-05 16:01:41 -07:00
Perry Kundert
14ca1f6f09 Restore istream performance #764
o Use std::streambuf I/O instead of std::istream; does not maintain
  (unused) istream flags.
o Further simplify get/unget handling.
o Restore original handling of NUL in input stream; ignored during
  token_string escaping.
2017-10-05 16:01:41 -07:00
Perry Kundert
12efeadc2e Further simplify istream handling; use native unget 2017-10-05 16:01:41 -07:00
Perry Kundert
f585fe4eec Test to confirm parsing of multiple JSON records in a istream #367 2017-10-05 16:01:41 -07:00
Perry Kundert
90adf6ec20 Simplify get_token_string, unnecessary buffering, handle Byte Order Mark 2017-10-05 16:01:41 -07:00
Niels Lohmann
0c0851dbea 📝 comment how to integrate tsl::ordered_map (#546) 2017-10-05 20:36:18 +02:00
Niels Lohmann
bab4a15748 📝 comment how to integrate fifo_map (#485) 2017-10-05 20:33:27 +02:00
Niels Lohmann
60439aff05 📝 different cmake call 2017-10-05 19:43:59 +02:00
Niels Lohmann
73d1b55aba 🔧 executing tests in parallel 2017-10-05 19:43:39 +02:00
Niels Lohmann
615366447a 🔧 removing -Weffc++ warnings 2017-10-05 19:43:19 +02:00
Niels Lohmann
73727c989c Merge branch 'feature/coveralls' into develop 2017-10-05 19:08:28 +02:00
Niels Lohmann
75f4678b96 🔨 added filter script for branch coverage 2017-10-05 19:08:15 +02:00
Niels Lohmann
c204ac82e0 🔨 adjusted Coverity script to work without Makefile 2017-10-05 07:13:59 +02:00
Niels Lohmann
7b82e4b4c8 🔨 added Makefile target to calculate lcov coverage 2017-10-05 00:17:09 +02:00
Niels Lohmann
1b3df3a63f 🔨 trying to use Coveralls with CMake #698 2017-10-04 22:18:21 +02:00
Niels Lohmann
99ee4c1eaf 🔨 cleaned up Makefiles and docs #698 2017-10-04 19:27:35 +02:00
Niels Lohmann
5cb6d7187d 🚨 fixing last warning in #755 2017-10-04 17:28:35 +02:00
Niels Lohmann
4e81c1db47 Merge pull request #765 from nlohmann/feature/issue698
using more CMake
2017-10-04 10:39:56 +02:00
Niels Lohmann
e2045eae53 🏁 and another try 2017-10-03 18:47:08 +02:00
Niels Lohmann
a85bc358f7 🏁 another try 2017-10-03 18:21:40 +02:00
Niels Lohmann
3457e7bc5b 🏁 try to get MSVC 2017 running again 2017-10-03 17:57:40 +02:00
Niels Lohmann
54bd1b5124 Merge branch 'develop' into feature/issue698 2017-10-03 17:23:05 +02:00
Niels Lohmann
7435d54e97 🔨 clean up 2017-10-02 23:06:41 +02:00
Niels Lohmann
4912231450 Merge branch 'develop' into feature/issue698 2017-10-02 18:25:25 +02:00
Niels Lohmann
b91805e1f0 🚨 removing a compiler warning #755 2017-10-02 18:11:36 +02:00
Niels Lohmann
f89f8b2d0b Merge branch 'develop' into feature/issue698 2017-10-02 17:47:53 +02:00
Niels Lohmann
8be303d4fb 🏁 fixing a min() call for MSVC #762 2017-10-02 13:54:14 +02:00
Niels Lohmann
1df836ce40 removed call to std::signbit #761 2017-10-01 15:48:29 +02:00
Niels Lohmann
8af49d4be5 🚨 removing compiler warnings #755 2017-09-30 11:00:26 +02:00
Niels Lohmann
1a66527dca 📝 fixed documentation #745 2017-09-30 10:18:18 +02:00
Niels Lohmann
b05ea3de55 Merge pull request #753 from gregmarr/patch-1
Add info for the vcpkg package.
2017-09-26 22:36:36 +02:00
gregmarr
ec60ff3451 Add info for the vcpkg package. 2017-09-26 08:39:38 -07:00
Niels Lohmann
647711fad1 improved test coverage 2017-09-14 17:31:28 +02:00
Niels Lohmann
737816d0cd 👷 another try with Travis 2017-09-14 17:31:14 +02:00
Niels Lohmann
e75adc21a5 Merge branch 'develop' into feature/issue698 2017-09-13 18:57:25 +02:00
Niels Lohmann
b90529c36d improved test coverage 2017-09-13 18:56:54 +02:00
Niels Lohmann
82c93680d1 Merge branch 'develop' into feature/issue698 2017-09-10 22:38:23 +02:00
Niels Lohmann
e2e0ecd867 improved test coverage 2017-09-10 22:38:04 +02:00
Niels Lohmann
248db1e423 Merge branch 'develop' into feature/issue698 2017-09-10 11:42:57 +02:00
Niels Lohmann
7410763731 improved test coverage 2017-09-10 11:42:43 +02:00
Niels Lohmann
cafc2d057a Merge branch 'develop' into feature/issue698 2017-09-10 10:22:10 +02:00
Niels Lohmann
da97cf7895 improved test coverage 2017-09-10 10:21:53 +02:00
Niels Lohmann
295d65ada7 Merge branch 'develop' into feature/issue698 2017-09-10 01:13:43 +02:00
Niels Lohmann
fcba9ec537 🔨 clean up 2017-09-10 01:12:03 +02:00
Niels Lohmann
41994ba028 Merge branch 'develop' into feature/issue698 2017-09-09 16:53:37 +02:00
Niels Lohmann
b21d7810fa improved test coverage 2017-09-09 16:53:27 +02:00
Niels Lohmann
c1d6478584 Merge branch 'develop' into feature/issue698 2017-09-09 13:07:40 +02:00
Niels Lohmann
9ae6796a38 improved test coverage 2017-09-09 13:07:10 +02:00
Niels Lohmann
31ce7e1e59 Merge branch 'develop' into feature/issue698 2017-09-09 11:05:20 +02:00
Niels Lohmann
fd250ae2b1 improved test coverage 2017-09-09 11:04:58 +02:00
Niels Lohmann
5c08b84dec back to previous MSVC 2017 2017-09-06 18:26:52 +02:00
Niels Lohmann
da14286abb 👷 try to use MSVC 2017 again 2017-09-06 18:13:35 +02:00
Niels Lohmann
c607b5c2ac 📝 improved documentation 2017-09-06 17:14:06 +02:00
Niels Lohmann
91e0032853 📝 improved documentation 2017-08-29 23:46:26 +02:00
Niels Lohmann
b41b13047c 👷 removed unneccessary test 2017-08-27 11:30:36 +02:00
Niels Lohmann
15e757c42b 🔨 trying to fix memory issue with valarray 2017-08-27 10:41:39 +02:00
Niels Lohmann
0e94ba8857 👷 using the same compilers 2017-08-26 08:56:34 +02:00
Niels Lohmann
4f5c345817 👷 run sanitizer another time to check if it works 2017-08-26 08:20:37 +02:00
Niels Lohmann
8608f42187 👷 trying to use libstdc++
https://github.com/travis-ci/apt-source-whitelist/issues/372#issuecomment-320547215
2017-08-25 22:49:18 +02:00
Niels Lohmann
5e7acbf05e 👷 adjusted flags for Clang sanitizer
we are overrding the CXXFLAGS provided by travis in order to use gcc's libstdc++
2017-08-25 22:34:00 +02:00
Niels Lohmann
268f5a3d0a 👷 added option to switch off exceptions 2017-08-25 21:29:27 +02:00
Niels Lohmann
839681ff9f 👷 using Ninja 2017-08-25 21:01:07 +02:00
Niels Lohmann
3dcd360139 👷 adding status messages 2017-08-25 20:19:58 +02:00
Niels Lohmann
05b97c473a 👷 added flags for Valgrind and Clang sanitizer 2017-08-25 20:12:21 +02:00
Niels Lohmann
c87b080cc5 👷 new cmake file for test cases 2017-08-25 18:06:22 +02:00
Niels Lohmann
5b71bf09a1 Merge pull request #708 from theodelrieu/fix/from_json_tuple_pair
fix from_json implementation for pair/tuple
2017-08-24 12:40:16 +02:00
Théo DELRIEU
bb1b4c934e fix from_json implementation for pair/tuple
Introduced by 6e4910d5c5

Fixes #707
2017-08-23 10:05:43 +02:00
Niels Lohmann
e45eaf6e30 Revert "👷 using libc++ with Clang"
This reverts commit 41b2c69bdb.
2017-08-23 08:39:19 +02:00
Niels Lohmann
0b5e8f859b 🔨 cleanup
Fixed some warning in Clion.
2017-08-23 00:42:15 +02:00
Niels Lohmann
9fd031b6f4 🐛 re-added support for std::valarray #702 2017-08-22 23:28:23 +02:00
Niels Lohmann
41b2c69bdb 👷 using libc++ with Clang 2017-08-22 22:04:38 +02:00
Niels Lohmann
cd53790993 👷 using Clang 5.0 2017-08-21 20:03:24 +02:00
Niels Lohmann
e569b9736b 👷 trying to fix build error
See http://help.appveyor.com/discussions/problems/7450-build-error-on-vs-2017-image-suddenly.
2017-08-21 17:31:14 +02:00
Niels Lohmann
ba5d37ba4b 👷 added Clang 5.0 (see https://docs.travis-ci.com/user/languages/cpp/#clang) 2017-08-21 17:27:35 +02:00
Niels Lohmann
64ef100ebf Revert "💥 changed iterators to andom_access_iterator #593"
This reverts commit c77a0be5f3.
2017-08-20 20:44:44 +02:00
Niels Lohmann
8acaf5bdbc 🚨 fixing two compiler warnings 2017-08-20 19:31:07 +02:00
Niels Lohmann
c77a0be5f3 💥 changed iterators to andom_access_iterator #593
This commit changes the iterator category to andom_access_iterator and allows offsets and subscript operators for object iterators.
2017-08-16 21:35:22 +02:00
Niels Lohmann
aba8b58492 🔨 approach to un-break the changes for #462 2017-08-16 20:11:05 +02:00
Niels Lohmann
22b59693f1 💥 CBOR/MessagePack input must end with EOF #505
The CBOR and MessagePack parsers now expect the input to be read until the end. Unless the new parameter "strict" is set to false (it is true by default), an exception is raised if the parser ends prematurely. This is a breaking change as the parsers ignored unread input so far.

Furthermore, the offset/startIndex paramter introduced in #462 was removed as this behavior can be mimicked with an iterator range. For instance, instead of calling "from_cbor(vec, 5);", you can write "from_cbor({vec.begin()+5, vec.end()});".
2017-08-16 14:48:23 +02:00
Niels Lohmann
1f31a5b808 ⬆️ Catch v1.9.7 2017-08-16 10:23:39 +02:00
Niels Lohmann
f5a53de845 👷 running sanitizer job in parallel 2017-08-16 09:21:20 +02:00
Niels Lohmann
21726d8d8f 👷 run sanitizer after tests 2017-08-16 08:11:02 +02:00
Niels Lohmann
df572aca79 👷 set sanitizer to clang4 2017-08-16 07:42:57 +02:00
Niels Lohmann
4391bf5615 Merge branch 'feature/update' into develop 2017-08-16 07:39:30 +02:00
Niels Lohmann
1e360bb32b 🔨 preparation for #505
Added a parameter to control whether parsing CBOR and MessagePack must completely consume the input.
2017-08-16 07:39:11 +02:00
Niels Lohmann
002410410f Merge branch 'develop' into feature/update 2017-08-15 21:42:58 +02:00
Niels Lohmann
72afe53fa0 📝 updated documentation for update() function #661 2017-08-15 21:42:50 +02:00
Niels Lohmann
76123fab76 📝 added note wrt. #667 2017-08-15 20:49:18 +02:00
Niels Lohmann
fdff42bc3d 👷 forgot to install Cmake on OSX 2017-08-15 20:30:01 +02:00
Niels Lohmann
039e2f03bc Merge branch 'develop' into feature/update 2017-08-15 19:54:22 +02:00
Niels Lohmann
7f4722a75d Merge branch 'feature/travis_clang' into develop 2017-08-15 19:52:47 +02:00
Niels Lohmann
08805f7f14 🔨 cleanup 2017-08-13 20:57:27 +02:00
Niels Lohmann
988077e046 Merge branch 'develop' into feature/travis_clang 2017-08-13 20:27:27 +02:00
Niels Lohmann
7d19aed567 🔨 cleanup 2017-08-13 19:02:58 +02:00
Niels Lohmann
569c00eb18 👷 changed c++17 to c++1z 2017-08-10 23:41:12 +02:00
Niels Lohmann
6151b056eb 🔨 cleanup 2017-08-10 23:40:30 +02:00
Niels Lohmann
bade3b3e6c 👷 cleanup 2017-08-10 21:17:40 +02:00
Niels Lohmann
76b195d7d1 👷 fix for coverity + clang-5.0 2017-08-10 20:54:59 +02:00
Niels Lohmann
cd34358e7c 👷 removing clang from source 2017-08-10 20:37:23 +02:00
Niels Lohmann
5eb9f5fd4f 👷 clang-3.4 2017-08-10 20:31:59 +02:00
Niels Lohmann
f49356e703 👷 clang-3.4 2017-08-10 20:26:49 +02:00
Niels Lohmann
e0f8eb1710 👷 clang-4.0 2017-08-10 20:21:41 +02:00
Niels Lohmann
6dc89e47fc 👷 clang-3.9 2017-08-10 20:16:35 +02:00
Niels Lohmann
8de710bbe7 👷 added source for gcc 2017-08-10 20:12:27 +02:00
Niels Lohmann
195d773bc5 👷 added gcc 2017-08-10 20:09:39 +02:00
Niels Lohmann
e7f2d2646a 👷 removed gcc 2017-08-10 20:06:47 +02:00
Niels Lohmann
6b20f6d1ef 👷 clang-3.8 2017-08-10 20:04:36 +02:00
Niels Lohmann
82cd8c8d02 👷 another try 2017-08-10 19:59:00 +02:00
Niels Lohmann
f256587c4f 👷 clang-3.4 2017-08-10 19:56:09 +02:00
Niels Lohmann
c06b5c5c10 👷 clang-3.5 2017-08-10 19:50:36 +02:00
Niels Lohmann
3283352db3 👷 using clang++ 2017-08-10 19:45:33 +02:00
Niels Lohmann
c20dd7522f 👷 another try 2017-08-10 19:40:09 +02:00
Niels Lohmann
94dfecd487 👷 removed g++ 2017-08-10 19:31:43 +02:00
Niels Lohmann
8963aae57d 👷 clang-3.6 2017-08-10 19:24:36 +02:00
Niels Lohmann
5aceb0e029 👷 clang-3.6 2017-08-10 19:23:55 +02:00
Niels Lohmann
e7a7e4f81f 👷 fixed compiler 2017-08-10 19:18:45 +02:00
Niels Lohmann
e333562633 👷 different source 2017-08-10 19:15:16 +02:00
Niels Lohmann
eb6de822bb 👷 clang-3.7 2017-08-10 19:12:04 +02:00
Niels Lohmann
c1642affaa 👷 clang-3.8 2017-08-10 19:03:35 +02:00
Niels Lohmann
a46afd4008 Merge pull request #679 from traits/patch-1
Digraph warning
2017-08-10 11:39:13 +02:00
traits
54c67dcfec Update json.hpp 2017-08-10 09:05:00 +02:00
Niels Lohmann
99ea12f304 📝 acknowledgements for #674, #678, #682, #685, and #686 2017-08-10 06:50:34 +02:00
Niels Lohmann
d26b3f1fe5 Merge pull request #686 from WebProdPP/patch-1
Update json.hpp
2017-08-10 06:44:59 +02:00
Niels Lohmann
345846b514 Merge pull request #685 from daixtrose/patch-1
Remove duplicate word
2017-08-09 15:32:33 +02:00
WebProdPP
c9509ccf97 Update json.hpp
mistake
2017-08-09 16:13:43 +03:00
Markus Werle
86b3d06a93 remove duplicate word
s/to to/to/
2017-08-09 11:56:48 +02:00
Niels Lohmann
6e5b895f87 Merge pull request #682 from kbthomp1/fix-intel-osx
To fix compilation issue for intel OSX compiler
2017-08-09 10:16:03 +02:00
Kyle Thompson
4b55f0ebd6 To fix compilation issue for intel OSX compiler
o To prevent the compilation issue on OSX with the intel compiler suite.  The
error was found with icpc version 15.0.3.187 where the "__clang_version__" was
not defined correctly, while "__clang__" was.
2017-08-08 18:43:03 -04:00
Niels Lohmann
c90bf5e0f1 👷 removed failing builders 2017-08-08 21:26:15 +02:00
Niels Lohmann
dd008545d1 Merge branch 'develop' of https://github.com/nlohmann/json into develop 2017-08-08 19:15:49 +02:00
Niels Lohmann
054b0250be 👷 trying to install g++ to make clang work 2017-08-08 19:14:22 +02:00
traits
ab44a50d98 Digraph warning
The original version can trigger a digraph-related warning in VS2015. Is this namespace construct a typo or something deliberate?
2017-08-07 14:23:48 +02:00
Niels Lohmann
b32a6b8c75 Merge pull request #678 from DmitryKuk/develop
massage -> message
2017-08-05 13:42:43 +02:00
DmitryKuk
19437c15de massage -> message 2017-08-05 10:43:08 +03:00
Niels Lohmann
e523312fa2 improved test coverage 2017-08-03 17:47:42 +02:00
Niels Lohmann
d2c3592908 added test cases for update #661 2017-08-02 22:44:58 +02:00
Niels Lohmann
d1e13d5128 🎉 first draft for #661 2017-08-02 22:12:41 +02:00
Niels Lohmann
0ea0d7d860 Merge pull request #674 from wincent/patch-1
Fix "not constraint" grammar in docs
2017-08-01 20:21:04 +02:00
Niels Lohmann
efdfd3aa5b replaced by-value call #673 2017-08-01 19:37:25 +02:00
Greg Hurrell
391303521a Fix "not constraint" grammar in docs 2017-08-01 08:56:28 -07:00
Niels Lohmann
76ecb2bd60 Merge pull request #671 from dan-42/develop
Add documentation for integration with CMake and hunter
2017-08-01 07:15:55 +02:00
dan-42
db0b9732d4 DOC: add sort mentioning about support in hunter 2017-07-31 23:20:37 +02:00
Niels Lohmann
e60002a1b3 🔨 fixed GCC warnings in #663
https://github.com/nlohmann/json/pull/663#issuecomment-318931884
2017-07-31 23:17:14 +02:00
dan-42
966989a3f5 CONFIG: pin cmake to enable only C++ 2017-07-31 09:49:26 +02:00
Niels Lohmann
850d856aae 🔨 cleanup after #663 2017-07-30 20:30:05 +02:00
Niels Lohmann
3d67ec40a6 Merge branch 'develop' of https://github.com/nlohmann/json into develop 2017-07-30 20:01:35 +02:00
Niels Lohmann
85c768084b 🔨 using emplace 2017-07-30 20:01:31 +02:00
Niels Lohmann
67fb517ccd Merge pull request #669 from dan-42/change_installed_cmake_include_path
REFACTOR: rewrite CMakeLists.txt for better inlcude and reuse
2017-07-30 20:01:03 +02:00
Niels Lohmann
80e95844f6 Merge pull request #663 from himikof/move-construction
Support moving from rvalues in std::initializer_list
2017-07-30 20:00:46 +02:00
Niels Lohmann
aad55219f8 Merge branch 'develop' into move-construction 2017-07-30 19:49:24 +02:00
Niels Lohmann
96dd4ffa19 🔨 simplified a call 2017-07-30 18:30:34 +02:00
Niels Lohmann
7737a29518 🔨 small parser performance improvements
- replaced list of pairs by flat list in next_byte_in_range
- implemented early exit in case of parse errors
- reused memory for object keys
- direct calls to embedded objects/arrays for insertions
2017-07-30 13:25:36 +02:00
dan-42
f434942371 REFACTOR: rewrite CMakeLists.txt for better inlcude and reuse
The rewrite uses more cmake build-in automatisms and build-in generates
variables to allow better generic reuse.
* cmake  files are installed to
``` <install_prefix>/lib/cmake/nlohmann_json/ ``` for best support on
most systems
* include path is set to ``` include ```  for usage as ``` #include
<nlohmann/json.hpp> ```
2017-07-29 11:59:09 +02:00
Niels Lohmann
c819a2d732 🔨 refactored some scanner internals 2017-07-28 19:18:50 +02:00
Niels Lohmann
5851daa576 binary formats can be stored in std::string, std::ofstreams or std::ostringstream #477 2017-07-28 00:21:55 +02:00
Niels Lohmann
c136b6f200 Merge pull request #666 from effolkronium/develop
enable_testing only if the JSON_BuildTests is ON
2017-07-27 20:48:56 +02:00
Niels Lohmann
7d51214045 implemented exception-free parser #458 #582
You can now pass a boolean "allow_exceptions" to the parse functions. If it is false, no exceptions are thrown in case of a parse error. Instead, parsing is stopped at the first error and a JSON value of type "discarded" (check with is_discarded()) is returned.
2017-07-27 20:33:11 +02:00
Ilya Polishchuk
a27dd3a6f6 enable_testing only if JSON_BuildTests is ON 2017-07-27 17:50:24 +03:00
Niels Lohmann
669ebf51bc 🔨 fixed an error in MSVC 2017-07-27 06:04:35 +02:00
Niels Lohmann
3d589fd032 🔨 fixed compilation error 2017-07-26 23:59:56 +02:00
Niels Lohmann
e6aa700360 🔨 cleanup 2017-07-26 23:44:55 +02:00
Nikita Ofitserov
93bb71232d Move from rvalues eagerly to work around MSVC problem
On MSVC compiler, temporaries that are constructed during a
list initialization, are sometimes destroyed even before calling
the initializing constructor, instead of at the end of the
containing full-expression. This is clearly non-conforming to
[class.temporary].
As the impact of this bug is silently producing incorrect
JSON values, move eagerly from rvalues to be safe.

See https://stackoverflow.com/questions/24586411
2017-07-25 12:17:32 +03:00
Nikita Ofitserov
897879bccb Make detail::json_ref do less work by deferring moves/copies 2017-07-24 12:29:06 +03:00
Nikita Ofitserov
0f4978e503 Fix an actually invalid test
C++ overload resolution/list initialization rules are hard.
2017-07-24 01:08:33 +03:00
Niels Lohmann
4414f94cd5 🔨 using input/output adapters for CBOR and MessagePack
- You can now pass a reference to a vector to the to_cbor and to_msgpack functions. The output will be written (appended) to the vector. #476

- You can now pass an output stream with uint8_t character type to the to_cbor and to_msgpack functions. #477

- You can now read from uint8_t */size in the to_cbor and to_msgpack functions. An input adapter will be created from this pair, so you need to use braces. #478
2017-07-23 23:02:24 +02:00
Nikita Ofitserov
f5cae64e52 Update tests while fixing possible UB
std::initializer_list does not own the temporaries created in
its initialization. Therefore, storing it in an independent
stack variable is unsafe.
2017-07-23 23:59:34 +03:00
Nikita Ofitserov
09cda57309 Support moving from rvalues in an std::initializer_list
This commit works around an issue in std::initializer_list design.
By using a detail::json_ref proxy with a mutable value inside,
rvalue-ness of an input to list initializer is remembered and
used later to move from the proxy instead of copying.
2017-07-23 23:57:17 +03:00
Nikita Ofitserov
cf3ca3b78c Optimize json construction from rvalue string_t/array_t/object_t 2017-07-23 23:50:59 +03:00
Nikita Ofitserov
7b3cbfff23 Add some tests for std::move from std::initializer_list 2017-07-23 23:47:15 +03:00
Niels Lohmann
9b1c058810 🔨 reorganized interfaces for parse/accept functions #623
We now rely on implicit conversions to an input_adapter object in the parse/accept functions.
2017-07-23 18:11:34 +02:00
Niels Lohmann
18e0430bfe 🔨 adding destroy function to discard values 2017-07-22 22:57:22 +02:00
Niels Lohmann
5b5f0090a1 🔨 trying to fix the sanitizer error
Travis found an error with Clang 3.8's sanitizers, see https://travis-ci.org/nlohmann/json/jobs/256366699. Unfortunately, I cannot reproduce this error with clang version 6.0.0 (trunk 308825) locally. However, this seems to be an issue, because so far, we did not reset a value after moving from it.
2017-07-22 16:41:42 +02:00
Niels Lohmann
d53ef95067 🔨 fixed some warnings 2017-07-22 15:33:31 +02:00
Niels Lohmann
c7a69ae03e started working on parser with provded result reference #418
Internally, the parser now writes its result into a JSON value provided as a reference. To be usable, the public interfaces need to be extended.
2017-07-22 15:18:38 +02:00
Niels Lohmann
f513c46749 🔨 further cleanup 2017-07-22 13:35:04 +02:00
Niels Lohmann
024fec8a9b 🔨 more cleanup using clang-tidy 2017-07-21 18:26:07 +02:00
Niels Lohmann
a09193e967 🔨 cleanup
- Replaced codepoint calculation by bit operations.
- Fixed several clang-tidy warnings.
2017-07-20 23:01:16 +02:00
Niels Lohmann
21d23982ca 🐛 fix for #656
A complete rewrite of the string escape function. It now provides codepoint-to-\uxxxx escaping. Invalid UTF-8 byte sequences are not escaped, but copied as-is. I haven’t spent much time optimizing the code - but the library now agrees with Python on every single Unicode character’s escaping (see file test/data/json_nlohmann_tests/all_unicode_ascii.json).

Other minor changes: replaced "size_t" by "std::size_t"
2017-07-17 07:53:02 +02:00
Niels Lohmann
8a9133c6b2 Merge pull request #652 from olegendo/develop
Rename BuildTests to JSON_BuildTests
2017-07-15 11:39:27 +02:00
Niels Lohmann
f1fabd1ba2 📄 added code of conduct
added Contributor Covenant Code of Conduct
2017-07-13 19:16:41 +02:00
Niels Lohmann
dad4916f9e Merge pull request #654 from ryanjmulder/develop
add ensure_ascii parameter to dump. #330
2017-07-12 07:58:45 +02:00
Ryan Mulder
486f3a2d16 restore necessary comman in documentation of dump 2017-07-11 14:18:02 -04:00
Ryan Mulder
40461c6c55 update comment on dump to not indicate that ensure_ascii is true by default 2017-07-11 13:59:07 -04:00
Ryan Mulder
71597be294 add ensure_ascii parameter to dump. #330 2017-07-11 13:48:08 -04:00
Oleg Endo
cd800522e4 Rename BuildTests to JSON_BuildTests
This avoids potential conflicts with other libraries when the library is
built from source and included in a bigger cmake build.
2017-07-11 22:57:49 +09:00
Niels Lohmann
7dee868a42 Merge pull request #643 from theodelrieu/refacto/split_basic_json
Refacto/split basic json
2017-07-09 23:12:35 +02:00
Théo DELRIEU
8585d35c92 move serializer outside of basic_json 2017-07-09 21:30:34 +02:00
Théo DELRIEU
acff23efb2 move binary_{reader,writer} outside of basic_json 2017-07-09 21:30:33 +02:00
Théo DELRIEU
bb752fd30c move json_reverse_iterator outside of basic_json 2017-07-09 21:30:33 +02:00
Théo DELRIEU
0ba98b6fe0 move internal_iterator/iter_impl/iteration_proxy outside of basic_json 2017-07-09 21:30:31 +02:00
Théo DELRIEU
00d6e27194 move primitive_iterator outside of basic_json 2017-07-09 21:22:16 +02:00
Théo DELRIEU
8e681d1e57 move lexer/parser outside of basic_json 2017-07-09 21:22:15 +02:00
Théo DELRIEU
15625ca4a7 move input adapters outside of basic_json 2017-07-09 21:21:12 +02:00
Théo DELRIEU
a332142194 move json_pointer outside of basic_json 2017-07-09 21:21:09 +02:00
Théo DELRIEU
fe086d7432 forward declare basic_json, add two macros
Those macros are used to reduce template argument boilerplate
2017-07-09 16:16:42 +02:00
Niels Lohmann
d3496347fc 👷 removing Clang 3.9 and 4.0
These versions are still not working properly: https://travis-ci.org/nlohmann/json/jobs/251675281
2017-07-09 12:19:14 +02:00
Niels Lohmann
504012a3db 📝 cleanup after #650
As <iostream> is not included in json.hpp any more, all code examples need to include <iostream> now.
2017-07-09 11:51:38 +02:00
Niels Lohmann
a0e0579374 Merge pull request #650 from olegendo/develop
Don't include <iostream>, use std::make_shared
2017-07-09 11:12:46 +02:00
Niels Lohmann
1b2fabe802 👷 adding two recent Clang versions
Maybe the simple approach is working now - at least it is in https://github.com/taocpp/PEGTL/blob/master/.travis.yml
2017-07-09 11:10:18 +02:00
Oleg Endo
e3bb156f82 fix typo 2017-07-09 15:20:28 +09:00
Oleg Endo
b753cb6ee7 use std::make_shared 2017-07-09 15:19:08 +09:00
Oleg Endo
f0ca96d462 include <iosfwd> instead of <iostream>
avoid bloat caused by <iostream> and std::cout and friends in apps where
iostream are not used.
2017-07-09 15:04:49 +09:00
Niels Lohmann
f1c543cb7b 👷 added GCC7 2017-07-08 22:59:19 +02:00
Niels Lohmann
7b05e1a687 🔨 improved performance in dump for deeply nested values 2017-07-08 22:59:04 +02:00
Niels Lohmann
f697fec522 📝 fixed documentation
There was an issue in the documentation example before. Unfortunately, I did not recreate the example outputs.
2017-07-08 22:16:45 +02:00
Niels Lohmann
87bccbc335 🔨 removed exception parse_error.111
It makes no sense to have this special exception. Instead of throwing when an input adapter is created, it is better to detect a parse error in later usage when an EOF is "read" unexpectedly.
2017-07-08 21:35:13 +02:00
Niels Lohmann
b38ecb5ca9 🔨 simplified binary write
Also added some comments and improved the documentation.
2017-07-08 20:31:13 +02:00
Niels Lohmann
b3ac36db93 🔨 excluded uncovered lines
These breaks were just added to silence a GCC warning - the GCC is right about warning as it cannot know that the expect function will not return in these two scenarios.
2017-07-08 18:34:08 +02:00
Niels Lohmann
e67df7c385 Merge branch 'feature/undo_171' into develop 2017-07-08 16:34:00 +02:00
Niels Lohmann
552622343e 📝 fixed typos 2017-07-08 16:18:27 +02:00
Niels Lohmann
566f6dcf30 🔥 removing usused functions #645
It seems these functions are not required any more. The code was added in commit 7e32457 to fix issue #171. There are still regression tests for #171, so when this commit passes the CI, the functions may be removed for good.
2017-07-08 13:33:13 +02:00
Niels Lohmann
6f12749ef6 📝 added version string for Xcode 9 2017-07-08 12:55:05 +02:00
Niels Lohmann
ac42333749 ⬆️ Catch v1.9.6 2017-07-08 12:11:45 +02:00
Niels Lohmann
015c88783e 🔨 fixed a pedantic warning 2017-07-08 12:03:12 +02:00
Niels Lohmann
df2feabb72 👷 added Xcode 9 beta
See https://twitter.com/travisci/status/880550780368855040
2017-07-08 11:57:09 +02:00
Niels Lohmann
63ecbfd36b re-added test
I have no idea why this test has been removed in the first place.
2017-07-07 23:38:04 +02:00
Niels Lohmann
07b78c993c 🐛 fixed undefined behavior bug
When an empty vector was passed to the parse function, an empty iterator range was used to construct an input iterator. Unfortunately, we then cannot use the start iterator to derive a pointer from.

Found with Xcode's undefined behavior sanitizer.
2017-07-07 23:37:16 +02:00
Niels Lohmann
8b123107c0 🔨 fixed some pedantic GCC warnings 2017-07-07 22:41:22 +02:00
Niels Lohmann
32065c8045 📝 fix for #639
Removed deprecated documentation of the comparison operator.
2017-07-07 21:16:33 +02:00
Niels Lohmann
e99b783def 🔨 simplifying scanner 2017-06-22 16:40:15 +02:00
Niels Lohmann
3dc5d95422 Merge branch 'develop' of https://github.com/nlohmann/json into develop 2017-06-21 18:55:28 +02:00
Niels Lohmann
b9a8425cc8 📝 cleanup after #629 and #630 2017-06-21 18:55:25 +02:00
Niels Lohmann
5ee651c387 Merge pull request #630 from Chocobo1/doc_neq
fix typo in operator__notequal example
2017-06-21 18:54:18 +02:00
Niels Lohmann
dad6051f37 Merge pull request #629 from Chocobo1/c4819
Fix MSVC warning C4819
2017-06-21 18:54:03 +02:00
Niels Lohmann
4b5433578a added progress output for Unicode tests
Travis aborts tests if they do not produce output for 10 minutes. This commit shall fix this.
2017-06-21 18:50:11 +02:00
Chocobo1
0395f3fdfb fix typo 2017-06-21 21:41:34 +08:00
Chocobo1
66ffac9e8a Fix MSVC warning C4819
Replace unicode whitespaces by ASCII whitespace 0x20
2017-06-21 16:17:10 +08:00
Niels Lohmann
6f3bebff5c 🔨 removed unexpect function 2017-06-21 07:26:50 +02:00
Niels Lohmann
2fd214c14b 🔨 adjusted pedantic flags 2017-06-20 23:05:37 +02:00
Niels Lohmann
e7695306f1 🔨 fixed a warning 2017-06-20 22:58:02 +02:00
Niels Lohmann
84f2e64a7c improved coverage 2017-06-20 22:35:31 +02:00
Niels Lohmann
9add24ff10 🔨 fixed a warning 2017-06-20 22:20:41 +02:00
Niels Lohmann
2f007ca092 improved coverage 2017-06-20 22:03:36 +02:00
Niels Lohmann
a5c27ede32 🔨 fixed a warning 2017-06-20 21:39:36 +02:00
Niels Lohmann
7c2a187258 improved test coverage 2017-06-20 21:09:26 +02:00
Niels Lohmann
e191dd833f 🔨 fixed warning about pointer members 2017-06-20 21:09:05 +02:00
Niels Lohmann
82b95ca664 🔨 simplified error handling in parser 2017-06-20 20:14:18 +02:00
Niels Lohmann
f2cdb3d594 ⬆️ Catch v1.9.5 2017-06-20 20:13:56 +02:00
Niels Lohmann
c2044205ef 📝 updated used compilers 2017-06-20 16:12:14 +02:00
Niels Lohmann
c2db4a118d 👷 update Travis to use Ubuntu Trusty 14.04 images 2017-06-19 21:51:24 +02:00
Niels Lohmann
70b7455a13 🔨 minor change 2017-06-19 21:50:36 +02:00
Niels Lohmann
4e6f548c0b Merge pull request #624 from theodelrieu/feature/pair_tuple_conversions
add pair/tuple conversions
2017-06-19 17:31:10 +02:00
Théo DELRIEU
08d781058c add from_json support for std::array 2017-06-19 12:03:38 +02:00
Théo DELRIEU
6e4910d5c5 add pair/tuple conversions 2017-06-19 10:16:37 +02:00
Niels Lohmann
112a6f4e53 🔨 replaced lexer's error message by const char* 2017-06-18 13:03:14 +02:00
Niels Lohmann
747f7d36d1 Merge branch 'develop' of https://github.com/nlohmann/json into develop 2017-06-18 00:00:36 +02:00
Niels Lohmann
b79a1a2678 📝 update after #626 2017-06-18 00:00:31 +02:00
Niels Lohmann
7b97100ffd Merge pull request #626 from koemeet/bugfix/vs2017-min-macro-fix
[BugFix] Add parentheses around std::min
2017-06-17 23:58:13 +02:00
Steffen Brem
04a1666ef2 Add parentheses around std::min so it bypasses the macro introduced by windows.h. 2017-06-17 22:01:18 +02:00
Niels Lohmann
1fbb82de89 🔨 using std::array to buffer input 2017-06-17 20:47:53 +02:00
Niels Lohmann
889006f006 regression test for #600 2017-06-17 13:37:04 +02:00
Niels Lohmann
e1ca484bc1 📝 added note about Conan #566 2017-06-17 11:20:09 +02:00
Niels Lohmann
b27d2adcbe accept functions to check if input is valid JSON #458 2017-06-16 19:23:55 +02:00
Niels Lohmann
d415293d41 Merge pull request #615 from theodelrieu/develop
remove std::pair support
2017-06-16 18:16:20 +02:00
Théo DELRIEU
c98364834f remove std::pair support 2017-06-13 11:11:29 +02:00
Niels Lohmann
fd4a0ecabc Merge branch 'feature/ifstream' into develop 2017-06-13 08:41:14 +02:00
Niels Lohmann
88dc7c11fa 🔨 fixed a warning 2017-06-12 19:58:44 +02:00
Niels Lohmann
afb959a083 🔨 removed nonportable code 2017-06-12 19:02:08 +02:00
Niels Lohmann
ac793e957f 🔨 trying to fix #367
Code from https://stackoverflow.com/a/44503794/266378 which is hopefully working with MSVC.
2017-06-12 18:58:58 +02:00
Niels Lohmann
5fa5c17bc6 ✏️ cleanup after #595 2017-06-10 18:29:16 +02:00
Niels Lohmann
6caad48e44 Merge pull request #595 from HenryRLee/iterator_arithmetic
Issue #593 Fix the arithmetic operators in the iterator and reverse iterator
2017-06-10 18:26:48 +02:00
HenryLee
e12c2ee6a8 Merge branch 'develop' into iterator_arithmetic 2017-06-09 20:47:42 +10:00
Niels Lohmann
52f934cbbf Merge pull request #609 from theodelrieu/develop
Add pair support, fix CompatibleObject conversions (fixes #600)
2017-06-07 16:38:23 +02:00
Théo DELRIEU
cea39dfaa8 fix #600
Instead of calling CompatibleObjectType iterator-range constructor,
first convert json::value_type to CompatibleObjectType::value_type
2017-06-07 10:24:59 +02:00
HenryLee
6661ec755b Merge branch 'develop' into iterator_arithmetic 2017-06-07 18:01:46 +10:00
HenryLee
0f065edff6 Revert a change in reverse iterator to pass the test cases 2017-06-07 18:01:01 +10:00
Niels Lohmann
92ef19696a ✏️ cleanup after #598 2017-06-06 20:48:11 +02:00
Niels Lohmann
bfdf0d1ce6 Merge pull request #598 from HenryRLee/issue550
#550 Fix iterator related compiling issues for Intel icc
2017-06-06 20:41:42 +02:00
Théo DELRIEU
85de93ba93 add std::pair<CompatibleStringType, T> support 2017-06-06 13:56:16 +02:00
HenryLee
c98169d0d5 Revert "Change iterator category to random access"
This reverts commit c4ab8f827e.
2017-06-05 21:59:17 +10:00
HenryLee
fb91aa81da Merge branch 'develop' into iterator_arithmetic 2017-06-05 20:24:21 +10:00
HenryLee
2ba554e442 Merge branch 'develop' into issue550 2017-06-05 20:24:08 +10:00
Niels Lohmann
1a9d76679a 🐛 fixed the issue with GCC7 #590 2017-06-04 18:40:32 +02:00
Niels Lohmann
d19c5ced4b 🐛 skipping BOM for iterators #602
I totally forgot about byte order marks in this scenario.
2017-06-02 12:38:32 +02:00
Niels Lohmann
c043ba6978 🔥 removed failing test #529 2017-06-01 07:32:39 +02:00
HenryLee
f2e1643039 Add test cases for iterator to const iterator assignment 2017-05-31 00:50:40 +10:00
HenryLee
2d5f0c0549 Redefine the converting assignment in iterator 2017-05-31 00:50:14 +10:00
HenryLee
c09a4cbbd7 Add test cases for iterator to const iterator conversion 2017-05-31 00:31:16 +10:00
HenryLee
0a51fb22ed Fix indentation 2017-05-30 23:37:24 +10:00
HenryLee
881cd3f420 Remove the iter_impl<const basic_json> copy constructor and copy assignment 2017-05-30 20:57:22 +10:00
HenryLee
790e7ca9e9 Add struct keyword in front of internal_iterator 2017-05-30 20:27:05 +10:00
HenryLee
ce39330ff8 Add converting constructors for iterator 2017-05-30 20:23:25 +10:00
HenryLee
c4ab8f827e Change iterator category to random access 2017-05-30 19:44:55 +10:00
HenryLee
daea213b44 Use static cast in the implementation of the operators of reverse iterator 2017-05-29 23:56:21 +10:00
HenryLee
0c2ed00ebe Add missing test cases for n + it arithmetic in iterators 2017-05-29 22:39:27 +10:00
HenryLee
5b245dae06 Comment out the exception message check in operator[] of reverse iterator 2017-05-29 22:19:10 +10:00
HenryLee
e42db27d6d Fix the indentation from the latest commit 2017-05-29 20:02:58 +10:00
HenryLee
3aef1a582e Change the definition of the operator override of reverse iterator to using the result of the base class directly 2017-05-29 19:45:34 +10:00
HenryLee
a3bf0131c4 Fix some more reverse iterator arithmetic test codes 2017-05-29 19:43:45 +10:00
HenryLee
adc73d6d5f Fix the arithmetic mistakes in reverse iterator 2017-05-29 18:52:53 +10:00
HenryLee
ed62129f8e Override n + iterator operator in the iterator 2017-05-27 13:44:14 +10:00
Niels Lohmann
52adf3fd5b 🔨 fixed compilation 2017-05-22 22:59:57 +02:00
Niels Lohmann
9a576fe1d9 added test for #367 2017-05-22 22:49:39 +02:00
Niels Lohmann
c7bd01edf2 🔨 trying something #367 2017-05-22 17:06:46 +02:00
Niels Lohmann
9e507dfad5 tests and fix for #367
operator>> now works as expected.
2017-05-21 16:36:51 +02:00
Niels Lohmann
16b63d3197 🔨 working toward #367 2017-05-20 12:44:13 +02:00
Niels Lohmann
8a35fdd8f5 🔨 overworked accept() function
Fixed to make sure no token is "overlooked".
2017-05-20 12:24:13 +02:00
Niels Lohmann
9ddc69f3a9 🐛 adjusting fix for future versions #586 2017-05-20 10:49:06 +02:00
Niels Lohmann
99cb095e89 🐛 fix for #586
Also added a Travis builder with -std=c++1z
2017-05-20 10:34:49 +02:00
Niels Lohmann
0f4131d138 Merge pull request #583 from zhaohuaxishi/doxygen_error
fix doxygen error of basic_json::get()
2017-05-15 21:09:43 +02:00
Niels Lohmann
0c3ffe12cd reverting first/second experiment #350 2017-05-15 21:07:58 +02:00
郭荣飞
b8dff3bc16 remove the redundant @ref command 2017-05-14 07:59:07 +08:00
Niels Lohmann
723c875604 💬 replaced "backspace" with "backslash" #509 2017-05-13 19:56:38 +02:00
郭荣飞
dfa371c436 fix doxygen error of basic_json::get() 2017-05-13 23:13:04 +08:00
Niels Lohmann
9b764ee5d6 🏁 fix for #581 2017-05-13 12:27:37 +02:00
Niels Lohmann
978255da8c 📝 updated contribution guidelines 2017-05-13 11:57:15 +02:00
Niels Lohmann
8b88e1b266 Merge pull request #579 from Type1J/develop_feature_first_second
Fixing assignement for iterator wrapper second, and adding unit test
2017-05-13 11:37:57 +02:00
Jay Sistar
b78457b792 Making comparison operators const. 2017-05-11 13:22:47 -04:00
Jay Sistar
00d841bfda Adding equal and not equal operators to proxys. 2017-05-11 14:51:06 +00:00
Jay Sistar
d6c78dacd8 Fixing assignement for iterator wrapper second, and adding unit test 2017-05-10 17:53:27 +00:00
Niels Lohmann
5beea35443 Merge pull request #578 from Type1J/develop_feature_first_second
Adding first and second properties to iteration_proxy_internal
2017-05-10 17:25:54 +02:00
Niels Lohmann
15ef9b8a35 Merge pull request #576 from Type1J/develop
Adding support for Meson.
2017-05-10 16:32:14 +02:00
Jay Sistar
6a656ed375 Adding first and second properties to iteration_proxy_internal 2017-05-10 13:20:52 +00:00
Niels Lohmann
2afbd33472 🔨 working on #367
Test cases succeed as expected, but the example in #367 is not fully
realized yet.
2017-05-10 12:06:24 +02:00
Jay Sistar
87744fd594 Missed one. 2017-05-09 02:04:02 +00:00
Jay Sistar
0719287e44 Reducing chatter about Meson. 2017-05-09 02:01:55 +00:00
Jay Sistar
31fe2f5825 Adding support for Meson. 2017-05-08 13:35:00 +00:00
Niels Lohmann
962da00171 implemented an indentation character #520
An optional parameter for dump() allows to set the character to use for
indentation (default: space). In case a JSON value is serialized to an
output stream, its fill character is used (and can be set with
std::setfill).
2017-05-07 19:27:40 +02:00
Niels Lohmann
fba1bcdd0b 🐛 fixing #575
I forgot to consider the offset.
2017-05-07 13:41:48 +02:00
Niels Lohmann
56ac7908f1 Merge branch 'feature/manual_lexer' into develop 2017-05-05 18:27:56 +02:00
Niels Lohmann
dbcb032f22 Merge branch 'develop' into feature/manual_lexer 2017-05-05 16:48:47 +02:00
Niels Lohmann
ecf895f2d1 📝 mentioned value function on main doc page #570 2017-05-05 16:42:22 +02:00
Niels Lohmann
19d2dec8b6 📝 added badge from isitmaintained.com 2017-05-03 22:49:21 +02:00
Niels Lohmann
8b9f51179e started working on #458
a simple acceptor function
2017-04-24 17:46:21 +02:00
Niels Lohmann
cfc2e8391c 🔨 removed too long running tests 2017-04-24 15:07:43 +02:00
Niels Lohmann
6d2c0a7928 added more Unicode test cases 2017-04-23 22:54:21 +02:00
Niels Lohmann
c42273d2a0 📝 fixed documentation #565
The documentation mismatched the actual code.
2017-04-23 21:46:30 +02:00
Niels Lohmann
2df8f12c09 🏁 another fix for MSVC #464
needed for VS2015.3 with /std:c++latest
2017-04-23 20:51:29 +02:00
Niels Lohmann
734297ff45 🔨 cleanup 2017-04-23 20:32:05 +02:00
Niels Lohmann
01e05d89e9 🔨 fixed a compiler warning
Default arguments are forbidden in lambdas.
2017-04-23 18:40:17 +02:00
Niels Lohmann
b686cc6ad9 🔨 removed #ifdefs 2017-04-23 18:34:14 +02:00
Niels Lohmann
5febd04a26 🐛 fixed test suite 2017-04-23 18:22:35 +02:00
Niels Lohmann
4aedae400e added exhaustive UTF-8 tests
Creates all well-formed sequences of bytes up to length 4. Furthermore,
creates ill-formed sequences by removing required trailing bytes or
changing bytes. As the tests can take a lot of time, preprocessor
symbols are introduced.
2017-04-23 15:12:50 +02:00
Niels Lohmann
e24df7eca9 📝 improved documentation 2017-04-23 15:10:40 +02:00
Niels Lohmann
2a21146160 Merge branch 'develop' into feature/manual_lexer 2017-04-22 11:35:58 +02:00
Niels Lohmann
4b316ec528 Merge branch 'feature/insert' into develop 2017-04-22 09:58:37 +02:00
Niels Lohmann
9b32f72584 📝 fixed examples for Wandbox
As I learned in https://github.com/melpon/wandbox/issues/209, this
library is already installed at Wandbox, so we need to adjust the
examples to use `#include "json.hpp"` insteas of `#include <json.hpp>`.
2017-04-21 22:07:07 +02:00
Niels Lohmann
db9bf953f3 🔨 improved diagnostic output 2017-04-15 10:40:10 +02:00
Niels Lohmann
717106eced 🔨 templated output_adapter and used in class serializer 2017-04-14 19:49:05 +02:00
Niels Lohmann
aea47422a2 📝 updated links and output 2017-04-14 18:13:01 +02:00
Niels Lohmann
6b6e554067 🐛 added missing header
std::setw needs the iomanip header (at least with GCC).
2017-04-14 17:37:28 +02:00
Niels Lohmann
951d0920fc 🐛 fixed README example
The example with the size() operator is bad: using operator[] already
changes the size of the object. The fix makes it clearer.
2017-04-14 17:36:45 +02:00
Niels Lohmann
e2f6cf7f46 🔥 removed .test files
These files were never meant to be versioned.
2017-04-14 17:35:31 +02:00
Niels Lohmann
2d2b98a50a Merge branch 'develop' into feature/manual_lexer 2017-04-12 18:07:25 +02:00
Niels Lohmann
d4469233ac Merge branch 'develop' into feature/insert 2017-04-12 18:01:06 +02:00
Niels Lohmann
42b4cdd4d0 👷 Travis is very picky 2017-04-11 22:13:26 +02:00
Niels Lohmann
ef55626296 👷 added Clang 3.9-5.0
Taken from
https://github.com/travis-ci/docs-travis-ci-com/pull/746/files.
2017-04-11 20:37:38 +02:00
Niels Lohmann
5bea6f383a ✏️ fixed a typo 2017-04-11 18:57:53 +02:00
Niels Lohmann
4c161161f0 Merge branch 'feature/vs2017' into develop 2017-04-10 19:51:58 +02:00
Niels Lohmann
d7e57e3b73 🔨 added an output adapter for the binary writer 2017-04-09 22:13:26 +02:00
Niels Lohmann
f3e43d7c6f 🔨 some cleanup 2017-04-09 21:14:51 +02:00
Niels Lohmann
186a9fd44d 🔨 simplified interface for parser, lexer, and binary_reader
These classes are now constructed with an interface adapter. This moves
complexity from various places into the interface adapter class, or to
some factories which now implement the different flavors of input.

Furthermore, input adapters are kept in std::shared_ptr to avoid the
need of manual deletion.
2017-04-09 19:28:15 +02:00
Niels Lohmann
e48114bbd6 🔨 check for value of _HAS_CXX17 2017-04-09 14:02:04 +02:00
Niels Lohmann
628be157a2 🐛 added fix for #464 2017-04-09 13:52:04 +02:00
Niels Lohmann
c40c8ac92e 👷 excluding MSVC 2015 with "/permissive- /std:c++latest /utf-8" 2017-04-09 12:00:30 +02:00
Niels Lohmann
a9f4094580 👷 another try 2017-04-09 11:47:31 +02:00
Niels Lohmann
180d249f6c 👷 another try 2017-04-09 11:38:42 +02:00
Niels Lohmann
d3d87674c8 👷 fixed AppVeyor syntax 2017-04-09 11:00:39 +02:00
Niels Lohmann
9d9c5216d7 👷 additional flags for MSVC #464
To test a fix for issue #464 (not yet implemented), we first need to
have  an MSVC build with “/permissive- /std:c++latest /utf-8”.
2017-04-09 10:59:45 +02:00
Niels Lohmann
6f99d5b2e9 🔨 fixed test case
One test case for CBOR and MessagePack assumed little endianess.
2017-04-08 23:39:17 +02:00
Niels Lohmann
d4e49873b7 👷 experimenting with configurations 2017-04-08 21:56:42 +02:00
Niels Lohmann
97a25de938 proposal for #428
This implementation forwards the iterators to std::map::insert.
2017-04-07 18:29:09 +02:00
Niels Lohmann
d62d48fc48 🔀 merge branch 'develop' into feature/manual_lexer 2017-04-07 17:19:52 +02:00
Niels Lohmann
90273e930c 🐛 fix for #512
We totally forgot to implement the comparison operators other than ==
and != for scalar types. Consequently, comparing a JSON value with a
scalar type led to compile errors.
2017-04-07 15:44:41 +02:00
Niels Lohmann
ff72f38863 🔨 fixed another warning
Do not store eof() in a char buffer…
2017-04-06 19:54:08 +02:00
Niels Lohmann
b992acc2e7 🔨 fixed a compiler warning 2017-04-05 20:39:27 +02:00
Niels Lohmann
08fdfcca9a 🔨 implemented a binary writer 2017-04-04 23:17:43 +02:00
Niels Lohmann
c28bf823bc 🔨 added endianess check 2017-04-04 17:30:43 +02:00
Niels Lohmann
b15fc13dd1 🔨 implemented MessagePack in binary_reader 2017-04-04 16:59:19 +02:00
Niels Lohmann
3a34f2d82c Merge branch 'develop' into feature/manual_lexer 2017-04-04 15:55:40 +02:00
Niels Lohmann
782570d46f 🔨 cleanup 2017-04-03 22:58:46 +02:00
Niels Lohmann
4f6b63e492 Merge pull request #545 from theodelrieu/feature/enum_class_support
add enum class default conversions
2017-04-03 22:13:59 +02:00
Niels Lohmann
ea667db446 🔨 fixed compilation errors
TIL about C++:

executing m[key()]=val(); for a std::map executes

First key() then val() with Clang

First val() then key() with GCC

#wat
2017-04-03 21:53:23 +02:00
Niels Lohmann
89efe627fe 🔨 a lot of restructuring
- removed uncached input stream adapter; it was too slow anyway
- implemented a class binary_read which parses CBOR based on input
adapters
- in the CBOR parser, numbers are created via memcpy to avoid undefined
behavior
2017-04-02 18:46:21 +02:00
Théo DELRIEU
af9b21151c add enum class default conversions 2017-04-02 13:10:15 +02:00
Niels Lohmann
3a5cf9bd0a 🔨 improved code coverage 2017-04-01 08:34:58 +02:00
Niels Lohmann
c32d2e5b3c 🔨 removed unget() function 2017-04-01 00:36:05 +02:00
Niels Lohmann
8d393b5eff Merge branch 'develop' into feature/manual_lexer 2017-03-31 23:58:45 +02:00
Niels Lohmann
3fa0610856 🔨 added minibench to ignore list 2017-03-31 23:57:24 +02:00
Niels Lohmann
50ee0a62f5 🔨 replaced lookup-tables by switches 2017-03-31 23:24:33 +02:00
Niels Lohmann
4c821c9e9c 🔨 moved buffer size to interface 2017-03-31 17:11:51 +02:00
Niels Lohmann
d07596a0ea 📝 mentioned #540 and fixed #538 2017-03-30 17:39:02 +02:00
Niels Lohmann
7881783745 Merge pull request #540 from tinloaf/diagnostics
Properly pop diagnostics
2017-03-30 17:25:29 +02:00
Lukas Barth
0b1b6307a5 Also change the re2c file 2017-03-30 16:14:02 +02:00
Lukas Barth
40aff4182f Pop for every push 2017-03-30 16:10:03 +02:00
Niels Lohmann
60057a4728 🔨 fixed bugs introduced by merging from develop 2017-03-29 07:54:26 +02:00
Niels Lohmann
a690a9f2d2 Merge branch 'develop' into feature/manual_lexer 2017-03-29 00:57:09 +02:00
Niels Lohmann
c2e80a72d7 🔨 deprecated j << istream / j >> ostream functions #367
The implementation is non-standard. Deprecation allows a simpler API in
the future without removing any features.
2017-03-29 00:39:47 +02:00
Niels Lohmann
9578c0f700 Merge branch 'develop' into feature/manual_lexer 2017-03-28 23:47:17 +02:00
Niels Lohmann
b4dbebffcd added regression test for #464 2017-03-28 23:28:54 +02:00
Niels Lohmann
62dfdf3f5d 📝 addressed #514
NaN values never compare equal to themselves or to other NaN values.
2017-03-28 23:24:59 +02:00
Niels Lohmann
5d586b0192 🔨 cleanup 2017-03-28 23:20:45 +02:00
Niels Lohmann
19d119e18c 🔨 fixed a warning in MSVC 2017-03-28 22:10:24 +02:00
Niels Lohmann
6b12e40478 🏁 removed __builtin_expect for MSVC 2017-03-28 21:55:26 +02:00
Niels Lohmann
d025b6aaf7 Merge branch 'develop' into feature/manual_lexer 2017-03-28 21:39:36 +02:00
Niels Lohmann
19cd206d99 📝 documented Xcode 8.3 2017-03-28 21:39:16 +02:00
Niels Lohmann
a0aa6ad2b2 👷 added Xcode 8.3
https://blog.travis-ci.com/2017-03-28-xcode-83-ga-is-here
2017-03-28 20:42:12 +02:00
Niels Lohmann
d37ca2eba8 🔨 fixed test case 2017-03-28 20:29:27 +02:00
Niels Lohmann
50e251f5f6 🔨 adjusted test case to new signature of token_type_name() 2017-03-28 20:17:00 +02:00
Niels Lohmann
6a6fbea62c 🔨 some cleanup 2017-03-28 20:08:08 +02:00
Niels Lohmann
1e495945f1 🔨 fixed buffer overflow 2017-03-28 18:06:43 +02:00
Niels Lohmann
bbb6bd9de5 🔨 fixing last failing test cases 2017-03-28 17:00:03 +02:00
Niels Lohmann
b0c47abd88 🔨 rewrote string parser to cope with UTF-8 2017-03-27 22:58:44 +02:00
Niels Lohmann
f75e195db3 🔨 added code for user-defined number types 2017-03-26 18:45:04 +02:00
Niels Lohmann
3425527970 🔨 added code for locale-independent number parsing 2017-03-26 18:12:58 +02:00
Niels Lohmann
06e2a291b1 🔨 fixed number parsing 2017-03-26 17:26:41 +02:00
Niels Lohmann
3b069b4b4c 🔨 adjusted more expected exceptions 2017-03-26 16:19:07 +02:00
Niels Lohmann
99e0d8b339 🔨 fixed \uxxxx parsing 2017-03-26 15:29:08 +02:00
Niels Lohmann
f47cf152a8 Merge branch 'develop' into feature/manual_lexer 2017-03-26 13:14:14 +02:00
Niels Lohmann
d4d51460ab Merge branch 'feature/noexcept_exceptions' into develop 2017-03-26 12:54:22 +02:00
Niels Lohmann
3336194306 🔨 reverted changes that led to Travis failures 2017-03-26 12:23:10 +02:00
Niels Lohmann
53b501a785 🔨 cleanup 2017-03-25 23:31:03 +01:00
Niels Lohmann
cf7786887c 🔨 fixed check for is_nothrow_copy_constructible
We now only demand our exceptions to be is_nothrow_copy_constructible
if std::runtime_exception is.
2017-03-25 17:35:57 +01:00
Niels Lohmann
c333679a96 🔨 small refactoring
The solution with a std::runtime_error member is more elegant. It
allows to have std::exception as base class again. However, I still
have no idea why GCC thinks the copy constructor may throw...
2017-03-25 17:25:39 +01:00
Niels Lohmann
cc36c65a89 🚑 made exceptions nothrow-copy-constructible #531
To have nothrow-copy-constructible exceptions, we inherit from
std::runtime_error which can cope with arbitrary-length error messages.
Intermediate strings are built with static functions and then passed to
the actual constructor.
2017-03-25 16:22:52 +01:00
Niels Lohmann
a58ed3cd17 💄 cleanup 2017-03-25 14:47:23 +01:00
Niels Lohmann
20bcf1015b 📝 cleanup after #536 2017-03-25 14:19:05 +01:00
Niels Lohmann
dc6e9b6188 Merge branch 'develop' into feature/manual_lexer 2017-03-25 14:12:58 +01:00
Niels Lohmann
0f9585685a Merge pull request #536 from vpetrigo/feature/VS17_appveyor_support
Add Visual Studio 17 image to appveyor build matrix
2017-03-25 14:12:30 +01:00
Vladimir Petrigo
8edb0cd15c Add VS17 image to appveyor matrix 2017-03-25 14:57:58 +03:00
Niels Lohmann
a93ec07c8c Merge branch 'develop' into feature/manual_lexer 2017-03-24 19:53:19 +01:00
Niels Lohmann
3d597dda5d 📝 update after #534 2017-03-24 19:51:11 +01:00
Niels Lohmann
40160f482a 🚧 manual lexer
This commit removed the re2c lexer and replaced it by a manual version.
Its integration is not yet complete: number parsing does not respect
locales or overflows. Furthermore, parsing does not need to end with
EOF. Therefore, a lot of test cases fail. The idea is to push this
branch forward so we can conduct performance comparisons. So far, a
nice side effect are better diagnosis messages in case of parse errors.
2017-03-24 19:49:02 +01:00
Niels Lohmann
bba688f53e Merge pull request #534 from TedLyngmo/utf8_encoding_enhancement
UTF8 encoding enhancement
2017-03-24 19:38:29 +01:00
Ted Lyngmo
cea2426731 UTF8 encoding enhancement 2017-03-24 14:56:48 +01:00
Niels Lohmann
8a872927e8 Merge pull request #530 from berkus/patch-1
Fix typo
2017-03-23 13:57:54 +01:00
Berkus Decker
b14629b0a6 Fix typo 2017-03-23 14:50:41 +02:00
Niels Lohmann
54db53c230 📝 update after #527 and #525 2017-03-22 08:10:31 +01:00
Niels Lohmann
d60851168e 🚨 fixed a compiler warning #527
The result of snprintf is later used in situations where a long may
overflow.
2017-03-22 08:10:02 +01:00
Niels Lohmann
67a06834b0 Merge pull request #526 from krzysztofwos/feature/exception-base-class
Make exception base class visible in basic_json
2017-03-22 07:50:34 +01:00
Krzysztof Woś
b9c3b8d688 Exit with an error if re2c is not available
Instead of overwriting src/json.hpp with an empty file
2017-03-20 16:00:58 +09:00
Krzysztof Woś
86579209c8 Make exception base class visible in basic_json 2017-03-20 16:00:58 +09:00
Niels Lohmann
31a6c0910e 🚑 fix for #519
Added catch branch for out_of_range exception that can occur if input
file contains a number overflow.
2017-03-17 22:18:48 +01:00
Niels Lohmann
f547679de5 🚑 fix for #516 and #518
We should compare the binary serializations rather than the JSON values
themselves. This fix was already done for CBOR and apparently forgotten
for MessagePack.
2017-03-17 22:18:05 +01:00
Niels Lohmann
2d474b5273 Merge pull request #510 from alex-weej/patch-1
🎨 Namespace `uint8_t` from the C++ stdlib
2017-03-17 06:47:11 +01:00
Alexander “weej” Jones
836f1c4189 🎨 Namespace uint8_t from the C++ stdlib 2017-03-16 18:24:41 +00:00
Niels Lohmann
cd43600e6f 💄 cleanup after #508 2017-03-16 19:02:05 +01:00
Niels Lohmann
773b33e016 Merge pull request #508 from theodelrieu/feature/c_array_conversion
add to_json method for C arrays
2017-03-16 19:00:58 +01:00
Niels Lohmann
c5711f3072 🚧 a lot of minor changes
- Removed unused headers.
- Added override where needed.
- Added description for parse_error.113 exception.
- Fixed some conversion warnings.
- Integrated cbor_expect_string function for CBOR maps.
- Added documentation on the supported CBOR/MessagePack features.
- Added test to check all initial bytes for CBOR input.
2017-03-16 18:39:33 +01:00
Niels Lohmann
483a58f625 🚨 added pedantic flags for GCC
With GCC 7, there are even more diagnostic flags.
2017-03-16 18:35:45 +01:00
Théo DELRIEU
dbebf8de47 add to_json method for C arrays
If the array can be converted to basic_json::string_t, the overload
in this commit is not chosen.
2017-03-16 15:20:39 +01:00
Niels Lohmann
100bf3ef2c Merge branch 'feature/getline' into develop 2017-03-14 23:08:19 +01:00
Niels Lohmann
710f8a2686 📝 improved documentation for to-CBOR and to-msgpack functions 2017-03-14 23:08:05 +01:00
Niels Lohmann
1de80e8af4 🔨 added user-defined exception #493
Replaced old std::invalid_argument exception by parse_error.111 to have
unified exceptions in case of input stream errors.
2017-03-14 21:31:36 +01:00
Niels Lohmann
63c2c62f19 🔨 changed call from "not good()" to "fail()" #493
Also merged develop into this feature branch.
2017-03-14 21:24:53 +01:00
Niels Lohmann
95474e420d 🏁 added parentheses around max/min calls #506
When <Windows.h> is included with MSVC, a macro NOMINMAX is defined
that yields compilation errors when max/min calls are encountered. This
can be fixed by un-defining NOMINMAX, or by placing parentheses around
all min/max calls. We chose the latter.
2017-03-14 21:11:20 +01:00
Niels Lohmann
b026591e9e 🚑 added special case to fuzzers to fix #504
Since #329, NaN and inf numbers do not yield an exception, but are
stored internally and are dumped as “null”. This commit adjusts the
fuzz testers to deal with this special case.
2017-03-14 21:05:38 +01:00
Niels Lohmann
bfe4788e32 🚑 fix for #500
Removed a check that already failed in MSVC.
2017-03-14 16:14:05 +01:00
Niels Lohmann
84072fbd6d 💄 fixed indentation 2017-03-14 16:07:28 +01:00
Niels Lohmann
b8b4362ca4 🔥 removed accidentally committed binaries 2017-03-13 19:04:19 +01:00
Niels Lohmann
c5cf32e34d 🔨 added user-defined exception 406 2017-03-12 20:59:33 +01:00
Niels Lohmann
43b8285249 🔀 merge branch 'feature/exceptions_3.0.0' into develop 2017-03-12 20:34:30 +01:00
Niels Lohmann
855cdcf05c 🔀 merge branch 'develop' into feature/exceptions_3.0.0 2017-03-12 20:22:30 +01:00
Niels Lohmann
8feaf8dc94 💥 implemented new handling of NaN and INF #70 #329 #388
- If an overflow occurs during parsing a number from a JSON text, an
exception (std::out_of_range for the moment, to be replaced by a
user-defined exception #244) is thrown so that the overflow is detected
early and roundtripping is guaranteed.
- NaN and INF floating-point values can be stored in a JSON value and
are not replaced by null. That is, the basic_json class behaves like
double in this regard (no exception occurs). However, NaN and INF are
serialized to “null”.
- Adjusted test cases appropriately.
2017-03-12 18:38:05 +01:00
Niels Lohmann
9355f05888 🔨 cleaned up array from_json methods #473
Removed some code that is not needed any more. Thus, streamlining the
array from_json methods.
2017-03-12 17:05:02 +01:00
Niels Lohmann
87eafd8d6a added regression tests for #473
These tests currently pass without any adjustments to the source code.
2017-03-12 15:20:17 +01:00
Niels Lohmann
80dcf22fc3 🔨 added a check function for MsgPack strings #497
To avoid the error described in #497, I added a function
msgpack_expect_string that is executed every time a string is expected
during the parsing of a map. In case the current byte does not belong
to a MsgPack string, an exception is thrown.
2017-03-12 14:39:20 +01:00
Niels Lohmann
28dbe4e651 📝 overworked documentation for the at functions
Added all possible exceptions to the examples of the at functions.
2017-03-12 13:49:39 +01:00
Niels Lohmann
89f6068385 Merge branch 'develop' into feature/exceptions_3.0.0 2017-03-12 11:51:24 +01:00
Niels Lohmann
dfa4e83cd8 Merge branch 'feature/no_exceptions' into develop 2017-03-12 11:49:52 +01:00
Niels Lohmann
e3e941ef2b 👷 fixed a syntax error 2017-03-12 11:19:27 +01:00
Niels Lohmann
01470f388b 👷 fixed no_exceptions test case
This test case relied on logics that have been replaced by CMake with
#461. This change enables compilation and execution of the test suite
without exceptions by adding an after_success task.
2017-03-12 11:04:26 +01:00
Niels Lohmann
4d7c29923e 🚑 fix for #486
Implemented std::less<value_t> to allow using value_t as std::map key
in MSVC.
2017-03-12 10:40:36 +01:00
Niels Lohmann
4b9c2f1287 🔨 added __EXCEPTIONS to the list 2017-03-11 20:16:13 +01:00
Niels Lohmann
4e49829851 🚑 fix for #493
Added a test to check if the input stream is good() before executing
getline on it. Also added two test cases that set the failbit and
badbit before calling file_line_buffer.
2017-03-11 19:26:12 +01:00
Niels Lohmann
122afbf128 🔨 added defined() check 2017-03-11 18:43:21 +01:00
Niels Lohmann
e3e6cbecc7 🏁 added check for _CPPUNWIND
MSVC does not define __cpp_exceptions, but seems to use _CPPUNWIND when
exception support is switched on, see
https://msdn.microsoft.com/en-us/library/b0084kay.aspx.
2017-03-11 17:59:24 +01:00
Niels Lohmann
65dfc97d40 🔨 using __cpp_exceptions to detect exception support #498
I used __EXCEPTIONS to detect whether exceptions are supported.
Apparently, this is a macro that is only used by libstdc++
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64276). It’s much cleaner
to use __cpp_exceptions as it is in the standard since C++98.

Note that compiling the unit-tests with “-fno-exceptions” still does
not work, because Catch uses throw internally. However, the library’s
exceptions can be switched off by defining JSON_NOEXCEPTION.
2017-03-11 17:44:54 +01:00
Niels Lohmann
ff0b18d10c Merge branch 'feature/vector_bool' into develop 2017-03-11 17:22:14 +01:00
Niels Lohmann
c7afb34e57 🎨 cleanup after #496
Ran “make pretty” and added a note to the README file.
2017-03-11 16:01:26 +01:00
Niels Lohmann
754ce0b991 Merge pull request #496 from TedLyngmo/fix_effcplusplus_warnings
Fix -Weffc++ warnings (GNU 6.3.1)
2017-03-11 15:57:10 +01:00
Niels Lohmann
d9e2dd03bf 🔨 fixed interface for to_json function 2017-03-11 15:46:52 +01:00
Niels Lohmann
f4126e4dd8 added overload for std::less<value_t> #486
MSVC needs this overload to compile code containing a std::map that
uses nlohmann::detail::operator as key.
2017-03-11 15:44:14 +01:00
Niels Lohmann
f5f6dac800 added overload for std::vector<bool> #494
Adds a to_json function for std::vector<bool> to allow implicit
conversion from bit vectors to basic_json.
2017-03-11 15:32:44 +01:00
Ted Lyngmo
70bbf19527 Fix -Weffc++ warnings (GNU 6.3.1) 2017-03-11 15:16:26 +01:00
Ted Lyngmo
5b809b9737 Fix -Weffc++ warnings (GNU 6.3.1) 2017-03-11 15:05:21 +01:00
Ted Lyngmo
9cfb777b65 Fix -Weffc++ warnings (GNU 6.3.1) 2017-03-11 13:56:38 +01:00
Niels Lohmann
f9fe0193d5 Merge branch 'develop' into coverity_scan 2017-03-09 18:55:27 +01:00
Niels Lohmann
758c4addc1 🚑 fix for #492
The original test case relied on an invalidated iterator. This error
did not occur before, but only with GCC with -D_GLIBCXX_DEBUG. This
commit fixes the test case. The library is unaffected by this change.
2017-03-09 18:20:26 +01:00
Niels Lohmann
0f6b8aa718 📝 more documentation for the new exceptions 2017-03-08 23:30:38 +01:00
Niels Lohmann
1ab580d6e9 📝 more documentation for the new exceptions 2017-03-08 23:12:13 +01:00
Niels Lohmann
fe71e7df1f 📝 overworked documentation
Replacing references to std exceptions with user-defined exceptions.
Also changed some examples to the new exceptions.
2017-03-08 21:03:19 +01:00
Niels Lohmann
9374eaa013 🔨 added user-defined exception 501 2017-03-08 19:16:53 +01:00
Niels Lohmann
c8a6ce79ea 🚑 fixing fuzzers to work with new exceptions 2017-03-08 18:37:03 +01:00
Niels Lohmann
fc9b528ec9 🔨 changed an exception 2017-03-08 18:07:21 +01:00
Niels Lohmann
8fcd01631f improved test coverage
Tests for parse_error.109 were missing.
2017-03-08 16:39:17 +01:00
Niels Lohmann
625cf7e3f7 🔨 added user-defined exception 112 2017-03-07 20:05:34 +01:00
Niels Lohmann
757d2c6c7a 🔨 replaced at() calls in msgpack/cbor 2017-03-06 23:45:08 +01:00
Niels Lohmann
5407333224 🔨 added user-defined exception 111 2017-03-06 22:37:46 +01:00
Niels Lohmann
21ec0e7806 🔨 added user-defined exception 110 2017-03-06 21:00:13 +01:00
Niels Lohmann
a186106bde 🔨 user-defined exception 302
Also moved all exception classes into the detail namespace and
introduced them via “using” into basic_json.
2017-03-06 19:34:44 +01:00
Niels Lohmann
38c2e20ce8 added user-defined exceptions 404-405 2017-03-05 23:25:22 +01:00
Niels Lohmann
30331fa21f 🔨 added user-defined exception 403 2017-03-05 23:16:17 +01:00
Niels Lohmann
60da36aee2 🔨 added user-defined exceptions 401-402 2017-03-05 22:56:39 +01:00
Niels Lohmann
491c9780a7 🔨 added user-defined exception 311 2017-03-05 22:39:21 +01:00
Niels Lohmann
6751d650be 🔨 added user-defined exception 311 2017-03-05 22:31:08 +01:00
Niels Lohmann
9e560ca40c 🔨 added user-defined exceptions 313-315 2017-03-05 19:58:26 +01:00
Niels Lohmann
144cf6a4c7 🔨 added user-defined exceptions 310 2017-03-05 19:48:11 +01:00
Niels Lohmann
5cca44c161 🔨 added user-defined exceptions 309 2017-03-05 19:42:05 +01:00
Niels Lohmann
70b2c3f45e 🔨 added user-defined exceptions 308 2017-03-05 19:35:24 +01:00
Niels Lohmann
2a9393af00 🔨 added user-defined exceptions 307 2017-03-05 19:26:44 +01:00
Niels Lohmann
bb740c43fb 🔨 added user-defined exceptions 306 2017-03-05 19:15:56 +01:00
Niels Lohmann
aa842b4a27 🔨 added user-defined exceptions 305 2017-03-05 19:08:12 +01:00
Niels Lohmann
f473f74fb0 🔨 added user-defined exceptions 303-304 2017-03-05 18:56:35 +01:00
Niels Lohmann
068c7acda9 🔨 added user-defined exceptions 301 2017-03-05 18:40:09 +01:00
Niels Lohmann
0c40c8e3be 🔨 added user-defined exceptions 2xx 2017-03-03 14:34:57 +01:00
Niels Lohmann
a4274d7766 🔨 added user-defined exceptions 205-206 2017-03-03 14:00:42 +01:00
Niels Lohmann
875b2da95d 🔨 added user-defined exceptions 203-204 2017-03-03 13:38:14 +01:00
Niels Lohmann
9381f6c4da 🔨 added user-defined exceptions 201-202
Started implementing exceptions for invalid iterators.
2017-03-03 13:19:45 +01:00
Niels Lohmann
e291c6c3d2 Merge branch 'develop' into feature/exceptions_3.0.0 2017-03-03 12:59:37 +01:00
Niels Lohmann
a1354184ce 📝 fixed typo #481 2017-03-03 12:56:54 +01:00
Niels Lohmann
0c6b1f8a24 Merge branch 'develop' into feature/exceptions_3.0.0 2017-03-03 12:54:45 +01:00
Niels Lohmann
776758d7a2 🔨 added user-defined exception 109
This exception occurs when a JSON pointer contains an array index that
can not be converted into a number.
2017-03-03 12:54:37 +01:00
Niels Lohmann
b86d2148ef 🔨 added user-defined exceptions 106-108
These exceptions occur when JSON pointers are malformed.
2017-03-03 11:56:58 +01:00
Niels Lohmann
06c788e4fd 📝 added missing word 2017-03-03 10:01:16 +01:00
Niels Lohmann
01d3a006b1 ⬆️ updated Catch to v1.8.1 2017-03-02 18:13:19 +01:00
Niels Lohmann
06815d274e 🔨 added user-defined exceptions 104 and 105
These exceptions are thrown in case of parse errors in JSON patch
documents.
2017-03-02 17:55:13 +01:00
Niels Lohmann
c085e3bac2 🔨 started with user-defined exceptions #301 #244
Added class hierarchy for user-defined exceptions (#244). Integrated
parse exceptions 101-103. Parse exceptions include the byte count of
the last read character to locate the position of the error (#301).
2017-03-01 21:28:44 +01:00
Niels Lohmann
7b8fd864e2 🔥 removed deprecated constructor #480
The constructor basic_json(std::istream&, const parser_callback_t) has
been deprecated since version 2.0.0. This commit removes it together
with its code example, deprecation macro, and test cases. The code now
also compiles with -W-deprecated-declarations.
2017-03-01 17:49:03 +01:00
Niels Lohmann
6b3912d936 📝 added note to 3.0.0 wiki page #474
I created a wiki page
https://github.com/nlohmann/json/wiki/Road-toward-3.0.0 to describe the
transition toward version 3.0.0. On this page, all API-breaking changes
shall be documented.
2017-03-01 17:26:32 +01:00
Niels Lohmann
f84ac523aa 📝 added a note to ordered maps
The library does not preserve the insertion order of object keys. There
are frequent requests to change the library in this aspect. The README
and the contribution guidelines now contain links to containers that
can be used to replace std::map to preserve the insertion order.
2017-03-01 10:15:07 +01:00
Niels Lohmann
41f9b32554 🔀 merge branch 'feature/serialization_class' into develop (#418)
Moved all dump()-related functions into a class "serializer". This fix includes a lot of performance improvements yielding a 7% speedup for serialization. Details on the individual steps can be found in the commit messages.

Individual benchmark numbers:

before:

dump jeopardy.json                            5   374555228 ns/op
dump jeopardy.json with indent                5   430953700 ns/op
dump numbers/floats.json                      5   622938509 ns/op
dump numbers/signed_ints.json                20    82177979 ns/op

after:

dump jeopardy.json                            5   335449757 ns/op -11%
dump jeopardy.json with indent                5   375467773 ns/op -13%
dump numbers/floats.json                      5   584611852 ns/op -7%
dump numbers/signed_ints.json                20    68289574 ns/op -17%
2017-02-28 21:04:16 +01:00
Niels Lohmann
d69242c6ba 💄 cleanup
- Added comments for the serializer class.
- Added test case for resizing of the indentation string.
- Using std::none_of to check if “.0” needs to be added to
floating-point number.
2017-02-28 19:20:50 +01:00
Niels Lohmann
059f21aada 💄 fixed a warning
snprintf returns an int, but we later assign it a difference_type which
is usually a long.
2017-02-28 17:24:03 +01:00
Niels Lohmann
224f99070b micro-optimization of dump()
A lot of small changes to avoid memory allocations:

- The locale is only queried once rather than with every number
serialization.
- The indentation string is recycled between different calls.
- The string escape function avoids a copy if no escaping is necessary.
- The string escape and the space function use a complete switch case
instead of cascaded ifs.

Cachegrind measures some 15% performance improvement.
2017-02-28 16:28:22 +01:00
Niels Lohmann
fc48b8ac2b 🐛 fixed a logical error
Treated the size of the range as the number of thousand separators.
This logical error yielded a negative value for written_bytes and
eventually an infinite loop, as written_bytes was converted to an
unsigned value.
2017-02-28 11:45:38 +01:00
Niels Lohmann
af070744ae 🔨 integrating numtostr into serializer class
By merging numtostr into serializer, we can write directly to the
output stream. As a consequence, all stream calls are now unformatted.
2017-02-27 22:10:57 +01:00
Niels Lohmann
54ef5f7b47 🔨 moved serialization functions to serializer class
The class is currently just a wrapper for an std::ostream and collects
all functions related to serialization. The next step should be
recycling of variables to avoid repetitive initialization for each
recursive dump call.
2017-02-27 21:22:39 +01:00
Niels Lohmann
9c4919ff34 " micro-optimizations for dump()"
This reverts commit 909b439b03.
For some strange reason, the test suite crashes when compiled
with GCC.
2017-02-27 16:19:07 +01:00
Niels Lohmann
909b439b03 micro-optimizations for dump()
numtostr now directly writes to a stream. Return value of snprintf is
reused to avoid finding end of string. Cachegrind suggests a 1%
performance increase.
2017-02-27 14:58:10 +01:00
Niels Lohmann
0f04e42dd5 micro-optimizations for dump()
All ‘<<‘ calls have been replaced by write()/put() calls. The
indentation strings needs not to be resized. Cachegrind measures 1%
performance improvement.
2017-02-27 01:22:24 +01:00
Niels Lohmann
b1441f3485 micro-optimizations for dump()
Indentation string is recycled to avoid allocations. Comma-separation
in objects does not need an if any more. Cachegrind measures 1%
performance improvement.
2017-02-26 20:58:00 +01:00
Niels Lohmann
bd0326cbc1 micro-optimizations for dump()
Added separate code paths for normal output and pritty-printed output.
This allowed to remove most of the ifs along the way. Benchmarks and
cachegrind suggest a 10% performance improvement.
2017-02-26 16:55:54 +01:00
Niels Lohmann
ae155c4734 💄 cleanup 2017-02-26 14:45:41 +01:00
Niels Lohmann
bf4d744d1a more tests for meta() call 2017-02-26 14:34:58 +01:00
Niels Lohmann
d1b30250d6 added missing tests 2017-02-26 11:50:52 +01:00
Niels Lohmann
f1cd15ce7e avoid copying a string 2017-02-26 11:22:18 +01:00
Niels Lohmann
9ff0cc0f02 📝 updated documentation 2017-02-25 16:43:15 +01:00
Niels Lohmann
03f06e1993 Merge branch 'develop' into coverity_scan 2017-02-25 16:38:18 +01:00
Niels Lohmann
1b5867bdcf 🔀 merge branch 'release/2.1.1' into develop 2017-02-25 16:37:28 +01:00
Niels Lohmann
c0d511ea50 🔀 merge branch 'release/2.1.1' 2017-02-25 16:36:46 +01:00
Niels Lohmann
27c65b860b 🔖 version 2.1.1 2017-02-25 16:34:38 +01:00
Niels Lohmann
0234e53e23 📝 added section on used third-party tools 2017-02-22 20:48:52 +01:00
Niels Lohmann
b49ce351eb 💄 fixed some warnings 2017-02-22 20:48:29 +01:00
Niels Lohmann
a646c9c599 🔀 merge branch 'cotire' of https://github.com/tusharpm/json into tusharpm-cotire 2017-02-22 19:45:10 +01:00
Niels Lohmann
8cec55a271 🚧 fixed more warnings 2017-02-22 18:14:29 +01:00
Niels Lohmann
345a106d73 💄 cleanup 2017-02-22 16:56:56 +01:00
Niels Lohmann
967f9144d4 🚧 overworked fix for #465 2017-02-21 19:11:34 +01:00
Niels Lohmann
7d14f167b8 🚑 fix for #465 2017-02-20 22:48:27 +01:00
Niels Lohmann
b04543ecc5 🎨 fixed newlines 2017-02-20 21:56:10 +01:00
Niels Lohmann
1a6d7f5bca 🚧 try to fix some warnings in MSVC 2017-02-20 18:32:11 +01:00
Niels Lohmann
f7075be93a 🐛 reverted change for #464 2017-02-20 18:15:50 +01:00
Niels Lohmann
f2dfa09aec 🐛 fix for #464 2017-02-20 18:05:52 +01:00
Niels Lohmann
83a9c60dbd 🔨 refactored code to avoid using strcpy/strlen/strcat (#463) 2017-02-20 17:37:34 +01:00
Niels Lohmann
716485a965 🚧 removed decay (#448) 2017-02-20 16:27:16 +01:00
Niels Lohmann
7a4a16a7db 💄 updated header list 2017-02-20 16:20:45 +01:00
Niels Lohmann
1f72c38861 🚑 fix for #448 2017-02-19 21:26:53 +01:00
Niels Lohmann
83f1d2c81b added start index for from_cbor and from_msgpack (#462) 2017-02-19 21:17:05 +01:00
Niels Lohmann
4151f2d297 added test with thousands_sep 2017-02-19 20:08:01 +01:00
Niels Lohmann
5b53f03e7c Merge branch 'develop' into TurpentineDistillery-feature/locale_independent_num_to_str 2017-02-19 19:24:55 +01:00
Niels Lohmann
9a9d0ba3df 🚧 fixing warning C4293 (#453) 2017-02-19 17:47:20 +01:00
Tushar Maheshwari
5436407b7e 👷 Add cmake logic to Travis config
- get CMake for XCode 8.1 image
2017-02-19 13:38:08 +05:30
Tushar Maheshwari
85ce4d7b53 cmake compile time reduce using cotire
- Add prefix header
  - Include catch.hpp
  - Include json.hpp
    - Replace private with public for all json_unit files
- Move `unit.cpp` to an object library
- cotire issue: strip whitespace from CMAKE_INCLUDE_SYSTEM_FLAG_CXX
2017-02-19 13:35:54 +05:30
Niels Lohmann
d1479e47bb 💄 added assertion message 2017-02-18 11:01:03 +01:00
Niels Lohmann
513eb3ab5f 🚧 clean up 2017-02-18 11:00:18 +01:00
Niels Lohmann
0200f2dc62 🚧 fixing warning C4267 (#453) 2017-02-17 19:14:21 +01:00
Niels Lohmann
6408402ad2 🔀 merge #378 (for #362 and #454) 2017-02-16 09:24:45 +01:00
Niels Lohmann
057b1e606b 🔀 merged #415 (fix for #414) 2017-02-16 08:50:20 +01:00
Niels Lohmann
2c17c1b1b2 💄 cleanup 2017-02-16 08:01:01 +01:00
Niels Lohmann
973402c11e 🚧 replaced throws (#440) and _MAX/_MIN macros (#451) 2017-02-15 22:44:18 +01:00
Niels Lohmann
b9f3149451 🚑 fix for #452 2017-02-15 21:30:28 +01:00
Mihai STAN
6bf93b3d06 Merge remote-tracking branch 'upstream/develop' into develop 2017-02-15 15:00:25 +02:00
Niels Lohmann
82fb613763 📝 update after #302 2017-02-14 07:28:30 +01:00
Niels Lohmann
22b9a301d6 Merge pull request #450 from nlohmann/TurpentineDistillery-feature/locale_independent_str_to_num
TurpentineDistillery feature/locale independent str to num
2017-02-14 07:18:35 +01:00
Niels Lohmann
c95ff863bf ⬆️ updated Catch to v1.7.2 2017-02-13 18:55:11 +01:00
Niels Lohmann
265c5b5207 🔨 more work on the number parser 2017-02-13 18:51:23 +01:00
Niels Lohmann
b84705d557 improved test coverage 2017-02-12 20:14:43 +01:00
Niels Lohmann
c8191c8172 🔨 further cleanup 2017-02-12 18:50:17 +01:00
Niels Lohmann
c2d55109c1 🔨 make lexer distinguishes number types 2017-02-11 16:54:25 +01:00
Niels Lohmann
9f5dccbab5 💄 cleanup 2017-02-11 15:55:53 +01:00
Niels Lohmann
926af6d50b 🔀 merge branch 'develop' into TurpentineDistillery-feature/locale_independent_str_to_num 2017-02-11 15:17:47 +01:00
Niels Lohmann
ed8516dc39 👷 added Codacy badge 2017-02-09 17:38:02 +01:00
Niels Lohmann
c485d46cea 📝 screenshoots look ugly 2017-02-08 20:00:46 +01:00
Niels Lohmann
6fd77cea4a 📝 added screenshots 2017-02-08 19:22:19 +01:00
Niels Lohmann
0ffa18aab8 📝 listing projects using the library 2017-02-08 19:16:38 +01:00
Niels Lohmann
662a9b8f3c ✏️ fixed more typos 2017-02-08 18:19:41 +01:00
Niels Lohmann
4746a4c536 💄 minor change 2017-02-08 17:56:43 +01:00
Niels Lohmann
163f8397fd ✏️ fixed a typo #446 2017-02-05 17:11:26 +01:00
Niels Lohmann
8d88a1da2a 🔀 merged #379 and fixed conflicts 2017-02-05 13:13:41 +01:00
Niels Lohmann
d284c86dd1 uncommented some tests 2017-02-04 21:00:41 +01:00
Niels Lohmann
922fe693e1 ⬆️ updated Catch to v1.7.0 2017-02-04 15:30:28 +01:00
Niels Lohmann
1cfdc2a753 🐛 fixed test compilation 2017-02-04 08:25:55 +01:00
Niels Lohmann
77d6f70602 📝 acknowledgments for #442 and #445 2017-02-03 18:28:22 +01:00
Niels Lohmann
d6afaa8e16 📝 fixing a documentation issue #442 2017-02-03 18:15:37 +01:00
Niels Lohmann
5976caf032 improved test compilation speed #445 2017-02-03 18:09:55 +01:00
Niels Lohmann
16af771277 added roundtrip test for the Big List of Naughty Strings 2017-02-01 17:34:39 +01:00
Niels Lohmann
bf8fdac99a 👷 dropped Doozer.io support 2017-02-01 16:41:05 +01:00
Niels Lohmann
7bb7033383 Merge branch 'develop' into coverity_scan 2017-02-01 16:03:51 +01:00
Niels Lohmann
c75865d88c 🐛 fixed -Weffc++ warnings 2017-02-01 15:13:21 +01:00
Niels Lohmann
b210f2dbf4 💄 minor refactoring 2017-01-29 21:40:37 +01:00
Niels Lohmann
0164b10e10 added missing tests found by mutate++ 2017-01-29 17:18:58 +01:00
Niels Lohmann
affa3bf4e9 Merge pull request #439 from jaredgrubb/patch-2
README: adjust boost::optional example
2017-01-29 08:18:44 +01:00
Jared Grubb
f2873e6d3a README: adjust boost::optional example
The "from_json" example for boost::optional is not complete and should also handle the 'none' case.
2017-01-29 02:46:58 +00:00
Niels Lohmann
c7f366520c Merge branch 'develop' into coverity_scan 2017-01-28 18:43:48 +01:00
Niels Lohmann
f642934b18 🔀 merge branch 'release/2.1.0' into develop 2017-01-28 18:43:01 +01:00
Niels Lohmann
1e99a0273f 🔀 merge branch 'release/2.1.0' 2017-01-28 18:42:27 +01:00
Niels Lohmann
6746a57524 📝 updated slides 2017-01-28 18:41:30 +01:00
Niels Lohmann
eb08e8b09b 📝 updated documentation 2017-01-28 18:20:12 +01:00
Niels Lohmann
4b5c61075f 📄 changes to let Github detect the license 2017-01-28 18:17:57 +01:00
Niels Lohmann
38e4935db0 📝 added example and documentation for the meta function 2017-01-28 17:12:29 +01:00
Niels Lohmann
cdde1a9436 🔖 set version to 2.1.0 2017-01-28 16:46:03 +01:00
Niels Lohmann
d870826811 🔖 set version to 2.1.0 2017-01-28 16:03:35 +01:00
Niels Lohmann
2f6260751c 📝 fixed #434 2017-01-27 18:50:52 +01:00
Niels Lohmann
42fa3f0568 🔀 merge pull request #435 (based on #338, #355, and #423)
conversion from/to user-defined types
2017-01-27 06:22:10 +01:00
Niels Lohmann
cd9701b123 💄 cleanup 2017-01-26 20:51:30 +01:00
Niels Lohmann
1305e03557 📝 fixed documentation 2017-01-26 19:39:34 +01:00
Niels Lohmann
77bb7af5d9 📝 added more documentation 2017-01-26 07:29:37 +01:00
Niels Lohmann
4d3053cd42 💄 some cleanup 2017-01-25 22:21:07 +01:00
Niels Lohmann
94d9b7bc86 📝 overworked documentation (re-added constructor examples) 2017-01-25 21:59:54 +01:00
Niels Lohmann
ec03c9c53e 📝 overworked docs #435 2017-01-25 19:01:31 +01:00
Mihai STAN
6198439f59 fix #414 - comparing to 0 literal
Overload comparison operators for all types that could be converted
to nullptr.
2017-01-24 22:33:37 +02:00
Niels Lohmann
4139bb6572 📝 adjusted test count 2017-01-24 15:20:20 +01:00
Niels Lohmann
c154f3133d 🚧 rephrased assertions 2017-01-24 15:02:35 +01:00
Niels Lohmann
50a3f3b301 📝 added nicer example 2017-01-24 14:55:51 +01:00
Niels Lohmann
781fd09f2d 📝 cleanup 2017-01-24 14:45:32 +01:00
Niels Lohmann
daf8dcdb32 📝 overworked README 2017-01-24 14:37:25 +01:00
Niels Lohmann
250e5bf43d 💄 overworked documentation and indentation 2017-01-24 13:47:33 +01:00
Niels Lohmann
030cf674ef 🚧 fixed a warning 2017-01-24 12:49:38 +01:00
Niels Lohmann
3857e55290 💄 ran "make pretty" 2017-01-24 12:43:43 +01:00
Théo DELRIEU
9f103d19d7 add implicit conversions test (operator T()) 2017-01-22 14:23:24 +01:00
Théo DELRIEU
9f8b270ed9 fix some warnings 2017-01-22 14:07:28 +01:00
Théo DELRIEU
9c6ef74a28 add static_asserts/remove the need for CopyConstructible in get 2017-01-21 19:12:40 +01:00
Théo DELRIEU
ba0b35f414 use typename U = uncvref_t where appropriate 2017-01-21 19:12:40 +01:00
Théo DELRIEU
37fd20b2eb put uncvref_t, enable_if_t, value_t and operator<(value_t) in detail 2017-01-21 19:12:40 +01:00
Théo DELRIEU
7d771c71ed put back type_name in basic_json
This can however not be done easily for value_t, since
external_constructor depends on it, as is operator< which was moved
outside basic_json too.
This is not really an issue, since all basic_json classes share the same
enum
2017-01-21 19:12:40 +01:00
Théo DELRIEU
f997758cad remove useless forward declaration of primitive_iterator_t 2017-01-21 19:12:40 +01:00
Théo DELRIEU
40ba5a8b7b remove inline keyword from anonymous namespace (not needed) 2017-01-21 19:12:40 +01:00
Théo DELRIEU
7f359017d2 rename template argument Json -> BasicJsonType 2017-01-21 19:12:40 +01:00
Théo DELRIEU
708eb9613b disable reserve tests when exceptions are disabled 2017-01-21 19:12:40 +01:00
Théo DELRIEU
889b269a4f rename template argument: BasicJson -> Json 2017-01-21 16:14:23 +01:00
Théo DELRIEU
a6b028286b move conjunction/disjunction to the top of detail 2017-01-21 16:14:23 +01:00
Théo DELRIEU
d566bb81c4 use switchs where appropriate 2017-01-21 16:14:23 +01:00
Théo DELRIEU
1e20887cff use JSON_THROW 2017-01-21 16:14:22 +01:00
Théo DELRIEU
447c6a670f run make re2c 2017-01-21 16:14:22 +01:00
Théo DELRIEU
3e15b551e0 run make pretty 2017-01-21 16:14:22 +01:00
Théo DELRIEU
fbac056c38 add readme 2017-01-21 16:14:22 +01:00
Théo DELRIEU
b56117b148 add noexcept tests 2017-01-21 16:14:22 +01:00
Théo DELRIEU
af94e712c7 add basic doxygen documentations 2017-01-21 16:14:22 +01:00
Théo DELRIEU
1d87097741 remove some boilerplate 2017-01-21 16:14:22 +01:00
Théo DELRIEU
e60e458a7e move static_const to the detail namespace 2017-01-21 16:14:22 +01:00
Théo DELRIEU
794dae8911 apply changes to json.hpp.re2c 2017-01-21 16:14:22 +01:00
Théo DELRIEU
68081cd112 remove useless file 2017-01-21 16:14:22 +01:00
Théo DELRIEU
07bc82d3a7 put const to the left 2017-01-21 16:14:22 +01:00
Théo DELRIEU
f1482d1f01 more tests in unit-udt 2017-01-21 16:14:22 +01:00
Théo DELRIEU
f2c71fafda minor message/comments tweak 2017-01-21 16:14:22 +01:00
Théo DELRIEU
63e4249e9f use a priority_tag instead of int and longs with sfinae-dispatch 2017-01-21 16:14:22 +01:00
Théo DELRIEU
b8012876a5 add noexcept checks, and some missing noexcepts 2017-01-21 16:14:22 +01:00
Théo DELRIEU
1554baa01d attempting to fix coverage. testing that reserve is called 2017-01-21 16:14:22 +01:00
Théo DELRIEU
a9d5ae4fad put back a specialization for containers with a reserve method 2017-01-21 16:14:22 +01:00
Théo DELRIEU
e247e01a6e use static_casts to silence MSVC warnings
Those warnings are not "fixed", but that's intentional.
Truncations are expected when ArithmeticType is not the same type than
number_unsigned_t (or another basic_json template argument)
2017-01-21 16:14:22 +01:00
Théo DELRIEU
d0d8070422 add static_asserts
remove some useless trailing return types and && to help MSVC
2017-01-21 16:14:22 +01:00
Théo DELRIEU
e678c075dd check for is_number_unsigned before is_number_integer 2017-01-21 16:14:22 +01:00
Théo DELRIEU
cb3d455bd2 do not const_cast when calling get_ptr 2017-01-21 16:14:22 +01:00
Théo DELRIEU
3494014ba0 new unit-udt.cpp tests 2017-01-21 16:14:22 +01:00
Théo DELRIEU
1f25ec5d36 add some constexpr + noexcept 2017-01-21 16:14:22 +01:00
Théo DELRIEU
29f9fe6ae9 remove one has_to/from_json template parameter 2017-01-21 16:14:22 +01:00
Théo DELRIEU
5839795725 remove useless helpers 2017-01-21 16:14:22 +01:00
Théo DELRIEU
b4cea6825d remove is_compatible_array_type_impl trait 2017-01-21 16:14:22 +01:00
Théo DELRIEU
b2543e06d8 removed is_compatible_float_type trait 2017-01-21 16:14:22 +01:00
Théo DELRIEU
be6b417c87 tweak SFINAE checks for internal types (see commit body)
only check for public types (iterators, json_pointer)

for private ones (m_array.iterator, primitive_iterator) simply double
parentheses on relevant Catch checks
2017-01-21 16:14:22 +01:00
Théo DELRIEU
317883b21b cleanup, details in body
removes:
- is_basic_json_compatible_type traits
- a useless operator=
- void_t
- disjunction

changes:
- is_compatible_object_type's first argument is BasicJson
2017-01-21 16:14:22 +01:00
Théo DELRIEU
4e8089b9de remove old get/get_impl overloads (doc removal is of course temporary) 2017-01-21 16:14:22 +01:00
Théo DELRIEU
7e6a6f978e replace constructor by from/to_json: array_t 2017-01-21 16:14:22 +01:00
Théo DELRIEU
c847e0eea2 replace constructor by from/to_json: array_t
- tweaked a bit how `get<container<json>>` is handled
- added a from_json overload for forward list
2017-01-21 16:14:22 +01:00
Théo DELRIEU
6d427acdde replace constructor by from/to_json: unscoped enum types
this also means that one can do: j.get<unscoped_enum>();
2017-01-21 16:14:22 +01:00
Théo DELRIEU
f00898331e replace constructor by from/to_json: number_integer_t 2017-01-21 16:14:22 +01:00
Théo DELRIEU
a32de3b528 replace constructor by from/to_json: number_unsigned_t
This commit forces a design change in custom JSONSerializer, which might
be temporary
2017-01-21 16:14:21 +01:00
Théo DELRIEU
d257149f36 replace constructor by from/to_json: number_float_t 2017-01-21 16:14:21 +01:00
Théo DELRIEU
bbe40641a3 replace constructor by from/to_json: string_t 2017-01-21 16:14:21 +01:00
Théo DELRIEU
6b89785fba replace constructor by from/to_json: boolean_t 2017-01-21 16:14:21 +01:00
Théo DELRIEU
c833b22b7b move type_name outside of basic_json, make it a friend 2017-01-21 16:14:21 +01:00
Théo DELRIEU
d359684f2b move enum class value_t outside of basic_json 2017-01-21 16:14:21 +01:00
Niels Lohmann
034d5ed97e 💄 some cleanup 2017-01-21 16:14:21 +01:00
Niels Lohmann
be1d3de49b 💄 moved changes to re2c file and ran make pretty 2017-01-21 16:14:21 +01:00
Théo DELRIEU
aa2679a8ce fix tests, avoid instantiating JSONSerializer when it will not be used 2017-01-21 16:14:21 +01:00
Théo DELRIEU
d5ee5830ed add more tests 2017-01-21 16:14:21 +01:00
Théo DELRIEU
1c21c87e6f use u8 prefix in unit-udt.cpp 2017-01-21 16:14:21 +01:00
Théo DELRIEU
7e750ec1fa fix msvc, by doubling parenthesis on catch assertions 2017-01-21 16:14:21 +01:00
Théo DELRIEU
3d405c6883 add support for enum classes 2017-01-21 16:14:21 +01:00
Théo DELRIEU
8e43d476d3 add more tests to unit-udt.cpp 2017-01-21 16:14:21 +01:00
Théo DELRIEU
f5cb089f89 add an enum constructor (quickfix) 2017-01-21 16:14:21 +01:00
Théo DELRIEU
1eafac7220 remove explicit keyword on udt-constructor 2017-01-21 16:14:21 +01:00
Théo Delrieu
c0c72b5b62 rewrite unit-udt: basic usage 2017-01-21 16:14:21 +01:00
Théo DELRIEU
60e6f822fa add support for non-default-constructible udt 2017-01-21 16:14:21 +01:00
Théo DELRIEU
e5999c6c82 add a few tests 2017-01-21 16:14:21 +01:00
Théo Delrieu
74bb11d92c remove some useless checks, format a bit, added some comments 2017-01-21 16:14:21 +01:00
Théo DELRIEU
907484fb43 format biggest lines 2017-01-21 16:14:21 +01:00
Théo Delrieu
47bc402113 only use conjunction & co when needed to avoid MSVC crashing 2017-01-21 16:14:21 +01:00
Théo DELRIEU
ee19acaf05 add is_compatible_basic_json_type trait 2017-01-21 16:14:21 +01:00
Théo Delrieu
9b401972a0 add a macro for has_xxx types 2017-01-21 16:14:21 +01:00
Théo DELRIEU
e2dbe7a69f correctly constrain basic_json udt constructor 2017-01-21 16:14:21 +01:00
Théo DELRIEU
0d91113ccf add negation, disjunction, and conjunction from C++17 2017-01-21 16:14:21 +01:00
Théo DELRIEU
88819449c2 remove constraints on JSONSerializer instances, constrain correctly new methods 2017-01-21 16:14:21 +01:00
Théo DELRIEU
23bd2bce35 add is_compatible_* traits 2017-01-21 16:14:21 +01:00
Théo DELRIEU
178441cdfd add basic test for custom serializer 2017-01-21 16:14:21 +01:00
Théo DELRIEU
2bc685f6b4 to_json and from_json takes both two arguments now
the first is the basic_json type, the second the user-defined type
2017-01-21 16:14:21 +01:00
Théo DELRIEU
837b81d672 renamed unit-constructor3.cpp to unit-udt.cpp 2017-01-21 16:14:21 +01:00
Théo DELRIEU
33abccf847 add template arguments for JSONSerializer 2017-01-21 16:14:21 +01:00
Théo DELRIEU
7dc268ef42 add first version for alternate implementation 2017-01-21 16:14:21 +01:00
Théo DELRIEU
4cdc61e493 move most SFINAE trickery in to/from_json_fn 2017-01-21 16:14:21 +01:00
Théo DELRIEU
03b391c37b remove has_destructor and has_json_traits, use decltype instead 2017-01-21 16:14:21 +01:00
Théo DELRIEU
12b4555b13 use uncvref_t<T> instead of remove_cv_t<remove_reference_t<T>>> 2017-01-21 16:14:21 +01:00
Théo DELRIEU
877d96c1d8 rename __static_const to _static_const (reserved identifier) 2017-01-21 16:14:21 +01:00
Théo DELRIEU
d54d6bb84c add alias templates to reduce boilerplate 2017-01-21 16:14:21 +01:00
Théo DELRIEU
fe628b585b anonymous namespace renamed to detail 2017-01-21 16:14:21 +01:00
Théo Delrieu
b443edf49e add first version support for user-defined types 2017-01-21 16:14:20 +01:00
Niels Lohmann
ce0b3fe5a3 🚧 made type_name() public 2017-01-21 16:12:17 +01:00
Niels Lohmann
145188f264 renaming did not help 2017-01-19 19:23:56 +01:00
Niels Lohmann
69be3fa842 📝 small documentation update 2017-01-19 18:19:20 +01:00
Niels Lohmann
5e3f9c8969 📄 help Github find the license 2017-01-19 17:09:55 +01:00
Niels Lohmann
e951d198f4 🔀 merge pull request #430 from vjon/patch-1
Fix documentation error
2017-01-19 07:42:29 +01:00
Jonathan Lee
046f6da82f Fix documentation error
Move comparison before "j.clear()" function call, such that the intended return value "true" is actually correct.
2017-01-18 11:43:14 -08:00
Niels Lohmann
bae8e70137 🔀 merge branch 'feature/noexceptions_2' into develop 2017-01-18 20:41:17 +01:00
Niels Lohmann
87c5e32e1f 🐛 fixed escaping 2017-01-16 22:46:49 +01:00
Niels Lohmann
a00149f8ee 🐛 fixed logic error 2017-01-16 22:36:58 +01:00
Niels Lohmann
1ab26ab367 option to switch off exceptions 2017-01-16 22:11:07 +01:00
Niels Lohmann
74cbd30cd0 📄 it's 2017 2017-01-16 20:04:47 +01:00
Niels Lohmann
a7f3938391 added Big List of Naughty Strings 2017-01-16 20:03:50 +01:00
Niels Lohmann
a9b4cb8bf8 🔀 merge branch 'feature/release_information' into develop #397 2017-01-12 21:37:31 +01:00
Niels Lohmann
3a9ccfac22 🚧 cleanup 2017-01-12 21:35:27 +01:00
Niels Lohmann
98ad3c3ac1 Merge branch 'develop' into feature/release_information 2017-01-12 21:30:08 +01:00
Niels Lohmann
0f03543861 ⬆️ upgraded to Catch 1.6.0 2017-01-11 22:23:02 +01:00
Niels Lohmann
e9bbf5aaba 🐛 forgot to remove a test case 2017-01-08 09:31:40 +01:00
Niels Lohmann
dd45ba6f89 🚧 renamed version() to meta() 2017-01-08 09:19:44 +01:00
Alex Astashyn
c236b596c9 Merge upstream/develop into feature/locale_independent_str_to_num 2017-01-04 19:20:16 -05:00
Alex Astashyn
949061079a Merge upstream/develop into feature/locale_independent_num_to_str 2017-01-04 18:55:19 -05:00
Niels Lohmann
e1b89dd1d6 Merge branch 'develop' into feature/release_information 2017-01-04 20:06:23 +01:00
Niels Lohmann
9f6c86f233 🐛 fix for #417 2017-01-04 18:54:44 +01:00
Niels Lohmann
4765070318 📝 added documentation wrt. UTF-8 strings #406 2017-01-04 18:07:46 +01:00
Niels Lohmann
cdd3b5a68c 🚑 fix for #416 2017-01-03 23:52:01 +01:00
Niels Lohmann
767637877b 💄 cleanup 2017-01-03 22:37:07 +01:00
Niels Lohmann
f8d640b185 👷 better support for OSS-Fuzz 2017-01-03 22:35:31 +01:00
Niels Lohmann
245a69d554 💄 ran clang-tidy 2017-01-03 21:33:23 +01:00
Niels Lohmann
ea4d71ee21 Merge branch 'develop' into feature/release_information 2017-01-02 17:26:00 +01:00
Niels Lohmann
528bc96d7e Merge branch 'develop' 2017-01-02 16:41:33 +01:00
Niels Lohmann
0f36541d65 Merge branch 'develop' into coverity_scan 2017-01-02 16:39:52 +01:00
Niels Lohmann
9755cc75b1 🔀 merge branch 'release/2.0.10' into develop 2017-01-02 16:38:23 +01:00
Niels Lohmann
1c98ce869c 🔀 merge branch 'release/2.0.10' 2017-01-02 16:37:52 +01:00
Niels Lohmann
7e2c4b3ead 📝 updated online link 2017-01-02 16:37:29 +01:00
Niels Lohmann
69c615e127 🔖 version bump to 2.0.10 2017-01-02 10:00:44 +01:00
Niels Lohmann
4d3bf433b4 🔖 updated ChangeLog 2017-01-02 09:56:21 +01:00
Niels Lohmann
8b46eb8ec0 📄 it's 2017 already 2017-01-02 09:40:00 +01:00
Niels Lohmann
6a20790056 📝 updated test count 2017-01-02 09:36:30 +01:00
Niels Lohmann
60b3703c62 🔖 version bump to 2.0.10 2017-01-02 09:35:57 +01:00
Niels Lohmann
d173517212 💄 clean up 2017-01-02 09:21:26 +01:00
Niels Lohmann
a3063c2419 🚧 added target to build all fuzzers 2017-01-01 21:51:36 +01:00
Niels Lohmann
db33629990 💄 cleanup after #410 2017-01-01 21:34:58 +01:00
Niels Lohmann
712529cd32 🔀 merge pull request #400 from andoma/develop
Add Doozer build badge
2017-01-01 19:47:33 +01:00
Niels Lohmann
09b91406c6 🔀 merge pull request #410 from Daniel599/feature/clang_sanitize
Feature/clang sanitize
2017-01-01 19:45:11 +01:00
Niels Lohmann
ab7d55e7ae 👷 removed failing test suites 2017-01-01 19:38:54 +01:00
Niels Lohmann
cf9bf2d913 🚑 fix for #411 and #412 2017-01-01 15:28:01 +01:00
Daniel Cohen
ff3221a375 #394 fixed memory leak in unit-allocator, found by clang's fsanitize 2016-12-30 15:21:25 +02:00
Niels Lohmann
328eb55dc4 🚧 started working on #397 2016-12-30 14:02:51 +01:00
Daniel Cohen
010ea126f3 going to try clang_sanitize with libstdc++ with g++-6 implementation
Conflicts:
	.travis.yml
	Makefile
2016-12-30 14:24:22 +02:00
Niels Lohmann
d7029c37aa improved test coverage 2016-12-30 13:04:33 +01:00
Niels Lohmann
f7575dee94 Merge branch 'develop' into feature/release_information 2016-12-30 12:29:01 +01:00
Niels Lohmann
42a8c64499 🔖 added version information 2016-12-30 12:28:52 +01:00
Niels Lohmann
f0edab2363 🚑 fix for #408 2016-12-29 17:00:02 +01:00
Niels Lohmann
383a29a924 🚑 fix for #407 2016-12-29 16:14:15 +01:00
Niels Lohmann
871cebaf84 🚑 fix for #405 2016-12-29 15:39:16 +01:00
Niels Lohmann
8381cd6020 🚑 removed unsafe call to strerror #403 2016-12-28 14:19:08 +01:00
Niels Lohmann
e4c2829aea 🔀 merge branch 'feature/fuzzer' into develop 2016-12-28 12:26:00 +01:00
Niels Lohmann
1dd99d04b6 Merge branch 'develop' into feature/fuzzer 2016-12-28 12:19:12 +01:00
Niels Lohmann
888f5b9f60 🚚 renamed test files to allow windows build 2016-12-28 12:18:48 +01:00
Niels Lohmann
55be721615 Merge branch 'develop' into feature/fuzzer 2016-12-28 12:11:51 +01:00
Niels Lohmann
acb7e0558d 🚑 fixed bugs detected by AFL-Fuzz 2016-12-28 12:09:15 +01:00
Niels Lohmann
e3b036348b 🚧 added targets for parallel AFL fuzzing 2016-12-25 16:36:43 +01:00
Niels Lohmann
1399abc583 🚧 added MessagePack fuzz target 2016-12-25 16:18:56 +01:00
Niels Lohmann
e4cc62e653 🐛 fixed Makefile to work with proper CBOR files 2016-12-25 16:07:10 +01:00
Niels Lohmann
6de9d4035a 🐛 fixed AFL driver to also read binary data 2016-12-25 16:06:56 +01:00
Niels Lohmann
dbdcb3fec8 🐛 fixed bug in CBOR/MessagePack deserialization 2016-12-25 16:06:36 +01:00
Niels Lohmann
6e129fbfb7 📝 some small documentation fixes 2016-12-25 14:39:08 +01:00
Niels Lohmann
f87f4c06f9 🚧 cleanup 2016-12-22 12:10:52 +01:00
Niels Lohmann
33be4e7f1f 🚧 cleanup 2016-12-22 12:08:36 +01:00
Niels Lohmann
a084e90f39 🔨 split AFL test in driver and test file 2016-12-22 11:09:26 +01:00
Niels Lohmann
048330b14b ⬆️ Catch v1.5.9 2016-12-22 09:37:15 +01:00
Niels Lohmann
22a6b956e8 📄 added license for Catch 2016-12-22 09:36:34 +01:00
Niels Lohmann
ad241a2260 🔨 moved third-party code into separate folder 2016-12-22 09:35:53 +01:00
Niels Lohmann
6e8791912f 🚧 added fuzzer from OSS-Fuzz 2016-12-22 09:09:40 +01:00
Niels Lohmann
69ed19e483 added libFuzzer 2016-12-22 09:08:50 +01:00
Niels Lohmann
09fd1a04b8 Merge branch 'develop' into coverity_scan 2016-12-21 16:19:26 +01:00
Niels Lohmann
7107072f71 👷 clang for fedora 2016-12-21 10:33:36 +01:00
Niels Lohmann
2cf0f299ad 👷 using clang where GCC is too old 2016-12-21 10:13:59 +01:00
Niels Lohmann
937cca762f 👷 forgot to install make 2016-12-21 09:54:11 +01:00
Niels Lohmann
91e45a8dd0 👷 the cmake of trusty is too old 2016-12-21 09:47:31 +01:00
Niels Lohmann
f78671de8e 👷 Fedora has no package "build-essential" 2016-12-21 09:33:16 +01:00
Niels Lohmann
2e5208d5cd 👷 there is no cmake in the osx image 2016-12-21 09:19:53 +01:00
Niels Lohmann
c6fbd305b0 👷 trying more doozer workers 2016-12-21 09:17:17 +01:00
Niels Lohmann
38597ac628 👷 added more builders 2016-12-20 23:04:07 +01:00
Andreas Smas
57b32d9773 Add Doozer build badge 2016-12-20 21:38:01 +01:00
Niels Lohmann
73b28e8f92 👷 fixing build command 2016-12-20 19:16:52 +01:00
Niels Lohmann
1178a8152a 👷 using cmake with Doozer 2016-12-20 19:13:19 +01:00
Niels Lohmann
0fffbb8488 👷 trying Doozer 2016-12-20 19:06:15 +01:00
Niels Lohmann
ab64419bb6 Merge branch 'develop' into coverity_scan 2016-12-18 18:17:51 +01:00
Niels Lohmann
9952a3c456 👷 trying to fix coverity task 2016-12-18 18:17:26 +01:00
Niels Lohmann
03b78fee63 Merge branch 'develop' into coverity_scan 2016-12-16 21:42:34 +01:00
Niels Lohmann
0e55af23fc 🔀 Merge branch 'release/2.0.9' into develop 2016-12-16 21:35:28 +01:00
Niels Lohmann
6df60b0448 🔀 Merge branch 'release/2.0.9' 2016-12-16 21:34:54 +01:00
Niels Lohmann
57afd293aa 🔖 updated documentation 2016-12-16 21:34:37 +01:00
Niels Lohmann
a507b9b46a 🔖 updated documentation 2016-12-16 21:25:20 +01:00
Niels Lohmann
36dc786106 🔖 updated Changelog 2016-12-16 21:09:14 +01:00
Niels Lohmann
706be50596 📝 updated number of tests 2016-12-16 20:54:43 +01:00
Niels Lohmann
303e873ae8 🔖 bumped version to 2.0.9 2016-12-16 20:45:46 +01:00
Niels Lohmann
f6f7fed99a 🚨 removed some warnings 2016-12-16 18:57:19 +01:00
Niels Lohmann
f24e4f680e 🎨 cleanup after PR #395 2016-12-14 22:30:09 +01:00
Niels Lohmann
fe00b368ae 🔀 merge pull request #395 from Bosswestfalen/develop
Replace class iterator and const_iterator by using a single template class to reduce code.
2016-12-14 21:56:43 +01:00
Niels Lohmann
2f94c30bad added a regression test for #380 / #390 2016-12-13 21:46:07 +01:00
Niels Lohmann
4e2fb1a533 Merge pull request #390 from qwename/integer-overflow
🔀 fix issue #380: Signed integer overflow check
2016-12-13 21:26:53 +01:00
Niels Lohmann
dfafd2c259 👷 can't get clang sanitizer to work #394
See https://travis-ci.org/nlohmann/json/jobs/183684093 for a failing
build.
2016-12-13 21:23:59 +01:00
Bosswestfalen
92e28c3153 added missing changes in json.hpp.re2c 2016-12-13 20:30:56 +01:00
Niels Lohmann
c3fac19692 👷 another try for sanitizers #394 2016-12-13 19:41:36 +01:00
Niels Lohmann
3f089cab2b 👷 moved instructed build to "before_script" #394 2016-12-13 18:24:16 +01:00
Niels Lohmann
9b5411db57 👷 clang 3.9.0 is not working #394 2016-12-13 17:55:41 +01:00
Niels Lohmann
f5d4a9c4eb 👷 added Clang 3.9.0 and sanitizer build #394 2016-12-13 17:51:46 +01:00
Yixin Zhang
703d4baf8b Fixed conversion warnings
Use static_cast on digit.
2016-12-12 21:12:08 -05:00
Yixin Zhang
bd6422f583 Ran make pretty 2016-12-12 21:12:08 -05:00
Yixin Zhang
1e981115c9 Fix issue #380: Signed integer overflow check
Instead of checking something like `x * y + z > max` where `x * y` can
overflow, check for `x > (max - z) / y` instead.
2016-12-12 21:12:08 -05:00
Alex Astashyn
6fba52b6da Merged upstream/develop into feature/locale_independent_str_to_num 2016-12-12 20:27:15 -05:00
Alex Astashyn
5cad2006eb Tweaked check for preserved sign; added LCOV_EXCL_LINE 2016-12-12 20:15:57 -05:00
Alex Astashyn
65b9b0c429 Disabling snprintf pre-check, since can't get locale-specific behavior to manifest in AppVeyor 2016-12-12 19:50:21 -05:00
Alex Astashyn
0f8de48ddb Disabling strtod pre-check, since can't get locale-specific behavior to manifest in AppVeyor 2016-12-12 19:48:14 -05:00
Alex Astashyn
cd0b651d43 Tweaked check for preserved sign; added LCOV_EXCL_LINE 2016-12-12 19:46:47 -05:00
Niels Lohmann
79fa8b2f41 🚑 fix to address #389 2016-12-12 23:19:43 +01:00
Bosswestfalen
dd3f4f9b92 Replaced class iterator and class const_iterator with aliases of template <typename U> iter_impl. iter_impl has operator const_iterator to create an const_iterator from an iterator. 2016-12-12 19:26:45 +01:00
Niels Lohmann
447e01427d 🚨 fixed some warnings 2016-12-12 18:21:17 +01:00
Niels Lohmann
b8776e8613 🚑 fix for #393 2016-12-12 17:39:56 +01:00
Niels Lohmann
f6c21a1f20 📝 added note to example files 2016-12-12 08:25:08 +01:00
Niels Lohmann
5402458ff5 🚑 fixed an AddressSanitizer warning 2016-12-12 08:13:26 +01:00
Niels Lohmann
a25d570040 📝 added TOC to README #383 2016-12-11 19:42:36 +01:00
Niels Lohmann
ea7b40687b 📝 updated FAQ of the contribution guidelines #382 2016-12-11 16:36:39 +01:00
Niels Lohmann
b2991950a5 📝 added not wrt re2c version #390 2016-12-11 16:21:53 +01:00
Niels Lohmann
e906933f39 🔀 Merge branch 'feature/messagepack' into develop 2016-12-11 16:11:59 +01:00
Niels Lohmann
a59eb4868a 🔀 Merge branch 'develop' into feature/messagepack 2016-12-11 16:11:43 +01:00
Niels Lohmann
a9d7d315a5 📝 cleanup after #391 2016-12-11 16:06:52 +01:00
Niels Lohmann
446019aefd 🔀 merge pull request #391 from jaredgrubb/jgrubb-clang-doc-warning
Clang: quiet a warning
2016-12-11 16:04:27 +01:00
Niels Lohmann
6fa4f96ba3 📝 fixed two documentation warnings 2016-12-11 16:03:23 +01:00
Niels Lohmann
dc6fc3e079 📝 clean up and added documentation for #358 2016-12-11 13:36:08 +01:00
Niels Lohmann
fdce38fa79 fixed a test case 2016-12-11 00:39:26 +01:00
Niels Lohmann
e8c903294f more test cases for CBOR and msgpack 2016-12-11 00:05:29 +01:00
Niels Lohmann
41673e8fed 🐛 fixed CBOR code and added test cases 2016-12-10 23:12:57 +01:00
Jared Grubb
98d6e6e523 Clang: quiet a warning 2016-12-10 13:19:56 -08:00
Niels Lohmann
7e5d6af5c1 🔨 refactored msgpack code 2016-12-10 21:30:18 +01:00
Niels Lohmann
f1b95d78f9 🔨 refactored CBOR code to a switch 2016-12-10 19:29:45 +01:00
Niels Lohmann
d99c230f51 implemented indefinite-length CBOR types (#387) 2016-12-10 18:32:56 +01:00
Alex Astashyn
01930357f7 Tweaking unit test, as digits grouping is failing to be invoked in CI 2016-12-08 22:39:38 -05:00
Alex Astashyn
343c9f9baa Addressing compiler warnings 2016-12-08 22:36:18 -05:00
Alex Astashyn
1c029b97c0 Still trying to invoke locale-specific behavior in CI 2016-12-08 22:13:05 -05:00
Alex Astashyn
38499e84fc Removed unused struct; fixed comments 2016-12-08 21:38:14 -05:00
Niels Lohmann
6b84c4155c 🔨 refactored get_from_vector function
Snippet from http://stackoverflow.com/a/41031865/266378
2016-12-08 09:37:23 +01:00
Alex Astashyn
50f0484ad5 Added unit test for issue #378 2016-12-07 20:23:25 -05:00
Alex Astashyn
27d9740ad6 Tweaks to unit-test for issue #379 2016-12-07 19:55:07 -05:00
Alex Astashyn
0a4a6a8399 Refactored to avoid using exceptions, as there are plans to support exceptionless mode 2016-12-07 19:53:27 -05:00
Niels Lohmann
81a4272444 more test cases for CBOR 2016-12-07 23:14:37 +01:00
Niels Lohmann
3a0f5398a2 more CBOR test cases 2016-12-07 22:50:10 +01:00
Niels Lohmann
b7e0c12966 CBOR support for half-precision floats 2016-12-07 21:43:59 +01:00
Niels Lohmann
17c9b17a7e test cases from RFC 7049 #384 2016-12-07 21:25:22 +01:00
Niels Lohmann
aab9bbbb93 🐛 fix for CBOR (small integers) 2016-12-07 21:24:42 +01:00
Niels Lohmann
de289ea336 💚 another approach to the AppVeyor error 2016-12-07 19:15:05 +01:00
Niels Lohmann
81c43dca6a 💚 more AppVeyor fixes 2016-12-07 16:51:15 +01:00
Niels Lohmann
3f14a09e73 💚 another try to fix the AppVeyor build 2016-12-07 16:43:55 +01:00
Niels Lohmann
74571d531c 💚 still fixing the AppVeyor error 2016-12-07 16:34:02 +01:00
Niels Lohmann
2c7946f2bc 💚 hopefully fixed an error on AppVeyor 2016-12-07 16:21:22 +01:00
Niels Lohmann
8f6bfe5b32 🔨 refactored function to get numbers from byte vector 2016-12-07 14:47:06 +01:00
Niels Lohmann
474da6b28f :white_check_mark: more msgpack test cases 2016-12-07 13:47:08 +01:00
Niels Lohmann
be973e52bb more msgpack test cases 2016-12-07 09:19:46 +01:00
Niels Lohmann
a1693bfe48 Merge branch 'develop' into feature/messagepack 2016-12-07 08:39:57 +01:00
Alex Astashyn
6774457733 Trying to coerce setlocale to make snprintf use commas as delimiter some more 2016-12-06 22:59:12 -05:00
Alex Astashyn
d169598c6c simplified code a bit based on @gregmarr's suggestions 2016-12-06 22:20:48 -05:00
Alex Astashyn
d2e9ce270a Trying to coerce setlocale to make snprintf use commas as delimiter; the behavior appears to be compiler/platform-specific 2016-12-06 22:18:20 -05:00
Alex Astashyn
6e8da7d8c4 Added unit-test for issue #379 (locale-independent str-to-num) 2016-12-06 19:45:48 -05:00
Alex Astashyn
7a081244a5 Refactored preprocessing with a lambda instead of do{...}while(0) 2016-12-06 19:41:31 -05:00
Alex Astashyn
0c87d5d6b3 Refactored preprocessing with a lambda instead of do{...}while(0) 2016-12-06 19:41:05 -05:00
Alex Astashyn
d643360575 Bugfix: when working with C formatting functions we need to query C locales (localeconv) rather than std::locale 2016-12-06 00:43:12 -05:00
Alex Astashyn
738d462955 Bugfix: when working with C formatting functions we need to query C locales (localeconv) rather than std::locale 2016-12-06 00:23:58 -05:00
Alex Astashyn
82b82fd487 Addressing msvc-specific compilation issues. 2016-12-05 20:33:28 -05:00
Alex Astashyn
509447b4d5 Small bufix related to creation of fmt string for snprintf 2016-12-05 19:03:39 -05:00
Alex Astashyn
e41a956782 Alternative handling of integer types relying on strto[u]ll 2016-12-04 13:23:39 -05:00
Alex Astashyn
2197856395 Fixed suffixing .0 and modified the unit tests accordingly 2016-12-04 01:38:23 -05:00
Alex Astashyn
21cae35930 Added locale-independent numtostr 2016-12-04 01:27:22 -05:00
Alex Astashyn
c75efedc6e stylistic changes 2016-12-03 23:19:43 -05:00
Alex Astashyn
4eafaab816 Improved overflow detection; removed debugging output statements. 2016-12-03 22:54:36 -05:00
Alex Astashyn
6b78b5c2be Added strtonum for locale-independent number parsing 2016-12-03 19:05:09 -05:00
Niels Lohmann
f9a19af7a8 Merge branch 'develop' into coverity_scan 2016-12-02 20:30:20 +01:00
Niels Lohmann
bc28942101 🔖 Merge branch 'release/2.0.8' into develop 2016-12-02 20:07:43 +01:00
Niels Lohmann
272ebdc900 🔖 Merge branch 'release/2.0.8' 2016-12-02 20:07:14 +01:00
Niels Lohmann
44c0f811b1 🔖 version 2.0.8 2016-12-02 20:05:53 +01:00
Niels Lohmann
6c24caf282 📝 updated ChangeLog 2016-12-02 19:04:36 +01:00
Niels Lohmann
4adb8a81bf 📝 version bump 2016-12-02 18:39:35 +01:00
Niels Lohmann
60b7299fe1 📝 updated README 2016-12-02 18:02:38 +01:00
Niels Lohmann
8f563a5f81 Merge branch 'feature/emplace' into develop 2016-12-01 21:22:23 +01:00
Niels Lohmann
5c811b91f1 Merge branch 'develop' into feature/emplace 2016-12-01 21:17:40 +01:00
Niels Lohmann
ba3c5e1a25 more test cases 2016-11-29 09:49:05 +01:00
Niels Lohmann
c46b4ea990 more test cases 2016-11-29 08:37:27 +01:00
Niels Lohmann
e717492019 Merge branch 'feature/issue365' into develop 2016-11-29 07:46:14 +01:00
Niels Lohmann
bd252b2a09 Merge branch 'develop' into feature/issue365 2016-11-28 23:24:52 +01:00
Niels Lohmann
50f647c866 Merge branch 'develop' into feature/messagepack 2016-11-28 23:24:35 +01:00
Niels Lohmann
7b6bd585c1 Merge branch 'develop' into feature/emplace 2016-11-28 23:23:56 +01:00
Niels Lohmann
d563c21afe 📝 update documentation of Travis builders 2016-11-28 23:23:45 +01:00
Niels Lohmann
ee0f23fdc6 🚧 bug fixes and more tests 2016-11-28 23:20:03 +01:00
Niels Lohmann
286025497f 👷 removed retired images (https://blog.travis-ci.com/2016-11-17-retiring-some-osx-images/) 2016-11-28 22:16:33 +01:00
Niels Lohmann
aeb4f87a27 added return value for emplace (#349) 2016-11-28 18:33:46 +01:00
Niels Lohmann
6ecff31b7f Merge branch 'develop' into feature/emplace 2016-11-28 18:00:10 +01:00
Niels Lohmann
bc238124ee 🚧 further simplifications 2016-11-27 21:42:21 +01:00
Niels Lohmann
4c232fe12b 👷 added precondition for individual tests 2016-11-27 19:11:58 +01:00
Niels Lohmann
a820d688eb 🔨 refactored number-to-vector calls 2016-11-27 19:11:32 +01:00
Niels Lohmann
56843eb7ba Merge branch 'feature/individual_tests' into feature/messagepack 2016-11-27 18:28:23 +01:00
Niels Lohmann
93589e630c CBOR roundtrip tests 2016-11-27 17:47:56 +01:00
Niels Lohmann
2477b09cb9 🐛 Clang 3.9.0 seems to not work right now 2016-11-27 17:29:19 +01:00
Niels Lohmann
f860f323be 🚧 falling back to single unit test for coveralls 2016-11-27 17:09:05 +01:00
Niels Lohmann
71c1232e32 🐛 fixed YAML 2016-11-27 16:46:33 +01:00
Niels Lohmann
36c79113fb 🚧 fixing coveralls and valgrind targets 2016-11-27 16:45:24 +01:00
Niels Lohmann
e1f98fbfc0 🚧 splitting tests into several binaries 2016-11-27 16:19:26 +01:00
Niels Lohmann
a73f43a7a2 🚧 CBOR support (#358) 2016-11-27 00:10:04 +01:00
Niels Lohmann
eef408e5fb tests for CBOR 2016-11-27 00:09:24 +01:00
Niels Lohmann
87e088990b Merge branch 'develop' into feature/messagepack 2016-11-26 18:17:18 +01:00
Niels Lohmann
a8522f391a Merge branch 'develop' into feature/issue365 2016-11-26 12:45:50 +01:00
Niels Lohmann
2773038cf9 added improvements (#365) 2016-11-26 12:43:23 +01:00
Niels Lohmann
a791af30b4 Merge branch 'feature/filenotfound' into develop 2016-11-25 17:39:38 +01:00
Niels Lohmann
1ed510c232 Merge branch 'develop' into feature/filenotfound 2016-11-25 17:39:24 +01:00
Niels Lohmann
f194db9aa6 added assertion for warning from #368 2016-11-24 22:07:35 +01:00
Niels Lohmann
c39c36e6ad 💄 fixed indentation 2016-11-24 22:05:29 +01:00
Niels Lohmann
472d0045ba 📝 updating README after fixing #299 2016-11-24 21:56:21 +01:00
Niels Lohmann
1407bbf94c 💄 fixed indentation 2016-11-24 21:54:05 +01:00
Niels Lohmann
8014637ad1 added a test for EOF error (#367) 2016-11-24 21:53:41 +01:00
Niels Lohmann
dfc49e7afe 🐛 fixed a bug if parser was called with a stream at EOF (#367) 2016-11-24 21:45:10 +01:00
Niels Lohmann
2819b555c8 Merge branch 'develop' into coverity_scan 2016-11-24 20:01:55 +01:00
Niels Lohmann
4bd3b1b0ef Merge branch 'develop' into feature/issue365 2016-11-24 18:25:00 +01:00
Niels Lohmann
e3450cac72 📈 removing more variance of the benchmarks 2016-11-24 18:24:26 +01:00
Niels Lohmann
c3a610d32a 🔧 ignoring Clion files 2016-11-24 17:45:01 +01:00
Niels Lohmann
739f8eefb7 Merge branch 'develop' into coverity_scan 2016-11-24 17:26:11 +01:00
Niels Lohmann
25548f85c9 👷 trying Coverity with Clang 3.6 (#299) 2016-11-24 17:25:05 +01:00
Niels Lohmann
4bb41d065b 🐛 parsing erroneous files yields an exception (#366) 2016-11-23 16:57:01 +01:00
Niels
5f4becb0f5 Merge branch 'develop' into feature/issue365 2016-11-23 08:48:54 +01:00
Niels
ed611119d9 📈 reducing benchmark variance (#365) 2016-11-23 08:47:40 +01:00
Niels
6cc2d58d69 🐛 hopefully fixing the crashes on Linux (#365) 2016-11-22 20:13:47 +01:00
Niels
f620d74919 added performance fixes (#365) 2016-11-22 07:26:11 +01:00
Niels
869f4c68d4 📝 updated thanks section 2016-11-22 07:25:40 +01:00
Niels
c34b41acd6 🐛 fixes crash in dump from static object (#359)
Merge branch 'feature/issue359' into develop
2016-11-22 06:57:58 +01:00
Niels
abce5c25bb 📝 cleaned comments and updated README 2016-11-21 23:38:17 +01:00
Niels
43dbe02d5b 🐛 fixing #359 2016-11-21 21:53:10 +01:00
Niels
edc81f3bc1 💚 restored test call 2016-11-16 22:49:25 +01:00
Niels
d362a07239 💚 moved sample.json to standard test suite to run it with Valgrind 2016-11-16 22:49:16 +01:00
Niels
a9744f3937 💚 is sample.json killing AppVeyor? 2016-11-16 22:08:21 +01:00
Niels
0c9ab9427f 💚 added verbose message to check AppVeyor build 2016-11-16 22:02:38 +01:00
Niels
05e916717b Merge branch 'develop' into feature/messagepack 2016-11-16 19:16:36 +01:00
Niels
693bfe439b Merge branch 'develop' into feature/emplace 2016-11-16 19:16:16 +01:00
Niels
0d72767b3e ⬆️ updated to Catch v1.5.8 2016-11-16 19:15:54 +01:00
Niels
56667af823 🎨 stating the name of the library in the license 2016-11-16 19:08:25 +01:00
Niels
0a908ce8e2 Merge branch 'develop' into feature/messagepack 2016-11-16 09:04:37 +01:00
Niels
b0f896558f Merge branch 'develop' into feature/emplace 2016-11-16 09:04:25 +01:00
Niels
425b9834a8 🐛 removed the wrong compiler 2016-11-16 08:25:08 +01:00
Niels
56671a88c6 🍎 removed Xcode 8.0 due to repeated problems 2016-11-16 08:01:48 +01:00
Niels
5316f0fff2 🍎 added Xcode 8.1 build for travis 2016-11-16 06:42:26 +01:00
Niels
1be73b903e proposal for emplace/emplace_back (#349) 2016-11-11 19:29:14 +01:00
Niels
d1e73ce954 hid an expensive test case 2016-11-11 17:31:37 +01:00
Niels
543745a10e starting to integrate MessagePack (#358) 2016-11-11 17:11:13 +01:00
Niels
79a9d00e15 Merge branch 'develop' 2016-11-03 18:54:59 +01:00
Niels
9ca00e4880 readded missing header 2016-11-03 07:27:32 +01:00
Niels
e385417047 documented and cleaned up headers (#314) 2016-11-02 21:27:19 +01:00
Niels
6d2b5e3771 Merge branch 'release/2.0.7' into develop 2016-11-02 20:52:42 +01:00
Niels
a4d13c92ba Merge branch 'release/2.0.7' 2016-11-02 20:52:24 +01:00
Niels
700977d73e version bump 2016-11-02 20:52:15 +01:00
Niels
79015b9d0a Merge branch 'feature/jsontestsuite' into develop 2016-11-02 17:03:17 +01:00
Niels
3716a2fbe8 Merge branch 'develop' into feature/jsontestsuite 2016-11-02 17:03:12 +01:00
Niels
737d43724f Merge branch 'feature/issue329' into develop 2016-11-02 16:59:23 +01:00
Niels
59c8343851 cleanup 2016-11-02 15:44:46 +01:00
Niels
94c16b2c31 fixed coverage 2016-11-01 17:01:04 +01:00
Niels
8f70525374 more test coverage 2016-10-30 17:46:00 +01:00
Niels
7adccde714 improved coverage and updated README 2016-10-30 17:10:11 +01:00
Niels
8d1e65f297 evaluated i-tests (#344) 2016-10-30 16:07:17 +01:00
Niels
7b4e6cf705 added implementation-specific tests (#344) 2016-10-30 12:08:29 +01:00
Niels
a8136c578a fixed BOM handling #344 2016-10-29 21:08:30 +02:00
Niels
b820bb3b1f fixed a lot of unicode errors (#344)
BOMs currently yield an error.
2016-10-29 19:35:17 +02:00
Niels
b03bbe724d added n test cases (#344) 2016-10-29 14:02:33 +02:00
Niels
7da182472d Merge branch 'develop' into feature/jsontestsuite 2016-10-29 13:37:17 +02:00
Niels
42ea4fb751 fixed a bug for short input files (#344)
For input files with less than 5 bytes, the parser had a bug so that
refilling the input buffer led to erasing it.
2016-10-29 13:32:36 +02:00
Niels
2fdba9de19 added "y" cases 2016-10-26 23:45:11 +02:00
Niels
a2808322c6 add test files from https://github.com/nst/JSONTestSuite 2016-10-26 18:57:56 +02:00
Niels Lohmann
a29fcae409 fixed Cmake link 2016-10-26 09:20:40 +02:00
Niels
3ebe28970a small fixes 2016-10-23 17:25:07 +02:00
Niels
79d9fdc016 user-defined string literals exploit string length (#340) 2016-10-22 18:57:58 +02:00
Niels
e310850353 cleanup after #336 2016-10-16 23:46:24 +02:00
Niels Lohmann
8057782bb8 Merge pull request #336 from seeekr/patch-1
fix minor grammar/style issue in README.md
2016-10-16 23:40:17 +02:00
Denis Andrejew
cb2d41e3a0 fix minor grammar/style issue in README.md 2016-10-16 02:46:43 +02:00
Niels
542a48a16a Merge branch 'release/2.0.6' into develop 2016-10-15 16:48:08 +02:00
Niels
60bba02cc6 Merge branch 'release/2.0.6' 2016-10-15 16:47:56 +02:00
Niels
606098f45d release 2.0.6 2016-10-15 16:47:45 +02:00
Niels
d91067220f added missing overflow check for #329 2016-10-13 21:00:48 +02:00
Niels
67b9f1936d cleanup after closing #324 2016-10-12 22:05:45 +02:00
Niels Lohmann
bb9d87ad55 Merge pull request #324 from vpetrigo/has_mapped_improve
make has_mapped_type struct friendly
2016-10-12 21:59:56 +02:00
Niels
e7a60d8961 Merge branch 'feature/issue323' into develop 2016-10-12 21:21:59 +02:00
Niels
470197bd0b improve test coverage 2016-10-10 21:58:31 +02:00
Niels
d3e7f9da67 code cleanup for #323 2016-10-10 20:38:50 +02:00
Niels
97280bbcfc added missing header 2016-10-09 16:32:01 +02:00
Vladimir Petrigo
e9fde3e116 make has_mapped_type struct friendly 2016-10-08 16:50:23 +03:00
Niels
54bf5f20e9 adjusted README 2016-10-08 14:33:10 +02:00
Niels
2fa8ea0f74 started fixing #323 2016-10-08 14:27:28 +02:00
Niels
a0ef5a194c addressed #319, #321, and #318 2016-10-06 23:27:43 +02:00
Niels Lohmann
04b11d78ff Merge pull request #318 from ChristophJud/include_dir_relocation
Include dir relocation
2016-10-06 22:35:36 +02:00
Niels Lohmann
8173c370f6 Merge pull request #321 from vasild/develop
Fix usage examples' comments for std::multiset
2016-10-06 22:33:58 +02:00
Niels
b6550b35c3 fix after #313 2016-10-04 18:20:36 +02:00
Vasil Dimov
b5128b1610 Fix usage examples' comments for std::multiset 2016-10-04 18:53:44 +03:00
Niels Lohmann
963efb1f09 Merge pull request #313 from 5tefan/develop
trivial documentation fix
2016-10-02 11:29:49 +02:00
Niels
d6005e59a5 added fuzzing results 2016-10-02 11:23:47 +02:00
Christoph Jud
e1b6a23049 relocation of install-include directory for other packages 2016-09-26 12:15:03 +02:00
Stefan Codrescu
be61091401 trivial documentation fix 2016-09-16 18:15:36 -06:00
Niels
e4366688f7 v2.0.5 2016-09-14 23:42:12 +02:00
Niels
5dfd2c9bdf Merge branch 'release/2.0.5' into develop 2016-09-14 23:07:14 +02:00
Niels
5879eb0be3 Merge branch 'release/2.0.5' 2016-09-14 23:06:53 +02:00
Niels
3d104f1d43 version bump 2016-09-14 23:06:39 +02:00
Niels
6bbcdc1ec5 fixes #310 2016-09-14 22:48:12 +02:00
Niels
7b6cba23f3 results for #307 2016-09-12 21:23:12 +02:00
Niels
24c588cd25 Merge branch 'release/2.0.4' into develop 2016-09-11 23:37:30 +02:00
Niels
f209be1142 Merge branch 'release/2.0.4' 2016-09-11 23:37:11 +02:00
Niels
768d66560e version bump 2016-09-11 23:36:59 +02:00
Niels
15925469c6 Travis updated their Xcode 2016-09-11 22:50:40 +02:00
Niels
f922426ec3 fixed #304 2016-09-11 22:40:51 +02:00
Niels
2daab5a4c2 fixed #306 2016-09-11 22:30:08 +02:00
Niels
8ea0ee502d clang 3.9.0 is not working yet 2016-09-03 13:08:17 +02:00
Niels
fa0299f03a moved cmake into clang 2016-09-03 12:30:10 +02:00
Niels
36745ed296 install from tarball 2016-09-03 10:34:52 +02:00
Niels
f0455b401d forgot sh call 2016-09-03 09:44:10 +02:00
Niels
e0d809312b the cmake in apt is too old 2016-09-03 09:17:30 +02:00
Niels
bfd6678800 clang 3.9.0 needs a newer cmake 2016-09-03 08:47:07 +02:00
Niels
9639f0dfb3 Clang 3.9.0 has been released 2016-09-03 00:37:45 +02:00
Niels
625370a1ad Merge branch 'develop' 2016-09-02 16:05:38 +02:00
Niels
357baeff5a release 2.0.3 2016-09-01 08:07:52 +02:00
Niels
42be2edd4c fixed test coverage 2016-09-01 00:29:42 +02:00
Niels
c8d01fa7b9 Merge branch 'release/2.0.3' into develop 2016-08-31 21:27:50 +02:00
Niels
2c82f25272 Merge branch 'release/2.0.3' 2016-08-31 21:27:32 +02:00
Niels
df9fd6237e release 2.0.3 2016-08-31 21:27:23 +02:00
Niels
776880bc49 Merge branch 'feature/iterator_range_parsing' into develop 2016-08-31 20:23:24 +02:00
Niels
740b66f225 cleanup 2016-08-31 20:23:21 +02:00
Niels
58cbf4b3ef added another test case 2016-08-31 18:23:46 +02:00
Niels
ae7aaed4ac Merge branch 'develop' into feature/iterator_range_parsing 2016-08-31 18:07:18 +02:00
Niels
442058f8ed interface cleanup 2016-08-31 17:07:35 +02:00
Niels
afba1d3fcb forgot to run re2c 2016-08-30 23:51:14 +02:00
Niels
941714c99c template changes did not work with MSVC 2016-08-30 23:49:06 +02:00
Niels
a485aa8d27 cleanup and improvement of branch coverage 2016-08-30 23:44:15 +02:00
Niels
6e6e1c9b1f implemented idea from #290 2016-08-30 18:26:07 +02:00
Niels
f76f9efe58 Merge branch 'develop' into feature/iterator_range_parsing 2016-08-30 18:20:13 +02:00
Niels Lohmann
463ffb21bc Merge pull request #300 from t-b/fix_warning_in_test_case
unit-constructor1.cpp: Fix floating point truncation warning
2016-08-29 22:52:18 +02:00
Niels
29c5f32d42 fixed performance degradation (#272) 2016-08-29 22:36:33 +02:00
Thomas Braun
e0ff1a837c unit-constructor1.cpp: Fix floating point truncation warning 2016-08-25 00:24:33 +02:00
Niels Lohmann
87dea32e81 using AppVeyor badge for develop branch 2016-08-24 21:31:11 +02:00
Niels Lohmann
bd3bd37e96 removed coverity badge (build is broken, see #299) 2016-08-24 21:29:28 +02:00
Niels
04c6c886eb another experiment 2016-08-24 21:02:33 +02:00
Niels Lohmann
8b833c452a experiment: changed order of parse functions 2016-08-24 07:12:56 +02:00
Niels
1d66ab9f7a fixed lexer issue which required null byte at the end of contiguous storage containers #290 2016-08-23 22:38:05 +02:00
Niels
a79d634ccb integrated proposals for #290 2016-08-22 21:40:07 +02:00
Niels
6d1254baba Merge branch 'develop' into feature/iterator_range_parsing 2016-08-22 20:54:55 +02:00
Niels
b688119aa4 reverted .travis file 2016-08-22 20:54:32 +02:00
Niels
29a4ef6c5c no execution for special cases 2016-08-22 20:50:12 +02:00
Niels
71af209ea9 fix for YAML file 2016-08-22 20:44:36 +02:00
Niels
79fd4dfbd8 do not build for special cases 2016-08-22 20:40:25 +02:00
Niels
8fbf635dd3 Merge branch 'develop' into coverity_scan 2016-08-21 23:20:05 +02:00
Niels
cda84ba323 Merge branch 'develop' into feature/iterator_range_parsing 2016-08-21 23:15:27 +02:00
Niels
034244a291 Merge branch 'feature/coverage' into develop 2016-08-21 22:48:02 +02:00
Niels
1e896eb91e improved code coverage 2016-08-21 22:38:56 +02:00
Niels
94331a355d removed LCOV_EXCL_LINE 2016-08-21 21:50:13 +02:00
Niels
aa7f5ad8b1 minor changes 2016-08-21 21:48:15 +02:00
Niels
585a39a235 improved branch coverage 2016-08-21 14:39:54 +02:00
Niels
b4571360df more on #290 2016-08-21 12:35:40 +02:00
Niels
eef8059003 allowing parsing from contiguous containers 2016-08-20 20:29:33 +02:00
Niels
6f3554f040 Merge branch 'develop' into feature/iterator_range_parsing 2016-08-20 18:51:11 +02:00
Niels
0cf7ebaa57 mentioning the CII 2016-08-18 18:43:27 +02:00
Niels
d2564c6100 added cppcheck target for travis 2016-08-18 18:29:19 +02:00
Niels
039cedaf8e changes to address #295 2016-08-17 23:14:28 +02:00
Niels
628a5eae50 reset build file 2016-08-17 22:33:26 +02:00
Niels
f40f81c87e forgot a semicolon 2016-08-17 21:44:53 +02:00
Niels
c0922c7aac /Wall 2016-08-17 21:43:28 +02:00
Niels
35f22e8596 checking MSVC compiler flags 2016-08-17 21:38:19 +02:00
Niels
a78eaa27b5 fixed unit tests 2016-08-17 21:31:59 +02:00
Niels
5e67f7af01 added a first version of a parser for #290 2016-08-15 22:44:14 +02:00
Niels
f791c5fd2e Merge branch 'develop' into feature/iterator_range_parsing 2016-08-15 21:46:02 +02:00
Niels
ca80a71c28 added notes from the CII Best Practices badge 2016-08-15 21:45:49 +02:00
Niels
dfc2c1abe5 added assertion for contiguous memory 2016-08-14 23:38:20 +02:00
Niels
92ee1d56eb cleanup 2016-08-14 21:59:41 +02:00
Niels
4871e39415 spell fix 2016-08-14 17:52:21 +02:00
Niels
7b42c973bd fix for MSVC 2016-08-14 17:34:58 +02:00
Niels
c9e5d56c9c fix for MSVC 2016-08-14 17:30:53 +02:00
Niels
01386b3977 cleanup 2016-08-14 17:23:15 +02:00
Niels
b76f5506d7 added a parser for continguous containers 2016-08-14 14:18:25 +02:00
Niels
03de590372 improved documentation for #289 2016-08-11 20:52:48 +02:00
Niels
37fdcd893d Merge branch 'feature/travis' into develop 2016-08-10 22:50:11 +02:00
Niels
46174879ef clean up 2016-08-10 22:41:09 +02:00
Niels
5db41313ba valgrind + full unit tests takes too long 2016-08-10 21:33:03 +02:00
Niels
1c4ca6d7b1 rubygems -> ruby 2016-08-10 21:00:36 +02:00
Niels
d02e67d4a9 coveralls with lcov 2016-08-10 20:56:26 +02:00
Niels
ce30526ee8 fixed Valgrind call 2016-08-10 19:35:27 +02:00
Niels
efe1d52629 added coverity, coveralls, and valgrind 2016-08-10 18:54:19 +02:00
Niels
a2e923de32 removed clang 3.5.x 2016-08-10 18:38:31 +02:00
Niels
4d90331718 a test 2016-08-10 17:42:33 +02:00
Niels
997bc5d1ab more clang versions 2016-08-10 16:56:05 +02:00
Niels
31963723d3 no directory change 2016-08-10 16:35:57 +02:00
Niels
407e8dbb8e fixed YAML error 2016-08-10 16:25:35 +02:00
Niels
b1c1fe9d39 added Clang 3.8 2016-08-10 16:22:53 +02:00
Niels
b76861dde5 commit to re-fix issue #195 2016-08-09 23:05:42 +02:00
Niels
6150ffb9dc more compilers 2016-08-09 22:49:08 +02:00
Niels
be05dbe618 moved sources 2016-08-09 22:33:31 +02:00
Niels
4b37082e36 more GCC versions 2016-08-09 22:29:01 +02:00
Niels
117fd59abd first try 2016-08-09 22:18:13 +02:00
Niels
ff612e0e39 reverted last commit 2016-08-09 18:33:06 +02:00
Niels
0b34ddd47a another try for coveralls 2016-08-09 18:19:54 +02:00
Niels
fa4fd334b2 accidentially deleted env 2016-08-05 08:56:58 +02:00
Niels
d3c6ed08d6 set build-root 2016-08-05 08:40:42 +02:00
Niels
00046f6ff1 fix for coveralls 2016-08-05 08:18:19 +02:00
Niels
38f562af2a reorganization into smaller test units 2016-08-04 22:51:08 +02:00
Niels
2d3374c8b2 removed codecov 2016-08-04 22:10:30 +02:00
Niels
bd75ef9f27 added check-fast flag 2016-08-04 22:05:16 +02:00
Niels
ff592c6d50 adjusted warning flags 2016-08-04 22:05:05 +02:00
Niels
91b6e223d9 adjusted capacity test cases 2016-08-04 22:04:55 +02:00
Niels
d80329034e split test suite in one file per test case 2016-08-04 21:55:47 +02:00
Niels
3944ecd470 chose correct flags 2016-08-04 07:40:04 +02:00
Niels
be5cf0e3ba forgot to pass CPPFLAGS 2016-08-04 07:33:44 +02:00
Niels
5541e6f6f9 split unit tests 2016-08-04 07:24:46 +02:00
Niels
263e6af48d switch off assertions for benchmarks 2016-07-31 23:03:14 +02:00
Niels
4444ef9396 version bump 2016-07-31 14:39:15 +02:00
Niels
c1a5a30285 Merge branch 'develop' into coverity_scan 2016-07-31 14:38:52 +02:00
Niels
3586767c05 Merge branch 'release/v2.0.2' 2016-07-31 13:37:26 +02:00
Niels
5bab89fb22 Merge branch 'develop' into coverity_scan 2016-07-20 20:27:55 +02:00
Niels
ea19be1736 Merge branch 'develop' into coverity_scan 2016-07-19 22:49:17 +02:00
Niels
8b39570009 Merge branch 'develop' 2016-06-28 21:40:23 +02:00
Niels
e29d6b5f41 Merge branch 'release/2.0.1' 2016-06-28 21:33:43 +02:00
Niels
25ccf7f908 Merge branch 'release/2.0.0' 2016-06-24 00:46:36 +02:00
Niels
3c27678963 Merge branch 'develop' into coverity_scan 2016-06-24 00:28:10 +02:00
Niels
0e90bcb539 Merge branch 'develop' into coverity_scan 2016-06-23 18:28:29 +02:00
Niels
804160e659 Merge branch 'develop' into coverity_scan 2016-06-19 22:39:05 +02:00
Niels
3948021b6c Merge branch 'develop' into coverity_scan 2016-06-19 22:07:16 +02:00
Niels
550475b5e1 Merge branch 'develop' into coverity_scan 2016-06-19 18:33:46 +02:00
Niels
d4ff1bbaec Merge branch 'develop' into coverity_scan 2016-05-29 14:56:36 +02:00
Niels
5666bd0e2d Merge branch 'develop' into coverity_scan 2016-05-29 14:06:54 +02:00
Niels
03db7b0dbb Merge branch 'develop' into coverity_scan 2016-05-29 13:32:48 +02:00
Niels
53603500ed Merge branch 'develop' into coverity_scan 2016-05-29 13:06:40 +02:00
Niels
97ea5ae403 Merge branch 'develop' into coverity_scan 2016-05-29 12:57:30 +02:00
1443 changed files with 180733 additions and 1231322 deletions

17
.cirrus.yml Normal file
View File

@@ -0,0 +1,17 @@
arm_container:
image: gcc:latest
check_task:
check_script:
- wget https://github.com/Kitware/CMake/releases/download/v3.20.2/cmake-3.20.2.tar.gz
- tar xfz cmake-3.20.2.tar.gz
- cd cmake-3.20.2
- ./configure
- make cmake ctest -j4
- cd ..
- mkdir build
- cd build
- ../cmake-3.20.2/bin/cmake .. -DJSON_FastTests=ON
- make -j4
- cd tests
- ../../cmake-3.20.2/bin/ctest -j4

85
.clang-tidy Normal file
View File

@@ -0,0 +1,85 @@
# TODO: The first three checks are only removed to get the CI going. They have to be addressed at some point.
# TODO: portability-avoid-pragma-once: should be fixed eventually
Checks: '*,
-portability-template-virtual-member-function,
-bugprone-use-after-move,
-hicpp-invalid-access-moved,
-altera-id-dependent-backward-branch,
-altera-struct-pack-align,
-altera-unroll-loops,
-android-cloexec-fopen,
-boost-use-ranges,
-bugprone-easily-swappable-parameters,
-cert-err58-cpp,
-clang-analyzer-webkit.NoUncountedMemberChecker,
-concurrency-mt-unsafe,
-cppcoreguidelines-avoid-const-or-ref-data-members,
-cppcoreguidelines-avoid-do-while,
-cppcoreguidelines-avoid-goto,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-avoid-non-const-global-variables,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-pro-bounds-avoid-unchecked-container-access,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-pro-type-reinterpret-cast,
-cppcoreguidelines-pro-type-union-access,
-cppcoreguidelines-rvalue-reference-param-not-moved,
-cppcoreguidelines-virtual-class-destructor,
-fuchsia-default-arguments-calls,
-fuchsia-default-arguments-declarations,
-fuchsia-overloaded-operator,
-google-explicit-constructor,
-google-readability-function-size,
-google-runtime-float,
-google-runtime-int,
-google-runtime-references,
-hicpp-avoid-goto,
-hicpp-explicit-conversions,
-hicpp-function-size,
-hicpp-no-array-decay,
-hicpp-no-assembler,
-hicpp-signed-bitwise,
-hicpp-uppercase-literal-suffix,
-llvm-header-guard,
-llvm-include-order,
-llvm-prefer-static-over-anonymous-namespace,
-llvm-use-ranges,
-llvmlibc-*,
-misc-use-anonymous-namespace,
-misc-confusable-identifiers,
-misc-include-cleaner,
-misc-no-recursion,
-misc-non-private-member-variables-in-classes,
-modernize-concat-nested-namespaces,
-modernize-type-traits,
-modernize-use-constraints,
-modernize-use-designated-initializers,
-modernize-use-nodiscard,
-modernize-use-ranges,
-modernize-use-std-numbers,
-modernize-use-trailing-return-type,
-performance-enum-size,
-portability-avoid-pragma-once,
-readability-function-cognitive-complexity,
-readability-function-size,
-readability-identifier-length,
-readability-magic-numbers,
-readability-redundant-access-specifiers,
-readability-redundant-parentheses,
-readability-simplify-boolean-expr,
-readability-uppercase-literal-suffix,
-readability-use-concise-preprocessor-directives'
CheckOptions:
- key: hicpp-special-member-functions.AllowSoleDefaultDtor
value: 1
WarningsAsErrors: '*'
#HeaderFilterRegex: '.*nlohmann.*'
HeaderFilterRegex: '.*hpp$'

6
.github/CODEOWNERS vendored Normal file
View File

@@ -0,0 +1,6 @@
# JSON for Modern C++ was originally written by Niels Lohmann.
# Since 2013, over 250 contributors have helped to improve the library.
# This CODEOWNERS file is only to make sure that @nlohmann is requested
# for a code review in case of a pull request.
* @nlohmann

132
.github/CODE_OF_CONDUCT.md vendored Normal file
View File

@@ -0,0 +1,132 @@
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official email address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[mail@nlohmann.me](mailto:mail@nlohmann.me).
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series of
actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within the
community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].
[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations

View File

@@ -1,75 +1,225 @@
[![Issue Stats](http://issuestats.com/github/nlohmann/json/badge/pr?style=flat)](http://issuestats.com/github/nlohmann/json) [![Issue Stats](http://issuestats.com/github/nlohmann/json/badge/issue?style=flat)](http://issuestats.com/github/nlohmann/json)
# Contribution Guidelines
# How to contribute
Thank you for your interest in contributing to this project! What began as an exercise to explore the exciting features
of C++11 has evolved into a [widely used](https://json.nlohmann.me/home/customers/) JSON library. I truly appreciate all
the contributions from the community, whether it's proposing features, identifying bugs, or fixing mistakes! To ensure
that our collaboration is efficient and effective, please follow these guidelines.
This project started as a little excuse to exercise some of the cool new C++11 features. Over time, people actually started to use the JSON library (yey!) and started to help improve it by proposing features, finding bugs, or even fixing my mistakes. I am really [thankful](https://github.com/nlohmann/json/blob/master/README.md#thanks) for this and try to keep track of all the helpers.
Feel free to discuss or suggest improvements to this document
[by submitting a pull request](https://github.com/nlohmann/json/edit/develop/.github/CONTRIBUTING.md).
To make it as easy as possible for you to contribute and for me to keep an overview, here are a few guidelines which should help us avoid all kinds of unnecessary work or disappointment. And of course, this document is subject to discussion, so please [create an issue](https://github.com/nlohmann/json/issues/new) or a pull request if you find a way to improve it!
## Ways to Contribute
## Prerequisites
There are multiple ways to contribute.
Please [create an issue](https://github.com/nlohmann/json/issues/new), assuming one does not already exist, and describe your concern. Note you need a [GitHub account](https://github.com/signup/free) for this.
### Reporting an issue
If you want propose changes to the code, you need to download the [`re2c`](http://re2c.org) tool.
## Describe your issue
Please [create an issue](https://github.com/nlohmann/json/issues/new/choose), assuming one does not already exist, and
describe your concern. Note you need a [GitHub account](https://github.com/signup/free) for this.
Clearly describe the issue:
- If it is a bug, please describe how to **reproduce** it. If possible, attach a complete example which demonstrates the error. Please also state what you **expected** to happen instead of the error.
- If you propose a change or addition, try to give an **example** how the improved code could look like or how to use it.
- If you found a compilation error, please tell us which **compiler** (version and operating system) you used and paste the (relevant part of) the error messages to the ticket.
- If it is a bug, please describe how to **reproduce** it. If possible, attach a _complete example_ which demonstrates
the error. Please also state what you **expected** to happen instead of the error.
- If you propose a change or addition, try to give an **example** what the improved code could look like or how to use
it.
- If you found a compilation error, please tell us which **compiler** (version and operating system) you used and paste
the (relevant part of) the error messages to the ticket.
## Files to change
Please stick to the provided issue template
[bug report](https://github.com/nlohmann/json/blob/develop/.github/ISSUE_TEMPLATE/bug.yaml) if possible.
There are currently two files which need to be edited:
### Reporting a security vulnerability
1. [`src/json.hpp.re2c`](https://github.com/nlohmann/json/blob/master/src/json.hpp.re2c) (note the `.re2c` suffix) - This file contains a comment section which describes the JSON lexic. This section is translated by [`re2c`](http://re2c.org) into file [`src/json.hpp`](https://github.com/nlohmann/json/blob/master/src/json.hpp) which is plain "vanilla" C++11 code. (In fact, the generated lexer consists of some hundred lines of `goto`s, which is a hint you never want to edit this file...).
You can report a security vulnerability according to our
[security policy](https://github.com/nlohmann/json/security/policy).
If you only edit file `src/json.hpp` (without the `.re2c` suffix), your changes will be overwritten as soon as the lexer is touched again. To generate the `src/json.hpp` file which is actually used during compilation of the tests and all other code, please execute
### Discussing a new feature
```sh
make re2c
```
For questions, feature or support requests, please
[open a discussion](https://github.com/nlohmann/json/discussions/new). If you find a proposed answer satisfactory,
please use the "Mark as answer" button to make it easier for readers to see what helped and for the community to filter
for open questions.
To run [`re2c`](http://re2c.org) and generate/overwrite file `src/json.hpp` with your changes in file `src/json.hpp.re2c`.
### Proposing a fix or an improvement
Join an ongoing discussion or comment on an existing issue before starting to code. This can help to avoid duplicate
efforts or other frustration during the later review.
2. [`test/src/unit.cpp`](https://github.com/nlohmann/json/blob/master/test/unit.cpp) - This contains the [Catch](https://github.com/philsquared/Catch) unit tests which currently cover [100 %](https://coveralls.io/github/nlohmann/json) of the library's code.
Create a [pull request](https://github.com/nlohmann/json/pulls?q=sort%3Aupdated-desc+is%3Apr+is%3Aopen) against the
`develop` branch and follow the pull request template. In particular,
If you add or change a feature, please also add a unit test to this file. The unit tests can be compiled with
- describe the changes in detail, both the what and why,
- reference existing issues where applicable,
- add tests to maintain 100% test coverage,
- update the documentation as needed, and
- ensure the source code is amalgamated.
```sh
make
```
We describe all points in detail below.
and can be executed with
All contributions (including pull requests) must agree to the
[Developer Certificate of Origin (DCO) version 1.1](https://developercertificate.org). This is exactly the same one
created and used by the Linux kernel developers and posted on http://developercertificate.org/. This is a developer's
certification that he or she has the right to submit the patch for inclusion into the project.
```sh
./json_unit
```
## How to...
The test cases are also executed with several different compilers on [Travis](https://travis-ci.org/nlohmann/json) once you open a pull request.
### Describe your changes
Please understand that I cannot accept pull requests changing only file `src/json.hpp`.
This library is primarily maintained as a spare-time project. As such, I cannot make any guarantee how quickly changes
are merged and released. Therefore, it is very important to make the review as smooth as possible by explaining not only
_what_ you changed, but _why_. This rationale can be very valuable down the road when improvements or bugs are discussed
years later.
### Reference an existing issue
## Note
[Link a pull request to an issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue)
to clarify that a fix is forthcoming and which issue can be closed after merging. Only a few cases (e.g., fixing typos)
do not require prior discussions.
- If you open a pull request, the code will be automatically tested with [Valgrind](http://valgrind.org)'s Memcheck tool to detect memory leaks. Please be aware that the execution with Valgrind _may_ in rare cases yield different behavior than running the code directly. This can result in failing unit tests which run successfully without Valgrind.
### Write tests
## Please don't
The library has an extensive test suite that currently covers [100 %](https://coveralls.io/github/nlohmann/json) of the
library's code. These tests are crucial to maintain API stability and give future contributors confidence that they do
not accidentally break things. As Titus Winters aptly put it:
- Only make changes to file `src/json.hpp` -- please read the paragraph above and understand why `src/json.hpp.re2c` exists.
- The C++11 support varies between different **compilers** and versions. Please note the [list of supported compilers](https://github.com/nlohmann/json/blob/master/README.md#supported-compilers). Some compilers like GCC 4.8 (and earlier), Clang 3.3 (and earlier), or Microsoft Visual Studio 13.0 and earlier are known not to work due to missing or incomplete C++11 support. Please refrain from proposing changes that work around these compiler's limitations with `#ifdef`s or other means.
- Specifically, I am aware of compilation problems with **Microsoft Visual Studio** (there even is an [issue label](https://github.com/nlohmann/json/issues?utf8=✓&q=label%3A%22visual+studio%22+) for these kind of bugs). I understand that even in 2016, complete C++11 support isn't there yet. But please also understand that I do not want to drop features or uglify the code just to make Microsoft's sub-standard compiler happy. The past has shown that there are ways to express the functionality such that the code compiles with the most recent MSVC - unfortunately, this is not the main objective of the project.
- Please refrain from proposing changes that would **break [JSON](http://json.org) conformance**. If you propose a conformant extension of JSON to be supported by the library, please motivate this extension.
- Please do not open pull requests that address **multiple issues**.
> If you liked it, you should have put a test on it.
#### Run the tests
First, ensure the test suite runs before making any changes:
```sh
$ cmake -S. -B build
$ cmake --build build -j 10
$ ctest --test-dir build -j 10
```
The test suite should report:
```
100% tests passed, 0 tests failed out of 98
```
#### Add tests
The tests are located in [`tests/src/unit-*.cpp`](https://github.com/nlohmann/json/tree/develop/tests/src) and contain
[doctest assertions](https://github.com/doctest/doctest/blob/master/doc/markdown/assertions.md) like `CHECK`. The tests
are structured along the features of the library or the nature of the tests. Usually, it should be clear from the
context which existing file needs to be extended, and only very few cases require creating new test files.
When fixing a bug, edit `unit-regression2.cpp` and add a section referencing the fixed issue.
#### Exceptions
When you test exceptions, please use `CHECK_THROWS_WITH_AS` which also takes the `what()` argument of the thrown
exception into account.
#### Coverage
If test coverage decreases, an automatic warning comment will be posted on the pull request. You can access a code
coverage report as an artifact to the “Ubuntu” workflow.
### Update the documentation
The [main documentation](https://json.nlohmann.me) of the library is generated from the files
[`docs/mkdocs/docs`](https://github.com/nlohmann/json/blob/develop/docs/mkdocs/docs). This folder contains dedicated
pages for [certain features](https://github.com/nlohmann/json/tree/develop/docs/mkdocs/docs/features), a list of
[all exceptions](https://github.com/nlohmann/json/blob/develop/docs/mkdocs/docs/home/exceptions.md), and
[extensive API documentation](https://github.com/nlohmann/json/tree/develop/docs/mkdocs/docs/api) with details on every
public API function.
Build the documentation locally using:
```shell
make install_venv -C docs/mkdocs
make serve -C docs/mkdocs
```
The documentation will then be available at <http://127.0.0.1:8000/>. See the documentation of
[mkdocs](https://www.mkdocs.org) and [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/) for more
information.
### Amalgamate the source code
The single-header files
[`single_include/nlohmann/json.hpp`](https://github.com/nlohmann/json/blob/develop/single_include/nlohmann/json.hpp) and
[`single_include/nlohmann/json_fwd.hpp`](https://github.com/nlohmann/json/blob/develop/single_include/nlohmann/json_fwd.hpp)
are **generated** from the source files in the
[`include/nlohmann` directory](https://github.com/nlohmann/json/tree/develop/include/nlohmann). **Do not** edit the
files directly; instead, modify the include/nlohmann sources and regenerate the files by executing:
```shell
make amalgamate
```
Running `make amalgamate` will also apply automatic formatting to the source files using
[`Artistic Style`](https://astyle.sourceforge.net/). This formatting may modify your source files in-place. Be certain to review and commit any changes to avoid unintended formatting diffs in commits.
## Recommended documentation
- The librarys [README file](https://github.com/nlohmann/json/blob/master/README.md) is an excellent starting point to
understand its functionality.
- The [documentation page](https://json.nlohmann.me) is the reference documentation of the library.
- [RFC 8259](https://datatracker.ietf.org/doc/html/rfc8259) is the reference for the JavaScript Object Notation (JSON)
Data Interchange Format.
## Please don't...
Certain contributions are not helpful.
### Break the public API
We take pride in the library being used by
[numerous customers across various industries](https://json.nlohmann.me/home/customers/). They all rely on the
guarantees provided by [semantic versioning](https://semver.org). Please do not change the library such that the public
API of the 3.x.y version is broken. This includes:
- Changing function signatures (altering parameter types, return types, number of parameters) or changing the const-ness
of member functions.
- Removing functions.
- Renaming functions or classes.
- Changing exception handling.
- Changing exception ids.
- Changing access specifiers.
- Changing default arguments.
Although these guidelines may seem restrictive, they are essential for maintaining the librarys utility.
Breaking changes may be introduced when they are guarded with a feature macro such as
[`JSON_USE_IMPLICIT_CONVERSIONS`](https://json.nlohmann.me/api/macros/json_use_implicit_conversions/) which allows
selectively changing the behavior of the library. In next steps, the current behavior can then be deprecated. Using
feature macros then allows users to test their code against the library in the next major release.
### Break C++11 language conformance
This library is designed to work with C++11 and later. This means that any
[supported C++11 compiler](https://github.com/nlohmann/json/blob/master/README.md#supported-compilers) should compile
the library without problems. Some compilers like GCC 4.7 (and earlier), Clang 3.3 (and earlier), or Microsoft Visual
Studio 13.0 and earlier are known not to work due to missing or incomplete C++11 support.
Please do not add features that do not work with the mentioned supported compilers. Please guard features from C++14 and
later against the respective [`JSON_HAS_CPP_14`](https://json.nlohmann.me/api/macros/json_has_cpp_11/) macros.
### Break JSON conformance
Please refrain from proposing changes that would **break [JSON](https://datatracker.ietf.org/doc/html/rfc8259)
conformance**. If you propose a conformant extension of JSON to be supported by the library, please motivate this
extension.
## Wanted
The following areas really need contribution:
The following areas really need contribution and are always welcomed:
- Extending the **continuous integration** toward more exotic compilers such as Android NDK, Intel's Compiler, or the bleeding-edge versions of GCC or Clang.
- Improving the efficiency of the **JSON parser**. The current parser is implemented as a naive recursive descent parser with hand coded string handling. More sophisticated approaches like LALR parsers would be really appreciated. That said, parser generators like Bison or ANTLR do not play nice with single-header files -- I really would like to keep the parser inside the `json.hpp` header, and I am not aware of approaches similar to [`re2c`](http://re2c.org) for parsing.
- Extending and updating existing **benchmarks** to include (the most recent version of) this library. Though efficiency is not everything, speed and memory consumption are very important characteristics for C++ developers, so having proper comparisons would be interesting.
- Extending the **continuous integration** toward more exotic compilers such as Android NDK, Intel's Compiler, or the
bleeding-edge versions Clang.
- Improving the efficiency of the **JSON parser**. The current parser is implemented as a naive recursive descent parser
with hand-coded string handling. More sophisticated approaches like LALR parsers would be really appreciated. That
said, parser generators like Bison or ANTLR do not play nice with single-header files -- I really would like to keep
the parser inside the `json.hpp` header, and I am not aware of approaches similar to [`re2c`](http://re2c.org) for
parsing.
- Extending and updating existing **benchmarks** to include (the most recent version of) this library. Though efficiency
is not everything, speed and memory consumption are very important characteristics for C++ developers, so having
proper comparisons would be interesting.
We look forward to your contributions and collaboration to enhance the library!

2
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,2 @@
github: nlohmann
custom: https://paypal.me/nlohmann

95
.github/ISSUE_TEMPLATE/bug.yaml vendored Normal file
View File

@@ -0,0 +1,95 @@
name: Bug Report
description: Create a bug report
labels:
- 'kind: bug'
body:
- type: markdown
attributes:
value: >
Thanks for taking the time to fill out this bug report!
Make sure you give it a short and specific **title** so that the report
is searchable and uniquely identifiable.
Note that this form is for bug reports only. Please
[open a discussion](https://github.com/nlohmann/json/discussions/new)
for questions, feature requests, or support requests.
**Please check the [FAQ](https://json.nlohmann.me/home/faq/) before
reporting an issue.** Common questions are answered there.
- type: textarea
id: summary
attributes:
label: Description
description: >
Please provide an abstract description of the issue to the developers,
and why you consider it to be a bug. Please include any specific links
to the documentation, JSON specification, or code.
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: Reproduction steps
description: >
How do you trigger the bug? Please walk us through step by step. Be as
specific as possible.
validations:
required: true
- type: textarea
id: results
attributes:
label: Expected vs. actual results
description: >
Please describe what you expected to happen after the steps above and
what actually happened.
validations:
required: true
- type: textarea
id: code
attributes:
label: Minimal code example
description: >
If possible, provide a small and self-contained example that triggers
the bug. Please understand that we cannot analyze and debug large code
bases. Please do not paste screenshots here.
render: Shell
- type: textarea
id: output
attributes:
label: Error messages
description: >
Please provide any kind of error output (compilation errors, exception
messages, stack traces, etc.) which can help to diagnose the error.
render: Shell
- type: input
id: compiler
attributes:
label: Compiler and operating system
description: >
On which operating systems and compilers have you observed the issue?
Include as many relevant details about the environment you experienced
the bug in. Make sure you use a
[supported compiler](https://github.com/nlohmann/json#supported-compilers).
validations:
required: true
- type: input
id: version
attributes:
label: Library version
description: >
Which version of the library did you use? If it is a released version,
please enter the version number (e.g., 3.12.0). Otherwise, please enter
the commit hash. If you got the library from another source as the
GitHub repository (e.g., via a package manager), please also state
this.
validations:
required: true
- type: checkboxes
id: validation
attributes:
label: Validation
description: >
Please check these additional steps:
options:
- label: The bug also occurs if the latest version from the [`develop`](https://github.com/nlohmann/json/tree/develop) branch is used.
- label: I can successfully [compile and run the unit tests](https://github.com/nlohmann/json#execute-unit-tests).

5
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Ask a question
url: https://github.com/nlohmann/json/discussions
about: Ask questions and discuss with other community members

View File

@@ -1,46 +1,9 @@
[Describe your pull request here. Please read the text below the line and make sure you follow the checklist.]
## Files to change
- [ ] The changes are described in detail, both the what and why.
- [ ] If applicable, an [existing issue](https://github.com/nlohmann/json/issues) is referenced.
- [ ] The [Code coverage](https://coveralls.io/github/nlohmann/json) remained at 100%. A test case for every new line of code.
- [ ] If applicable, the [documentation](https://json.nlohmann.me) is updated.
- [ ] The source code is amalgamated by running `make amalgamate`.
There are currently two files which need to be edited:
1. [`src/json.hpp.re2c`](https://github.com/nlohmann/json/blob/master/src/json.hpp.re2c) (note the `.re2c` suffix) - This file contains a comment section which describes the JSON lexic. This section is translated by [`re2c`](http://re2c.org) into file [`src/json.hpp`](https://github.com/nlohmann/json/blob/master/src/json.hpp) which is plain "vanilla" C++11 code. (In fact, the generated lexer consists of some hundred lines of `goto`s, which is a hint you never want to edit this file...).
If you only edit file `src/json.hpp` (without the `.re2c` suffix), your changes will be overwritten as soon as the lexer is touched again. To generate the `src/json.hpp` file which is actually used during compilation of the tests and all other code, please execute
```sh
make re2c
```
To run [`re2c`](http://re2c.org) and generate/overwrite file `src/json.hpp` with your changes in file `src/json.hpp.re2c`.
2. [`test/src/unit.cpp`](https://github.com/nlohmann/json/blob/master/test/unit.cpp) - This contains the [Catch](https://github.com/philsquared/Catch) unit tests which currently cover [100 %](https://coveralls.io/github/nlohmann/json) of the library's code.
If you add or change a feature, please also add a unit test to this file. The unit tests can be compiled with
```sh
make
```
and can be executed with
```sh
./json_unit
```
The test cases are also executed with several different compilers on [Travis](https://travis-ci.org/nlohmann/json) once you open a pull request.
Please understand that I cannot accept pull requests changing only file `src/json.hpp`.
## Note
- If you open a pull request, the code will be automatically tested with [Valgrind](http://valgrind.org)'s Memcheck tool to detect memory leaks. Please be aware that the execution with Valgrind _may_ in rare cases yield different behavior than running the code directly. This can result in failing unit tests which run successfully without Valgrind.
## Please don't
- Only make changes to file `src/json.hpp` -- please read the paragraph above and understand why `src/json.hpp.re2c` exists.
- The C++11 support varies between different **compilers** and versions. Please note the [list of supported compilers](https://github.com/nlohmann/json/blob/master/README.md#supported-compilers). Some compilers like GCC 4.8 (and earlier), Clang 3.3 (and earlier), or Microsoft Visual Studio 13.0 and earlier are known not to work due to missing or incomplete C++11 support. Please refrain from proposing changes that work around these compiler's limitations with `#ifdef`s or other means.
- Specifically, I am aware of compilation problems with **Microsoft Visual Studio** (there even is an [issue label](https://github.com/nlohmann/json/issues?utf8=✓&q=label%3A%22visual+studio%22+) for these kind of bugs). I understand that even in 2016, complete C++11 support isn't there yet. But please also understand that I do not want to drop features or uglify the code just to make Microsoft's sub-standard compiler happy. The past has shown that there are ways to express the functionality such that the code compiles with the most recent MSVC - unfortunately, this is not the main objective of the project.
- Please refrain from proposing changes that would **break [JSON](http://json.org) conformance**. If you propose a conformant extension of JSON to be supported by the library, please motivate this extension.
- Please do not open pull requests that address **multiple issues**.
Read the [Contribution Guidelines](https://github.com/nlohmann/json/blob/develop/.github/CONTRIBUTING.md) for detailed information.

25
.github/SECURITY.md vendored Normal file
View File

@@ -0,0 +1,25 @@
# Security Policy
## Reporting a Vulnerability
We value the security of our users and appreciate your efforts to responsibly disclose vulnerabilities. If you have
identified a security vulnerability in this repository, please use the GitHub Security Advisory
["Report a Vulnerability"](https://github.com/nlohmann/json/security/advisories/new) tab.
Until it is published, this draft security advisory will only be visible to the maintainers of this project. Other
users and teams may be added once the advisory is created.
We will send a response indicating the next steps in handling your report. After the initial reply to your report, we
will keep you informed of the progress towards a fix and full announcement and may ask for additional information or
guidance.
For vulnerabilities in third-party dependencies or modules, please report them directly to the respective maintainers.
## Additional Resources
- Explore security-related topics and contribute to tools and projects through
[GitHub Security Lab](https://securitylab.github.com/).
- Learn more about responsible disclosure and reporting vulnerabilities in GitHub at
[About coordinated disclosure of security vulnerabilities](https://docs.github.com/en/code-security/repository-security-advisories/about-coordinated-disclosure-of-security-vulnerabilities).
We sincerely thank you for contributing to the security and integrity of this project!

22
.github/config.yml vendored Normal file
View File

@@ -0,0 +1,22 @@
# Configuration for sentiment-bot - https://github.com/behaviorbot/sentiment-bot
# *Required* toxicity threshold between 0 and .99 with the higher numbers being the most toxic
# Anything higher than this threshold will be marked as toxic and commented on
sentimentBotToxicityThreshold: .7
# *Required* Comment to reply with
sentimentBotReplyComment: >
Please be sure to review the [code of conduct](https://github.com/nlohmann/json/blob/develop/.github/CODE_OF_CONDUCT.md) and be respectful of other users. cc/ @nlohmann
# Configuration for request-info - https://github.com/behaviorbot/request-info
# *Required* Comment to reply with
requestInfoReplyComment: >
We would appreciate it if you could provide us with more info about this issue or pull request! Please check the [issue template](https://github.com/nlohmann/json/blob/develop/.github/ISSUE_TEMPLATE.md) and the [pull request template](https://github.com/nlohmann/json/blob/develop/.github/PULL_REQUEST_TEMPLATE.md).
# *OPTIONAL* Label to be added to Issues and Pull Requests with insufficient information given
requestInfoLabelToAdd: "state: needs more info"
checkIssueTemplate: true
checkPullRequestTemplate: true

31
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,31 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
- package-ecosystem: pip
directory: /docs/mkdocs
schedule:
interval: daily
- package-ecosystem: pip
directory: /tools/astyle
schedule:
interval: daily
- package-ecosystem: pip
directory: /tools/generate_natvis
schedule:
interval: daily
- package-ecosystem: pip
directory: /tools/serve_header
schedule:
interval: daily
- package-ecosystem: pip
directory: /cmake/requirements
schedule:
interval: daily

91
.github/external_ci/appveyor.yml vendored Normal file
View File

@@ -0,0 +1,91 @@
version: '{build}'
# only build PRs and commits to develop branch
# (see https://help.appveyor.com/discussions/questions/55079-two-builds-per-commit-to-pull-request)
branches:
only:
- develop
only_commits:
files:
- .github/external_ci/appveyor.yml
- cmake/
- include/
- tests/
- CMakeLists.txt
environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
configuration: Debug
platform: x86
CXX_FLAGS: "/W4 /WX"
CMAKE_OPTIONS: ""
GENERATOR: Visual Studio 14 2015
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
configuration: Release
platform: x86
CXX_FLAGS: "/W4 /WX"
CMAKE_OPTIONS: ""
GENERATOR: Visual Studio 14 2015
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
configuration: Release
platform: x86
name: with_win_header
CXX_FLAGS: "/W4 /WX"
CMAKE_OPTIONS: ""
GENERATOR: Visual Studio 14 2015
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
configuration: Release
platform: x86
CXX_FLAGS: "/permissive- /std:c++17 /utf-8 /W4 /WX"
CMAKE_OPTIONS: ""
GENERATOR: Visual Studio 15 2017
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
configuration: Release
platform: x86
CXX_FLAGS: "/W4 /WX"
CMAKE_OPTIONS: "-DJSON_ImplicitConversions=OFF"
GENERATOR: Visual Studio 16 2019
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
configuration: Release
platform: x64
CXX_FLAGS: "/W4 /WX"
CMAKE_OPTIONS: ""
GENERATOR: Visual Studio 14 2015
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
configuration: Release
platform: x64
CXX_FLAGS: "/permissive- /std:c++17 /Zc:__cplusplus /utf-8 /W4 /WX"
CMAKE_OPTIONS: ""
GENERATOR: Visual Studio 15 2017
init:
- cmake --version
- msbuild /version
install:
- if "%platform%"=="x86" set GENERATOR_PLATFORM=Win32
before_build:
# for with_win_header build, inject the inclusion of Windows.h to the single-header library
- ps: if ($env:name -Eq "with_win_header") { $header_path = "single_include\nlohmann\json.hpp" }
- ps: if ($env:name -Eq "with_win_header") { "#include <Windows.h>`n" + (Get-Content $header_path | Out-String) | Set-Content $header_path }
- cmake . -G "%GENERATOR%" -A "%GENERATOR_PLATFORM%" -DCMAKE_CXX_FLAGS="%CXX_FLAGS%" -DCMAKE_IGNORE_PATH="C:/Program Files/Git/usr/bin" -DJSON_BuildTests=On "%CMAKE_OPTIONS%"
build_script:
- cmake --build . --config "%configuration%" --parallel 2
test_script:
- if "%configuration%"=="Release" ctest -C "%configuration%" --parallel 2 --output-on-failure
# On Debug builds, skip test-unicode_all
# as it is extremely slow to run and cause
# occasional timeouts on AppVeyor.
# More info: https://github.com/nlohmann/json/pull/1570
- if "%configuration%"=="Debug" ctest --exclude-regex "test-unicode" -C "%configuration%" --parallel 2 --output-on-failure

38
.github/labeler.yml vendored Normal file
View File

@@ -0,0 +1,38 @@
version: 1
labels:
- label: "documentation"
files:
- "README.md"
- label: "documentation"
files:
- "docs/.*"
- label: "tests"
files:
- "tests/.*"
- label: "CMake"
files:
- ".*CMakeLists.txt"
- label: "CMake"
files:
- "cmake/.*"
- label: "CI"
files:
- "github/workflows/.*"
- label: "CI"
files:
- "github/external_ci/.*"
- label: "S"
size-below: 10
- label: "M"
size-above: 9
size-below: 100
- label: "L"
size-above: 100

View File

@@ -0,0 +1,76 @@
name: "Check amalgamation"
on:
pull_request:
permissions:
contents: read
jobs:
save:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- name: Save PR number
run: |
mkdir -p ./pr
echo ${{ github.event.number }} > ./pr/number
echo ${{ github.event.pull_request.user.login }} > ./pr/author
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: pr
path: pr/
check:
runs-on: ubuntu-latest
env:
MAIN_DIR: ${{ github.workspace }}/main
INCLUDE_DIR: ${{ github.workspace }}/main/single_include/nlohmann
TOOL_DIR: ${{ github.workspace }}/tools/tools/amalgamate
steps:
- name: Harden Runner
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- name: Checkout pull request
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
path: main
ref: ${{ github.event.pull_request.head.sha }}
- name: Checkout tools
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
path: tools
ref: develop
- name: Install astyle
run: |
python3 -mvenv venv
venv/bin/pip3 install -r $MAIN_DIR/tools/astyle/requirements.txt
- name: Check amalgamation
run: |
cd $MAIN_DIR
rm -fr $INCLUDE_DIR/json.hpp~ $INCLUDE_DIR/json_fwd.hpp~
cp $INCLUDE_DIR/json.hpp $INCLUDE_DIR/json.hpp~
cp $INCLUDE_DIR/json_fwd.hpp $INCLUDE_DIR/json_fwd.hpp~
python3 $TOOL_DIR/amalgamate.py -c $TOOL_DIR/config_json.json -s .
python3 $TOOL_DIR/amalgamate.py -c $TOOL_DIR/config_json_fwd.json -s .
echo "Format (1)"
${{ github.workspace }}/venv/bin/astyle --project=tools/astyle/.astylerc --suffix=none --quiet $INCLUDE_DIR/json.hpp $INCLUDE_DIR/json_fwd.hpp
diff $INCLUDE_DIR/json.hpp~ $INCLUDE_DIR/json.hpp
diff $INCLUDE_DIR/json_fwd.hpp~ $INCLUDE_DIR/json_fwd.hpp
${{ github.workspace }}/venv/bin/astyle --project=tools/astyle/.astylerc --suffix=orig $(find docs/examples include tests -type f \( -name '*.hpp' -o -name '*.cpp' -o -name '*.cu' \) -not -path 'tests/thirdparty/*' -not -path 'tests/abi/include/nlohmann/*' | sort)
echo Check
find $MAIN_DIR -name '*.orig' -exec false {} \+

35
.github/workflows/cifuzz.yml vendored Normal file
View File

@@ -0,0 +1,35 @@
name: CIFuzz
on: [pull_request]
permissions:
contents: read
jobs:
Fuzzing:
runs-on: ubuntu-22.04
steps:
- name: Harden Runner
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- name: Build Fuzzers
id: build
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
with:
oss-fuzz-project-name: 'json'
dry-run: false
language: c++
- name: Run Fuzzers
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
with:
oss-fuzz-project-name: 'json'
fuzz-seconds: 300
dry-run: false
language: c++
- name: Upload Crash
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
if: failure() && steps.build.outcome == 'success'
with:
name: artifacts
path: ./out/artifacts

49
.github/workflows/codeql-analysis.yml vendored Normal file
View File

@@ -0,0 +1,49 @@
name: "Code scanning - action"
on:
push:
branches:
- develop
- master
- release/*
pull_request:
schedule:
- cron: '0 19 * * 1'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
jobs:
CodeQL-Build:
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@9e907b5e64f6b83e7804b09294d44122997950d6 # v4.32.3
with:
languages: c-cpp
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@9e907b5e64f6b83e7804b09294d44122997950d6 # v4.32.3
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@9e907b5e64f6b83e7804b09294d44122997950d6 # v4.32.3

View File

@@ -0,0 +1,81 @@
name: Comment Check Amalgamation
on:
workflow_run:
workflows: ["Check amalgamation"]
types:
- completed
permissions:
contents: read
jobs:
comment:
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
runs-on: ubuntu-latest
permissions:
contents: read
actions: read
issues: read
pull-requests: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- name: 'Download artifact'
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
script: |
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{github.event.workflow_run.id }},
});
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "pr"
})[0];
var download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
var fs = require('fs');
fs.writeFileSync('${{github.workspace}}/pr.zip', Buffer.from(download.data));
- run: unzip pr.zip
- name: 'Comment on PR'
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
var fs = require('fs');
const author = fs.readFileSync('./author')
const issue_number = Number(fs.readFileSync('./number'));
const opts = github.rest.issues.listForRepo.endpoint.merge({
owner: context.repo.owner,
repo: context.repo.repo,
creator: author,
state: 'all'
})
let first = true
const issues = await github.paginate(opts)
for (const issue of issues) {
if (issue.number === issue_number) {
continue
}
if (issue.pull_request) {
first = false
break
}
}
await github.rest.issues.createComment({
issue_number: issue_number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '## 🔴 Amalgamation check failed! 🔴\nThe source code has not been amalgamated.'
+ (first ? ' @' + author + ' Please read and follow the [Contribution Guidelines]'
+ '(https://github.com/nlohmann/json/blob/develop/.github/CONTRIBUTING.md#files-to-change).'
: '')
})

27
.github/workflows/dependency-review.yml vendored Normal file
View File

@@ -0,0 +1,27 @@
# Dependency Review Action
#
# This Action will scan dependency manifest files that change as part of a Pull Request,
# surfacing known-vulnerable versions of the packages declared or updated in the PR.
# Once installed, if the workflow run is marked as required,
# PRs introducing known-vulnerable packages will be blocked from merging.
#
# Source repository: https://github.com/actions/dependency-review-action
name: 'Dependency Review'
on: [pull_request]
permissions:
contents: read
jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- name: 'Checkout Repository'
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: 'Dependency Review'
uses: actions/dependency-review-action@3c4e3dcb1aa7874d2c16be7d79418e9b7efd6261 # v4.8.2

46
.github/workflows/flawfinder.yml vendored Normal file
View File

@@ -0,0 +1,46 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: flawfinder
permissions:
contents: read
on:
push:
branches: [ "develop" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "develop" ]
schedule:
- cron: '41 14 * * 3'
jobs:
flawfinder:
name: Flawfinder
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: flawfinder_scan
uses: david-a-wheeler/flawfinder@c57197cd6061453f10a496f30a732bc1905918d1 # v2.0.19
with:
arguments: '--sarif ./'
output: 'flawfinder_results.sarif'
- name: Upload analysis results to GitHub Security tab
uses: github/codeql-action/upload-sarif@9e907b5e64f6b83e7804b09294d44122997950d6 # v4
with:
sarif_file: ${{github.workspace}}/flawfinder_results.sarif

26
.github/workflows/labeler.yml vendored Normal file
View File

@@ -0,0 +1,26 @@
name: "Pull Request Labeler"
on:
pull_request_target:
types: [opened, synchronize]
permissions:
contents: read
jobs:
label:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- uses: srvaroa/labeler@471cdb892ebac76de6cb869105a2017fa3b9b9b3 # master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

121
.github/workflows/macos.yml vendored Normal file
View File

@@ -0,0 +1,121 @@
name: macOS
on:
push:
branches:
- develop
- master
- release/*
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
jobs:
# macos-11 is deprecated
# macos-11:
# runs-on: macos-11
# strategy:
# matrix:
# xcode: ['11.7', '12.4', '12.5.1', '13.0']
# env:
# DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
#
# steps:
# - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
# - name: Run CMake
# run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On -DJSON_FastTests=ON
# - name: Build
# run: cmake --build build --parallel 10
# - name: Test
# run: cd build ; ctest -j 10 --output-on-failure
# macos-12 is deprecated (https://github.com/actions/runner-images/issues/10721)
# macos-12:
# runs-on: macos-12 # https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md
# strategy:
# matrix:
# xcode: ['13.1', '13.2.1', '13.3.1', '13.4.1', '14.0', '14.0.1', '14.1']
# env:
# DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
#
# steps:
# - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
# - name: Run CMake
# run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On -DJSON_FastTests=ON
# - name: Build
# run: cmake --build build --parallel 10
# - name: Test
# run: cd build ; ctest -j 10 --output-on-failure
# macos-13 is deprecated (https://github.com/actions/runner-images/issues/13046)
# macos-13:
# runs-on: macos-13 # https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md
# strategy:
# matrix:
# xcode: ['14.1', '14.2', '14.3', '14.3.1', '15.0.1', '15.1', '15.2']
# env:
# DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
#
# steps:
# - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
# - name: Run CMake
# run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On -DJSON_FastTests=ON
# - name: Build
# run: cmake --build build --parallel 10
# - name: Test
# run: cd build ; ctest -j 10 --output-on-failure
macos-14:
runs-on: macos-14 # https://github.com/actions/runner-images/blob/main/images/macos/macos-14-Readme.md
strategy:
matrix:
xcode: ['15.0.1', '15.1', '15.2', '15.3', '15.4']
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Run CMake
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On -DJSON_FastTests=ON
- name: Build
run: cmake --build build --parallel 10
- name: Test
run: cd build ; ctest -j 10 --output-on-failure
macos-15:
runs-on: macos-15 # https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md
strategy:
matrix:
xcode: ['16.0', '16.1', '16.2', '16.3', '16.4', '26.0.1']
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Run CMake
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On -DJSON_FastTests=ON
- name: Build
run: cmake --build build --parallel 10
- name: Test
run: cd build ; ctest -j 10 --output-on-failure
xcode_standards:
runs-on: macos-latest
strategy:
matrix:
standard: [11, 14, 17, 20, 23, 26]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Run CMake
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On -DJSON_TestStandards=${{ matrix.standard }}
- name: Build
run: cmake --build build --parallel 10
- name: Test
run: cd build ; ctest -j 10 --output-on-failure

View File

@@ -0,0 +1,46 @@
name: Publish documentation
# publish the documentation on every merge to develop branch
on:
push:
branches:
- develop
paths:
- docs/mkdocs/**
- docs/examples/**
workflow_dispatch:
# we don't want to have concurrent jobs, and we don't want to cancel running jobs to avoid broken publications
concurrency:
group: documentation
cancel-in-progress: false
permissions:
contents: read
jobs:
publish_documentation:
permissions:
contents: write
if: github.repository == 'nlohmann/json'
runs-on: ubuntu-22.04
steps:
- name: Harden Runner
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install virtual environment
run: make install_venv -C docs/mkdocs
- name: Build documentation
run: make build -C docs/mkdocs
- name: Deploy documentation
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/mkdocs/site

81
.github/workflows/scorecards.yml vendored Normal file
View File

@@ -0,0 +1,81 @@
# This workflow uses actions that are not certified by GitHub. They are provided
# by a third-party and are governed by separate terms of service, privacy
# policy, and support documentation.
name: Scorecard supply-chain security
on:
# For Branch-Protection check. Only the default branch is supported. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
branch_protection_rule:
# To guarantee Maintained check is occasionally updated. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
schedule:
- cron: '20 7 * * 2'
push:
branches: ["develop"]
permissions:
contents: read
jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-latest
permissions:
# Needed to upload the results to code-scanning dashboard.
security-events: write
# Needed to publish results and get a badge (see publish_results below).
id-token: write
contents: read
actions: read
# To allow GraphQL ListCommits to work
issues: read
pull-requests: read
# To detect SAST tools
checks: read
steps:
- name: Harden Runner
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- name: "Checkout code"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: "Run analysis"
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
with:
results_file: results.sarif
results_format: sarif
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
# - you want to enable the Branch-Protection check on a *public* repository, or
# - you are installing Scorecards on a *private* repository
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat.
# repo_token: ${{ secrets.SCORECARD_TOKEN }}
# Public repositories:
# - Publish results to OpenSSF REST API for easy access by consumers
# - Allows the repository to include the Scorecard badge.
# - See https://github.com/ossf/scorecard-action#publishing-results.
# For private repositories:
# - `publish_results` will always be set to `false`, regardless
# of the value entered here.
publish_results: true
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: SARIF file
path: results.sarif
retention-days: 5
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@9e907b5e64f6b83e7804b09294d44122997950d6 # v4.32.3
with:
sarif_file: results.sarif

54
.github/workflows/semgrep.yml vendored Normal file
View File

@@ -0,0 +1,54 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow file requires a free account on Semgrep.dev to
# manage rules, file ignores, notifications, and more.
#
# See https://semgrep.dev/docs
name: Semgrep
on:
push:
branches: [ "develop" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "develop" ]
schedule:
- cron: '23 2 * * 4'
permissions:
contents: read
jobs:
semgrep:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
name: Scan
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
# Checkout project source
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
# Scan code using project's configuration on https://semgrep.dev/manage
- uses: returntocorp/semgrep-action@713efdd345f3035192eaa63f56867b88e63e4e5d
with:
publishToken: ${{ secrets.SEMGREP_APP_TOKEN }}
publishDeployment: ${{ secrets.SEMGREP_DEPLOYMENT_ID }}
generateSarif: "1"
# Upload SARIF file generated in previous step
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@9e907b5e64f6b83e7804b09294d44122997950d6 # v4
with:
sarif_file: semgrep.sarif
if: always()

34
.github/workflows/stale.yml vendored Normal file
View File

@@ -0,0 +1,34 @@
name: 'Comment and close stale issues and PR'
on:
schedule:
- cron: '0 0 * * *'
permissions:
contents: read
jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- uses: actions/stale@997185467fa4f803885201cee163a9f38240193d # v10.1.1
with:
stale-issue-label: 'state: stale'
stale-pr-label: 'state: stale'
exempt-issue-labels: 'pinned,security'
stale-issue-message: 'This issue has been marked as stale because it has been open for 90 days without activity. If this issue is still relevant, please add a comment or remove the "stale" label. Otherwise, it will be closed in 10 days. Thank you for helping us prioritize our work!'
stale-pr-message: 'This pull request has been marked as stale because it has had no activity for 30 days. While we wont close it automatically, we encourage you to update or comment if it is still relevant. Keeping pull requests active and up-to-date helps us review and merge changes more efficiently. Thank you for your contributions!'
close-issue-message: 'This issue has been closed after being marked as stale for 10 days without any further activity. If this was done in error or the issue is still relevant, please feel free to reopen it or create a new issue. We appreciate your understanding and contributions.'
days-before-stale: 90
days-before-pr-stale: 30
days-before-close: 10
days-before-pr-close: -1

283
.github/workflows/ubuntu.yml vendored Normal file
View File

@@ -0,0 +1,283 @@
name: Ubuntu
on:
push:
branches:
- develop
- master
- release/*
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true
jobs:
ci_test_gcc:
runs-on: ubuntu-latest
container: gcc:latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Get latest CMake and ninja
uses: lukka/get-cmake@dc05ee1ee5ba69770230c73a6a4e947595745cab # v4.2.2
- name: Run CMake
run: cmake -S . -B build -DJSON_CI=On
- name: Build
run: cmake --build build --target ci_test_gcc
ci_infer:
runs-on: ubuntu-latest
container: ghcr.io/nlohmann/json-ci:v2.4.0
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Run CMake
run: cmake -S . -B build -DJSON_CI=On
- name: Build
run: cmake --build build --target ci_infer
ci_static_analysis_ubuntu:
runs-on: ubuntu-latest
strategy:
matrix:
target: [ci_test_amalgamation, ci_test_single_header, ci_cppcheck, ci_cpplint, ci_reproducible_tests, ci_non_git_tests, ci_offline_testdata, ci_reuse_compliance, ci_test_valgrind]
steps:
- name: Harden Runner
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- name: Install Valgrind
run: sudo apt-get update ; sudo apt-get install -y valgrind
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Get latest CMake and ninja
uses: lukka/get-cmake@dc05ee1ee5ba69770230c73a6a4e947595745cab # v4.2.2
- name: Run CMake
run: cmake -S . -B build -DJSON_CI=On
- name: Build
run: cmake --build build --target ${{ matrix.target }}
ci_static_analysis_clang:
runs-on: ubuntu-latest
container: silkeh/clang:dev
strategy:
matrix:
target: [ci_test_clang, ci_clang_tidy, ci_test_clang_sanitizer, ci_clang_analyze, ci_single_binaries]
steps:
- name: Install git, clang-tools, iwyu (ci_single_binaries), and unzip
run: apt-get update ; apt-get install -y git clang-tools iwyu unzip
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Get latest CMake and ninja
uses: lukka/get-cmake@dc05ee1ee5ba69770230c73a6a4e947595745cab # v4.2.2
- name: Run CMake
run: cmake -S . -B build -DJSON_CI=On
- name: Build
run: cmake --build build --target ${{ matrix.target }}
ci_cmake_options:
runs-on: ubuntu-latest
container: ubuntu:focal
strategy:
matrix:
target: [ci_cmake_flags, ci_test_diagnostics, ci_test_diagnostic_positions, ci_test_noexceptions, ci_test_noimplicitconversions, ci_test_legacycomparison, ci_test_noglobaludls]
steps:
- name: Install build-essential
run: apt-get update ; apt-get install -y build-essential unzip wget git libssl-dev
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Get latest CMake and ninja
uses: lukka/get-cmake@dc05ee1ee5ba69770230c73a6a4e947595745cab # v4.2.2
- name: Run CMake
run: cmake -S . -B build -DJSON_CI=On
- name: Build
run: cmake --build build --target ${{ matrix.target }}
ci_test_coverage:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- 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
run: cmake -S . -B build -DJSON_CI=On
- name: Build
run: cmake --build build --target ci_test_coverage
- name: Archive coverage report
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: code-coverage-report
path: ${{ github.workspace }}/build/html
- name: Publish report to Coveralls
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ${{ github.workspace }}/build/json.info.filtered.noexcept
fail-on-error: false
ci_test_compilers_gcc_old:
runs-on: ubuntu-latest
strategy:
matrix:
compiler: ['4.8', '4.9', '5', '6']
container: ghcr.io/nlohmann/json-ci:v2.4.0
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Run CMake
run: CXX=g++-${{ matrix.compiler }} cmake -S . -B build -DJSON_CI=On
- name: Build
run: cmake --build build --target ci_test_compiler_g++-${{ matrix.compiler }}
ci_test_compilers_gcc:
runs-on: ubuntu-latest
strategy:
matrix:
# older GCC docker images (4, 5, 6) fail to check out code
compiler: ['7', '8', '9', '10', '11', '12', '13', '14', '15', 'latest']
container: gcc:${{ matrix.compiler }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Get latest CMake and ninja
uses: lukka/get-cmake@dc05ee1ee5ba69770230c73a6a4e947595745cab # v4.2.2
- name: Run CMake
run: cmake -S . -B build -DJSON_CI=On
- name: Build
run: cmake --build build --target ci_test_compiler_default
ci_test_compilers_clang:
runs-on: ubuntu-latest
strategy:
matrix:
compiler: ['3.4', '3.5', '3.6', '3.7', '3.8', '3.9', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15-bullseye', '16', '17', '18', '19', '20', 'latest']
container: silkeh/clang:${{ matrix.compiler }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Get latest CMake and ninja
uses: lukka/get-cmake@dc05ee1ee5ba69770230c73a6a4e947595745cab # v4.2.2
- name: Set env FORCE_STDCPPFS_FLAG for clang 7 / 8 / 9 / 10
run: echo "JSON_FORCED_GLOBAL_COMPILE_OPTIONS=-DJSON_HAS_FILESYSTEM=0;-DJSON_HAS_EXPERIMENTAL_FILESYSTEM=0" >> "$GITHUB_ENV"
if: ${{ matrix.compiler == '7' || matrix.compiler == '8' || matrix.compiler == '9' || matrix.compiler == '10' }}
- name: Run CMake
run: cmake -S . -B build -DJSON_CI=On
- name: Build
run: cmake --build build --target ci_test_compiler_default
ci_test_standards_gcc:
runs-on: ubuntu-latest
container: gcc:latest
strategy:
matrix:
standard: [11, 14, 17, 20, 23, 26]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Get latest CMake and ninja
uses: lukka/get-cmake@dc05ee1ee5ba69770230c73a6a4e947595745cab # v4.2.2
- name: Run CMake
run: cmake -S . -B build -DJSON_CI=On
- name: Build
run: cmake --build build --target ci_test_gcc_cxx${{ matrix.standard }}
ci_test_standards_clang:
runs-on: ubuntu-latest
container: silkeh/clang:latest
strategy:
matrix:
standard: [11, 14, 17, 20, 23, 26]
stdlib: [libcxx, libstdcxx]
steps:
- name: Install git and unzip
run: apt-get update ; apt-get install -y git unzip
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Get latest CMake and ninja
uses: lukka/get-cmake@dc05ee1ee5ba69770230c73a6a4e947595745cab # v4.2.2
- name: Run CMake
run: cmake -S . -B build -DJSON_CI=On
- name: Build with libc++
run: cmake --build build --target ci_test_clang_libcxx_cxx${{ matrix.standard }}
if: ${{ matrix.stdlib == 'libcxx' }}
- name: Build with libstdc++
run: cmake --build build --target ci_test_clang_cxx${{ matrix.standard }}
if: ${{ matrix.stdlib == 'libstdcxx' }}
ci_cuda_example:
runs-on: ubuntu-latest
container: ghcr.io/nlohmann/json-ci:v2.4.0
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Run CMake
run: cmake -S . -B build -DJSON_CI=On
- name: Build
run: cmake --build build --target ci_cuda_example
ci_module_cpp20:
strategy:
matrix:
container: ['gcc:latest', 'silkeh/clang:latest']
runs-on: ubuntu-latest
container: ${{ matrix.container }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Get latest CMake and ninja
uses: lukka/get-cmake@dc05ee1ee5ba69770230c73a6a4e947595745cab # v4.2.2
- name: Run CMake
run: cmake -S . -B build -DJSON_CI=On
- name: Build
run: cmake --build build --target ci_module_cpp20
ci_icpc:
runs-on: ubuntu-latest
container: ghcr.io/nlohmann/json-ci:v2.2.0
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Run CMake
run: cmake -S . -B build -DJSON_CI=On
- name: Build
run: |
. /opt/intel/oneapi/setvars.sh
cmake --build build --target ci_icpc
ci_emscripten:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- name: Install emscripten
uses: mymindstorm/setup-emsdk@6ab9eb1bda2574c4ddb79809fc9247783eaf9021 # v14
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Get latest CMake and ninja
uses: lukka/get-cmake@dc05ee1ee5ba69770230c73a6a4e947595745cab # v4.2.2
- name: Run CMake
run: cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -GNinja
- name: Build
run: cmake --build build
ci_test_documentation:
runs-on: ubuntu-latest
strategy:
matrix:
target: [ci_test_examples, ci_test_build_documentation]
steps:
- name: Harden Runner
uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Run CMake
run: cmake -S . -B build -DJSON_CI=On
- name: Build
run: cmake --build build --target ${{ matrix.target }}

124
.github/workflows/windows.yml vendored Normal file
View File

@@ -0,0 +1,124 @@
name: Windows
on:
push:
branches:
- develop
- master
- release/*
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true
jobs:
mingw:
runs-on: windows-2022
strategy:
matrix:
architecture: [x64, x86]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up MinGW
uses: egor-tensin/setup-mingw@41b837e47d7f85214629d255b9c4bc3fcbe9fd63 # v3.0
with:
platform: ${{ matrix.architecture }}
version: 12.2.0 # https://github.com/egor-tensin/setup-mingw/issues/14
- name: Run CMake
run: cmake -S . -B build -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On
- name: Build
run: cmake --build build --parallel 10
- name: Test
run: cd build ; ctest -j 10 -C Debug --output-on-failure
msvc:
strategy:
matrix:
build_type: [Debug, Release]
architecture: [Win32, x64]
std_version: [default, latest]
runs-on: windows-2022
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set extra CXX_FLAGS for latest std_version
id: cxxflags
run: |
if [ "${{ matrix.std_version }}" = "latest" ]; then
echo "flags=/permissive- /std:c++latest /utf-8 /W4 /WX" >> $GITHUB_ENV
else
echo "flags=/W4 /WX" >> $GITHUB_ENV
fi
shell: bash
- name: Run CMake (Release)
run: cmake -S . -B build -G "Visual Studio 17 2022" -A ${{ matrix.architecture }} -DJSON_BuildTests=On -DCMAKE_CXX_FLAGS="$env:flags"
if: matrix.build_type == 'Release'
shell: pwsh
- name: Run CMake (Debug)
run: cmake -S . -B build -G "Visual Studio 17 2022" -A ${{ matrix.architecture }} -DJSON_BuildTests=On -DJSON_FastTests=ON -DCMAKE_CXX_FLAGS="$env:flags"
if: matrix.build_type == 'Debug'
shell: pwsh
- name: Build
run: cmake --build build --config ${{ matrix.build_type }} --parallel 10
- name: Test
run: cd build ; ctest -j 10 -C ${{ matrix.build_type }} --output-on-failure
clang:
runs-on: windows-2022
strategy:
matrix:
version: [11.0.1, 12.0.1, 13.0.1, 14.0.6, 15.0.7, 16.0.6, 18.1.8, 19.1.7, 20.1.8]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install Clang
run: curl -fsSL -o LLVM${{ matrix.version }}.exe https://github.com/llvm/llvm-project/releases/download/llvmorg-${{ matrix.version }}/LLVM-${{ matrix.version }}-win64.exe ; 7z x LLVM${{ matrix.version }}.exe -y -o"C:/Program Files/LLVM"
- name: Set up MinGW
uses: egor-tensin/setup-mingw@41b837e47d7f85214629d255b9c4bc3fcbe9fd63 # v3.0
with:
platform: x64
version: 12.2.0 # https://github.com/egor-tensin/setup-mingw/issues/14
- name: Run CMake
run: cmake -S . -B build ^
-DCMAKE_CXX_COMPILER="C:/Program Files/LLVM/bin/clang++.exe" ^
-DCMAKE_CXX_FLAGS="--target=x86_64-w64-mingw32 -stdlib=libstdc++ -pthread" ^
-DCMAKE_EXE_LINKER_FLAGS="-lwinpthread" ^
-G"MinGW Makefiles" ^
-DCMAKE_BUILD_TYPE=Debug ^
-DJSON_BuildTests=On
- name: Build
run: cmake --build build --parallel 10
- name: Test
run: cd build ; ctest -j 10 -C Debug --exclude-regex "test-unicode" --output-on-failure
clang-cl-12:
runs-on: windows-2022
strategy:
matrix:
architecture: [Win32, x64]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Run CMake
run: cmake -S . -B build -G "Visual Studio 17 2022" -A ${{ matrix.architecture }} -T ClangCL -DJSON_BuildTests=On
- name: Build
run: cmake --build build --config Debug --parallel 10
- name: Test
run: cd build ; ctest -j 10 -C Debug --exclude-regex "test-unicode" --output-on-failure
ci_module_cpp20:
runs-on: windows-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Run CMake (Debug)
run: cmake -S . -B build -G "Visual Studio 17 2022" -DJSON_CI=ON -DCMAKE_CXX_FLAGS="/permissive- /std:c++latest /utf-8 /W4 /WX"
- name: Build
run: cmake --build build --config Debug --target ci_module_cpp20

53
.gitignore vendored
View File

@@ -1,16 +1,47 @@
json_unit
json_benchmarks
fuzz-testing
*.dSYM
*.o
*.gcno
*.gcda
.DS_Store
working
/.idea
/cmake-build-*
html
me.nlohmann.json.docset
# Visual Studio / Visual Studio Code
/.vs/
/.vscode/
/out/
android
doc/xml
# clangd cache
/.cache/
benchmarks/files/numbers/*.json
# build directories (vscode-cmake-tools, user-defined, ...)
/build*/
# fuzzers
/tests/corpus_*
/tests/parse_*_fuzzer
# documentation
/docs/docset/JSON_for_Modern_C++.docset/
/docs/docset/JSON_for_Modern_C++.tgz
/docs/docset/docSet.dsidx
/docs/mkdocs/.cache/
/docs/mkdocs/docs/__pycache__/
/docs/mkdocs/site/
/docs/mkdocs/venv/
# serve_header
/localhost.pem
/localhost-key.pem
/serve_header.yml
# Swift Package Manager build directory
/.build
venv
nlohmann_json.spdx
# Bazel-related
MODULE.bazel.lock

36
.reuse/dep5 Normal file
View File

@@ -0,0 +1,36 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: json
Upstream-Contact: Niels Lohmann <mail@nlohmann.me>
Source: https://github.com/nlohmann/json
Files: *
Copyright: 2013-2026 Niels Lohmann <https://nlohmann.me>
License: MIT
Files: include/nlohmann/thirdparty/hedley.hpp
Copyright: 2016-2021 Evan Nemerson <evan@nemerson.com>
License: CC0
Files: tests/thirdparty/doctest/*
Copyright: 2016-2023 Viktor Kirilov
License: MIT
Files: tests/thirdparty/fifo_map/*
Copyright: 2015-2017 Niels Lohmann
License: MIT
Files: tests/thirdparty/Fuzzer/*
Copyright: 2003-2022 LLVM Project.
License: Apache-2.0
Files: tests/thirdparty/imapdl/*
Copyright: 2017 Georg Sauthoff <mail@gms.tf>
License: GPL-3.0-only
Files: tools/amalgamate/*
Copyright: 2012 Erik Edlund <erik.edlund@32767.se>
License: BSD-3-Clause
Files: tools/gdb_pretty_printer/*
Copyright: 2020 Hannes Domani <https://github.com/ssbssa>
License: MIT

View File

@@ -0,0 +1,11 @@
__ _____ _____ _____
__| | __| | | | JSON for Modern C++
| | |__ | | | | | | version 3.12.0
|_____|_____|_____|_|___| https://github.com/nlohmann/json
{% for copyright_line in copyright_lines %}
{{ copyright_line }}
{% endfor %}
{% for expression in spdx_expressions %}
SPDX-License-Identifier: {{ expression }}
{% endfor %}

View File

@@ -0,0 +1,11 @@
__ _____ _____ _____
__| | __| | | | JSON for Modern C++ (supporting code)
| | |__ | | | | | | version 3.12.0
|_____|_____|_____|_|___| https://github.com/nlohmann/json
{% for copyright_line in copyright_lines %}
{{ copyright_line }}
{% endfor %}
{% for expression in spdx_expressions %}
SPDX-License-Identifier: {{ expression }}
{% endfor %}

View File

@@ -1,176 +0,0 @@
language: cpp
dist: trusty
sudo: required
env:
global:
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
# via the "travis encrypt" command using the project repo's public key
- secure: "m89SSgE+ASLO38rSKx7MTXK3n5NkP9bIx95jwY71YEiuFzib30PDJ/DifKnXxBjvy/AkCGztErQRk/8ZCvq+4HXozU2knEGnL/RUitvlwbhzfh2D4lmS3BvWBGS3N3NewoPBrRmdcvnT0xjOGXxtZaJ3P74TkB9GBnlz/HmKORA="
# from http://stackoverflow.com/a/32127147/266378
matrix:
include:
- os: linux
compiler: gcc
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-4.9', 'valgrind', 'python-pip', 'python-yaml']
before_script:
- pip install --user git+git://github.com/eddyxu/cpp-coveralls.git
after_success:
- make clean
- touch src/json.hpp
- make json_unit CXXFLAGS="-fprofile-arcs -ftest-coverage -std=c++11 -lstdc++" CXX=$COMPILER
- ./json_unit "*"
- coveralls --exclude test/src/catch.hpp --exclude test/src/unit.cpp --include src/json.hpp --gcov-options '\-lp' --gcov 'gcov-4.9'
- bash <(curl -s https://codecov.io/bash)
env: COMPILER=g++-4.9
- os: linux
compiler: gcc
before_install: echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-certificates.crt
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-5', 'valgrind']
coverity_scan:
project:
name: "nlohmann/json"
description: "Build submitted via Travis CI"
notification_email: niels.lohmann@gmail.com
build_command_prepend: "make clean ; sudo cp $(which g++-5) $(which g++)"
build_command: "make"
branch_pattern: coverity_scan
env: COMPILER=g++-5
- os: linux
compiler: gcc
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-6', 'valgrind']
env: COMPILER=g++-6
# from https://github.com/travis-ci/travis-ci/issues/6120
- os: linux
env:
- LLVM_VERSION=3.8.0
- LLVM_ARCHIVE_PATH=$HOME/clang+llvm.tar.xz
- COMPILER=clang++
- CPPFLAGS="-I $HOME/clang-$LLVM_VERSION/include/c++/v1"
- CXXFLAGS=-lc++
- PATH=$HOME/clang-$LLVM_VERSION/bin:$PATH
- LD_LIBRARY_PATH=$HOME/clang-$LLVM_VERSION/lib:$LD_LIBRARY_PATH
before_install:
- wget http://llvm.org/releases/$LLVM_VERSION/clang+llvm-$LLVM_VERSION-x86_64-linux-gnu-ubuntu-14.04.tar.xz -O $LLVM_ARCHIVE_PATH
- mkdir $HOME/clang-$LLVM_VERSION
- tar xf $LLVM_ARCHIVE_PATH -C $HOME/clang-$LLVM_VERSION --strip-components 1
# Clang 3.5 is not able to compile the code,
# see https://travis-ci.org/nlohmann/json/jobs/126720186
# - os: linux
# compiler: clang
# addons:
# apt:
# sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.6']
# packages: ['clang-3.6', 'valgrind']
# env: COMPILER=clang++-3.6
#
# - os: linux
# compiler: clang
# addons:
# apt:
# sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.7']
# packages: ['clang-3.7', 'valgrind']
# env: COMPILER=clang++-3.7
#
# - os: linux
# compiler: clang
# addons:
# apt:
# sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.8']
# packages: ['clang-3.8', 'valgrind']
# env: COMPILER=clang++-3.8
# - os: linux
# compiler: clang
# addons:
# apt:
# sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise']
# packages: ['clang-3.9', 'valgrind']
# env: COMPILER=clang++-3.9
- os: osx
osx_image: beta-xcode6.1
compiler: clang
env:
- COMPILER=clang
- CXXFLAGS=-lstdc++
- os: osx
osx_image: beta-xcode6.2
compiler: clang
env:
- COMPILER=clang
- CXXFLAGS=-lstdc++
- os: osx
osx_image: beta-xcode6.3
compiler: clang
env:
- COMPILER=clang
- CXXFLAGS=-lstdc++
- os: osx
osx_image: xcode6.4
compiler: clang
env:
- COMPILER=clang
- CXXFLAGS=-lstdc++
- os: osx
osx_image: xcode7.1
compiler: clang
env:
- COMPILER=clang
- CXXFLAGS=-lstdc++
- os: osx
osx_image: xcode7.2
compiler: clang
env:
- COMPILER=clang
- CXXFLAGS=-lstdc++
- os: osx
osx_image: xcode7.3
compiler: clang
env:
- COMPILER=clang
- CXXFLAGS=-lstdc++
- os: osx
osx_image: xcode8
compiler: clang
env:
- COMPILER=clang
- CXXFLAGS=-lstdc++
script:
- uname -a
- $COMPILER --version
- make CXX=$COMPILER
- ./json_unit "*"
- if [ `which valgrind` ]; then
valgrind --error-exitcode=1 --leak-check=full ./json_unit ;
fi
- if [ `which brew` ]; then
brew update ;
brew tap nlohmann/json ;
brew install nlohmann_json --HEAD ;
brew test nlohmann_json ;
fi

80
BUILD.bazel Normal file
View File

@@ -0,0 +1,80 @@
load("@rules_cc//cc:cc_library.bzl", "cc_library")
load("@rules_license//rules:license.bzl", "license")
package(
default_applicable_licenses = [":license"],
)
exports_files([
"LICENSE.MIT",
])
license(
name = "license",
license_kinds = ["@rules_license//licenses/spdx:MIT"],
license_text = "LICENSE.MIT",
)
cc_library(
name = "json",
hdrs = [
"include/nlohmann/adl_serializer.hpp",
"include/nlohmann/byte_container_with_subtype.hpp",
"include/nlohmann/detail/abi_macros.hpp",
"include/nlohmann/detail/conversions/from_json.hpp",
"include/nlohmann/detail/conversions/to_chars.hpp",
"include/nlohmann/detail/conversions/to_json.hpp",
"include/nlohmann/detail/exceptions.hpp",
"include/nlohmann/detail/hash.hpp",
"include/nlohmann/detail/input/binary_reader.hpp",
"include/nlohmann/detail/input/input_adapters.hpp",
"include/nlohmann/detail/input/json_sax.hpp",
"include/nlohmann/detail/input/lexer.hpp",
"include/nlohmann/detail/input/parser.hpp",
"include/nlohmann/detail/input/position_t.hpp",
"include/nlohmann/detail/iterators/internal_iterator.hpp",
"include/nlohmann/detail/iterators/iter_impl.hpp",
"include/nlohmann/detail/iterators/iteration_proxy.hpp",
"include/nlohmann/detail/iterators/iterator_traits.hpp",
"include/nlohmann/detail/iterators/json_reverse_iterator.hpp",
"include/nlohmann/detail/iterators/primitive_iterator.hpp",
"include/nlohmann/detail/json_custom_base_class.hpp",
"include/nlohmann/detail/json_pointer.hpp",
"include/nlohmann/detail/json_ref.hpp",
"include/nlohmann/detail/macro_scope.hpp",
"include/nlohmann/detail/macro_unscope.hpp",
"include/nlohmann/detail/meta/call_std/begin.hpp",
"include/nlohmann/detail/meta/call_std/end.hpp",
"include/nlohmann/detail/meta/cpp_future.hpp",
"include/nlohmann/detail/meta/detected.hpp",
"include/nlohmann/detail/meta/identity_tag.hpp",
"include/nlohmann/detail/meta/is_sax.hpp",
"include/nlohmann/detail/meta/std_fs.hpp",
"include/nlohmann/detail/meta/type_traits.hpp",
"include/nlohmann/detail/meta/void_t.hpp",
"include/nlohmann/detail/output/binary_writer.hpp",
"include/nlohmann/detail/output/output_adapters.hpp",
"include/nlohmann/detail/output/serializer.hpp",
"include/nlohmann/detail/string_concat.hpp",
"include/nlohmann/detail/string_escape.hpp",
"include/nlohmann/detail/string_utils.hpp",
"include/nlohmann/detail/value_t.hpp",
"include/nlohmann/json.hpp",
"include/nlohmann/json_fwd.hpp",
"include/nlohmann/ordered_map.hpp",
"include/nlohmann/thirdparty/hedley/hedley.hpp",
"include/nlohmann/thirdparty/hedley/hedley_undef.hpp",
],
includes = ["include"],
visibility = ["//visibility:public"],
alwayslink = True,
)
cc_library(
name = "singleheader-json",
hdrs = [
"single_include/nlohmann/json.hpp",
],
includes = ["single_include"],
visibility = ["//visibility:public"],
)

14
CITATION.cff Normal file
View File

@@ -0,0 +1,14 @@
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: Lohmann
given-names: Niels
orcid: https://orcid.org/0000-0001-9037-795X
email: mail@nlohmann.me
website: https://nlohmann.me
title: "JSON for Modern C++"
version: 3.12.0
date-released: 2025-04-07
license: MIT
repository-code: "https://github.com/nlohmann"
url: https://json.nlohmann.me

View File

@@ -1,54 +1,237 @@
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.5...4.0)
# define the project
project(nlohmann_json VERSION 2.0.2 LANGUAGES CXX)
##
## PROJECT
## name and version
##
project(nlohmann_json VERSION 3.12.0 LANGUAGES CXX)
enable_testing()
option(BuildTests "Build the unit tests" ON)
# define project variables
set(JSON_TARGET_NAME ${PROJECT_NAME})
set(JSON_PACKAGE_NAME ${JSON_TARGET_NAME})
set(JSON_TARGETS_FILENAME "${JSON_PACKAGE_NAME}Targets.cmake")
set(JSON_CONFIG_FILENAME "${JSON_PACKAGE_NAME}Config.cmake")
set(JSON_CONFIGVERSION_FILENAME "${JSON_PACKAGE_NAME}ConfigVersion.cmake")
set(JSON_CONFIG_DESTINATION "cmake")
set(JSON_INCLUDE_DESTINATION "include/nlohmann")
# create and configure the library target
add_library(${JSON_TARGET_NAME} INTERFACE)
target_include_directories(${JSON_TARGET_NAME} INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:${JSON_INCLUDE_DESTINATION}>)
# create and configure the unit test target
if (BuildTests)
add_subdirectory(test)
##
## MAIN_PROJECT CHECK
## determine if nlohmann_json is built as a subproject (using add_subdirectory) or if it is the main project
##
set(MAIN_PROJECT OFF)
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(MAIN_PROJECT ON)
endif()
# generate a config and config version file for the package
##
## INCLUDE
##
##
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
include(ExternalProject)
# ---- C++ Modules Support (optional) ----
option(NLOHMANN_JSON_BUILD_MODULES "Build C++ modules support" OFF)
if(NLOHMANN_JSON_BUILD_MODULES)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.28)
message(STATUS "Building nlohmann.json C++ module")
add_subdirectory(src/modules)
else()
message(WARNING "Skipping nlohmann.json C++ module (requires CMake 3.28+, found ${CMAKE_VERSION})")
endif()
endif()
##
## OPTIONS
##
if (POLICY CMP0077)
# Allow CMake 3.13+ to override options when using FetchContent / add_subdirectory.
cmake_policy(SET CMP0077 NEW)
endif ()
# VERSION_GREATER_EQUAL is not available in CMake 3.1
if(${MAIN_PROJECT} AND (${CMAKE_VERSION} VERSION_EQUAL 3.13 OR ${CMAKE_VERSION} VERSION_GREATER 3.13))
set(JSON_BuildTests_INIT ON)
else()
set(JSON_BuildTests_INIT OFF)
endif()
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_Diagnostics "Use extended diagnostic messages." OFF)
option(JSON_Diagnostic_Positions "Enable diagnostic positions." OFF)
option(JSON_GlobalUDLs "Place user-defined string literals in the global namespace." ON)
option(JSON_ImplicitConversions "Enable implicit conversions." ON)
option(JSON_DisableEnumSerialization "Disable default integer enum serialization." OFF)
option(JSON_LegacyDiscardedValueComparison "Enable legacy discarded value comparison." OFF)
option(JSON_Install "Install CMake targets during install step." ${MAIN_PROJECT})
option(JSON_MultipleHeaders "Use non-amalgamated version of the library." ON)
option(JSON_SystemInclude "Include as system headers (skip for clang-tidy)." OFF)
if (JSON_CI)
include(ci)
endif ()
##
## CONFIGURATION
##
include(GNUInstallDirs)
if (NOT DEFINED NLOHMANN_JSON_TARGET_NAME)
# Allow overriding the target name when using FetchContent / add_subdirectory.
set(NLOHMANN_JSON_TARGET_NAME ${PROJECT_NAME})
endif()
set(NLOHMANN_JSON_CONFIG_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/cmake/${PROJECT_NAME}" CACHE INTERNAL "")
set(NLOHMANN_JSON_INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}")
set(NLOHMANN_JSON_TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets")
set(NLOHMANN_JSON_CMAKE_CONFIG_TEMPLATE "cmake/config.cmake.in")
set(NLOHMANN_JSON_CMAKE_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}")
set(NLOHMANN_JSON_CMAKE_VERSION_CONFIG_FILE "${NLOHMANN_JSON_CMAKE_CONFIG_DIR}/${PROJECT_NAME}ConfigVersion.cmake")
set(NLOHMANN_JSON_CMAKE_PROJECT_CONFIG_FILE "${NLOHMANN_JSON_CMAKE_CONFIG_DIR}/${PROJECT_NAME}Config.cmake")
set(NLOHMANN_JSON_CMAKE_PROJECT_TARGETS_FILE "${NLOHMANN_JSON_CMAKE_CONFIG_DIR}/${PROJECT_NAME}Targets.cmake")
set(NLOHMANN_JSON_PKGCONFIG_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/pkgconfig")
if (JSON_MultipleHeaders)
set(NLOHMANN_JSON_INCLUDE_BUILD_DIR "${PROJECT_SOURCE_DIR}/include/")
message(STATUS "Using the multi-header code from ${NLOHMANN_JSON_INCLUDE_BUILD_DIR}")
else()
set(NLOHMANN_JSON_INCLUDE_BUILD_DIR "${PROJECT_SOURCE_DIR}/single_include/")
message(STATUS "Using the single-header code from ${NLOHMANN_JSON_INCLUDE_BUILD_DIR}")
endif()
if (NOT JSON_ImplicitConversions)
message(STATUS "Implicit conversions are disabled (JSON_USE_IMPLICIT_CONVERSIONS=0)")
endif()
if (JSON_DisableEnumSerialization)
message(STATUS "Enum integer serialization is disabled (JSON_DISABLE_ENUM_SERIALIZATION=0)")
endif()
if (JSON_LegacyDiscardedValueComparison)
message(STATUS "Legacy discarded value comparison enabled (JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON=1)")
endif()
if (JSON_Diagnostics)
message(STATUS "Diagnostics enabled (JSON_DIAGNOSTICS=1)")
endif()
if (JSON_Diagnostic_Positions)
message(STATUS "Diagnostic positions enabled (JSON_DIAGNOSTIC_POSITIONS=1)")
endif()
if (NOT JSON_GlobalUDLs)
message(STATUS "User-defined string literals are not put in the global namespace (JSON_USE_GLOBAL_UDLS=0)")
endif()
if (JSON_SystemInclude)
set(NLOHMANN_JSON_SYSTEM_INCLUDE "SYSTEM")
endif()
##
## TARGET
## create target and add include path
##
add_library(${NLOHMANN_JSON_TARGET_NAME} INTERFACE)
add_library(${PROJECT_NAME}::${NLOHMANN_JSON_TARGET_NAME} ALIAS ${NLOHMANN_JSON_TARGET_NAME})
if (${CMAKE_VERSION} VERSION_LESS "3.8.0")
target_compile_features(${NLOHMANN_JSON_TARGET_NAME} INTERFACE cxx_range_for)
else()
target_compile_features(${NLOHMANN_JSON_TARGET_NAME} INTERFACE cxx_std_11)
endif()
target_compile_definitions(
${NLOHMANN_JSON_TARGET_NAME}
INTERFACE
$<$<NOT:$<BOOL:${JSON_GlobalUDLs}>>:JSON_USE_GLOBAL_UDLS=0>
$<$<NOT:$<BOOL:${JSON_ImplicitConversions}>>:JSON_USE_IMPLICIT_CONVERSIONS=0>
$<$<BOOL:${JSON_DisableEnumSerialization}>:JSON_DISABLE_ENUM_SERIALIZATION=1>
$<$<BOOL:${JSON_Diagnostics}>:JSON_DIAGNOSTICS=1>
$<$<BOOL:${JSON_Diagnostic_Positions}>:JSON_DIAGNOSTIC_POSITIONS=1>
$<$<BOOL:${JSON_LegacyDiscardedValueComparison}>:JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON=1>
)
target_include_directories(
${NLOHMANN_JSON_TARGET_NAME}
${NLOHMANN_JSON_SYSTEM_INCLUDE} INTERFACE
$<BUILD_INTERFACE:${NLOHMANN_JSON_INCLUDE_BUILD_DIR}>
$<INSTALL_INTERFACE:${NLOHMANN_JSON_INCLUDE_INSTALL_DIR}>
)
## add debug view definition file for msvc (natvis)
if (MSVC)
set(NLOHMANN_ADD_NATVIS TRUE)
set(NLOHMANN_NATVIS_FILE "nlohmann_json.natvis")
target_sources(
${NLOHMANN_JSON_TARGET_NAME}
INTERFACE
$<INSTALL_INTERFACE:${NLOHMANN_NATVIS_FILE}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/${NLOHMANN_NATVIS_FILE}>
)
endif()
# Install a pkg-config file, so other tools can find this.
CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/pkg-config.pc.in"
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc"
@ONLY
)
##
## TESTS
## create and configure the unit test target
##
if (JSON_BuildTests)
include(CTest)
enable_testing()
add_subdirectory(tests)
endif()
##
## INSTALL
## install header files, generate and install cmake config files for find_package()
##
include(CMakePackageConfigHelpers)
configure_package_config_file("cmake/config.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/${JSON_CONFIG_FILENAME}"
INSTALL_DESTINATION ${JSON_CONFIG_DESTINATION})
write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/${JSON_CONFIGVERSION_FILENAME}"
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion)
# use a custom package version config file instead of
# write_basic_package_version_file to ensure that it's architecture-independent
# https://github.com/nlohmann/json/issues/1697
configure_file(
"cmake/nlohmann_jsonConfigVersion.cmake.in"
${NLOHMANN_JSON_CMAKE_VERSION_CONFIG_FILE}
@ONLY
)
configure_file(
${NLOHMANN_JSON_CMAKE_CONFIG_TEMPLATE}
${NLOHMANN_JSON_CMAKE_PROJECT_CONFIG_FILE}
@ONLY
)
# export the library target and store build directory in package registry
export(TARGETS ${JSON_TARGET_NAME}
FILE "${CMAKE_CURRENT_BINARY_DIR}/${JSON_TARGETS_FILENAME}")
export(PACKAGE ${JSON_PACKAGE_NAME})
# install library target and config files
install(TARGETS ${JSON_TARGET_NAME}
EXPORT ${JSON_PACKAGE_NAME})
install(FILES "src/json.hpp"
DESTINATION ${JSON_INCLUDE_DESTINATION})
install(EXPORT ${JSON_PACKAGE_NAME}
FILE ${JSON_TARGETS_FILENAME}
DESTINATION ${JSON_CONFIG_DESTINATION})
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${JSON_CONFIG_FILENAME}"
"${CMAKE_CURRENT_BINARY_DIR}/${JSON_CONFIGVERSION_FILENAME}"
DESTINATION ${JSON_CONFIG_DESTINATION})
if(JSON_Install)
install(
DIRECTORY ${NLOHMANN_JSON_INCLUDE_BUILD_DIR}
DESTINATION ${NLOHMANN_JSON_INCLUDE_INSTALL_DIR}
)
install(
FILES ${NLOHMANN_JSON_CMAKE_PROJECT_CONFIG_FILE} ${NLOHMANN_JSON_CMAKE_VERSION_CONFIG_FILE}
DESTINATION ${NLOHMANN_JSON_CONFIG_INSTALL_DIR}
)
if (NLOHMANN_ADD_NATVIS)
install(
FILES ${NLOHMANN_NATVIS_FILE}
DESTINATION .
)
endif()
export(
TARGETS ${NLOHMANN_JSON_TARGET_NAME}
NAMESPACE ${PROJECT_NAME}::
FILE ${NLOHMANN_JSON_CMAKE_PROJECT_TARGETS_FILE}
)
install(
TARGETS ${NLOHMANN_JSON_TARGET_NAME}
EXPORT ${NLOHMANN_JSON_TARGETS_EXPORT_NAME}
INCLUDES DESTINATION ${NLOHMANN_JSON_INCLUDE_INSTALL_DIR}
)
install(
EXPORT ${NLOHMANN_JSON_TARGETS_EXPORT_NAME}
NAMESPACE ${PROJECT_NAME}::
DESTINATION ${NLOHMANN_JSON_CONFIG_INSTALL_DIR}
)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc"
DESTINATION ${NLOHMANN_JSON_PKGCONFIG_INSTALL_DIR}
)
include(CPack)
endif()

File diff suppressed because it is too large Load Diff

239
FILES.md Normal file
View File

@@ -0,0 +1,239 @@
# Supporting files
This file describes the source for supporting files; that is, files that are not part of the library, but define the infrastructure and other aspects of the project.
- [Continuous Integration](#continuous-integration)
- [GitHub](#github)
- [REUSE](#reuse)
- [Package Managers](#package-managers)
## Continuous Integration
### `.cirrus.yml`
Configuration file for the pipeline at [Cirrus CI](https://cirrus-ci.com/github/nlohmann/json).
Further documentation:
- [Writing tasks](https://cirrus-ci.org/guide/writing-tasks/)
> [!IMPORTANT]
> The filename `.cirrus.yml` and position (root of the repository) are predetermined by Cirrus CI.
### `.github/external_ci/appveyor.yml`
Configuration for the pipelines at [AppVeyor](https://ci.appveyor.com/project/nlohmann/json).
Further documentation:
- [appveyor.yml reference](https://www.appveyor.com/docs/appveyor-yml/)
> [!NOTE]
> The filename can be freely configured in the AppVeyor project.
## GitHub
### `CITATION.cff`
A file to configure the citation for the repository which is displayed in the sidebar of the project.
Further documentation:
- [About CITATION files](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-citation-files)
> [!IMPORTANT]
> The filename `CITATION.cff` and position (root of the repository) are predetermined by GitHub.
### `.github/CODE_OF_CONDUCT.md`
The code of conduct for the project. This is the Markdown version of the [Contributor Covenant Code of Conduct](https://www.contributor-covenant.org/version/2/1/code_of_conduct/). The code of conduct is linked on the [Community Standards](https://github.com/nlohmann/json/community) page and is mentioned by the Sentiment Bot.
Further documentation:
- [Adding a code of conduct to your project](https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/adding-a-code-of-conduct-to-your-project)
> [!IMPORTANT]
> The filename `.github/CODE_OF_CONDUCT.md` is predetermined by GitHub.
> [!NOTE]
> The file is part of the documentation and is included in `docs/mkdocs/docs/community/code_of_conduct.md`.
### `.github/CODEOWNERS`
The code owners file for the project which is used to select reviewers for new pull requests.
Further documentation:
- [About code owners](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners)
> [!IMPORTANT]
> The filename `.github/CODEOWNERS` is predetermined by GitHub.
### `.github/config.yml`
Configuration file for [probot](https://probot.github.io/apps/), in particular the [Sentiment Bot](https://probot.github.io/apps/sentiment-bot/) and the [Request Info](https://probot.github.io/apps/request-info/).
> [!IMPORTANT]
> The filename `.github/config.yml` is predetermined by probot.
### `.github/CONTRIBUTING.md`
The contribution guidelines which are linked in the [Community Standards](https://github.com/nlohmann/json/community) and at <https://github.com/nlohmann/json/contribute>.
Further documentation:
- [Setting guidelines for repository contributors](https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/setting-guidelines-for-repository-contributors)
> [!IMPORTANT]
> The filename `.github/CONTRIBUTING.md` is predetermined by GitHub.
> [!NOTE]
> The file is part of the documentation and is included in `docs/mkdocs/docs/community/contribution_guidelines.md`.
### `.github/dependabot.yml`
The configuration of [dependabot](https://github.com/dependabot) which ensures the dependencies (GitHub actions and Python packages used in the CI) remain up to date.
Further documentation:
- [Configuring Dependabot security updates](https://docs.github.com/en/code-security/dependabot/dependabot-security-updates/configuring-dependabot-security-updates)
> [!IMPORTANT]
> The filename `.github/dependabot.yml` is predetermined by GitHub.
### `.github/FUNDING.yml`
A file to configure the sponsor button of the repository which is displayed in the sidebar of the project.
Further documentation:
- [Displaying a sponsor button in your repository](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/displaying-a-sponsor-button-in-your-repository)
> [!IMPORTANT]
> The filename `.github/FUNDING.yml` is predetermined by GitHub.
### `.github/ISSUE_TEMPLATE/bug.yaml`
Issue form template for bugs.
Further documentation:
- [Configuring issue templates for your repository](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository)
> [!IMPORTANT]
> The folder `.github/ISSUE_TEMPLATE` is predetermined by GitHub.
### `.github/ISSUE_TEMPLATE/config.yaml`
Issue template chooser configuration. The file is used to configure the dialog when a new issue is created.
Further documentation:
- [Configuring issue templates for your repository](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository)
> [!IMPORTANT]
> The filename `.github/ISSUE_TEMPLATE/config.yaml` is predetermined by GitHub.
### `.github/labeler.yml`
Configuration file for the "Pull Request Labeler" workflow defined in `workflows/labeler.yml`. This file defines rules how labels are assigned to pull requests based on which files are changed.
Further documentation:
- [Label manager for PRs and issues based on configurable conditions](https://github.com/srvaroa/labeler)
> [!NOTE]
> The filename defaults to `.github/labeler.yml` and can be configured in the workflow.
### `.github/PULL_REQUEST_TEMPLATE.md`
The pull request template which prefills new pull requests.
Further documentation:
- [Creating a pull request template for your repository](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/creating-a-pull-request-template-for-your-repository)
> [!IMPORTANT]
> The filename `.github/PULL_REQUEST_TEMPLATE.md` is predetermined by GitHub.
### `.github/SECURITY.md`
The goal is to describe how to securely report security vulnerabilities for this repository. The security policy is linked at <https://github.com/nlohmann/json/security/policy>.
Further documentation:
- [Adding a security policy to your repository](https://docs.github.com/en/code-security/getting-started/adding-a-security-policy-to-your-repository)
> [!IMPORTANT]
> The filename `.github/SECURITY.yml` is predetermined by GitHub.
> [!NOTE]
> The file is part of the documentation and is included in `docs/mkdocs/docs/community/security_policy.md`.
### `LICENSE.MIT`
The license of the project.
Further documentation:
- [Adding a license to a repository](https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/adding-a-license-to-a-repository)
> [!IMPORTANT]
> The filename `LICENSE.MIT` is partly predetermined by GitHub. The root filename must be `LICENSE`.
## REUSE
### `.reuse/dep5`
The file defines the licenses of certain third-party components in the repository. The root `Makefile` contains a target `reuse` that checks for compliance.
Further documentation:
- [DEP5](https://reuse.software/spec-3.2/#dep5-deprecated)
- [reuse command-line tool](https://pypi.org/project/reuse/)
- [documentation of linting](https://reuse.readthedocs.io/en/stable/man/reuse-lint.html)
- [REUSE](http://reuse.software)
> [!IMPORTANT]
> The filename `.reuse/dep5` is predetermined by REUSE. Alternatively, a `REUSE.toml` file can be used.
### `.reuse/templates`
Copyright header templates for source files. The root `Makefile` contains a target `reuse` that updates copyright headers with the templates.
Further information:
- [reuse command-line tool](https://pypi.org/project/reuse/)
- [documentation on templates](https://reuse.readthedocs.io/en/stable/man/reuse-annotate.html#cmdoption-t)
- [REUSE](http://reuse.software)
> [!IMPORTANT]
> The folder name `.reuse/templates` is predetermined by REUSE.
### `LICENSES`
A folder that contains every license of all license files (library and third-party code).
Further documentation:
- [REUSE specification](https://reuse.software/spec-3.3/)
> [!IMPORTANT]
> The folder name `LICENSES` is predetermined by REUSE.
## Package Managers
### `BUILD.bazel`
The file can be updated by calling
```shell
make BUILD.bazel
```
### `meson.build`
### `Package.swift`
### `WORKSPACE.bazel`

View File

@@ -1,14 +1,13 @@
The library is licensed under the MIT License
<http://opensource.org/licenses/MIT>:
MIT License
Copyright (c) 2013-2016 Niels Lohmann
Copyright (c) 2013-2026 Niels Lohmann
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:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

73
LICENSES/Apache-2.0.txt Normal file
View File

@@ -0,0 +1,73 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

11
LICENSES/BSD-3-Clause.txt Normal file
View File

@@ -0,0 +1,11 @@
Copyright (c) <year> <owner>.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

121
LICENSES/CC0-1.0.txt Normal file
View File

@@ -0,0 +1,121 @@
Creative Commons Legal Code
CC0 1.0 Universal
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
HEREUNDER.
Statement of Purpose
The laws of most jurisdictions throughout the world automatically confer
exclusive Copyright and Related Rights (defined below) upon the creator
and subsequent owner(s) (each and all, an "owner") of an original work of
authorship and/or a database (each, a "Work").
Certain owners wish to permanently relinquish those rights to a Work for
the purpose of contributing to a commons of creative, cultural and
scientific works ("Commons") that the public can reliably and without fear
of later claims of infringement build upon, modify, incorporate in other
works, reuse and redistribute as freely as possible in any form whatsoever
and for any purposes, including without limitation commercial purposes.
These owners may contribute to the Commons to promote the ideal of a free
culture and the further production of creative, cultural and scientific
works, or to gain reputation or greater distribution for their Work in
part through the use and efforts of others.
For these and/or other purposes and motivations, and without any
expectation of additional consideration or compensation, the person
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
is an owner of Copyright and Related Rights in the Work, voluntarily
elects to apply CC0 to the Work and publicly distribute the Work under its
terms, with knowledge of his or her Copyright and Related Rights in the
Work and the meaning and intended legal effect of CC0 on those rights.
1. Copyright and Related Rights. A Work made available under CC0 may be
protected by copyright and related or neighboring rights ("Copyright and
Related Rights"). Copyright and Related Rights include, but are not
limited to, the following:
i. the right to reproduce, adapt, distribute, perform, display,
communicate, and translate a Work;
ii. moral rights retained by the original author(s) and/or performer(s);
iii. publicity and privacy rights pertaining to a person's image or
likeness depicted in a Work;
iv. rights protecting against unfair competition in regards to a Work,
subject to the limitations in paragraph 4(a), below;
v. rights protecting the extraction, dissemination, use and reuse of data
in a Work;
vi. database rights (such as those arising under Directive 96/9/EC of the
European Parliament and of the Council of 11 March 1996 on the legal
protection of databases, and under any national implementation
thereof, including any amended or successor version of such
directive); and
vii. other similar, equivalent or corresponding rights throughout the
world based on applicable law or treaty, and any national
implementations thereof.
2. Waiver. To the greatest extent permitted by, but not in contravention
of, applicable law, Affirmer hereby overtly, fully, permanently,
irrevocably and unconditionally waives, abandons, and surrenders all of
Affirmer's Copyright and Related Rights and associated claims and causes
of action, whether now known or unknown (including existing as well as
future claims and causes of action), in the Work (i) in all territories
worldwide, (ii) for the maximum duration provided by applicable law or
treaty (including future time extensions), (iii) in any current or future
medium and for any number of copies, and (iv) for any purpose whatsoever,
including without limitation commercial, advertising or promotional
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
member of the public at large and to the detriment of Affirmer's heirs and
successors, fully intending that such Waiver shall not be subject to
revocation, rescission, cancellation, termination, or any other legal or
equitable action to disrupt the quiet enjoyment of the Work by the public
as contemplated by Affirmer's express Statement of Purpose.
3. Public License Fallback. Should any part of the Waiver for any reason
be judged legally invalid or ineffective under applicable law, then the
Waiver shall be preserved to the maximum extent permitted taking into
account Affirmer's express Statement of Purpose. In addition, to the
extent the Waiver is so judged Affirmer hereby grants to each affected
person a royalty-free, non transferable, non sublicensable, non exclusive,
irrevocable and unconditional license to exercise Affirmer's Copyright and
Related Rights in the Work (i) in all territories worldwide, (ii) for the
maximum duration provided by applicable law or treaty (including future
time extensions), (iii) in any current or future medium and for any number
of copies, and (iv) for any purpose whatsoever, including without
limitation commercial, advertising or promotional purposes (the
"License"). The License shall be deemed effective as of the date CC0 was
applied by Affirmer to the Work. Should any part of the License for any
reason be judged legally invalid or ineffective under applicable law, such
partial invalidity or ineffectiveness shall not invalidate the remainder
of the License, and in such case Affirmer hereby affirms that he or she
will not (i) exercise any of his or her remaining Copyright and Related
Rights in the Work or (ii) assert any associated claims and causes of
action with respect to the Work, in either case contrary to Affirmer's
express Statement of Purpose.
4. Limitations and Disclaimers.
a. No trademark or patent rights held by Affirmer are waived, abandoned,
surrendered, licensed or otherwise affected by this document.
b. Affirmer offers the Work as-is and makes no representations or
warranties of any kind concerning the Work, express, implied,
statutory or otherwise, including without limitation warranties of
title, merchantability, fitness for a particular purpose, non
infringement, or the absence of latent or other defects, accuracy, or
the present or absence of errors, whether or not discoverable, all to
the greatest extent permissible under applicable law.
c. Affirmer disclaims responsibility for clearing rights of other persons
that may apply to the Work or any use thereof, including without
limitation any person's Copyright and Related Rights in the Work.
Further, Affirmer disclaims responsibility for obtaining any necessary
consents, permissions or other rights required for any use of the
Work.
d. Affirmer understands and acknowledges that Creative Commons is not a
party to this document and has no duty or obligation with respect to
this CC0 or use of the Work.

232
LICENSES/GPL-3.0-only.txt Normal file
View File

@@ -0,0 +1,232 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for software and other kinds of works.
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and modification follow.
TERMS AND CONDITIONS
0. Definitions.
“This License” refers to version 3 of the GNU General Public License.
“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations.
To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work.
A “covered work” means either the unmodified Program or a work based on the Program.
To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
1. Source Code.
The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.
A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
The Corresponding Source for a work in source code form is that same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”.
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
7. Additional Terms.
“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
11. Patents.
A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”.
A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”.
You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <http://www.gnu.org/philosophy/why-not-lgpl.html>.

9
LICENSES/MIT.txt Normal file
View File

@@ -0,0 +1,9 @@
MIT License
Copyright (c) <year> <copyright holders>
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:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

7
MODULE.bazel Normal file
View File

@@ -0,0 +1,7 @@
module(
name = "nlohmann_json",
compatibility_level = 1,
)
bazel_dep(name = "rules_cc", version = "0.0.17")
bazel_dep(name = "rules_license", version = "1.0.0")

291
Makefile
View File

@@ -1,38 +1,58 @@
.PHONY: pretty clean ChangeLog.md
.PHONY: pretty clean ChangeLog.md release
# used programs
RE2C = re2c
SED = sed
##########################################################################
# configuration
##########################################################################
# find GNU sed to use `-i` parameter
SED:=$(shell command -v gsed || which sed)
##########################################################################
# source files
##########################################################################
# the list of sources in the include folder
SRCS=$(shell find include -type f | sort)
# the list of sources in the tests folder
TESTS_SRCS=$(shell find tests -type f \( -name '*.hpp' -o -name '*.cpp' -o -name '*.cu' \) -not -path 'tests/thirdparty/*' -not -path 'tests/abi/include/nlohmann/*' | sort)
# the single headers (amalgamated from the source files)
AMALGAMATED_FILE=single_include/nlohmann/json.hpp
AMALGAMATED_FWD_FILE=single_include/nlohmann/json_fwd.hpp
##########################################################################
# documentation of the Makefile's targets
##########################################################################
# main target
all: json_unit
# clean up
clean:
rm -fr json_unit json_benchmarks fuzz fuzz-testing *.dSYM
rm -fr benchmarks/files/numbers/*.json
$(MAKE) clean -Cdoc
all:
@echo "amalgamate - amalgamate files single_include/nlohmann/json{,_fwd}.hpp from the include/nlohmann sources"
@echo "ChangeLog.md - generate ChangeLog file"
@echo "check-amalgamation - check whether sources have been amalgamated"
@echo "clean - remove built files"
@echo "doctest - compile example files and check their output"
@echo "fuzz_testing - prepare fuzz testing of the JSON parser"
@echo "fuzz_testing_bson - prepare fuzz testing of the BSON parser"
@echo "fuzz_testing_cbor - prepare fuzz testing of the CBOR parser"
@echo "fuzz_testing_msgpack - prepare fuzz testing of the MessagePack parser"
@echo "fuzz_testing_ubjson - prepare fuzz testing of the UBJSON parser"
@echo "pretty - beautify code with Artistic Style"
@echo "run_benchmarks - build and run benchmarks"
##########################################################################
# unit tests
# benchmarks
##########################################################################
# additional flags
FLAGS = -Wall -Wextra -pedantic -Weffc++ -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wmissing-declarations -Wmissing-include-dirs -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-overflow=5 -Wswitch -Wundef -Wno-unused -Wnon-virtual-dtor -Wreorder -Wdeprecated -Wfloat-equal
# build unit tests (TODO: Does this want its own makefile?)
json_unit: test/src/unit.cpp src/json.hpp test/src/catch.hpp
$(CXX) -std=c++11 $(CXXFLAGS) $(FLAGS) $(CPPFLAGS) -I src -I test $< $(LDFLAGS) -o $@
##########################################################################
# documentation tests
##########################################################################
# compile example files and check output
doctest:
$(MAKE) check_output -C doc
run_benchmarks:
rm -fr cmake-build-benchmarks
mkdir cmake-build-benchmarks
cd cmake-build-benchmarks ; cmake ../tests/benchmarks -GNinja -DCMAKE_BUILD_TYPE=Release
cd cmake-build-benchmarks ; ninja
cd cmake-build-benchmarks ; ./json_benchmarks
##########################################################################
@@ -43,61 +63,204 @@ doctest:
fuzz_testing:
rm -fr fuzz-testing
mkdir -p fuzz-testing fuzz-testing/testcases fuzz-testing/out
$(MAKE) fuzz CXX=afl-clang++
mv fuzz fuzz-testing
find test/data/json_tests -size -5k -name *json | xargs -I{} cp "{}" fuzz-testing/testcases
@echo "Execute: afl-fuzz -i fuzz-testing/testcases -o fuzz-testing/out fuzz-testing/fuzz"
$(MAKE) parse_afl_fuzzer -C tests CXX=afl-clang++
mv tests/parse_afl_fuzzer fuzz-testing/fuzzer
find tests/data/json_tests -size -5k -name *json | xargs -I{} cp "{}" fuzz-testing/testcases
@echo "Execute: afl-fuzz -i fuzz-testing/testcases -o fuzz-testing/out fuzz-testing/fuzzer"
# the fuzzer binary
fuzz: test/src/fuzz.cpp src/json.hpp
$(CXX) -std=c++11 $(CXXFLAGS) $(FLAGS) $(CPPFLAGS) -I src $< $(LDFLAGS) -o $@
fuzz_testing_bson:
rm -fr fuzz-testing
mkdir -p fuzz-testing fuzz-testing/testcases fuzz-testing/out
$(MAKE) parse_bson_fuzzer -C tests CXX=afl-clang++
mv tests/parse_bson_fuzzer fuzz-testing/fuzzer
find tests/data -size -5k -name *.bson | xargs -I{} cp "{}" fuzz-testing/testcases
@echo "Execute: afl-fuzz -i fuzz-testing/testcases -o fuzz-testing/out fuzz-testing/fuzzer"
fuzz_testing_cbor:
rm -fr fuzz-testing
mkdir -p fuzz-testing fuzz-testing/testcases fuzz-testing/out
$(MAKE) parse_cbor_fuzzer -C tests CXX=afl-clang++
mv tests/parse_cbor_fuzzer fuzz-testing/fuzzer
find tests/data -size -5k -name *.cbor | xargs -I{} cp "{}" fuzz-testing/testcases
@echo "Execute: afl-fuzz -i fuzz-testing/testcases -o fuzz-testing/out fuzz-testing/fuzzer"
fuzz_testing_msgpack:
rm -fr fuzz-testing
mkdir -p fuzz-testing fuzz-testing/testcases fuzz-testing/out
$(MAKE) parse_msgpack_fuzzer -C tests CXX=afl-clang++
mv tests/parse_msgpack_fuzzer fuzz-testing/fuzzer
find tests/data -size -5k -name *.msgpack | xargs -I{} cp "{}" fuzz-testing/testcases
@echo "Execute: afl-fuzz -i fuzz-testing/testcases -o fuzz-testing/out fuzz-testing/fuzzer"
fuzz_testing_ubjson:
rm -fr fuzz-testing
mkdir -p fuzz-testing fuzz-testing/testcases fuzz-testing/out
$(MAKE) parse_ubjson_fuzzer -C tests CXX=afl-clang++
mv tests/parse_ubjson_fuzzer fuzz-testing/fuzzer
find tests/data -size -5k -name *.ubjson | xargs -I{} cp "{}" fuzz-testing/testcases
@echo "Execute: afl-fuzz -i fuzz-testing/testcases -o fuzz-testing/out fuzz-testing/fuzzer"
fuzzing-start:
afl-fuzz -S fuzzer1 -i fuzz-testing/testcases -o fuzz-testing/out fuzz-testing/fuzzer > /dev/null &
afl-fuzz -S fuzzer2 -i fuzz-testing/testcases -o fuzz-testing/out fuzz-testing/fuzzer > /dev/null &
afl-fuzz -S fuzzer3 -i fuzz-testing/testcases -o fuzz-testing/out fuzz-testing/fuzzer > /dev/null &
afl-fuzz -S fuzzer4 -i fuzz-testing/testcases -o fuzz-testing/out fuzz-testing/fuzzer > /dev/null &
afl-fuzz -S fuzzer5 -i fuzz-testing/testcases -o fuzz-testing/out fuzz-testing/fuzzer > /dev/null &
afl-fuzz -S fuzzer6 -i fuzz-testing/testcases -o fuzz-testing/out fuzz-testing/fuzzer > /dev/null &
afl-fuzz -S fuzzer7 -i fuzz-testing/testcases -o fuzz-testing/out fuzz-testing/fuzzer > /dev/null &
afl-fuzz -M fuzzer0 -i fuzz-testing/testcases -o fuzz-testing/out fuzz-testing/fuzzer
fuzzing-stop:
-killall fuzzer
-killall afl-fuzz
##########################################################################
# static analyzer
# Static analysis
##########################################################################
# call cppcheck on the main header file
cppcheck:
cppcheck --enable=all --inconclusive --std=c++11 src/json.hpp
# call PVS-Studio Analyzer <https://www.viva64.com/en/pvs-studio/>
pvs_studio:
rm -fr cmake-build-pvs-studio
mkdir cmake-build-pvs-studio
cd cmake-build-pvs-studio ; cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=On -DJSON_MultipleHeaders=ON
cd cmake-build-pvs-studio ; pvs-studio-analyzer analyze -j 10
cd cmake-build-pvs-studio ; plog-converter -a'GA:1,2;64:1;CS' -t fullhtml PVS-Studio.log -o pvs
open cmake-build-pvs-studio/pvs/index.html
##########################################################################
# maintainer targets
# Code format and source amalgamation
##########################################################################
# create scanner with re2c
re2c: src/json.hpp.re2c
$(RE2C) -W --bit-vectors --nested-ifs --no-debug-info $< | $(SED) '1d' > src/json.hpp
ASTYLE=tools/astyle/venv/bin/astyle
# pretty printer
pretty:
astyle --style=allman --indent=spaces=4 --indent-modifiers \
--indent-switches --indent-preproc-block --indent-preproc-define \
--indent-col1-comments --pad-oper --pad-header --align-pointer=type \
--align-reference=type --add-brackets --convert-tabs --close-templates \
--lineend=linux --preserve-date --suffix=none --formatted \
src/json.hpp src/json.hpp.re2c test/src/unit.cpp test/src/fuzz.cpp benchmarks/benchmarks.cpp doc/examples/*.cpp
install_astyle:
@test -d tools/astyle/venv || python3 -mvenv tools/astyle/venv ; tools/astyle/venv/bin/pip3 install --quiet --upgrade pip
@test -f $(ASTYLE) || tools/astyle/venv/bin/pip3 install --quiet -r tools/astyle/requirements.txt
@$(ASTYLE) --version
# call the Artistic Style pretty printer on all source files
pretty: install_astyle
$(ASTYLE) --project=tools/astyle/.astylerc $(SRCS) $(TESTS_SRCS) $(AMALGAMATED_FILE) $(AMALGAMATED_FWD_FILE) docs/mkdocs/docs/examples/*.cpp
# call the Clang-Format on all source files
pretty_format:
for FILE in $(SRCS) $(TESTS_SRCS) $(AMALGAMATED_FILE) docs/mkdocs/docs/examples/*.cpp; do echo $$FILE; clang-format -i $$FILE; done
# create single header files and pretty print
amalgamate: $(AMALGAMATED_FILE) $(AMALGAMATED_FWD_FILE)
$(MAKE) pretty
# call the amalgamation tool for json.hpp
$(AMALGAMATED_FILE): $(SRCS)
tools/amalgamate/amalgamate.py -c tools/amalgamate/config_json.json -s . --verbose=yes
# call the amalgamation tool for json_fwd.hpp
$(AMALGAMATED_FWD_FILE): $(SRCS)
tools/amalgamate/amalgamate.py -c tools/amalgamate/config_json_fwd.json -s . --verbose=yes
# check if file single_include/nlohmann/json.hpp has been amalgamated from the nlohmann sources
# Note: this target is called by Travis
check-amalgamation:
@mv $(AMALGAMATED_FILE) $(AMALGAMATED_FILE)~
@mv $(AMALGAMATED_FWD_FILE) $(AMALGAMATED_FWD_FILE)~
@$(MAKE) amalgamate
@diff $(AMALGAMATED_FILE) $(AMALGAMATED_FILE)~ || (echo "===================================================================\n Amalgamation required! Please read the contribution guidelines\n in file .github/CONTRIBUTING.md.\n===================================================================" ; mv $(AMALGAMATED_FILE)~ $(AMALGAMATED_FILE) ; false)
@diff $(AMALGAMATED_FWD_FILE) $(AMALGAMATED_FWD_FILE)~ || (echo "===================================================================\n Amalgamation required! Please read the contribution guidelines\n in file .github/CONTRIBUTING.md.\n===================================================================" ; mv $(AMALGAMATED_FWD_FILE)~ $(AMALGAMATED_FWD_FILE) ; false)
@mv $(AMALGAMATED_FILE)~ $(AMALGAMATED_FILE)
@mv $(AMALGAMATED_FWD_FILE)~ $(AMALGAMATED_FWD_FILE)
BUILD.bazel: $(SRCS)
cmake -P cmake/scripts/gen_bazel_build_file.cmake
##########################################################################
# benchmarks
# ChangeLog
##########################################################################
# benchmarks
json_benchmarks: benchmarks/benchmarks.cpp benchmarks/benchpress.hpp benchmarks/cxxopts.hpp src/json.hpp
cd benchmarks/files/numbers ; python generate.py
$(CXX) -std=c++11 $(CXXFLAGS) -O3 -flto -I src -I benchmarks $< $(LDFLAGS) -o $@
./json_benchmarks
##########################################################################
# changelog
##########################################################################
# Create a ChangeLog based on the git log using the GitHub Changelog Generator
# (<https://github.com/github-changelog-generator/github-changelog-generator>).
# variable to control the diffs between the last released version and the current repository state
NEXT_VERSION ?= "unreleased"
ChangeLog.md:
github_changelog_generator -o ChangeLog.md --simple-list --release-url https://github.com/nlohmann/json/releases/tag/%s --future-release $(NEXT_VERSION)
gsed -i 's|https://github.com/nlohmann/json/releases/tag/HEAD|https://github.com/nlohmann/json/tree/HEAD|' ChangeLog.md
gsed -i '2i All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/).' ChangeLog.md
github_changelog_generator -o ChangeLog.md --user nlohmann --project json --simple-list --release-url https://github.com/nlohmann/json/releases/tag/%s --future-release $(NEXT_VERSION)
$(SED) -i 's|https://github.com/nlohmann/json/releases/tag/HEAD|https://github.com/nlohmann/json/tree/HEAD|' ChangeLog.md
$(SED) -i '2i All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/).' ChangeLog.md
##########################################################################
# Release files
##########################################################################
# Create a tar.xz archive that contains sufficient files to be used as CMake project (e.g., using FetchContent). The
# archive is created according to the advices of <https://reproducible-builds.org/docs/archives/>.
json.tar.xz:
mkdir json
rsync -R $(shell find LICENSE.MIT nlohmann_json.natvis CMakeLists.txt cmake/*.in include single_include -type f) json
gtar --sort=name --mtime="@$(shell git log -1 --pretty=%ct)" --owner=0 --group=0 --numeric-owner --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime --create --file - json | xz --compress -9e --threads=2 - > json.tar.xz
rm -fr json
# We use `-X` to make the resulting ZIP file reproducible, see
# <https://content.pivotal.io/blog/barriers-to-deterministic-reproducible-zip-files>.
include.zip: BUILD.bazel
zip -9 --recurse-paths -X include.zip $(SRCS) $(AMALGAMATED_FILE) $(AMALGAMATED_FWD_FILE) BUILD.bazel WORKSPACE.bazel meson.build LICENSE.MIT
# Create the files for a release and add signatures and hashes.
release: include.zip json.tar.xz
rm -fr release_files
mkdir release_files
gpg --armor --detach-sig include.zip
gpg --armor --detach-sig $(AMALGAMATED_FILE)
gpg --armor --detach-sig $(AMALGAMATED_FWD_FILE)
gpg --armor --detach-sig json.tar.xz
cp $(AMALGAMATED_FILE) release_files
cp $(AMALGAMATED_FWD_FILE) release_files
mv $(AMALGAMATED_FILE).asc $(AMALGAMATED_FWD_FILE).asc json.tar.xz json.tar.xz.asc include.zip include.zip.asc release_files
cd release_files ; shasum -a 256 json.hpp include.zip json.tar.xz > hashes.txt
##########################################################################
# Maintenance
##########################################################################
# clean up
clean:
rm -fr fuzz fuzz-testing *.dSYM tests/*.dSYM
rm -fr benchmarks/files/numbers/*.json
rm -fr cmake-build-benchmarks fuzz-testing cmake-build-pvs-studio release_files
$(MAKE) clean -Cdocs
##########################################################################
# Thirdparty code
##########################################################################
update_hedley:
rm -f include/nlohmann/thirdparty/hedley/hedley.hpp include/nlohmann/thirdparty/hedley/hedley_undef.hpp
curl https://raw.githubusercontent.com/nemequ/hedley/master/hedley.h -o include/nlohmann/thirdparty/hedley/hedley.hpp
$(SED) -i 's/HEDLEY_/JSON_HEDLEY_/g' include/nlohmann/thirdparty/hedley/hedley.hpp
grep "[[:blank:]]*#[[:blank:]]*undef" include/nlohmann/thirdparty/hedley/hedley.hpp | grep -v "__" | sort | uniq | $(SED) 's/ //g' | $(SED) 's/undef/undef /g' > include/nlohmann/thirdparty/hedley/hedley_undef.hpp
$(SED) -i '1s/^/#pragma once\n\n/' include/nlohmann/thirdparty/hedley/hedley.hpp
$(SED) -i '1s/^/#pragma once\n\n/' include/nlohmann/thirdparty/hedley/hedley_undef.hpp
$(MAKE) amalgamate
##########################################################################
# serve_header.py
##########################################################################
serve_header:
./tools/serve_header/serve_header.py --make $(MAKE)
##########################################################################
# REUSE
##########################################################################
reuse:
pipx run reuse annotate --recursive single_include include -tjson --license MIT --copyright "Niels Lohmann <https://nlohmann.me>" --year "2013-2026" --merge-copyrights
pipx run reuse annotate $(TESTS_SRCS) -tjson_support --license MIT --copyright "Niels Lohmann <https://nlohmann.me>" --year "2013-2026" --merge-copyrights
pipx run reuse lint
spdx:
pipx run reuse spdx --output nlohmann_json.spdx --creator-person "Niels Lohmann" --add-license-concluded

22
Package.swift Normal file
View File

@@ -0,0 +1,22 @@
// swift-tools-version: 5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "nlohmann-json",
platforms: [
.iOS(.v12), .macOS(.v10_13), .tvOS(.v12), .watchOS(.v4), .visionOS(.v1)
],
products: [
.library(name: "json", targets: ["json"])
],
targets: [
.target(
name: "json",
path: "single_include/nlohmann",
publicHeadersPath: "."
)
],
cxxLanguageStandard: .cxx11
)

1652
README.md

File diff suppressed because it is too large Load Diff

View File

@@ -1,10 +0,0 @@
version: '{build}'
os: Visual Studio 2015
init: []
install: []
build_script:
- set PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH%
- cmake . -G "Visual Studio 14 2015"
- cmake --build . --config Release
test_script:
- ctest -C Release -V

View File

@@ -1,107 +0,0 @@
#define BENCHPRESS_CONFIG_MAIN
#include <fstream>
#include <benchpress.hpp>
#include <json.hpp>
BENCHMARK("parse jeopardy.json", [](benchpress::context* ctx)
{
for (size_t i = 0; i < ctx->num_iterations(); ++i)
{
std::ifstream input_file("benchmarks/files/jeopardy/jeopardy.json");
nlohmann::json j;
j << input_file;
}
})
BENCHMARK("parse canada.json", [](benchpress::context* ctx)
{
for (size_t i = 0; i < ctx->num_iterations(); ++i)
{
std::ifstream input_file("benchmarks/files/nativejson-benchmark/canada.json");
nlohmann::json j;
j << input_file;
}
})
BENCHMARK("parse citm_catalog.json", [](benchpress::context* ctx)
{
for (size_t i = 0; i < ctx->num_iterations(); ++i)
{
std::ifstream input_file("benchmarks/files/nativejson-benchmark/citm_catalog.json");
nlohmann::json j;
j << input_file;
}
})
BENCHMARK("parse twitter.json", [](benchpress::context* ctx)
{
for (size_t i = 0; i < ctx->num_iterations(); ++i)
{
std::ifstream input_file("benchmarks/files/nativejson-benchmark/twitter.json");
nlohmann::json j;
j << input_file;
}
})
BENCHMARK("parse numbers/floats.json", [](benchpress::context* ctx)
{
for (size_t i = 0; i < ctx->num_iterations(); ++i)
{
std::ifstream input_file("benchmarks/files/numbers/floats.json");
nlohmann::json j;
j << input_file;
}
})
BENCHMARK("parse numbers/signed_ints.json", [](benchpress::context* ctx)
{
for (size_t i = 0; i < ctx->num_iterations(); ++i)
{
std::ifstream input_file("benchmarks/files/numbers/signed_ints.json");
nlohmann::json j;
j << input_file;
}
})
BENCHMARK("parse numbers/unsigned_ints.json", [](benchpress::context* ctx)
{
for (size_t i = 0; i < ctx->num_iterations(); ++i)
{
std::ifstream input_file("benchmarks/files/numbers/unsigned_ints.json");
nlohmann::json j;
j << input_file;
}
})
BENCHMARK("dump jeopardy.json", [](benchpress::context* ctx)
{
std::ifstream input_file("benchmarks/files/jeopardy/jeopardy.json");
nlohmann::json j;
j << input_file;
std::ofstream output_file("jeopardy.dump.json");
ctx->reset_timer();
for (size_t i = 0; i < ctx->num_iterations(); ++i)
{
output_file << j;
}
std::remove("jeopardy.dump.json");
})
BENCHMARK("dump jeopardy.json with indent", [](benchpress::context* ctx)
{
std::ifstream input_file("benchmarks/files/jeopardy/jeopardy.json");
nlohmann::json j;
j << input_file;
std::ofstream output_file("jeopardy.dump.json");
ctx->reset_timer();
for (size_t i = 0; i < ctx->num_iterations(); ++i)
{
output_file << std::setw(4) << j;
}
std::remove("jeopardy.dump.json");
})

View File

@@ -1,401 +0,0 @@
/*
* Copyright (C) 2015 Christopher Gilbert.
*
* 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:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#ifndef BENCHPRESS_HPP
#define BENCHPRESS_HPP
#include <algorithm> // max, min
#include <atomic> // atomic_intmax_t
#include <chrono> // high_resolution_timer, duration
#include <functional> // function
#include <iomanip> // setw
#include <iostream> // cout
#include <regex> // regex, regex_match
#include <sstream> // stringstream
#include <string> // string
#include <thread> // thread
#include <vector> // vector
namespace benchpress {
/*
* The options class encapsulates all options for running benchmarks.
*
* When including benchpress, a main function can be emitted which includes a command-line parser for building an
* options object. However from time-to-time it may be necessary for the developer to have to build their own main
* stub and construct the options object manually.
*
* options opts;
* opts
* .bench(".*")
* .benchtime(1)
* .cpu(4);
*/
class options {
std::string d_bench;
size_t d_benchtime;
size_t d_cpu;
public:
options()
: d_bench(".*")
, d_benchtime(1)
, d_cpu(std::thread::hardware_concurrency())
{}
options& bench(const std::string& bench) {
d_bench = bench;
return *this;
}
options& benchtime(size_t benchtime) {
d_benchtime = benchtime;
return *this;
}
options& cpu(size_t cpu) {
d_cpu = cpu;
return *this;
}
std::string get_bench() const {
return d_bench;
}
size_t get_benchtime() const {
return d_benchtime;
}
size_t get_cpu() const {
return d_cpu;
}
};
class context;
/*
* The benchmark_info class is used to store a function name / pointer pair.
*
* benchmark_info bi("example", [](benchpress::context* b) {
* // benchmark function
* });
*/
class benchmark_info {
std::string d_name;
std::function<void(context*)> d_func;
public:
benchmark_info(std::string name, std::function<void(context*)> func)
: d_name(name)
, d_func(func)
{}
std::string get_name() const { return d_name; }
std::function<void(context*)> get_func() const { return d_func; }
};
/*
* The registration class is responsible for providing a single global point of reference for registering
* benchmark functions.
*
* registration::get_ptr()->register_benchmark(info);
*/
class registration {
static registration* d_this;
std::vector<benchmark_info> d_benchmarks;
public:
static registration* get_ptr() {
if (nullptr == d_this) {
d_this = new registration();
}
return d_this;
}
void register_benchmark(benchmark_info& info) {
d_benchmarks.push_back(info);
}
std::vector<benchmark_info> get_benchmarks() { return d_benchmarks; }
};
/*
* The auto_register class is a helper used to register benchmarks.
*/
class auto_register {
public:
auto_register(const std::string& name, std::function<void(context*)> func) {
benchmark_info info(name, func);
registration::get_ptr()->register_benchmark(info);
}
};
#define CONCAT(x, y) x ## y
#define CONCAT2(x, y) CONCAT(x, y)
// The BENCHMARK macro is a helper for creating benchmark functions and automatically registering them with the
// registration class.
#define BENCHMARK(x, f) benchpress::auto_register CONCAT2(register_, __LINE__)((x), (f));
// This macro will prevent the compiler from removing a redundant code path which has no side-effects.
#define DISABLE_REDUNDANT_CODE_OPT() { asm(""); }
/*
* The result class is responsible for producing a printable string representation of a benchmark run.
*/
class result {
size_t d_num_iterations;
std::chrono::nanoseconds d_duration;
size_t d_num_bytes;
public:
result(size_t num_iterations, std::chrono::nanoseconds duration, size_t num_bytes)
: d_num_iterations(num_iterations)
, d_duration(duration)
, d_num_bytes(num_bytes)
{}
size_t get_ns_per_op() const {
if (d_num_iterations <= 0) {
return 0;
}
return d_duration.count() / d_num_iterations;
}
double get_mb_per_s() const {
if (d_num_iterations <= 0 || d_duration.count() <= 0 || d_num_bytes <= 0) {
return 0;
}
return ((double(d_num_bytes) * double(d_num_iterations) / double(1e6)) /
double(std::chrono::duration_cast<std::chrono::seconds>(d_duration).count()));
}
std::string to_string() const {
std::stringstream tmp;
tmp << std::setw(12) << std::right << d_num_iterations;
size_t npo = get_ns_per_op();
tmp << std::setw(12) << std::right << npo << std::setw(0) << " ns/op";
double mbs = get_mb_per_s();
if (mbs > 0.0) {
tmp << std::setw(12) << std::right << mbs << std::setw(0) << " MB/s";
}
return std::string(tmp.str());
}
};
/*
* The parallel_context class is responsible for providing a thread-safe context for parallel benchmark code.
*/
class parallel_context {
std::atomic_intmax_t d_num_iterations;
public:
parallel_context(size_t num_iterations)
: d_num_iterations(num_iterations)
{}
bool next() {
return (d_num_iterations.fetch_sub(1) > 0);
}
};
/*
* The context class is responsible for providing an interface for capturing benchmark metrics to benchmark functions.
*/
class context {
bool d_timer_on;
std::chrono::high_resolution_clock::time_point d_start;
std::chrono::nanoseconds d_duration;
std::chrono::seconds d_benchtime;
size_t d_num_iterations;
size_t d_num_threads;
size_t d_num_bytes;
benchmark_info d_benchmark;
public:
context(const benchmark_info& info, const options& opts)
: d_timer_on(false)
, d_start()
, d_duration()
, d_benchtime(std::chrono::seconds(opts.get_benchtime()))
, d_num_iterations(1)
, d_num_threads(opts.get_cpu())
, d_num_bytes(0)
, d_benchmark(info)
{}
size_t num_iterations() const { return d_num_iterations; }
void set_num_threads(size_t n) { d_num_threads = n; }
size_t num_threads() const { return d_num_threads; }
void start_timer() {
if (!d_timer_on) {
d_start = std::chrono::high_resolution_clock::now();
d_timer_on = true;
}
}
void stop_timer() {
if (d_timer_on) {
d_duration += std::chrono::high_resolution_clock::now() - d_start;
d_timer_on = false;
}
}
void reset_timer() {
if (d_timer_on) {
d_start = std::chrono::high_resolution_clock::now();
}
d_duration = std::chrono::nanoseconds::zero();
}
void set_bytes(int64_t bytes) { d_num_bytes = bytes; }
size_t get_ns_per_op() {
if (d_num_iterations <= 0) {
return 0;
}
return d_duration.count() / d_num_iterations;
}
void run_n(size_t n) {
d_num_iterations = n;
reset_timer();
start_timer();
d_benchmark.get_func()(this);
stop_timer();
}
void run_parallel(std::function<void(parallel_context*)> f) {
parallel_context pc(d_num_iterations);
std::vector<std::thread> threads;
for (size_t i = 0; i < d_num_threads; ++i) {
threads.push_back(std::thread([&pc,&f]() -> void {
f(&pc);
}));
}
for(auto& thread : threads){
thread.join();
}
}
result run() {
size_t n = 1;
run_n(n);
while (d_duration < d_benchtime && n < 1e9) {
size_t last = n;
if (get_ns_per_op() == 0) {
n = 1e9;
} else {
n = d_duration.count() / get_ns_per_op();
}
n = std::max(std::min(n+n/2, 100*last), last+1);
n = round_up(n);
run_n(n);
}
return result(n, d_duration, d_num_bytes);
}
private:
template<typename T>
T round_down_10(T n) {
int tens = 0;
while (n > 10) {
n /= 10;
tens++;
}
int result = 1;
for (int i = 0; i < tens; ++i) {
result *= 10;
}
return result;
}
template<typename T>
T round_up(T n) {
T base = round_down_10(n);
if (n < (2 * base)) {
return 2 * base;
}
if (n < (5 * base)) {
return 5 * base;
}
return 10 * base;
}
};
/*
* The run_benchmarks function will run the registered benchmarks.
*/
void run_benchmarks(const options& opts) {
std::regex match_r(opts.get_bench());
auto benchmarks = registration::get_ptr()->get_benchmarks();
for (auto& info : benchmarks) {
if (std::regex_match(info.get_name(), match_r)) {
context c(info, opts);
auto r = c.run();
std::cout << std::setw(35) << std::left << info.get_name() << r.to_string() << std::endl;
}
}
}
} // namespace benchpress
/*
* If BENCHPRESS_CONFIG_MAIN is defined when the file is included then a main function will be emitted which provides a
* command-line parser and then executes run_benchmarks.
*/
#ifdef BENCHPRESS_CONFIG_MAIN
#include "cxxopts.hpp"
benchpress::registration* benchpress::registration::d_this;
int main(int argc, char** argv) {
std::chrono::high_resolution_clock::time_point bp_start = std::chrono::high_resolution_clock::now();
benchpress::options bench_opts;
try {
cxxopts::Options cmd_opts(argv[0], " - command line options");
cmd_opts.add_options()
("bench", "run benchmarks matching the regular expression", cxxopts::value<std::string>()
->default_value(".*"))
("benchtime", "run enough iterations of each benchmark to take t seconds", cxxopts::value<size_t>()
->default_value("1"))
("cpu", "specify the number of threads to use for parallel benchmarks", cxxopts::value<size_t>()
->default_value(std::to_string(std::thread::hardware_concurrency())))
("help", "print help")
;
cmd_opts.parse(argc, argv);
if (cmd_opts.count("help")) {
std::cout << cmd_opts.help({""}) << std::endl;
exit(0);
}
if (cmd_opts.count("bench")) {
bench_opts.bench(cmd_opts["bench"].as<std::string>());
}
if (cmd_opts.count("benchtime")) {
bench_opts.benchtime(cmd_opts["benchtime"].as<size_t>());
}
if (cmd_opts.count("cpu")) {
bench_opts.cpu(cmd_opts["cpu"].as<size_t>());
}
} catch (const cxxopts::OptionException& e) {
std::cout << "error parsing options: " << e.what() << std::endl;
exit(1);
}
benchpress::run_benchmarks(bench_opts);
float duration = std::chrono::duration_cast<std::chrono::milliseconds>(
std::chrono::high_resolution_clock::now() - bp_start
).count() / 1000.f;
std::cout << argv[0] << " " << duration << "s" << std::endl;
return 0;
}
#endif
#endif // BENCHPRESS_HPP

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,25 +0,0 @@
#!/usr/bin/env python
import json
import random
import sys
random.seed(0)
# floats
result_floats = []
for x in range(0, 1000000):
result_floats.append(random.uniform(-100000000.0, 100000000.0))
json.dump(result_floats, open("floats.json", "w"), indent=2)
# unsigned integers
result_uints = []
for x in range(0, 1000000):
result_uints.append(random.randint(0, 18446744073709551615))
json.dump(result_uints, open("unsigned_ints.json", "w"), indent=2)
# signed integers
result_sints = []
for x in range(0, 1000000):
result_sints.append(random.randint(-9223372036854775808, 9223372036854775807))
json.dump(result_sints, open("signed_ints.json", "w"), indent=2)

725
cmake/ci.cmake Normal file
View File

@@ -0,0 +1,725 @@
# number of parallel jobs for CTest
set(N 10)
###############################################################################
# Needed tools.
###############################################################################
include(FindPython3)
find_package(Python3 COMPONENTS Interpreter)
find_program(CLANG_TOOL NAMES clang++-HEAD clang++ clang++-20 clang++-19 clang++-18 clang++-17 clang++-16 clang++-15 clang++-14 clang++-13 clang++-12 clang++-11 clang++)
execute_process(COMMAND ${CLANG_TOOL} --version OUTPUT_VARIABLE CLANG_TOOL_VERSION ERROR_VARIABLE CLANG_TOOL_VERSION)
string(REGEX MATCH "[0-9]+(\\.[0-9]+)+" CLANG_TOOL_VERSION "${CLANG_TOOL_VERSION}")
message(STATUS "🔖 Clang ${CLANG_TOOL_VERSION} (${CLANG_TOOL})")
find_program(CLANG_TIDY_TOOL NAMES clang-tidy-20 clang-tidy-19 clang-tidy-18 clang-tidy-17 clang-tidy-16 clang-tidy-15 clang-tidy-14 clang-tidy-13 clang-tidy-12 clang-tidy-11 clang-tidy)
execute_process(COMMAND ${CLANG_TIDY_TOOL} --version OUTPUT_VARIABLE CLANG_TIDY_TOOL_VERSION ERROR_VARIABLE CLANG_TIDY_TOOL_VERSION)
string(REGEX MATCH "[0-9]+(\\.[0-9]+)+" CLANG_TIDY_TOOL_VERSION "${CLANG_TIDY_TOOL_VERSION}")
message(STATUS "🔖 Clang-Tidy ${CLANG_TIDY_TOOL_VERSION} (${CLANG_TIDY_TOOL})")
message(STATUS "🔖 CMake ${CMAKE_VERSION} (${CMAKE_COMMAND})")
find_program(GCC_TOOL NAMES g++-latest g++-HEAD g++ g++-15 g++-14 g++-13 g++-12 g++-11 g++-10)
execute_process(COMMAND ${GCC_TOOL} --version OUTPUT_VARIABLE GCC_TOOL_VERSION ERROR_VARIABLE GCC_TOOL_VERSION)
string(REGEX MATCH "[0-9]+(\\.[0-9]+)+" GCC_TOOL_VERSION "${GCC_TOOL_VERSION}")
message(STATUS "🔖 GCC ${GCC_TOOL_VERSION} (${GCC_TOOL})")
find_program(GCOV_TOOL NAMES gcov-HEAD gcov gcov-15 gcov-14 gcov-13 gcov-12 gcov-11 gcov-10)
execute_process(COMMAND ${GCOV_TOOL} --version OUTPUT_VARIABLE GCOV_TOOL_VERSION ERROR_VARIABLE GCOV_TOOL_VERSION)
string(REGEX MATCH "[0-9]+(\\.[0-9]+)+" GCOV_TOOL_VERSION "${GCOV_TOOL_VERSION}")
message(STATUS "🔖 GCOV ${GCOV_TOOL_VERSION} (${GCOV_TOOL})")
find_program(GIT_TOOL NAMES git)
execute_process(COMMAND ${GIT_TOOL} --version OUTPUT_VARIABLE GIT_TOOL_VERSION ERROR_VARIABLE GIT_TOOL_VERSION)
string(REGEX MATCH "[0-9]+(\\.[0-9]+)+" GIT_TOOL_VERSION "${GIT_TOOL_VERSION}")
message(STATUS "🔖 Git ${GIT_TOOL_VERSION} (${GIT_TOOL})")
find_program(IWYU_TOOL NAMES include-what-you-use iwyu)
execute_process(COMMAND ${IWYU_TOOL} --version OUTPUT_VARIABLE IWYU_TOOL_VERSION ERROR_VARIABLE IWYU_TOOL_VERSION)
string(REGEX MATCH "[0-9]+(\\.[0-9]+)+" IWYU_TOOL_VERSION "${IWYU_TOOL_VERSION}")
message(STATUS "🔖 include-what-you-use ${IWYU_TOOL_VERSION} (${IWYU_TOOL})")
find_program(INFER_TOOL NAMES infer)
execute_process(COMMAND ${INFER_TOOL} --version OUTPUT_VARIABLE INFER_TOOL_VERSION ERROR_VARIABLE INFER_TOOL_VERSION)
string(REGEX MATCH "[0-9]+(\\.[0-9]+)+" INFER_TOOL_VERSION "${INFER_TOOL_VERSION}")
message(STATUS "🔖 Infer ${INFER_TOOL_VERSION} (${INFER_TOOL})")
find_program(LCOV_TOOL NAMES lcov)
execute_process(COMMAND ${LCOV_TOOL} --version OUTPUT_VARIABLE LCOV_TOOL_VERSION ERROR_VARIABLE LCOV_TOOL_VERSION)
string(REGEX MATCH "[0-9]+(\\.[0-9]+)+" LCOV_TOOL_VERSION "${LCOV_TOOL_VERSION}")
message(STATUS "🔖 LCOV ${LCOV_TOOL_VERSION} (${LCOV_TOOL})")
find_program(NINJA_TOOL NAMES ninja)
execute_process(COMMAND ${NINJA_TOOL} --version OUTPUT_VARIABLE NINJA_TOOL_VERSION ERROR_VARIABLE NINJA_TOOL_VERSION)
string(REGEX MATCH "[0-9]+(\\.[0-9]+)+" NINJA_TOOL_VERSION "${NINJA_TOOL_VERSION}")
message(STATUS "🔖 Ninja ${NINJA_TOOL_VERSION} (${NINJA_TOOL})")
find_program(OCLINT_TOOL NAMES oclint-json-compilation-database)
find_program(OCLINT_VERSION_TOOL NAMES oclint)
execute_process(COMMAND ${OCLINT_VERSION_TOOL} --version OUTPUT_VARIABLE OCLINT_TOOL_VERSION ERROR_VARIABLE OCLINT_TOOL_VERSION)
string(REGEX MATCH "[0-9]+(\\.[0-9]+)+" OCLINT_TOOL_VERSION "${OCLINT_TOOL_VERSION}")
message(STATUS "🔖 OCLint ${OCLINT_TOOL_VERSION} (${OCLINT_TOOL})")
find_program(VALGRIND_TOOL NAMES valgrind)
execute_process(COMMAND ${VALGRIND_TOOL} --version OUTPUT_VARIABLE VALGRIND_TOOL_VERSION ERROR_VARIABLE VALGRIND_TOOL_VERSION)
string(REGEX MATCH "[0-9]+(\\.[0-9]+)+" VALGRIND_TOOL_VERSION "${VALGRIND_TOOL_VERSION}")
message(STATUS "🔖 Valgrind ${VALGRIND_TOOL_VERSION} (${VALGRIND_TOOL})")
find_program(GENHTML_TOOL NAMES genhtml)
find_program(PLOG_CONVERTER_TOOL NAMES plog-converter)
find_program(PVS_STUDIO_ANALYZER_TOOL NAMES pvs-studio-analyzer)
find_program(SCAN_BUILD_TOOL NAMES scan-build-15 scan-build-14 scan-build-13 scan-build-12 scan-build-11 scan-build)
# the individual source files
file(GLOB_RECURSE SRC_FILES ${PROJECT_SOURCE_DIR}/include/nlohmann/*.hpp)
###############################################################################
# Thorough check with recent compilers
###############################################################################
include(clang_flags)
include(gcc_flags)
add_custom_target(ci_test_gcc
COMMAND CXX=${GCC_TOOL} CXXFLAGS="${GCC_CXXFLAGS}" ${CMAKE_COMMAND}
-DCMAKE_BUILD_TYPE=Debug -GNinja
-DJSON_BuildTests=ON
-S${PROJECT_SOURCE_DIR} -B${PROJECT_BINARY_DIR}/build_gcc
COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR}/build_gcc
COMMAND cd ${PROJECT_BINARY_DIR}/build_gcc && ${CMAKE_CTEST_COMMAND} --parallel ${N} --output-on-failure
COMMENT "Compile and test with GCC using maximal warning flags"
)
add_custom_target(ci_test_clang
COMMAND CXX=${CLANG_TOOL} CXXFLAGS="${CLANG_CXXFLAGS}" ${CMAKE_COMMAND}
-DCMAKE_BUILD_TYPE=Debug -GNinja
-DJSON_BuildTests=ON
-S${PROJECT_SOURCE_DIR} -B${PROJECT_BINARY_DIR}/build_clang
COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR}/build_clang
COMMAND cd ${PROJECT_BINARY_DIR}/build_clang && ${CMAKE_CTEST_COMMAND} --parallel ${N} --output-on-failure
COMMENT "Compile and test with Clang using maximal warning flags"
)
###############################################################################
# Different C++ Standards.
###############################################################################
foreach(CXX_STANDARD 11 14 17 20 23 26)
add_custom_target(ci_test_gcc_cxx${CXX_STANDARD}
COMMAND CXX=${GCC_TOOL} CXXFLAGS="${GCC_CXXFLAGS}" ${CMAKE_COMMAND}
-DCMAKE_BUILD_TYPE=Debug -GNinja
-DJSON_BuildTests=ON -DJSON_FastTests=ON
-DJSON_TestStandards=${CXX_STANDARD}
-S${PROJECT_SOURCE_DIR} -B${PROJECT_BINARY_DIR}/build_gcc_cxx${CXX_STANDARD}
COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR}/build_gcc_cxx${CXX_STANDARD}
COMMAND cd ${PROJECT_BINARY_DIR}/build_gcc_cxx${CXX_STANDARD} && ${CMAKE_CTEST_COMMAND} --parallel ${N} --output-on-failure
COMMENT "Compile and test with GCC for C++${CXX_STANDARD}"
)
add_custom_target(ci_test_clang_cxx${CXX_STANDARD}
COMMAND CXX=${CLANG_TOOL} CXXFLAGS="${CLANG_CXXFLAGS}" ${CMAKE_COMMAND}
-DCMAKE_BUILD_TYPE=Debug -GNinja
-DJSON_BuildTests=ON -DJSON_FastTests=ON
-DJSON_TestStandards=${CXX_STANDARD}
-S${PROJECT_SOURCE_DIR} -B${PROJECT_BINARY_DIR}/build_clang_cxx${CXX_STANDARD}
COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR}/build_clang_cxx${CXX_STANDARD}
COMMAND cd ${PROJECT_BINARY_DIR}/build_clang_cxx${CXX_STANDARD} && ${CMAKE_CTEST_COMMAND} --parallel ${N} --output-on-failure
COMMENT "Compile and test with Clang for C++${CXX_STANDARD}"
)
add_custom_target(ci_test_clang_libcxx_cxx${CXX_STANDARD}
COMMAND CXX=${CLANG_TOOL} CXXFLAGS="${CLANG_CXXFLAGS}" ${CMAKE_COMMAND}
-DCMAKE_BUILD_TYPE=Debug -GNinja
-DJSON_BuildTests=ON -DJSON_FastTests=ON
-DJSON_TestStandards=${CXX_STANDARD}
-DCMAKE_CXX_FLAGS="-stdlib=libc++"
-DCMAKE_EXE_LINKER_FLAGS="-lc++abi"
-S${PROJECT_SOURCE_DIR} -B${PROJECT_BINARY_DIR}/build_clang_cxx${CXX_STANDARD}
COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR}/build_clang_cxx${CXX_STANDARD}
COMMAND cd ${PROJECT_BINARY_DIR}/build_clang_cxx${CXX_STANDARD} && ${CMAKE_CTEST_COMMAND} --parallel ${N} --output-on-failure
COMMENT "Compile and test with Clang for C++${CXX_STANDARD} (libc++)"
)
endforeach()
###############################################################################
# Disable exceptions.
###############################################################################
add_custom_target(ci_test_noexceptions
COMMAND ${CMAKE_COMMAND}
-DCMAKE_BUILD_TYPE=Debug -GNinja
-DJSON_BuildTests=ON -DCMAKE_CXX_FLAGS=-DJSON_NOEXCEPTION -DDOCTEST_TEST_FILTER=--no-throw
-S${PROJECT_SOURCE_DIR} -B${PROJECT_BINARY_DIR}/build_noexceptions
COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR}/build_noexceptions
COMMAND cd ${PROJECT_BINARY_DIR}/build_noexceptions && ${CMAKE_CTEST_COMMAND} --parallel ${N} --output-on-failure
COMMENT "Compile and test with exceptions switched off"
)
###############################################################################
# Disable implicit conversions.
###############################################################################
add_custom_target(ci_test_noimplicitconversions
COMMAND ${CMAKE_COMMAND}
-DCMAKE_BUILD_TYPE=Debug -GNinja
-DJSON_BuildTests=ON -DJSON_ImplicitConversions=OFF
-S${PROJECT_SOURCE_DIR} -B${PROJECT_BINARY_DIR}/build_noimplicitconversions
COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR}/build_noimplicitconversions
COMMAND cd ${PROJECT_BINARY_DIR}/build_noimplicitconversions && ${CMAKE_CTEST_COMMAND} --parallel ${N} --output-on-failure
COMMENT "Compile and test with implicit conversions switched off"
)
###############################################################################
# Enable improved diagnostics.
###############################################################################
add_custom_target(ci_test_diagnostics
COMMAND ${CMAKE_COMMAND}
-DCMAKE_BUILD_TYPE=Debug -GNinja
-DJSON_BuildTests=ON -DJSON_Diagnostics=ON
-S${PROJECT_SOURCE_DIR} -B${PROJECT_BINARY_DIR}/build_diagnostics
COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR}/build_diagnostics
COMMAND cd ${PROJECT_BINARY_DIR}/build_diagnostics && ${CMAKE_CTEST_COMMAND} --parallel ${N} --output-on-failure
COMMENT "Compile and test with improved diagnostics enabled"
)
###############################################################################
# Enable diagnostic positions support.
###############################################################################
add_custom_target(ci_test_diagnostic_positions
COMMAND ${CMAKE_COMMAND}
-DCMAKE_BUILD_TYPE=Debug -GNinja
-DJSON_BuildTests=ON -DJSON_Diagnostic_Positions=ON
-S${PROJECT_SOURCE_DIR} -B${PROJECT_BINARY_DIR}/build_diagnostic_positions
COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR}/build_diagnostic_positions
COMMAND cd ${PROJECT_BINARY_DIR}/build_diagnostic_positions && ${CMAKE_CTEST_COMMAND} --parallel ${N} --output-on-failure
COMMENT "Compile and test with diagnostic positions enabled"
)
###############################################################################
# Enable legacy discarded value comparison.
###############################################################################
add_custom_target(ci_test_legacycomparison
COMMAND ${CMAKE_COMMAND}
-DCMAKE_BUILD_TYPE=Debug -GNinja
-DJSON_BuildTests=ON -DJSON_LegacyDiscardedValueComparison=ON
-S${PROJECT_SOURCE_DIR} -B${PROJECT_BINARY_DIR}/build_legacycomparison
COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR}/build_legacycomparison
COMMAND cd ${PROJECT_BINARY_DIR}/build_legacycomparison && ${CMAKE_CTEST_COMMAND} --parallel ${N} --output-on-failure
COMMENT "Compile and test with legacy discarded value comparison enabled"
)
###############################################################################
# Disable global UDLs.
###############################################################################
add_custom_target(ci_test_noglobaludls
COMMAND ${CMAKE_COMMAND}
-DCMAKE_BUILD_TYPE=Debug -GNinja
-DJSON_BuildTests=ON -DJSON_FastTests=ON -DJSON_GlobalUDLs=OFF
-DCMAKE_CXX_FLAGS=-DJSON_TEST_NO_GLOBAL_UDLS
-S${PROJECT_SOURCE_DIR} -B${PROJECT_BINARY_DIR}/build_noglobaludls
COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR}/build_noglobaludls
COMMAND cd ${PROJECT_BINARY_DIR}/build_noglobaludls && ${CMAKE_CTEST_COMMAND} --parallel ${N} --output-on-failure
COMMENT "Compile and test with global UDLs disabled"
)
###############################################################################
# Coverage.
###############################################################################
add_custom_target(ci_test_coverage
COMMAND CXX=g++ ${CMAKE_COMMAND}
-DCMAKE_BUILD_TYPE=Debug -GNinja -DCMAKE_CXX_FLAGS="--coverage;-fprofile-arcs;-ftest-coverage"
-DJSON_BuildTests=ON
-S${PROJECT_SOURCE_DIR} -B${PROJECT_BINARY_DIR}/build_coverage
COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR}/build_coverage
COMMAND cd ${PROJECT_BINARY_DIR}/build_coverage && ${CMAKE_CTEST_COMMAND} --parallel ${N} --output-on-failure
COMMAND CXX=g++ ${CMAKE_COMMAND}
-DCMAKE_BUILD_TYPE=Debug -GNinja -DCMAKE_CXX_FLAGS="-m32;--coverage;-fprofile-arcs;-ftest-coverage"
-DJSON_BuildTests=ON -DJSON_32bitTest=ONLY
-S${PROJECT_SOURCE_DIR} -B${PROJECT_BINARY_DIR}/build_coverage32
COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR}/build_coverage32
COMMAND cd ${PROJECT_BINARY_DIR}/build_coverage32 && ${CMAKE_CTEST_COMMAND} --parallel ${N} --output-on-failure
COMMAND ${LCOV_TOOL} --directory . --capture --output-file json.info --rc branch_coverage=1 --rc geninfo_unexecuted_blocks=1 --ignore-errors mismatch --ignore-errors unused
COMMAND ${LCOV_TOOL} -e json.info ${SRC_FILES} --output-file json.info.filtered --rc branch_coverage=1 --ignore-errors unused
COMMAND ${CMAKE_SOURCE_DIR}/tests/thirdparty/imapdl/filterbr.py json.info.filtered > json.info.filtered.noexcept
COMMAND genhtml --title "JSON for Modern C++" --legend --demangle-cpp --output-directory html --show-details --branch-coverage json.info.filtered.noexcept
COMMENT "Compile and test with coverage"
)
###############################################################################
# Sanitizers.
###############################################################################
set(CLANG_CXX_FLAGS_SANITIZER "-g -O1 -fsanitize=address -fsanitize=undefined -fsanitize=integer -fsanitize=nullability -fno-omit-frame-pointer -fno-sanitize-recover=all -fno-sanitize=unsigned-integer-overflow -fno-sanitize=unsigned-shift-base")
add_custom_target(ci_test_clang_sanitizer
COMMAND CXX=${CLANG_TOOL} CXXFLAGS=${CLANG_CXX_FLAGS_SANITIZER} ${CMAKE_COMMAND}
-DCMAKE_BUILD_TYPE=Debug -GNinja
-DJSON_BuildTests=ON
-S${PROJECT_SOURCE_DIR} -B${PROJECT_BINARY_DIR}/build_clang_sanitizer
COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR}/build_clang_sanitizer
COMMAND cd ${PROJECT_BINARY_DIR}/build_clang_sanitizer && ${CMAKE_CTEST_COMMAND} --parallel ${N} --output-on-failure
COMMENT "Compile and test with sanitizers"
)
###############################################################################
# Check if header is amalgamated and sources are properly indented.
###############################################################################
file(GLOB_RECURSE INDENT_FILES
${PROJECT_SOURCE_DIR}/include/nlohmann/*.hpp
${PROJECT_SOURCE_DIR}/tests/src/*.cpp
${PROJECT_SOURCE_DIR}/tests/src/*.hpp
${PROJECT_SOURCE_DIR}/tests/benchmarks/src/benchmarks.cpp
${PROJECT_SOURCE_DIR}/docs/examples/*.cpp
)
set(include_dir ${PROJECT_SOURCE_DIR}/single_include/nlohmann)
set(tool_dir ${PROJECT_SOURCE_DIR}/tools/amalgamate)
add_custom_target(ci_test_amalgamation
COMMAND rm -fr ${include_dir}/json.hpp~ ${include_dir}/json_fwd.hpp~
COMMAND cp ${include_dir}/json.hpp ${include_dir}/json.hpp~
COMMAND cp ${include_dir}/json_fwd.hpp ${include_dir}/json_fwd.hpp~
COMMAND ${Python3_EXECUTABLE} -mvenv venv_astyle
COMMAND venv_astyle/bin/pip3 --quiet install -r ${CMAKE_SOURCE_DIR}/tools/astyle/requirements.txt
COMMAND venv_astyle/bin/astyle --version
COMMAND ${Python3_EXECUTABLE} ${tool_dir}/amalgamate.py -c ${tool_dir}/config_json.json -s .
COMMAND ${Python3_EXECUTABLE} ${tool_dir}/amalgamate.py -c ${tool_dir}/config_json_fwd.json -s .
COMMAND venv_astyle/bin/astyle --project=tools/astyle/.astylerc --suffix=none ${include_dir}/json.hpp ${include_dir}/json_fwd.hpp
COMMAND diff ${include_dir}/json.hpp~ ${include_dir}/json.hpp
COMMAND diff ${include_dir}/json_fwd.hpp~ ${include_dir}/json_fwd.hpp
COMMAND venv_astyle/bin/astyle --project=tools/astyle/.astylerc --suffix=orig ${INDENT_FILES}
COMMAND for FILE in `find . -name '*.orig'`\; do false \; done
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMENT "Check amalgamation and indentation"
)
###############################################################################
# Build and test using the amalgamated header
###############################################################################
add_custom_target(ci_test_single_header
COMMAND ${CMAKE_COMMAND}
-DCMAKE_BUILD_TYPE=Debug -GNinja
-DJSON_BuildTests=ON -DJSON_MultipleHeaders=OFF -DJSON_FastTests=ON
-S${PROJECT_SOURCE_DIR} -B${PROJECT_BINARY_DIR}/build_single_header
COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR}/build_single_header
COMMAND cd ${PROJECT_BINARY_DIR}/build_single_header && ${CMAKE_CTEST_COMMAND} --parallel ${N} --output-on-failure
COMMENT "Compile and test single-header version"
)
###############################################################################
# Valgrind.
###############################################################################
add_custom_target(ci_test_valgrind
COMMAND CXX=${GCC_TOOL} ${CMAKE_COMMAND}
-DCMAKE_BUILD_TYPE=Debug -GNinja
-DJSON_BuildTests=ON -DJSON_Valgrind=ON
-S${PROJECT_SOURCE_DIR} -B${PROJECT_BINARY_DIR}/build_valgrind
COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR}/build_valgrind
COMMAND cd ${PROJECT_BINARY_DIR}/build_valgrind && ${CMAKE_CTEST_COMMAND} -L valgrind --parallel ${N} --output-on-failure
COMMENT "Compile and test with Valgrind"
)
###############################################################################
# Check code with Clang Static Analyzer.
###############################################################################
set(CLANG_ANALYZER_CHECKS "fuchsia.HandleChecker,nullability.NullableDereferenced,nullability.NullablePassedToNonnull,nullability.NullableReturnedFromNonnull,optin.cplusplus.UninitializedObject,optin.cplusplus.VirtualCall,optin.mpi.MPI-Checker,optin.osx.OSObjectCStyleCast,optin.osx.cocoa.localizability.EmptyLocalizationContextChecker,optin.osx.cocoa.localizability.NonLocalizedStringChecker,optin.performance.GCDAntipattern,optin.performance.Padding,optin.portability.UnixAPI,security.FloatLoopCounter,security.insecureAPI.DeprecatedOrUnsafeBufferHandling,security.insecureAPI.bcmp,security.insecureAPI.bcopy,security.insecureAPI.bzero,security.insecureAPI.rand,security.insecureAPI.strcpy,valist.CopyToSelf,valist.Uninitialized,valist.Unterminated,webkit.NoUncountedMemberChecker,webkit.RefCntblBaseVirtualDtor,core.CallAndMessage,core.DivideZero,core.NonNullParamChecker,core.NullDereference,core.StackAddressEscape,core.UndefinedBinaryOperatorResult,core.VLASize,core.uninitialized.ArraySubscript,core.uninitialized.Assign,core.uninitialized.Branch,core.uninitialized.CapturedBlockVariable,core.uninitialized.UndefReturn,cplusplus.InnerPointer,cplusplus.Move,cplusplus.NewDelete,cplusplus.NewDeleteLeaks,cplusplus.PlacementNew,cplusplus.PureVirtualCall,deadcode.DeadStores,nullability.NullPassedToNonnull,nullability.NullReturnedFromNonnull,osx.API,osx.MIG,osx.NumberObjectConversion,osx.OSObjectRetainCount,osx.ObjCProperty,osx.SecKeychainAPI,osx.cocoa.AtSync,osx.cocoa.AutoreleaseWrite,osx.cocoa.ClassRelease,osx.cocoa.Dealloc,osx.cocoa.IncompatibleMethodTypes,osx.cocoa.Loops,osx.cocoa.MissingSuperCall,osx.cocoa.NSAutoreleasePool,osx.cocoa.NSError,osx.cocoa.NilArg,osx.cocoa.NonNilReturnValue,osx.cocoa.ObjCGenerics,osx.cocoa.RetainCount,osx.cocoa.RunLoopAutoreleaseLeak,osx.cocoa.SelfInit,osx.cocoa.SuperDealloc,osx.cocoa.UnusedIvars,osx.cocoa.VariadicMethodTypes,osx.coreFoundation.CFError,osx.coreFoundation.CFNumber,osx.coreFoundation.CFRetainRelease,osx.coreFoundation.containers.OutOfBounds,osx.coreFoundation.containers.PointerSizedValues,security.insecureAPI.UncheckedReturn,security.insecureAPI.decodeValueOfObjCType,security.insecureAPI.getpw,security.insecureAPI.gets,security.insecureAPI.mkstemp,security.insecureAPI.mktemp,security.insecureAPI.vfork,unix.API,unix.Malloc,unix.MallocSizeof,unix.MismatchedDeallocator,unix.Vfork,unix.cstring.BadSizeArg,unix.cstring.NullArg")
add_custom_target(ci_clang_analyze
COMMAND CXX=${CLANG_TOOL} ${CMAKE_COMMAND}
-DCMAKE_BUILD_TYPE=Debug -GNinja
-DJSON_BuildTests=ON
-S${PROJECT_SOURCE_DIR} -B${PROJECT_BINARY_DIR}/build_clang_analyze
COMMAND cd ${PROJECT_BINARY_DIR}/build_clang_analyze && ${SCAN_BUILD_TOOL} -enable-checker ${CLANG_ANALYZER_CHECKS} --use-c++=${CLANG_TOOL} -analyze-headers -o ${PROJECT_BINARY_DIR}/report ninja
COMMENT "Check code with Clang Analyzer"
)
###############################################################################
# Check code with Cppcheck.
###############################################################################
add_custom_target(ci_cppcheck
COMMAND mkdir -p cppcheck
COMMAND clang -dM -E -x c++ -std=c++11 ${CMAKE_SOURCE_DIR}/include/nlohmann/thirdparty/hedley/hedley.hpp > default_defines.hpp 2> /dev/null
COMMAND ${Python3_EXECUTABLE} -mvenv venv_cppcheck
COMMAND venv_cppcheck/bin/pip3 --quiet install -r ${CMAKE_SOURCE_DIR}/cmake/requirements/requirements-cppcheck.txt
COMMAND venv_cppcheck/bin/cppcheck --enable=warning --check-level=exhaustive --inline-suppr --inconclusive --force
--std=c++11 ${PROJECT_SOURCE_DIR}/include/nlohmann/json.hpp -I ${CMAKE_SOURCE_DIR}/include
--error-exitcode=1 --relative-paths=${PROJECT_SOURCE_DIR} -j ${N} --include=default_defines.hpp
--cppcheck-build-dir=cppcheck --check-level=exhaustive
-UJSON_CATCH_USER -UJSON_TRY_USER -UJSON_ASSERT -UJSON_INTERNAL_CATCH -UJSON_THROW
-DJSON_HAS_CPP_11 -UJSON_HAS_CPP_14 -UJSON_HAS_CPP_17 -UJSON_HAS_CPP_20 -UJSON_HAS_THREE_WAY_COMPARISON
COMMENT "Check code with Cppcheck"
)
###############################################################################
# Check code with cpplint.
###############################################################################
add_custom_target(ci_cpplint
COMMAND ${Python3_EXECUTABLE} -mvenv venv_cpplint
COMMAND venv_cpplint/bin/pip3 --quiet install -r ${CMAKE_SOURCE_DIR}/cmake/requirements/requirements-cpplint.txt
COMMAND venv_cpplint/bin/cpplint --filter=-whitespace,-legal,-runtime/references,-runtime/explicit,-runtime/indentation_namespace,-readability/casting,-readability/nolint --quiet --recursive ${SRC_FILES}
COMMENT "Check code with cpplint"
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
)
###############################################################################
# Check code with OCLint.
###############################################################################
file(COPY ${PROJECT_SOURCE_DIR}/single_include/nlohmann/json.hpp DESTINATION ${PROJECT_BINARY_DIR}/src_single)
file(RENAME ${PROJECT_BINARY_DIR}/src_single/json.hpp ${PROJECT_BINARY_DIR}/src_single/all.cpp)
file(APPEND "${PROJECT_BINARY_DIR}/src_single/all.cpp" "\n\nint main()\n{}\n")
add_executable(single_all ${PROJECT_BINARY_DIR}/src_single/all.cpp)
target_compile_features(single_all PRIVATE cxx_std_11)
add_custom_target(ci_oclint
COMMAND ${CMAKE_COMMAND}
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
-DJSON_BuildTests=OFF -DJSON_CI=ON
-S${PROJECT_SOURCE_DIR} -B${PROJECT_BINARY_DIR}/build_oclint
COMMAND ${OCLINT_TOOL} -i ${PROJECT_BINARY_DIR}/build_oclint/src_single/all.cpp -p ${PROJECT_BINARY_DIR}/build_oclint --
-report-type html -enable-global-analysis --max-priority-1=0 --max-priority-2=1000 --max-priority-3=2000
--disable-rule=MultipleUnaryOperator
--disable-rule=DoubleNegative
--disable-rule=ShortVariableName
--disable-rule=GotoStatement
--disable-rule=LongLine
-o ${PROJECT_BINARY_DIR}/build_oclint/oclint_report.html
COMMENT "Check code with OCLint"
)
###############################################################################
# Check code with Clang-Tidy.
###############################################################################
add_custom_target(ci_clang_tidy
COMMAND CXX=${CLANG_TOOL} ${CMAKE_COMMAND}
-DCMAKE_BUILD_TYPE=Debug -GNinja
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_CXX_CLANG_TIDY=${CLANG_TIDY_TOOL}
-DJSON_BuildTests=ON
-S${PROJECT_SOURCE_DIR} -B${PROJECT_BINARY_DIR}/build_clang_tidy
COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR}/build_clang_tidy
COMMENT "Check code with Clang-Tidy"
)
###############################################################################
# Check code with PVS-Studio Analyzer <https://www.viva64.com/en/pvs-studio/>.
###############################################################################
add_custom_target(ci_pvs_studio
COMMAND CXX=${CLANG_TOOL} ${CMAKE_COMMAND}
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
-DJSON_BuildTests=ON
-S${PROJECT_SOURCE_DIR} -B${PROJECT_BINARY_DIR}/build_pvs_studio
COMMAND cd ${PROJECT_BINARY_DIR}/build_pvs_studio && ${PVS_STUDIO_ANALYZER_TOOL} analyze -j 10
COMMAND cd ${PROJECT_BINARY_DIR}/build_pvs_studio && ${PLOG_CONVERTER_TOOL} -a'GA:1,2;64:1;CS' -t fullhtml PVS-Studio.log -o pvs
COMMENT "Check code with PVS Studio"
)
###############################################################################
# Check code with Infer <https://fbinfer.com> static analyzer.
###############################################################################
add_custom_target(ci_infer
COMMAND mkdir -p ${PROJECT_BINARY_DIR}/build_infer
COMMAND cd ${PROJECT_BINARY_DIR}/build_infer && ${INFER_TOOL} compile -- ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Debug ${PROJECT_SOURCE_DIR} -DJSON_BuildTests=ON
COMMAND cd ${PROJECT_BINARY_DIR}/build_infer && ${INFER_TOOL} run -- make
COMMENT "Check code with Infer"
)
###############################################################################
# Run test suite with previously downloaded test data.
###############################################################################
add_custom_target(ci_offline_testdata
COMMAND mkdir -p ${PROJECT_BINARY_DIR}/build_offline_testdata/test_data
COMMAND cd ${PROJECT_BINARY_DIR}/build_offline_testdata/test_data && ${GIT_TOOL} clone -c advice.detachedHead=false --branch v3.1.0 https://github.com/nlohmann/json_test_data.git --quiet --depth 1
COMMAND ${CMAKE_COMMAND}
-DCMAKE_BUILD_TYPE=Debug -GNinja
-DJSON_BuildTests=ON -DJSON_FastTests=ON -DJSON_TestDataDirectory=${PROJECT_BINARY_DIR}/build_offline_testdata/test_data/json_test_data
-S${PROJECT_SOURCE_DIR} -B${PROJECT_BINARY_DIR}/build_offline_testdata
COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR}/build_offline_testdata
COMMAND cd ${PROJECT_BINARY_DIR}/build_offline_testdata && ${CMAKE_CTEST_COMMAND} --parallel ${N} --output-on-failure
COMMENT "Check code with previously downloaded test data"
)
###############################################################################
# Run test suite when project was not checked out from Git
###############################################################################
add_custom_target(ci_non_git_tests
COMMAND git config --global --add safe.directory ${PROJECT_SOURCE_DIR}
COMMAND mkdir -p ${PROJECT_BINARY_DIR}/build_non_git_tests/sources
COMMAND cd ${PROJECT_SOURCE_DIR} && for FILE in `${GIT_TOOL} ls-tree --name-only HEAD`\; do cp -r $$FILE ${PROJECT_BINARY_DIR}/build_non_git_tests/sources \; done
COMMAND ${CMAKE_COMMAND}
-DCMAKE_BUILD_TYPE=Debug -GNinja
-DJSON_BuildTests=ON -DJSON_FastTests=ON
-S${PROJECT_BINARY_DIR}/build_non_git_tests/sources -B${PROJECT_BINARY_DIR}/build_non_git_tests
COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR}/build_non_git_tests
COMMAND cd ${PROJECT_BINARY_DIR}/build_non_git_tests && ${CMAKE_CTEST_COMMAND} --parallel ${N} -LE git_required --output-on-failure
COMMENT "Check code when project was not checked out from Git"
)
###############################################################################
# Run test suite and exclude tests that change installed files
###############################################################################
add_custom_target(ci_reproducible_tests
COMMAND ${CMAKE_COMMAND}
-DCMAKE_BUILD_TYPE=Debug -GNinja
-DJSON_BuildTests=ON -DJSON_FastTests=ON
-S${PROJECT_SOURCE_DIR} -B${PROJECT_BINARY_DIR}/build_reproducible_tests
COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR}/build_reproducible_tests
COMMAND cd ${PROJECT_BINARY_DIR}/build_reproducible_tests && ${CMAKE_CTEST_COMMAND} --parallel ${N} -LE not_reproducible --output-on-failure
COMMENT "Check code and exclude tests that change installed files"
)
###############################################################################
# Check if every header in the include folder includes sufficient headers to
# be compiled individually.
###############################################################################
set(iwyu_path_and_options ${IWYU_TOOL} -Xiwyu --max_line_length=300)
foreach(SRC_FILE ${SRC_FILES})
# get relative path of the header file
file(RELATIVE_PATH RELATIVE_SRC_FILE "${PROJECT_SOURCE_DIR}/include/nlohmann" "${SRC_FILE}")
# replace slashes and strip suffix
string(REPLACE "/" "_" RELATIVE_SRC_FILE "${RELATIVE_SRC_FILE}")
string(REPLACE ".hpp" "" RELATIVE_SRC_FILE "${RELATIVE_SRC_FILE}")
# create code file
file(WRITE "${PROJECT_BINARY_DIR}/src_single/${RELATIVE_SRC_FILE}.cpp" "#include \"${SRC_FILE}\" // IWYU pragma: keep\n\nint main()\n{}\n")
# create executable
add_executable(single_${RELATIVE_SRC_FILE} EXCLUDE_FROM_ALL ${PROJECT_BINARY_DIR}/src_single/${RELATIVE_SRC_FILE}.cpp)
target_include_directories(single_${RELATIVE_SRC_FILE} PRIVATE ${PROJECT_SOURCE_DIR}/include)
target_compile_features(single_${RELATIVE_SRC_FILE} PRIVATE cxx_std_11)
set_property(TARGET single_${RELATIVE_SRC_FILE} PROPERTY CXX_INCLUDE_WHAT_YOU_USE "${iwyu_path_and_options}")
# remember binary for ci_single_binaries target
list(APPEND single_binaries single_${RELATIVE_SRC_FILE})
endforeach()
add_custom_target(ci_single_binaries
DEPENDS ${single_binaries}
COMMENT "Check if headers are self-contained"
)
###############################################################################
# Benchmarks
###############################################################################
add_custom_target(ci_benchmarks
COMMAND ${CMAKE_COMMAND}
-DCMAKE_BUILD_TYPE=Release -GNinja
-S${PROJECT_SOURCE_DIR}/benchmarks -B${PROJECT_BINARY_DIR}/build_benchmarks
COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR}/build_benchmarks --target json_benchmarks
COMMAND cd ${PROJECT_BINARY_DIR}/build_benchmarks && ./json_benchmarks
COMMENT "Run benchmarks"
)
###############################################################################
# CMake flags
###############################################################################
# we test the project with different CMake versions:
# - CMake 3.5 (the earliest supported)
# - CMake 3.31.6 (the latest 3.x release)
# - CMake 4.0.0 (the latest release)
function(ci_get_cmake version var)
set(${var} ${PROJECT_BINARY_DIR}/cmake-${version}/bin/cmake)
add_custom_command(
OUTPUT ${${var}}
COMMAND wget -nc https://github.com/Kitware/CMake/releases/download/v${version}/cmake-${version}.tar.gz
COMMAND tar xfz cmake-${version}.tar.gz
COMMAND rm cmake-${version}.tar.gz
# -DCMAKE_POLICY_VERSION_MINIMUM=3.5 required to compile older CMake versions with CMake 4.0.0
COMMAND cmake -S cmake-${version} -B cmake-${version} -DCMAKE_POLICY_VERSION_MINIMUM=3.5
COMMAND cmake --build cmake-${version} --parallel 10
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
COMMENT "Download CMake ${version}"
)
set(${var} ${${var}} PARENT_SCOPE)
endfunction()
ci_get_cmake(3.5.0 CMAKE_3_5_0_BINARY)
ci_get_cmake(3.31.6 CMAKE_3_31_6_BINARY)
ci_get_cmake(4.0.0 CMAKE_4_0_0_BINARY)
# the tests require CMake 3.13 or later, so they are excluded for CMake 3.5.0
set(JSON_CMAKE_FLAGS_3_5_0 JSON_Diagnostics JSON_Diagnostic_Positions JSON_GlobalUDLs JSON_ImplicitConversions JSON_DisableEnumSerialization
JSON_LegacyDiscardedValueComparison JSON_Install JSON_MultipleHeaders JSON_SystemInclude JSON_Valgrind)
set(JSON_CMAKE_FLAGS_3_31_6 JSON_BuildTests ${JSON_CMAKE_FLAGS_3_31_6})
set(JSON_CMAKE_FLAGS_4_0_0 JSON_BuildTests ${JSON_CMAKE_FLAGS_3_5_0})
function(ci_add_cmake_flags_targets flag min_version)
string(TOLOWER "ci_cmake_flag_${flag}" flag_target)
string(REPLACE . _ min_version_var ${min_version})
set(cmake_binary ${CMAKE_${min_version_var}_BINARY})
add_custom_target(${flag_target}_${min_version}_2
COMMENT "Check CMake flag ${flag} (CMake ${CMAKE_VERSION})"
COMMAND ${CMAKE_COMMAND}
-Werror=dev
-D${flag}=ON
-S${PROJECT_SOURCE_DIR} -B${PROJECT_BINARY_DIR}/build_${flag_target}
)
add_custom_target(${flag_target}_${min_version_var}
COMMENT "Check CMake flag ${JSON_CMAKE_FLAG} (CMake ${min_version})"
COMMAND mkdir -pv ${PROJECT_BINARY_DIR}/build_${flag_target}_${min_version_var}
COMMAND cd ${PROJECT_BINARY_DIR}/build_${flag_target}_${min_version_var}
&& ${cmake_binary} -Werror=dev ${PROJECT_SOURCE_DIR} -D${flag}=ON
DEPENDS ${cmake_binary}
)
list(APPEND JSON_CMAKE_FLAG_TARGETS ${JSON_CMAKE_FLAG_TARGET} ${flag_target}_${min_version_var})
list(APPEND JSON_CMAKE_FLAG_BUILD_DIRS ${PROJECT_BINARY_DIR}/build_${flag_target} ${PROJECT_BINARY_DIR}/build_${flag_target}_${min_version_var})
set(JSON_CMAKE_FLAG_TARGETS ${JSON_CMAKE_FLAG_TARGETS} PARENT_SCOPE)
set(JSON_CMAKE_FLAG_BUILD_DIRS ${JSON_CMAKE_FLAG_BUILD_DIRS} PARENT_SCOPE)
endfunction()
foreach(JSON_CMAKE_FLAG ${JSON_CMAKE_FLAGS_3_5_0})
ci_add_cmake_flags_targets(${JSON_CMAKE_FLAG} 3.5.0)
endforeach()
foreach(JSON_CMAKE_FLAG ${JSON_CMAKE_FLAGS_3_31_6})
ci_add_cmake_flags_targets(${JSON_CMAKE_FLAG} 3.31.6)
endforeach()
foreach(JSON_CMAKE_FLAG ${JSON_CMAKE_FLAGS_4_0_0})
ci_add_cmake_flags_targets(${JSON_CMAKE_FLAG} 4.0.0)
endforeach()
add_custom_target(ci_cmake_flags
DEPENDS ${JSON_CMAKE_FLAG_TARGETS}
COMMENT "Check CMake flags"
)
###############################################################################
# Use more installed compilers.
###############################################################################
foreach(COMPILER g++-4.8 g++-4.9 g++-5 g++-6 g++-7 g++-8 g++-9 g++-10 g++-11 clang++-3.5 clang++-3.6 clang++-3.7 clang++-3.8 clang++-3.9 clang++-4.0 clang++-5.0 clang++-6.0 clang++-7 clang++-8 clang++-9 clang++-10 clang++-11 clang++-12 clang++-13 clang++-14 clang++-15 clang++-16 clang++-17 clang++-18 clang++-19 clang++-20)
find_program(COMPILER_TOOL NAMES ${COMPILER})
if (COMPILER_TOOL)
unset(ADDITIONAL_FLAGS)
add_custom_target(ci_test_compiler_${COMPILER}
COMMAND CXX=${COMPILER} ${CMAKE_COMMAND}
-DCMAKE_BUILD_TYPE=Debug -GNinja
-DJSON_BuildTests=ON -DJSON_FastTests=ON
-S${PROJECT_SOURCE_DIR} -B${PROJECT_BINARY_DIR}/build_compiler_${COMPILER}
${ADDITIONAL_FLAGS}
COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR}/build_compiler_${COMPILER}
COMMAND cd ${PROJECT_BINARY_DIR}/build_compiler_${COMPILER} && ${CMAKE_CTEST_COMMAND} --parallel ${N} --exclude-regex "test-unicode" --output-on-failure
COMMENT "Compile and test with ${COMPILER}"
)
endif()
unset(COMPILER_TOOL CACHE)
endforeach()
add_custom_target(ci_test_compiler_default
COMMAND ${CMAKE_COMMAND}
-DCMAKE_BUILD_TYPE=Debug -GNinja
-DJSON_BuildTests=ON -DJSON_FastTests=ON
-S${PROJECT_SOURCE_DIR} -B${PROJECT_BINARY_DIR}/build_compiler_default
${ADDITIONAL_FLAGS}
COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR}/build_compiler_default --parallel ${N}
COMMAND cd ${PROJECT_BINARY_DIR}/build_compiler_default && ${CMAKE_CTEST_COMMAND} --parallel ${N} --exclude-regex "test-unicode" -LE git_required --output-on-failure
COMMENT "Compile and test with default C++ compiler"
)
###############################################################################
# CUDA example
###############################################################################
add_custom_target(ci_cuda_example
COMMAND ${CMAKE_COMMAND}
-DCMAKE_BUILD_TYPE=Debug -GNinja
-DCMAKE_CUDA_HOST_COMPILER=g++-8
-S${PROJECT_SOURCE_DIR}/tests/cuda_example -B${PROJECT_BINARY_DIR}/build_cuda_example
COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR}/build_cuda_example
)
###############################################################################
# C++ 20 modules
###############################################################################
add_custom_target(ci_module_cpp20
COMMAND ${CMAKE_COMMAND}
-DCMAKE_BUILD_TYPE=Debug -GNinja
-DJSON_CI=ON -DNLOHMANN_JSON_BUILD_MODULES=ON -DJSON_Install=ON
-S${PROJECT_SOURCE_DIR}/tests/module_cpp20 -B${PROJECT_BINARY_DIR}/ci_module_cpp20
COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR}/ci_module_cpp20
)
###############################################################################
# Intel C++ Compiler
###############################################################################
add_custom_target(ci_icpc
COMMAND ${CMAKE_COMMAND}
-DCMAKE_BUILD_TYPE=Debug -GNinja
-DCMAKE_C_COMPILER=icc -DCMAKE_CXX_COMPILER=icpc
-DJSON_BuildTests=ON -DJSON_FastTests=ON
-S${PROJECT_SOURCE_DIR} -B${PROJECT_BINARY_DIR}/build_icpc
COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR}/build_icpc
COMMAND cd ${PROJECT_BINARY_DIR}/build_icpc && ${CMAKE_CTEST_COMMAND} --parallel ${N} --exclude-regex "test-unicode" --output-on-failure
COMMENT "Compile and test with ICPC"
)
###############################################################################
# REUSE
###############################################################################
add_custom_target(ci_reuse_compliance
COMMAND ${Python3_EXECUTABLE} -mvenv venv_reuse
COMMAND venv_reuse/bin/pip3 --quiet install -r ${PROJECT_SOURCE_DIR}/cmake/requirements/requirements-reuse.txt
COMMAND venv_reuse/bin/reuse --root ${PROJECT_SOURCE_DIR} lint
COMMENT "Check REUSE specification compliance"
)
###############################################################################
# test documentation
###############################################################################
add_custom_target(ci_test_examples
COMMAND make CXX="${GCC_TOOL}" check_output_portable -j8
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/docs
COMMENT "Check that all examples compile and create the desired output"
)
add_custom_target(ci_test_build_documentation
COMMAND ${Python3_EXECUTABLE} -mvenv venv
COMMAND venv/bin/pip3 --quiet install -r requirements.txt
COMMAND make build
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/docs/mkdocs
COMMENT "Build the documentation"
)
###############################################################################
# Clean up all generated files.
###############################################################################
add_custom_target(ci_clean
COMMAND rm -fr ${PROJECT_BINARY_DIR}/build_* cmake-3.5.0-Darwin64 ${JSON_CMAKE_FLAG_BUILD_DIRS} ${single_binaries}
COMMENT "Clean generated directories"
)

22
cmake/clang_flags.cmake Normal file
View File

@@ -0,0 +1,22 @@
# Ignored Clang warnings:
# -Wno-c++98-compat The library targets C++11.
# -Wno-c++98-compat-pedantic The library targets C++11.
# -Wno-deprecated-declarations The library contains annotations for deprecated functions.
# -Wno-extra-semi-stmt The library uses assert which triggers this warning.
# -Wno-padded We do not care about padding warnings.
# -Wno-covered-switch-default All switches list all cases and a default case.
# -Wno-unsafe-buffer-usage Otherwise Doctest would not compile.
# -Wno-missing-noreturn We found no way to silence this warning otherwise, see PR #4871
set(CLANG_CXXFLAGS
-Werror
-Weverything
-Wno-c++98-compat
-Wno-c++98-compat-pedantic
-Wno-deprecated-declarations
-Wno-extra-semi-stmt
-Wno-padded
-Wno-covered-switch-default
-Wno-unsafe-buffer-usage
-Wno-missing-noreturn
)

View File

@@ -1,6 +1,15 @@
@PACKAGE_INIT@
include(FindPackageHandleStandardArgs)
set(${CMAKE_FIND_PACKAGE_NAME}_CONFIG ${CMAKE_CURRENT_LIST_FILE})
find_package_handle_standard_args(@PROJECT_NAME@ CONFIG_MODE)
cmake_policy(PUSH)
cmake_policy(SET CMP0024 OLD)
include(${CMAKE_CURRENT_LIST_DIR}/@JSON_TARGETS_FILENAME@)
cmake_policy(POP)
if(NOT TARGET @PROJECT_NAME@::@NLOHMANN_JSON_TARGET_NAME@)
include("${CMAKE_CURRENT_LIST_DIR}/@NLOHMANN_JSON_TARGETS_EXPORT_NAME@.cmake")
if((NOT TARGET @NLOHMANN_JSON_TARGET_NAME@) AND
(NOT @PROJECT_NAME@_FIND_VERSION OR
@PROJECT_NAME@_FIND_VERSION VERSION_LESS 3.2.0))
add_library(@NLOHMANN_JSON_TARGET_NAME@ INTERFACE IMPORTED)
set_target_properties(@NLOHMANN_JSON_TARGET_NAME@ PROPERTIES
INTERFACE_LINK_LIBRARIES @PROJECT_NAME@::@NLOHMANN_JSON_TARGET_NAME@
)
endif()
endif()

View File

@@ -0,0 +1,31 @@
/*
* Detect used C++ Standard Library
*
* This file is compiled and run via try_run in download_test_data.cmake.
*/
#include <cstdio>
// see https://en.cppreference.com/w/cpp/header/ciso646
#if __cplusplus >= 202002L
#include <version>
#else
#include <ciso646>
#endif
int main()
{
#if defined(_LIBCPP_VERSION)
std::printf("LLVM C++ Standard Library (libc++), _LIBCPP_VERSION=%d", _LIBCPP_VERSION);
#elif defined(__GLIBCXX__)
std::printf("GNU C++ Standard Library (libstdc++), __GLIBCXX__=%d", __GLIBCXX__);
#elif defined(_MSVC_STL_VERSION)
std::printf("Microsoft C++ Standard Library (MSVC STL), _MSVC_STL_VERSION=%d", _MSVC_STL_VERSION);
#elif defined(_LIBCUDACXX_VERSION)
std::printf("NVIDIA C++ Standard Library (libcudacxx), _LIBCUDACXX_VERSION=%d", _LIBCUDACXX_VERSION);
#elif defined(EASTL_VERSION)
std::printf("Electronic Arts Standard Template Library (EASTL), EASTL_VERSION=%d", EASTL_VERSION);
#else
std::printf("unknown");
#endif
}

View File

@@ -0,0 +1,87 @@
set(JSON_TEST_DATA_URL https://github.com/nlohmann/json_test_data)
set(JSON_TEST_DATA_VERSION 3.1.0)
include(ExternalProject)
# if variable is set, use test data from given directory rather than downloading them
if(JSON_TestDataDirectory)
message(STATUS "Using test data in ${JSON_TestDataDirectory}.")
add_custom_target(download_test_data)
file(WRITE ${CMAKE_BINARY_DIR}/include/test_data.hpp "#define TEST_DATA_DIRECTORY \"${JSON_TestDataDirectory}\"\n")
else()
# create a header with the path to the downloaded test data
file(WRITE ${CMAKE_BINARY_DIR}/include/test_data.hpp "#define TEST_DATA_DIRECTORY \"${CMAKE_BINARY_DIR}/test_files\"\n")
# download test data from GitHub release
ExternalProject_Add(download_test_data_project
URL "${JSON_TEST_DATA_URL}/archive/refs/tags/v${JSON_TEST_DATA_VERSION}.zip"
SOURCE_DIR "${CMAKE_BINARY_DIR}/test_files"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
LOG_DOWNLOAD TRUE
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
EXCLUDE_FROM_ALL TRUE
)
# target to download test data
add_custom_target(download_test_data
DEPENDS download_test_data_project
)
endif()
# determine the operating system (for debug and support purposes)
find_program(UNAME_COMMAND uname)
find_program(VER_COMMAND ver)
find_program(LSB_RELEASE_COMMAND lsb_release)
find_program(SW_VERS_COMMAND sw_vers)
set(OS_VERSION_STRINGS "${CMAKE_SYSTEM}")
if (VER_COMMAND)
execute_process(COMMAND ${VER_COMMAND} OUTPUT_VARIABLE VER_COMMAND_RESULT OUTPUT_STRIP_TRAILING_WHITESPACE)
set(OS_VERSION_STRINGS "${OS_VERSION_STRINGS}; ${VER_COMMAND_RESULT}")
endif()
if (SW_VERS_COMMAND)
execute_process(COMMAND ${SW_VERS_COMMAND} OUTPUT_VARIABLE SW_VERS_COMMAND_RESULT OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
string(REGEX REPLACE "[ ]*\n" "; " SW_VERS_COMMAND_RESULT "${SW_VERS_COMMAND_RESULT}")
set(OS_VERSION_STRINGS "${OS_VERSION_STRINGS}; ${SW_VERS_COMMAND_RESULT}")
endif()
if (LSB_RELEASE_COMMAND)
execute_process(COMMAND ${LSB_RELEASE_COMMAND} -a OUTPUT_VARIABLE LSB_RELEASE_COMMAND_RESULT OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
string(REGEX REPLACE "[ ]*\n" "; " LSB_RELEASE_COMMAND_RESULT "${LSB_RELEASE_COMMAND_RESULT}")
set(OS_VERSION_STRINGS "${OS_VERSION_STRINGS}; ${LSB_RELEASE_COMMAND_RESULT}")
endif()
if (UNAME_COMMAND)
execute_process(COMMAND ${UNAME_COMMAND} -a OUTPUT_VARIABLE UNAME_COMMAND_RESULT OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
set(OS_VERSION_STRINGS "${OS_VERSION_STRINGS}; ${UNAME_COMMAND_RESULT}")
endif()
message(STATUS "Operating system: ${OS_VERSION_STRINGS}")
# determine the compiler (for debug and support purposes)
if (MSVC)
execute_process(COMMAND ${CMAKE_CXX_COMPILER} OUTPUT_VARIABLE CXX_VERSION_RESULT OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_VARIABLE CXX_VERSION_RESULT ERROR_STRIP_TRAILING_WHITESPACE)
set(CXX_VERSION_RESULT "${CXX_VERSION_RESULT}; MSVC_VERSION=${MSVC_VERSION}; MSVC_TOOLSET_VERSION=${MSVC_TOOLSET_VERSION}")
else()
execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version OUTPUT_VARIABLE CXX_VERSION_RESULT OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
string(REGEX REPLACE "[ ]*\n" "; " CXX_VERSION_RESULT "${CXX_VERSION_RESULT}")
message(STATUS "Compiler: ${CXX_VERSION_RESULT}")
# determine used C++ standard library (for debug and support purposes)
if(CMAKE_CROSSCOMPILING)
set(LIBCPP_VERSION_OUTPUT_CACHED "could not be detected due to cross-compiling" CACHE STRING "Detected C++ standard library version")
endif()
if(NOT DEFINED LIBCPP_VERSION_OUTPUT_CACHED)
try_run(RUN_RESULT_VAR COMPILE_RESULT_VAR
"${CMAKE_BINARY_DIR}" SOURCES "${CMAKE_SOURCE_DIR}/cmake/detect_libcpp_version.cpp"
RUN_OUTPUT_VARIABLE LIBCPP_VERSION_OUTPUT
COMPILE_OUTPUT_VARIABLE LIBCPP_VERSION_COMPILE_OUTPUT
)
if(NOT LIBCPP_VERSION_OUTPUT)
set(LIBCPP_VERSION_OUTPUT "Unknown")
message(AUTHOR_WARNING "Failed to compile cmake/detect_libcpp_version to detect the used C++ standard library. This does not affect the library or the test cases. Please still create an issue at https://github.com/nlohmann/json to investigate this.\n${LIBCPP_VERSION_COMPILE_OUTPUT}")
endif()
set(LIBCPP_VERSION_OUTPUT_CACHED "${LIBCPP_VERSION_OUTPUT}" CACHE STRING "Detected C++ standard library version")
endif()
message(STATUS "C++ standard library: ${LIBCPP_VERSION_OUTPUT_CACHED}")

363
cmake/gcc_flags.cmake Normal file
View File

@@ -0,0 +1,363 @@
# Warning flags determined for GCC 15.1.0 with https://github.com/nlohmann/gcc_flags:
# Ignored GCC warnings:
# -Wno-abi-tag We do not care about ABI tags.
# -Wno-aggregate-return The library uses aggregate returns.
# -Wno-long-long The library uses the long long type to interface with system functions.
# -Wno-namespaces The library uses namespaces.
# -Wno-nrvo Doctest triggers this warning.
# -Wno-padded We do not care about padding warnings.
# -Wno-system-headers We do not care about warnings in system headers.
# -Wno-templates The library uses templates.
set(GCC_CXXFLAGS
-pedantic
-Werror
--all-warnings
--extra-warnings
-W
-WNSObject-attribute
-Wno-abi-tag
-Waddress
-Waddress-of-packed-member
-Wno-aggregate-return
-Waggressive-loop-optimizations
-Waligned-new=all
-Wall
-Walloc-size
-Walloc-zero
-Walloca
-Wanalyzer-allocation-size
-Wanalyzer-deref-before-check
-Wanalyzer-double-fclose
-Wanalyzer-double-free
-Wanalyzer-exposure-through-output-file
-Wanalyzer-exposure-through-uninit-copy
-Wanalyzer-fd-access-mode-mismatch
-Wanalyzer-fd-double-close
-Wanalyzer-fd-leak
-Wanalyzer-fd-phase-mismatch
-Wanalyzer-fd-type-mismatch
-Wanalyzer-fd-use-after-close
-Wanalyzer-fd-use-without-check
-Wanalyzer-file-leak
-Wanalyzer-free-of-non-heap
-Wanalyzer-imprecise-fp-arithmetic
-Wanalyzer-infinite-loop
-Wanalyzer-infinite-recursion
-Wanalyzer-jump-through-null
-Wanalyzer-malloc-leak
-Wanalyzer-mismatching-deallocation
-Wanalyzer-null-argument
-Wanalyzer-null-dereference
-Wanalyzer-out-of-bounds
-Wanalyzer-overlapping-buffers
-Wanalyzer-possible-null-argument
-Wanalyzer-possible-null-dereference
-Wanalyzer-putenv-of-auto-var
-Wanalyzer-shift-count-negative
-Wanalyzer-shift-count-overflow
-Wanalyzer-stale-setjmp-buffer
-Wanalyzer-symbol-too-complex
-Wanalyzer-tainted-allocation-size
-Wanalyzer-tainted-array-index
-Wanalyzer-tainted-assertion
-Wanalyzer-tainted-divisor
-Wanalyzer-tainted-offset
-Wanalyzer-tainted-size
-Wanalyzer-too-complex
-Wanalyzer-undefined-behavior-ptrdiff
-Wanalyzer-undefined-behavior-strtok
-Wanalyzer-unsafe-call-within-signal-handler
-Wanalyzer-use-after-free
-Wanalyzer-use-of-pointer-in-stale-stack-frame
-Wanalyzer-use-of-uninitialized-value
-Wanalyzer-va-arg-type-mismatch
-Wanalyzer-va-list-exhausted
-Wanalyzer-va-list-leak
-Wanalyzer-va-list-use-after-va-end
-Wanalyzer-write-to-const
-Wanalyzer-write-to-string-literal
-Warith-conversion
-Warray-bounds=2
-Warray-compare
-Warray-parameter=2
-Wattribute-alias=2
-Wattribute-warning
-Wattributes
-Wbool-compare
-Wbool-operation
-Wbuiltin-declaration-mismatch
-Wbuiltin-macro-redefined
-Wc++0x-compat
-Wc++11-compat
-Wc++11-extensions
-Wc++14-compat
-Wc++14-extensions
-Wc++17-compat
-Wc++17-extensions
-Wc++1z-compat
-Wc++20-compat
-Wc++20-extensions
-Wc++23-extensions
-Wc++26-extensions
-Wc++2a-compat
-Wcalloc-transposed-args
-Wcannot-profile
-Wcast-align
-Wcast-align=strict
-Wcast-function-type
-Wcast-qual
-Wcast-user-defined
-Wcatch-value=3
-Wchanges-meaning
-Wchar-subscripts
-Wclass-conversion
-Wclass-memaccess
-Wclobbered
-Wcomma-subscript
-Wcomment
-Wcomments
-Wcomplain-wrong-lang
-Wconditionally-supported
-Wconversion
-Wconversion-null
-Wcoverage-invalid-line-number
-Wcoverage-mismatch
-Wcoverage-too-many-conditions
-Wcoverage-too-many-paths
-Wcpp
-Wctad-maybe-unsupported
-Wctor-dtor-privacy
-Wdangling-else
-Wdangling-pointer=2
-Wdangling-reference
-Wdate-time
-Wdefaulted-function-deleted
-Wdelete-incomplete
-Wdelete-non-virtual-dtor
-Wdeprecated
-Wdeprecated-copy
-Wdeprecated-copy-dtor
-Wdeprecated-declarations
-Wdeprecated-enum-enum-conversion
-Wdeprecated-enum-float-conversion
-Wdeprecated-literal-operator
-Wdeprecated-variadic-comma-omission
-Wdisabled-optimization
-Wdiv-by-zero
-Wdouble-promotion
-Wduplicated-branches
-Wduplicated-cond
-Weffc++
-Welaborated-enum-base
-Wempty-body
-Wendif-labels
-Wenum-compare
-Wenum-conversion
-Wexceptions
-Wexpansion-to-defined
-Wextra
-Wextra-semi
-Wflex-array-member-not-at-end
-Wfloat-conversion
-Wfloat-equal
-Wformat -Wformat-contains-nul
-Wformat -Wformat-diag
-Wformat -Wformat-extra-args
-Wformat -Wformat-nonliteral
-Wformat -Wformat-overflow=2
-Wformat -Wformat-security
-Wformat -Wformat-signedness
-Wformat -Wformat-truncation=2
-Wformat -Wformat-y2k
-Wformat -Wformat-zero-length
-Wformat=2
-Wframe-address
-Wfree-nonheap-object
-Wglobal-module
-Whardened
-Wheader-guard
-Whsa
-Wif-not-aligned
-Wignored-attributes
-Wignored-qualifiers
-Wimplicit-fallthrough=5
-Winaccessible-base
-Winfinite-recursion
-Winherited-variadic-ctor
-Winit-list-lifetime
-Winit-self
-Winline
-Wint-in-bool-context
-Wint-to-pointer-cast
-Winterference-size
-Winvalid-constexpr
-Winvalid-imported-macros
-Winvalid-memory-model
-Winvalid-offsetof
-Winvalid-pch
-Winvalid-utf8
-Wliteral-suffix
-Wlogical-not-parentheses
-Wlogical-op
-Wno-long-long
-Wlto-type-mismatch
-Wmain
-Wmaybe-musttail-local-addr
-Wmaybe-uninitialized
-Wmemset-elt-size
-Wmemset-transposed-args
-Wmisleading-indentation
-Wmismatched-dealloc
-Wmismatched-new-delete
-Wmismatched-tags
-Wmissing-attributes
-Wmissing-braces
-Wmissing-declarations
-Wmissing-field-initializers
-Wmissing-include-dirs
-Wmissing-profile
-Wmissing-requires
-Wmissing-template-keyword
-Wmultichar
-Wmultiple-inheritance
-Wmultistatement-macros
-Wmusttail-local-addr
-Wno-namespaces
-Wnarrowing
-Wnoexcept
-Wnoexcept-type
-Wnon-template-friend
-Wnon-virtual-dtor
-Wnonnull
-Wnonnull-compare
-Wnormalized=nfkc
-Wno-nrvo
-Wnull-dereference
-Wodr
-Wold-style-cast
-Wopenacc-parallelism
-Wopenmp
-Wopenmp-simd
-Woverflow
-Woverlength-strings
-Woverloaded-virtual=2
-Wpacked
-Wpacked-bitfield-compat
-Wpacked-not-aligned
-Wno-padded
-Wparentheses
-Wpedantic
-Wpessimizing-move
-Wplacement-new=2
-Wpmf-conversions
-Wpointer-arith
-Wpointer-compare
-Wpragma-once-outside-header
-Wpragmas
-Wprio-ctor-dtor
-Wpsabi
-Wrange-loop-construct
-Wredundant-decls
-Wredundant-move
-Wredundant-tags
-Wregister
-Wreorder
-Wrestrict
-Wreturn-local-addr
-Wreturn-type
-Wscalar-storage-order
-Wself-move
-Wsequence-point
-Wshadow=compatible-local
-Wshadow=global
-Wshadow=local
-Wshift-count-negative
-Wshift-count-overflow
-Wshift-negative-value
-Wshift-overflow=2
-Wsign-compare
-Wsign-conversion
-Wsign-promo
-Wsized-deallocation
-Wsizeof-array-argument
-Wsizeof-array-div
-Wsizeof-pointer-div
-Wsizeof-pointer-memaccess
-Wstack-protector
-Wstrict-aliasing
-Wstrict-aliasing=3
-Wstrict-null-sentinel
-Wstrict-overflow
-Wstring-compare
-Wstringop-overflow
-Wstringop-overflow=4
-Wstringop-overread
-Wstringop-truncation
-Wsubobject-linkage
-Wsuggest-attribute=cold
-Wsuggest-attribute=const
-Wsuggest-attribute=format
-Wsuggest-attribute=malloc
-Wsuggest-attribute=noreturn
-Wsuggest-attribute=pure
-Wsuggest-attribute=returns_nonnull
-Wsuggest-final-methods
-Wsuggest-final-types
-Wsuggest-override
-Wswitch
-Wswitch-bool
-Wswitch-default
-Wswitch-enum
-Wswitch-outside-range
-Wswitch-unreachable
-Wsync-nand
-Wsynth
-Wno-system-headers
-Wtautological-compare
-Wtemplate-body
-Wtemplate-id-cdtor
-Wtemplate-names-tu-local
-Wno-templates
-Wterminate
-Wtrailing-whitespace
-Wtrampolines
-Wtrigraphs
-Wtrivial-auto-var-init
-Wtsan
-Wtype-limits
-Wundef
-Wunicode
-Wuninitialized
-Wunknown-pragmas
-Wunreachable-code
-Wunsafe-loop-optimizations
-Wunused
-Wunused-but-set-parameter
-Wunused-but-set-variable
-Wunused-const-variable=2
-Wunused-function
-Wunused-label
-Wunused-local-typedefs
-Wunused-macros
-Wunused-parameter
-Wunused-result
-Wunused-value
-Wunused-variable
-Wuse-after-free=3
-Wuseless-cast
-Wvarargs
-Wvariadic-macros
-Wvector-operation-performance
-Wvexing-parse
-Wvirtual-inheritance
-Wvirtual-move-assign
-Wvla
-Wvla-parameter
-Wvolatile
-Wvolatile-register-var
-Wwrite-strings
-Wxor-used-as-pow
-Wzero-as-null-pointer-constant
-Wzero-length-bounds
)

View File

@@ -0,0 +1,20 @@
# This is essentially cmake's BasicConfigVersion-SameMajorVersion.cmake.in but
# without the 32/64-bit check. Since json is a header-only library, it doesn't
# matter if it was built on a different platform than what it is used on (see
# https://github.com/nlohmann/json/issues/1697).
set(PACKAGE_VERSION "@PROJECT_VERSION@")
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
if(PACKAGE_FIND_VERSION_MAJOR STREQUAL "@PROJECT_VERSION_MAJOR@")
set(PACKAGE_VERSION_COMPATIBLE TRUE)
else()
set(PACKAGE_VERSION_COMPATIBLE FALSE)
endif()
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()

7
cmake/pkg-config.pc.in Normal file
View File

@@ -0,0 +1,7 @@
prefix=@CMAKE_INSTALL_PREFIX@
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
Name: @PROJECT_NAME@
Description: JSON for Modern C++
Version: @PROJECT_VERSION@
Cflags: -I${includedir}

View File

@@ -0,0 +1 @@
cppcheck==1.5.0

View File

@@ -0,0 +1 @@
cpplint==2.0.2

View File

@@ -0,0 +1 @@
reuse==6.2.0

View File

@@ -0,0 +1,24 @@
# generate Bazel BUILD file
set(PROJECT_ROOT "${CMAKE_CURRENT_LIST_DIR}/../..")
set(BUILD_FILE "${PROJECT_ROOT}/BUILD.bazel")
file(GLOB_RECURSE HEADERS LIST_DIRECTORIES false RELATIVE "${PROJECT_ROOT}" "include/*.hpp")
file(WRITE "${BUILD_FILE}" [=[
cc_library(
name = "json",
hdrs = [
]=])
foreach(header ${HEADERS})
file(APPEND "${BUILD_FILE}" " \"${header}\",\n")
endforeach()
file(APPEND "${BUILD_FILE}" [=[
],
includes = ["include"],
visibility = ["//visibility:public"],
alwayslink = True,
)
]=])

273
cmake/test.cmake Normal file
View File

@@ -0,0 +1,273 @@
set(_json_test_cmake_list_file ${CMAKE_CURRENT_LIST_FILE})
#############################################################################
# download test data
#############################################################################
include(download_test_data)
# test fixture to download test data
add_test(NAME "download_test_data" COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR}
--target download_test_data
)
set_tests_properties(download_test_data PROPERTIES FIXTURES_SETUP TEST_DATA)
if(JSON_Valgrind)
find_program(CMAKE_MEMORYCHECK_COMMAND valgrind)
message(STATUS "Executing test suite with Valgrind (${CMAKE_MEMORYCHECK_COMMAND})")
set(memcheck_command "${CMAKE_MEMORYCHECK_COMMAND} ${CMAKE_MEMORYCHECK_COMMAND_OPTIONS} --error-exitcode=1 --leak-check=full")
separate_arguments(memcheck_command)
endif()
#############################################################################
# detect standard support
#############################################################################
# C++11 is the minimum required
set(compiler_supports_cpp_11 TRUE)
foreach(feature ${CMAKE_CXX_COMPILE_FEATURES})
if (${feature} STREQUAL cxx_std_14)
set(compiler_supports_cpp_14 TRUE)
elseif (${feature} STREQUAL cxx_std_17)
set(compiler_supports_cpp_17 TRUE)
elseif (${feature} STREQUAL cxx_std_20)
set(compiler_supports_cpp_20 TRUE)
elseif (${feature} STREQUAL cxx_std_23)
set(compiler_supports_cpp_23 TRUE)
endif()
endforeach()
#############################################################################
# test functions
#############################################################################
#############################################################################
# json_test_set_test_options(
# all|<tests>
# [CXX_STANDARDS all|<args>...]
# [COMPILE_DEFINITIONS <args>...]
# [COMPILE_FEATURES <args>...]
# [COMPILE_OPTIONS <args>...]
# [LINK_LIBRARIES <args>...]
# [LINK_OPTIONS <args>...]
# [TEST_PROPERTIES <args>...])
#
# Supply test- and standard-specific build settings and/or test properties.
# Specify multiple tests using a list e.g., "test-foo;test-bar".
#
# Must be called BEFORE the test is created.
#############################################################################
function(json_test_set_test_options tests)
cmake_parse_arguments(args "" ""
"CXX_STANDARDS;COMPILE_DEFINITIONS;COMPILE_FEATURES;COMPILE_OPTIONS;LINK_LIBRARIES;LINK_OPTIONS;TEST_PROPERTIES"
${ARGN})
if(NOT args_CXX_STANDARDS)
set(args_CXX_STANDARDS "all")
endif()
foreach(test ${tests})
if("${test}" STREQUAL "all")
set(test "")
endif()
foreach(cxx_standard ${args_CXX_STANDARDS})
if("${cxx_standard}" STREQUAL "all")
if("${test}" STREQUAL "")
message(FATAL_ERROR "Not supported. Change defaults in: ${_json_test_cmake_list_file}")
endif()
set(test_interface _json_test_interface_${test})
else()
set(test_interface _json_test_interface_${test}_cpp_${cxx_standard})
endif()
if(NOT TARGET ${test_interface})
add_library(${test_interface} INTERFACE)
endif()
target_compile_definitions(${test_interface} INTERFACE ${args_COMPILE_DEFINITIONS})
target_compile_features(${test_interface} INTERFACE ${args_COMPILE_FEATURES})
target_compile_options(${test_interface} INTERFACE ${args_COMPILE_OPTIONS})
target_link_libraries (${test_interface} INTERFACE ${args_LINK_LIBRARIES})
target_link_options(${test_interface} INTERFACE ${args_LINK_OPTIONS})
#set_target_properties(${test_interface} PROPERTIES JSON_TEST_PROPERTIES "${args_TEST_PROPERTIES}")
set_property(DIRECTORY PROPERTY
${test_interface}_TEST_PROPERTIES "${args_TEST_PROPERTIES}"
)
endforeach()
endforeach()
endfunction()
# for internal use by _json_test_add_test()
function(_json_test_apply_test_properties test_target properties_target)
#get_target_property(test_properties ${properties_target} JSON_TEST_PROPERTIES)
get_property(test_properties DIRECTORY PROPERTY ${properties_target}_TEST_PROPERTIES)
if(test_properties)
set_tests_properties(${test_target} PROPERTIES ${test_properties})
endif()
endfunction()
# for internal use by json_test_add_test_for()
function(_json_test_add_test test_name file main cxx_standard)
set(test_target ${test_name}_cpp${cxx_standard})
if(TARGET ${test_target})
message(FATAL_ERROR "Target ${test_target} has already been added.")
endif()
add_executable(${test_target} ${file})
target_link_libraries(${test_target} PRIVATE ${main})
# set and require C++ standard
set_target_properties(${test_target} PROPERTIES
CXX_STANDARD ${cxx_standard}
CXX_STANDARD_REQUIRED ON
)
# apply standard-specific build settings
if(TARGET _json_test_interface__cpp_${cxx_standard})
target_link_libraries(${test_target} PRIVATE _json_test_interface__cpp_${cxx_standard})
endif()
# apply test-specific build settings
if(TARGET _json_test_interface_${test_name})
target_link_libraries(${test_target} PRIVATE _json_test_interface_${test_name})
endif()
# apply test- and standard-specific build settings
if(TARGET _json_test_interface_${test_name}_cpp_${cxx_standard})
target_link_libraries(${test_target} PRIVATE
_json_test_interface_${test_name}_cpp_${cxx_standard}
)
endif()
if (JSON_FastTests)
add_test(NAME ${test_target}
COMMAND ${test_target} ${DOCTEST_TEST_FILTER}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
else()
add_test(NAME ${test_target}
COMMAND ${test_target} ${DOCTEST_TEST_FILTER} --no-skip
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
endif()
set_tests_properties(${test_target} PROPERTIES LABELS "all" FIXTURES_REQUIRED TEST_DATA)
# apply standard-specific test properties
if(TARGET _json_test_interface__cpp_${cxx_standard})
_json_test_apply_test_properties(${test_target} _json_test_interface__cpp_${cxx_standard})
endif()
# apply test-specific test properties
if(TARGET _json_test_interface_${test_name})
_json_test_apply_test_properties(${test_target} _json_test_interface_${test_name})
endif()
# apply test- and standard-specific test properties
if(TARGET _json_test_interface_${test_name}_cpp_${cxx_standard})
_json_test_apply_test_properties(${test_target}
_json_test_interface_${test_name}_cpp_${cxx_standard}
)
endif()
if(JSON_Valgrind)
add_test(NAME ${test_target}_valgrind
COMMAND ${memcheck_command} $<TARGET_FILE:${test_target}> ${DOCTEST_TEST_FILTER}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
set_tests_properties(${test_target}_valgrind PROPERTIES
LABELS "valgrind" FIXTURES_REQUIRED TEST_DATA
)
endif()
endfunction()
#############################################################################
# json_test_add_test_for(
# <file>
# [NAME <name>]
# MAIN <main>
# [CXX_STANDARDS <version_number>...] [FORCE])
#
# Given a <file> unit-foo.cpp, produces
#
# test-foo_cpp<version_number>
#
# if C++ standard <version_number> is supported by the compiler and the
# source file contains JSON_HAS_CPP_<version_number>.
# Use NAME <name> to override the filename-derived test name.
# Use FORCE to create the test regardless of the file containing
# JSON_HAS_CPP_<version_number>.
# Test targets are linked against <main>.
# CXX_STANDARDS defaults to "11".
#############################################################################
function(json_test_add_test_for file)
cmake_parse_arguments(args "FORCE" "MAIN;NAME" "CXX_STANDARDS" ${ARGN})
if("${args_MAIN}" STREQUAL "")
message(FATAL_ERROR "Required argument MAIN <main> missing.")
endif()
if("${args_NAME}" STREQUAL "")
get_filename_component(file_basename ${file} NAME_WE)
string(REGEX REPLACE "unit-([^$]+)" "test-\\1" test_name ${file_basename})
else()
set(test_name ${args_NAME})
if(NOT test_name MATCHES "test-[^$]+")
message(FATAL_ERROR "Test name must start with 'test-'.")
endif()
endif()
if("${args_CXX_STANDARDS}" STREQUAL "")
set(args_CXX_STANDARDS 11)
endif()
file(READ ${file} file_content)
foreach(cxx_standard ${args_CXX_STANDARDS})
if(NOT compiler_supports_cpp_${cxx_standard})
continue()
endif()
# add unconditionally if C++11 (default) or forced
if(NOT ("${cxx_standard}" STREQUAL 11 OR args_FORCE))
string(FIND "${file_content}" JSON_HAS_CPP_${cxx_standard} has_cpp_found)
if(${has_cpp_found} EQUAL -1)
continue()
endif()
endif()
_json_test_add_test(${test_name} ${file} ${args_MAIN} ${cxx_standard})
endforeach()
endfunction()
#############################################################################
# json_test_should_build_32bit_test(
# <build_32bit_var> <build_32bit_only_var> <input>)
#
# Check if the 32bit unit test should be built based on the value of <input>
# and store the result in the variables <build_32bit_var> and
# <build_32bit_only_var>.
#############################################################################
function(json_test_should_build_32bit_test build_32bit_var build_32bit_only_var input)
set(${build_32bit_only_var} OFF PARENT_SCOPE)
string(TOUPPER "${input}" ${build_32bit_var})
if("${${build_32bit_var}}" STREQUAL AUTO)
# check if compiler is targeting 32bit by default
include(CheckTypeSize)
check_type_size("size_t" sizeof_size_t LANGUAGE CXX)
if(${sizeof_size_t} AND ${sizeof_size_t} EQUAL 4)
message(STATUS "Auto-enabling 32bit unit test.")
set(${build_32bit_var} ON)
else()
set(${build_32bit_var} OFF)
endif()
elseif("${${build_32bit_var}}" STREQUAL ONLY)
set(${build_32bit_only_var} ON PARENT_SCOPE)
endif()
set(${build_32bit_var} "${${build_32bit_var}}" PARENT_SCOPE)
endfunction()

View File

@@ -1,317 +0,0 @@
# Doxyfile 1.8.9.1
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = "JSON for Modern C++"
PROJECT_NUMBER = 2.0.2
PROJECT_BRIEF =
PROJECT_LOGO =
OUTPUT_DIRECTORY = .
CREATE_SUBDIRS = NO
ALLOW_UNICODE_NAMES = NO
OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = NO
ABBREVIATE_BRIEF =
ALWAYS_DETAILED_SEC = YES
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = YES
STRIP_FROM_PATH =
STRIP_FROM_INC_PATH =
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = NO
QT_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = YES
TAB_SIZE = 4
ALIASES = "complexity=@par Complexity\n"
ALIASES += liveexample{2}="@par Example\n \1 \n @includelineno \2.cpp \n Output (play with this example @htmlinclude \2.link):\n @verbinclude \2.output \n The example code above can be translated with @verbatim g++ -std=c++11 -Isrc doc/examples/\2.cpp -o \2 @endverbatim"
ALIASES += requirement="@par Requirements\n"
ALIASES += exceptionsafety="@par Exception safety\n"
TCL_SUBST =
OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
EXTENSION_MAPPING =
MARKDOWN_SUPPORT = YES
AUTOLINK_SUPPORT = NO
BUILTIN_STL_SUPPORT = YES
CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
IDL_PROPERTY_SUPPORT = YES
DISTRIBUTE_GROUP_DOC = NO
SUBGROUPING = YES
INLINE_GROUPED_CLASSES = NO
INLINE_SIMPLE_STRUCTS = NO
TYPEDEF_HIDES_STRUCT = NO
LOOKUP_CACHE_SIZE = 0
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
EXTRACT_ALL = YES
EXTRACT_PRIVATE = NO
EXTRACT_PACKAGE = YES
EXTRACT_STATIC = YES
EXTRACT_LOCAL_CLASSES = YES
EXTRACT_LOCAL_METHODS = YES
EXTRACT_ANON_NSPACES = YES
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
HIDE_FRIEND_COMPOUNDS = NO
HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = NO
CASE_SENSE_NAMES = NO
HIDE_SCOPE_NAMES = NO
HIDE_COMPOUND_REFERENCE= NO
SHOW_INCLUDE_FILES = YES
SHOW_GROUPED_MEMB_INC = NO
FORCE_LOCAL_INCLUDES = NO
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = YES
SORT_MEMBERS_CTORS_1ST = YES
SORT_GROUP_NAMES = NO
SORT_BY_SCOPE_NAME = NO
STRICT_PROTO_MATCHING = NO
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = NO
SHOW_FILES = NO
SHOW_NAMESPACES = NO
FILE_VERSION_FILTER =
LAYOUT_FILE =
CITE_BIB_FILES =
#---------------------------------------------------------------------------
# Configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = YES
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = YES
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
#---------------------------------------------------------------------------
# Configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = ../src/json.hpp index.md
INPUT_ENCODING = UTF-8
FILE_PATTERNS =
RECURSIVE = NO
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXCLUDE_SYMBOLS = nlohmann::anonymous_namespace
EXAMPLE_PATH = examples
EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO
IMAGE_PATH = images
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
FILTER_SOURCE_PATTERNS =
USE_MDFILE_AS_MAINPAGE = index.md
#---------------------------------------------------------------------------
# Configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER = YES
INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = NO
REFERENCES_RELATION = NO
REFERENCES_LINK_SOURCE = NO
SOURCE_TOOLTIPS = YES
USE_HTAGS = NO
VERBATIM_HEADERS = NO
#---------------------------------------------------------------------------
# Configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = YES
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_EXTRA_STYLESHEET = css/mylayout.css
HTML_EXTRA_FILES =
HTML_COLORSTYLE_HUE = 220
HTML_COLORSTYLE_SAT = 100
HTML_COLORSTYLE_GAMMA = 80
HTML_TIMESTAMP = YES
HTML_DYNAMIC_SECTIONS = YES
HTML_INDEX_NUM_ENTRIES = 100
GENERATE_DOCSET = YES
DOCSET_FEEDNAME = "Doxygen generated docs"
DOCSET_BUNDLE_ID = me.nlohmann.json
DOCSET_PUBLISHER_ID = me.nlohmann
DOCSET_PUBLISHER_NAME = Niels Lohmann
GENERATE_HTMLHELP = NO
CHM_FILE =
HHC_LOCATION =
GENERATE_CHI = NO
CHM_INDEX_ENCODING =
BINARY_TOC = NO
TOC_EXPAND = NO
GENERATE_QHP = NO
QCH_FILE =
QHP_NAMESPACE = org.doxygen.Project
QHP_VIRTUAL_FOLDER = doc
QHP_CUST_FILTER_NAME =
QHP_CUST_FILTER_ATTRS =
QHP_SECT_FILTER_ATTRS =
QHG_LOCATION =
GENERATE_ECLIPSEHELP = NO
ECLIPSE_DOC_ID = org.doxygen.Project
DISABLE_INDEX = NO
GENERATE_TREEVIEW = NO
ENUM_VALUES_PER_LINE = 4
TREEVIEW_WIDTH = 250
EXT_LINKS_IN_WINDOW = NO
FORMULA_FONTSIZE = 10
FORMULA_TRANSPARENT = YES
USE_MATHJAX = NO
MATHJAX_FORMAT = HTML-CSS
MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
MATHJAX_EXTENSIONS =
MATHJAX_CODEFILE =
SEARCHENGINE = YES
SERVER_BASED_SEARCH = NO
EXTERNAL_SEARCH = NO
SEARCHENGINE_URL =
SEARCHDATA_FILE = searchdata.xml
EXTERNAL_SEARCH_ID =
EXTRA_SEARCH_MAPPINGS =
#---------------------------------------------------------------------------
# Configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = NO
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4
EXTRA_PACKAGES =
LATEX_HEADER =
LATEX_FOOTER =
LATEX_EXTRA_STYLESHEET =
LATEX_EXTRA_FILES =
PDF_HYPERLINKS = YES
USE_PDFLATEX = YES
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
LATEX_SOURCE_CODE = NO
LATEX_BIB_STYLE = plain
#---------------------------------------------------------------------------
# Configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
RTF_SOURCE_CODE = NO
#---------------------------------------------------------------------------
# Configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = NO
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_SUBDIR =
MAN_LINKS = NO
#---------------------------------------------------------------------------
# Configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = YES
XML_OUTPUT = xml
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# Configuration options related to the DOCBOOK output
#---------------------------------------------------------------------------
GENERATE_DOCBOOK = NO
DOCBOOK_OUTPUT = docbook
DOCBOOK_PROGRAMLISTING = NO
#---------------------------------------------------------------------------
# Configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# Configuration options related to the Perl module output
#---------------------------------------------------------------------------
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED =
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration options related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
EXTERNAL_PAGES = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = NO
MSCGEN_PATH =
DIA_PATH =
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = YES
DOT_NUM_THREADS = 0
DOT_FONTNAME = Helvetica
DOT_FONTSIZE = 10
DOT_FONTPATH =
CLASS_GRAPH = NO
COLLABORATION_GRAPH = NO
GROUP_GRAPHS = YES
UML_LOOK = YES
UML_LIMIT_NUM_FIELDS = 10
TEMPLATE_RELATIONS = NO
INCLUDE_GRAPH = NO
INCLUDED_BY_GRAPH = NO
CALL_GRAPH = NO
CALLER_GRAPH = NO
GRAPHICAL_HIERARCHY = NO
DIRECTORY_GRAPH = NO
DOT_IMAGE_FORMAT = svg
INTERACTIVE_SVG = YES
DOT_PATH =
DOTFILE_DIRS =
MSCFILE_DIRS =
DIAFILE_DIRS =
PLANTUML_JAR_PATH =
PLANTUML_INCLUDE_PATH =
DOT_GRAPH_MAX_NODES = 50
MAX_DOT_GRAPH_DEPTH = 0
DOT_TRANSPARENT = NO
DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
DOT_CLEANUP = YES

View File

@@ -1,84 +0,0 @@
SRCDIR = ../src
SED:=$(shell command -v gsed || which sed)
all: doxygen
##########################################################################
# example files
##########################################################################
# where are the example cpp files
EXAMPLES = $(wildcard examples/*.cpp)
# create output from a stand-alone example file
%.output: %.cpp
make $(<:.cpp=) CPPFLAGS="-I $(SRCDIR)" CXXFLAGS="-std=c++11"
./$(<:.cpp=) > $@
rm $(<:.cpp=)
# compare created output with current output of the example files
%.test: %.cpp
make $(<:.cpp=) CPPFLAGS="-I $(SRCDIR)" CXXFLAGS="-std=c++11"
./$(<:.cpp=) > $@
diff $@ $(<:.cpp=.output)
rm $(<:.cpp=) $@
# create links to try the code online
%.link: %.cpp
rm -fr tmp
mkdir tmp
cp $(SRCDIR)/json.hpp tmp
scripts/send_to_wandbox.py tmp $< > $@.tmp
/bin/echo -n "<a target=\"_blank\" href=\"`cat $@.tmp`\"><b>online</b></a>" > $@
rm -fr tmp $@.tmp
# create output from all stand-alone example files
create_output: $(EXAMPLES:.cpp=.output)
create_links: $(EXAMPLES:.cpp=.link)
# check output of all stand-alone example files
check_output: $(EXAMPLES:.cpp=.test)
clean:
rm -fr me.nlohmann.json.docset html $(EXAMPLES:.cpp=)
##########################################################################
# Doxygen HTML documentation
##########################################################################
# create Doxygen documentation
doxygen: create_output create_links
doxygen
$(SED) -i 's@&lt; ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberFloatType, AllocatorType &gt;@@g' html/*.html
$(SED) -i 's@&lt;&#160;ObjectType,&#160;ArrayType,&#160;StringType,&#160;BooleanType,&#160;NumberIntegerType,&#160;NumberFloatType,&#160;AllocatorType&#160;&gt;@@g' html/*.html
$(SED) -i 's@&lt; ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType &gt;@@g' html/*.html
$(SED) -i 's@< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType >@@g' html/*.html
upload: clean doxygen check_output
cd html ; ../scripts/git-update-ghpages nlohmann/json
rm -fr html
open http://nlohmann.github.io/json/
##########################################################################
# docset
##########################################################################
# create docset for Dash
docset: create_output
cp Doxyfile Doxyfile_docset
$(SED) -i 's/DISABLE_INDEX = NO/DISABLE_INDEX = YES/' Doxyfile_docset
$(SED) -i 's/SEARCHENGINE = YES/SEARCHENGINE = NO/' Doxyfile_docset
$(SED) -i 's@HTML_EXTRA_STYLESHEET = css/mylayout.css@HTML_EXTRA_STYLESHEET = css/mylayout_docset.css@' Doxyfile_docset
rm -fr html *.docset
doxygen Doxyfile_docset
$(SED) -i 's@&lt; ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberFloatType, AllocatorType &gt;@@g' html/*.html
$(SED) -i 's@&lt;&#160;ObjectType,&#160;ArrayType,&#160;StringType,&#160;BooleanType,&#160;NumberIntegerType,&#160;NumberFloatType,&#160;AllocatorType&#160;&gt;@@g' html/*.html
make -C html
mv html/*.docset .
$(SED) -i 's@<string>doxygen</string>@<string>json</string>@' me.nlohmann.json.docset/Contents/Info.plist
rm -fr Doxyfile_docset html

View File

@@ -1,26 +0,0 @@
/* hide lengthy template information */
.memtemplate, .memTemplParams {
display: none;
}
/* allow compiler information to wrap */
/* https://css-tricks.com/snippets/css/make-pre-text-wrap/ */
pre.fragment {
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
td.paramname {
vertical-align: top;
}
.ok_green {
background-color: #89C35C;
}
.nok_throws {
background-color: #ffa500;
}

View File

@@ -1,27 +0,0 @@
.memtemplate {
display: none;
}
.memTemplParams {
display: none;
}
.navtab {
display: none;
}
#top, .footer {
display: none;
}
td.paramname {
vertical-align: top;
}
.ok_green {
background-color: #89C35C;
}
.nok_throws {
background-color: #ffa500;
}

View File

@@ -1 +0,0 @@
<a target="_blank" href="http://melpon.org/wandbox/permlink/p5o4znPnGHJpDVqN"><b>online</b></a>

View File

@@ -1 +0,0 @@
<a target="_blank" href="http://melpon.org/wandbox/permlink/1fsm4gI55p83DOwU"><b>online</b></a>

View File

@@ -1,33 +0,0 @@
#include <json.hpp>
using json = nlohmann::json;
int main()
{
// create JSON object
json object =
{
{"the good", "il buono"},
{"the bad", "il cativo"},
{"the ugly", "il brutto"}
};
// output element with key "the ugly"
std::cout << object.at("the ugly") << '\n';
// change element with key "the bad"
object.at("the bad") = "il cattivo";
// output changed array
std::cout << object << '\n';
// try to write at a nonexisting key
try
{
object.at("the fast") = "il rapido";
}
catch (std::out_of_range& e)
{
std::cout << "out of range: " << e.what() << '\n';
}
}

View File

@@ -1 +0,0 @@
<a target="_blank" href="http://melpon.org/wandbox/permlink/rsnwWxpDjmtRRSzb"><b>online</b></a>

View File

@@ -1,3 +0,0 @@
"il brutto"
{"the bad":"il cattivo","the good":"il buono","the ugly":"il brutto"}
out of range: key 'the fast' not found

View File

@@ -1,27 +0,0 @@
#include <json.hpp>
using json = nlohmann::json;
int main()
{
// create JSON object
json object =
{
{"the good", "il buono"},
{"the bad", "il cativo"},
{"the ugly", "il brutto"}
};
// output element with key "the ugly"
std::cout << object.at("the ugly") << '\n';
// try to read from a nonexisting key
try
{
std::cout << object.at("the fast") << '\n';
}
catch (std::out_of_range)
{
std::cout << "out of range" << '\n';
}
}

View File

@@ -1 +0,0 @@
<a target="_blank" href="http://melpon.org/wandbox/permlink/aeoZrnhnb3HKClCY"><b>online</b></a>

View File

@@ -1,2 +0,0 @@
"il brutto"
out of range

View File

@@ -1,28 +0,0 @@
#include <json.hpp>
using json = nlohmann::json;
int main()
{
// create JSON array
json array = {"first", "2nd", "third", "fourth"};
// output element at index 2 (third element)
std::cout << array.at(2) << '\n';
// change element at index 1 (second element) to "second"
array.at(1) = "second";
// output changed array
std::cout << array << '\n';
// try to write beyond the array limit
try
{
array.at(5) = "sixth";
}
catch (std::out_of_range& e)
{
std::cout << "out of range: " << e.what() << '\n';
}
}

View File

@@ -1 +0,0 @@
<a target="_blank" href="http://melpon.org/wandbox/permlink/R7z2SB2rMdFQ9XtR"><b>online</b></a>

View File

@@ -1,3 +0,0 @@
"third"
["first","second","third","fourth"]
out of range: array index 5 is out of range

View File

@@ -1,22 +0,0 @@
#include <json.hpp>
using json = nlohmann::json;
int main()
{
// create JSON array
json array = {"first", "2nd", "third", "fourth"};
// output element at index 2 (third element)
std::cout << array.at(2) << '\n';
// try to read beyond the array limit
try
{
std::cout << array.at(5) << '\n';
}
catch (std::out_of_range)
{
std::cout << "out of range" << '\n';
}
}

View File

@@ -1 +0,0 @@
<a target="_blank" href="http://melpon.org/wandbox/permlink/L1bMeiN6nYm7JrvA"><b>online</b></a>

View File

@@ -1,2 +0,0 @@
"third"
out of range

View File

@@ -1,35 +0,0 @@
#include <json.hpp>
using json = nlohmann::json;
int main()
{
// create a JSON value
json j =
{
{"number", 1}, {"string", "foo"}, {"array", {1, 2}}
};
// read-only access
// output element with JSON pointer "/number"
std::cout << j.at("/number"_json_pointer) << '\n';
// output element with JSON pointer "/string"
std::cout << j.at("/string"_json_pointer) << '\n';
// output element with JSON pointer "/array"
std::cout << j.at("/array"_json_pointer) << '\n';
// output element with JSON pointer "/array/1"
std::cout << j.at("/array/1"_json_pointer) << '\n';
// writing access
// change the string
j.at("/string"_json_pointer) = "bar";
// output the changed string
std::cout << j["string"] << '\n';
// change an array element
j.at("/array/1"_json_pointer) = 21;
// output the changed array
std::cout << j["array"] << '\n';
}

View File

@@ -1 +0,0 @@
<a target="_blank" href="http://melpon.org/wandbox/permlink/NDSjglHZIjIZ0Uxg"><b>online</b></a>

View File

@@ -1,6 +0,0 @@
1
"foo"
[1,2]
2
"bar"
[1,21]

View File

@@ -1,23 +0,0 @@
#include <json.hpp>
using json = nlohmann::json;
int main()
{
// create a JSON value
json j =
{
{"number", 1}, {"string", "foo"}, {"array", {1, 2}}
};
// read-only access
// output element with JSON pointer "/number"
std::cout << j.at("/number"_json_pointer) << '\n';
// output element with JSON pointer "/string"
std::cout << j.at("/string"_json_pointer) << '\n';
// output element with JSON pointer "/array"
std::cout << j.at("/array"_json_pointer) << '\n';
// output element with JSON pointer "/array/1"
std::cout << j.at("/array/1"_json_pointer) << '\n';
}

View File

@@ -1 +0,0 @@
<a target="_blank" href="http://melpon.org/wandbox/permlink/OuLYiMJ3pgyOHupb"><b>online</b></a>

View File

@@ -1 +0,0 @@
<a target="_blank" href="http://melpon.org/wandbox/permlink/nPVnBcHf8nrNpGOJ"><b>online</b></a>

View File

@@ -1,6 +0,0 @@
true
17
23.42
2
16
"Hello, world"

View File

@@ -1,12 +0,0 @@
#include <json.hpp>
using json = nlohmann::json;
int main()
{
// create a JSON value with default null value
json j;
// serialize the JSON null value
std::cout << j << '\n';
}

View File

@@ -1 +0,0 @@
<a target="_blank" href="http://melpon.org/wandbox/permlink/dRptmFmhvpsYB49t"><b>online</b></a>

View File

@@ -1 +0,0 @@
null

View File

@@ -1,58 +0,0 @@
#include <json.hpp>
#include <deque>
#include <list>
#include <forward_list>
#include <set>
#include <unordered_set>
using json = nlohmann::json;
int main()
{
// create an array from std::vector
std::vector<int> c_vector {1, 2, 3, 4};
json j_vec(c_vector);
// create an array from std::deque
std::deque<double> c_deque {1.2, 2.3, 3.4, 5.6};
json j_deque(c_deque);
// create an array from std::list
std::list<bool> c_list {true, true, false, true};
json j_list(c_list);
// create an array from std::forward_list
std::forward_list<int64_t> c_flist {12345678909876, 23456789098765, 34567890987654, 45678909876543};
json j_flist(c_flist);
// create an array from std::array
std::array<unsigned long, 4> c_array {{1, 2, 3, 4}};
json j_array(c_array);
// create an array from std::set
std::set<std::string> c_set {"one", "two", "three", "four", "one"};
json j_set(c_set); // only one entry for "one" is used
// create an array from std::unordered_set
std::unordered_set<std::string> c_uset {"one", "two", "three", "four", "one"};
json j_uset(c_uset); // only one entry for "one" is used
// create an array from std::multiset
std::multiset<std::string> c_mset {"one", "two", "one", "four"};
json j_mset(c_mset); // only one entry for "one" is used
// create an array from std::unordered_multiset
std::unordered_multiset<std::string> c_umset {"one", "two", "one", "four"};
json j_umset(c_umset); // both entries for "one" are used
// serialize the JSON arrays
std::cout << j_vec << '\n';
std::cout << j_deque << '\n';
std::cout << j_list << '\n';
std::cout << j_flist << '\n';
std::cout << j_array << '\n';
std::cout << j_set << '\n';
std::cout << j_uset << '\n';
std::cout << j_mset << '\n';
std::cout << j_umset << '\n';
}

View File

@@ -1 +0,0 @@
<a target="_blank" href="http://melpon.org/wandbox/permlink/MghSilgvyh4ZJShY"><b>online</b></a>

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