mirror of
https://github.com/nlohmann/json.git
synced 2026-10-11 17:03:42 +07:00
Destroyed Road toward 3.0.0 (markdown)
-114
@@ -1,114 +0,0 @@
|
||||
# Overview
|
||||
|
||||
This library follows the [Semantic Versioning Specification](http://semver.org). The last released library version was [version 2.1.1](https://github.com/nlohmann/json/releases/tag/v2.1.1). In the last months, several changes and bug fixes have been proposed that would break the public API. As a result, they could not be merged into the 2.x.x version family. These changes will be addressed with [version 3.0.0](https://github.com/nlohmann/json/milestone/5).
|
||||
|
||||
In case of bugs, there may be another 2.x.x release. However, pushing forward version 3.0.0 has a priority.
|
||||
|
||||
# Branches
|
||||
|
||||
- The [`master`](https://github.com/nlohmann/json/tree/master) branch contains the code of version 2.1.1. This branch should be seen as **stable** in the sense that it not will not be touched until the next release.
|
||||
- The [`develop`](https://github.com/nlohmann/json/tree/develop) branch will be the place where the transition toward version 3.0.0 will happen. This branch is **unstable**. This branch will soon contain code that is incompatible to the 2.x.x version. That is, existing code may not compile with this library version.
|
||||
|
||||
:warning: Please **do not** use the `develop` branch for production use.
|
||||
|
||||
# Changes
|
||||
|
||||
This section shall list the changes that have been made past version 2.1.1. If possible, we shall provide examples how to change existing tools to work with the 3.0.0 release.
|
||||
|
||||
## Removal of deprecated input stream constructor
|
||||
|
||||
[Issue 480](https://github.com/nlohmann/json/issues/480) describes the removal of constructor `explicit basic_json(std::istream& i, const parser_callback_t cb = nullptr)`.
|
||||
|
||||
### Code changes
|
||||
|
||||
New code should use the `parse()` function. Let `ss` be a stream and `cb` be a parse callback function.
|
||||
|
||||
Old code:
|
||||
|
||||
```cpp
|
||||
json j(ss, cb);
|
||||
```
|
||||
|
||||
New code:
|
||||
|
||||
```cpp
|
||||
json j = json::parse(ss, cb);
|
||||
```
|
||||
|
||||
If no callback function is used, also the following code works:
|
||||
|
||||
```cpp
|
||||
json j;
|
||||
j << ss;
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```cpp
|
||||
json j;
|
||||
ss >> j;
|
||||
```
|
||||
|
||||
## Handling of NaN and INF
|
||||
|
||||
- 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) 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”.
|
||||
|
||||
## User-defined exceptions
|
||||
|
||||
```
|
||||
(stub)
|
||||
|
||||
invalid_iterator.201 | domain_error
|
||||
invalid_iterator.202 | domain_error
|
||||
invalid_iterator.203 | domain_error
|
||||
invalid_iterator.204 | out_of_range
|
||||
invalid_iterator.205 | out_of_range
|
||||
invalid_iterator.206 | domain_error
|
||||
invalid_iterator.207 | domain_error
|
||||
invalid_iterator.208 | domain_error
|
||||
invalid_iterator.209 | domain_error
|
||||
invalid_iterator.210 | domain_error
|
||||
invalid_iterator.211 | domain_error
|
||||
invalid_iterator.212 | domain_error
|
||||
invalid_iterator.213 | domain_error
|
||||
invalid_iterator.214 | out_of_range
|
||||
|
||||
other_error.501 | domain_error
|
||||
|
||||
type_error.301 | domain_error
|
||||
type_error.302 | domain_error
|
||||
type_error.303 | domain_error
|
||||
type_error.304 | domain_error
|
||||
type_error.305 | domain_error
|
||||
type_error.306 | domain_error
|
||||
type_error.307 | domain_error
|
||||
type_error.308 | domain_error
|
||||
type_error.309 | domain_error
|
||||
type_error.310 | domain_error
|
||||
type_error.311 | domain_error
|
||||
--
|
||||
type_error.313 | domain_error
|
||||
type_error.314 | domain_error
|
||||
type_error.315 | domain_error
|
||||
|
||||
out_of_range.401 | out_of_range
|
||||
out_of_range.402 | out_of_range
|
||||
out_of_range.403 | out_of_range
|
||||
out_of_range.404 | out_of_range
|
||||
out_of_range.405 | domain_error
|
||||
|
||||
parse_error.101 | invalid_argument
|
||||
parse_error.102 | invalid_argument
|
||||
parse_error.103 | invalid_argument
|
||||
parse_error.104 | invalid_argument
|
||||
parse_error.105 | invalid_argument
|
||||
parse_error.106 | domain_error
|
||||
parse_error.107 | domain_error
|
||||
parse_error.108 | domain_error
|
||||
parse_error.109 | invalid_argument
|
||||
parse_error.110 | out_of_range
|
||||
parse_error.111 | invalid_argument
|
||||
parse_error.112 | invalid_argument
|
||||
```
|
||||
Reference in New Issue
Block a user