Skip to content

Release 1.9.0

Latest

Choose a tag to compare

@danielaparker danielaparker released this 07 Aug 17:10
· 2 commits to master since this release
  • 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_source has been deprecated and renamed to chars_source.

    • The class binary_iterator_source has been removed (replaced by iterator_source).

    • The type name order_preserving_policy has 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_traits has been deprecated and renamed to json_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 a staj_events::key event .
      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::key is now defined as
      staj_events::string_value | staj_events::key_flag.

    • For the common case of CBOR or MessagePack unsigned integer keys,
      the enum value id has been added to sjaj_events,
      defined as staj_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_json value.