-
Fixed bugs:
-
Fixed issue identified by Google fuzz where a CBOR classical multi-dimensional array
contained elements of typed array. -
Git PR #727: fix CBOR parser issues the fuzzer exposed
-
-
Changes
-
The type name
string_sourcehas been deprecated and renamed tochars_source. -
The class
binary_iterator_sourcehas been removed (replaced byiterator_source). -
The type name
order_preserving_policyhas been deprecated and renamed to
ordered_policy. For backwards compatibility the old name is aliased to the new name but
will be removed in a future release. -
The type name
json_conv_traitshas been deprecated and renamed tojson_traits.
For backwards compatibility the old name is aliased to the new name but
will be removed in a future release.
-
-
Enhancements:
-
Until 1.9.0, cbor and msgpack cursors read key-value pairs
and convert the key part into a string before making it
avaliable to the cursor as astaj_events::keyevent .
Since 1.9.0, cbor and msgpack cursors read key-value pairs
and make both string and non-string keys available to the cursor
as a value event ORed with a key flag (staj_events::key_flag).
For backwards compatibility,staj_events::keyis now defined as
staj_events::string_value | staj_events::key_flag. -
For the common case of CBOR or MessagePack unsigned integer keys,
the enum valueidhas been added tosjaj_events,
defined asstaj_events::uint64_value | staj_events::key_flag.cbor::cbor_bytes_cursor cursor{data}; while (!cursor.done()) { switch (cursor.current().event_type()) { case staj_events::id: auto id = cursor.current().get<uint64_t>(); // handle unsigned integer key event break; } } -
When decoding a CBOR or MessagePack array of maps that have unsigned
integer keys, code like
auto m = cbor::decode_cbor<std::vector<std::map<uint64_t, std::string>>>(data);
produces the same result as 1.8.0, but no longer results in conversions
from integer to string and back to integer.-
Reduced allocations when parsing BSON, CBOR, MessagePack and UBJSON.
-
JSONCONS_ALL_MEMBER_TRAITS, JSONCONS_N_MEMBER_TRAITS,
JSONCONS_ALL_MEMBER_NAME_TRAITS, and JSONCONS_N_MEMBER_NAME_TRAITS now
generate decode traits that support decode without an intermediate
basic_jsonvalue.
-