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> ```
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.
- 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
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.
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"
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.
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.
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.