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>
When the static libary is available use it as exported alias, otherwise use shared library. Cmake takes care about import library when Windows platform DLL is used
CMake provides helpers to generate config file. Generated config file has usefull macro check_required_components() to set necessary variables like PackageName_FOUND if requirements has been satisfied. An absence of dedicated config file confuses user project as necessary variables are not set.
* Fix a precision bug of valueToString, prevent to give an error result on input of wanted precision 0 and a double value which end of zero before decimal point ,such as 1230.01,12300.1;
Add test cases for double valueToString with precision 0;
* Delete a test case with platform differences in the previous commit
* Fix clang-format.
* Fix clang-format!
Co-authored-by: lilei <dlilei@126.com>
* ENH: Prevent cmake in source builds
Building directly inside the root of the source tree
can cause problems where the build intermediate files
overwrite or conflict with the intended source code
files.
This modification identifies this problem and
issues failure messages and suggestions to over
come the problem with more robust build suggestion.
Co-authored-by: Jordan Bayles <jophba@chromium.org>
This lets us simplify linux a little.
However, we still want to test cmake, so there is only so much we
can simplify.
For OSX, we still need `clang-format` from homebrew.
* Add PYTHONUSERBASE/bin to PATH for linux
* BUILD_TYPE corresponds to Release/Debug
but LIB_TYPE corresponds to shared/static.
* Add support to build shared, static and object lib at the same time.
This patch adds an explicit ctor with a std::nullptr_t argument, that is `delete`-d. This keeps Json::Value from exposing a coding error when automatically promoted to a const char* type.
* avoid isprint
`std::isprint` is locale-specific and the JSON-spec is not.
In particular, isprint('\t') is true in Windows CP1252.
Has bitten others, e.g. https://github.com/laurikari/tre/issues/64Fixes#1187
* semicolon (rookie mistake!)
* Windows tab escape testing with custom locale (#1190)
Co-authored-by: Nikolay Baklicharov <thestorm.nik@gmail.com>
* avoid isprint
`std::isprint` is locale-specific and the JSON-spec is not.
In particular, isprint('\t') is true in Windows CP1252.
Has bitten others, e.g. https://github.com/laurikari/tre/issues/64Fixes#1187
* semicolon (rookie mistake!)