![]() |
TerraForge3D
2.3.1
3D Terrain And Landscape Generator
|
|
inlinestatic |
create a JSON value from an input in MessagePack format
Deserializes a given input i to a JSON value using the MessagePack serialization format.
The library maps MessagePack types to JSON value types as follows:
MessagePack type | JSON value type | first byte |
---|---|---|
positive fixint | number_unsigned | 0x00..0x7F |
fixmap | object | 0x80..0x8F |
fixarray | array | 0x90..0x9F |
fixstr | string | 0xA0..0xBF |
nil | null | 0xC0 |
false | false | 0xC2 |
true | true | 0xC3 |
float 32 | number_float | 0xCA |
float 64 | number_float | 0xCB |
uint 8 | number_unsigned | 0xCC |
uint 16 | number_unsigned | 0xCD |
uint 32 | number_unsigned | 0xCE |
uint 64 | number_unsigned | 0xCF |
int 8 | number_integer | 0xD0 |
int 16 | number_integer | 0xD1 |
int 32 | number_integer | 0xD2 |
int 64 | number_integer | 0xD3 |
str 8 | string | 0xD9 |
str 16 | string | 0xDA |
str 32 | string | 0xDB |
array 16 | array | 0xDC |
array 32 | array | 0xDD |
map 16 | object | 0xDE |
map 32 | object | 0xDF |
bin 8 | binary | 0xC4 |
bin 16 | binary | 0xC5 |
bin 32 | binary | 0xC6 |
ext 8 | binary | 0xC7 |
ext 16 | binary | 0xC8 |
ext 32 | binary | 0xC9 |
fixext 1 | binary | 0xD4 |
fixext 2 | binary | 0xD5 |
fixext 4 | binary | 0xD6 |
fixext 8 | binary | 0xD7 |
fixext 16 | binary | 0xD8 |
negative fixint | number_integer | 0xE0-0xFF |
[in] | i | an input in MessagePack format convertible to an input adapter |
[in] | strict | whether to expect the input to be consumed until EOF (true by default) |
[in] | allow_exceptions | whether to throw exceptions in case of a parse error (optional, true by default) |
false
, the return value will be value_t::discarded.parse_error.110 | if the given input ends prematurely or the end of file was not reached when strict was set to true |
parse_error.112 | if unsupported features from MessagePack were used in the given input i or if the input is not valid MessagePack |
parse_error.113 | if a string was expected as map key, but not found |
@complexity Linear in the size of the input i.
@liveexample{The example shows the deserialization of a byte vector in MessagePack format to a JSON value.,from_msgpack}
Definition at line 25610 of file json.hpp.