Go to file
Tero Kinnunen 2d55c7445f
Parse large floats as infinity (#1349) (#1353)
Return 1.9.1 functionality where values too large to fit in
double are converted to positive or negative infinity.

Commit 645cd04 changed functionality so that large floats cause
parse error, while version 1.9.1 accepted them as infinite.
This is problematic because writer outputs infinity values
as `1e+9999`, which could no longer be parsed back.

Fixed also legacy Reader even though it did not parse large values
even before breaking change, due to problematic output/parse asymmetry.

`>>` operator sets value to numeric_limits::max/lowest value if
representation is too large to fit to double. [1][2] In macos
value appears to be parsed to infinity.

> | value in *val*           | description |
> |--------------------------|-------------|
> | numeric_limits::max()    | The sequence represents a value too large for the type of val |
> | numeric_limits::lowest() | The sequence represents a value too large negative for the type of val |

[1] https://www.cplusplus.com/reference/istream/istream/operator%3E%3E/
[2] https://www.cplusplus.com/reference/locale/num_get/get/

Signed-off-by: Tero Kinnunen <tero.kinnunen@vaisala.com>

Co-authored-by: Tero Kinnunen <tero.kinnunen@vaisala.com>
2021-12-14 18:00:28 -08:00
.github/ISSUE_TEMPLATE Update issue templates 2019-06-24 14:40:08 -07:00
.travis_scripts clang-format is not available by default 2021-10-28 13:38:53 -05:00
cmake Fix generation of pkg-config file with absolute includedir/libdir. (#1199) 2020-07-20 20:36:30 +08:00
devtools Remove trailing space characters (#1256) 2021-01-09 22:39:07 -06:00
doc Cleanup versioning strategy relanding (#989) (#997) 2019-08-13 22:41:43 -07:00
example minor fix for code examples (#1317) 2021-08-12 17:08:46 -04:00
include Bump micro version 2021-11-03 11:39:54 -05:00
pkg-config Fixed pkg-config Version 2021-02-03 13:40:56 -06:00
src Parse large floats as infinity (#1349) (#1353) 2021-12-14 18:00:28 -08:00
test Parse large floats as infinity (#1349) (#1353) 2021-12-14 18:00:28 -08:00
.clang-format Issue #958: Travis CI should enforce clang-format standards (#1026) 2019-10-11 11:19:00 -07:00
.clang-tidy Remove trailing space characters (#1256) 2021-01-09 22:39:07 -06:00
.gitattributes add .gitattributes 2015-08-09 16:25:36 -07:00
.gitignore Update version in dox 2021-01-10 00:18:59 -06:00
.travis.yml clang-format is not available by default 2021-10-28 13:38:53 -05:00
amalgamate.py amalgamate: add version.h and allocator.h to the forwards header 2020-04-23 23:22:10 -05:00
appveyor.yml ENH: Prevent cmake in source builds (#1091) 2020-11-06 13:35:51 -08:00
AUTHORS Update README.md and add dota17 to AUTHORS list. (#1168) 2020-04-30 18:05:17 +08:00
BUILD.bazel Add support for Bazel build system (#1275) 2021-05-05 21:03:02 -05:00
CMakeLists.txt Bump micro version 2021-11-03 11:39:54 -05:00
CONTRIBUTING.md ENH: Prevent cmake in source builds (#1091) 2020-11-06 13:35:51 -08:00
CTestConfig.cmake ENH: Refactor and enhance the CI testing infrastructure 2019-01-14 16:12:43 -06:00
dev.makefile Update version in dox 2021-01-10 00:18:59 -06:00
doxybuild.py Remove trailing space characters (#1256) 2021-01-09 22:39:07 -06:00
get_version.pl Update version in dox 2021-01-10 00:18:59 -06:00
jsoncpp-namespaced-targets.cmake - isolated namespace targets into separate file 2021-05-04 23:34:28 -05:00
jsoncppConfig.cmake.in - isolated namespace targets into separate file 2021-05-04 23:34:28 -05:00
LICENSE Remove trailing space characters (#1256) 2021-01-09 22:39:07 -06:00
meson_options.txt Meson updates (#1124) 2020-01-07 09:23:50 +08:00
meson.build Bump micro version 2021-11-03 11:39:54 -05:00
README.md Added current dir specifier for PowerShell (#1169) 2020-05-08 09:00:12 +08:00
reformat.sh Fix clang-tidy warnings (#1231) 2020-11-06 13:22:26 -08:00
version.in generate both version.h and version from CMakelists.txt 2015-03-05 18:27:39 -06:00

JsonCpp

badge badge badge Coverage Status

JSON is a lightweight data-interchange format. It can represent numbers, strings, ordered sequences of values, and collections of name/value pairs.

JsonCpp is a C++ library that allows manipulating JSON values, including serialization and deserialization to and from strings. It can also preserve existing comment in unserialization/serialization steps, making it a convenient format to store user input files.

Documentation

JsonCpp documentation is generated using Doxygen.

A note on backward-compatibility

  • 1.y.z is built with C++11.
  • 0.y.z can be used with older compilers.
  • 00.11.z can be used both in old and new compilers.
  • Major versions maintain binary-compatibility.

Special note

The branch 00.11.zis a new branch, its major version number 00 is to show that it is different from 0.y.z and 1.y.z, the main purpose of this branch is to make a balance between the other two branches. Thus, users can use some new features in this new branch that introduced in 1.y.z, but can hardly applied into 0.y.z.

Using JsonCpp in your project

The vcpkg dependency manager

You can download and install JsonCpp using the vcpkg dependency manager:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install jsoncpp

The JsonCpp port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

Amalgamated source

https://github.com/open-source-parsers/jsoncpp/wiki/Amalgamated-(Possibly-outdated)

The Meson Build System

If you are using the Meson Build System, then you can get a wrap file by downloading it from Meson WrapDB, or simply use meson wrap install jsoncpp.

Other ways

If you have trouble, see the Wiki, or post a question as an Issue.

License

See the LICENSE file for details. In summary, JsonCpp is licensed under the MIT license, or public domain if desired and recognized in your jurisdiction.