Releases: danielaparker/jsoncons
Release 0.99.7.3
-
json_type_traits
supportsstd::pair
(convert to/from json array of size 2) -
parse_stream
renamed toparse
(backwards compatible) -
kvp_type
renamed tokey_value_pair_type
(backwards compatible) -
The
_json
and_ojson
literal operators have been moved to the namespacejsoncons::literals
.
Access to these literals now requires
using namespace jsoncons::literals;
Rationale: avoid name clashes with other json
libraries
-
The name
owjson
has been deprecated (still works) and changed towojson
. Rationale: naming consistency -
Added json array functions
emplace_back
andemplace
, and json object functionstry_emplace
andinsert_or_assign
, which are analagous to the standard library vector and map functions.
Release 0.99.7.2
Bug fix
- A bug was introduced in 0.99.7 causing the values of existing object members to not be changed with set or assignment operations. This has been fixed.
Change
- jsoncons_ext/binary changed to jsoncons_ext/msgpack
- namespace jsoncons::binary changed to jsoncons::msgpack
Release 0.99.7.1
0.99.7.1
- Workarounds in unicode_traits and jsonpath to maintain support for vs2013
- Added
mapping_type::n_rows
,mapping_type::n_objects
, andmapping_type::m_columns
options for csv to json
0.99.7
Bug fixes
- Issues with precedence in JsonPath filter evaluations have been fixed
- An issue with (a - expression) in JsonPath filter evaluations has been fixed
New feature
- The new binary extension supports encoding to and decoding from the MessagePack binary serialization format.
- An extension to JsonPath to allow filter expressions over a single object.
- Added support for
*
and/
operators to jsonpath filter - literal operators _json and _ojson have been introduced
Non-breaking changes
- The
json
write
functions have been renamed todump
. The old names have been deprecated but still work. - Support for stateful allocators
- json function object_range() now returns a pair of RandomAccessIterator (previously BidirectionalIterator)
- json operator [size_t i] applied to a json object now returns the ith object (previously threw)
Breaking change (if you've implemented your own input and output handlers)
In basic_json_input_handler, the virtual functions
virtual void do_name(const CharT* value, size_t length,
const basic_parsing_context<CharT>& context)
virtual void do_string_value(const CharT* value, size_t length,
const basic_parsing_context<CharT>& context)
have been changed to
virtual void do_name(string_view_type val,
const basic_parsing_context<CharT>& context)
virtual void do_string_value(string_view_type val,
const basic_parsing_context<CharT>& context)
In basic_json_output_handler, the virtual functions
virtual void do_name(const CharT* value, size_t length)
virtual void do_string_value(const CharT* value, size_t length)
have been changed to
virtual void do_name(string_view_type val)
virtual void do_string_value(string_view_type val)
Removed features:
- The jsonx extension has been removed
Release 0.99.5
- Validations added to utf8 and utf16 string parsing to pass all JSONTestSuite tests
- The name
json_encoder
introduced in 0.99.4 has been changed tojson_decoder
. Rationale: consistencty with common usage (encoding and serialization, decoding and deserialization)
Release 0.99.3a
0.99.3a
Changes
The json
initializer-list constructor has been removed, it gives inconsistent results when an initializer has zero elements, or one element of the type being initialized (json
). Please replace
json j = {1,2,3}
with json j = json::array{1,2,3}
, and
json j = {{1,2,3},{4,5,6}}
with json j = json::array{json::array{1,2,3},json::array{4,5,6}}
- Initializer-list constructors are now supported in
json::object
as well asjson::array
, e.g.
json j = json::object{{"first",1},{"second",json::array{1,2,3}}};
- json::any has been deprecated and will be removed in the future
- The json method
to_stream
has been renamed towrite
, the old name is still supported. output_format
object_array_block_option
,array_array_block_option
functions have been deprecated and replaced by
object_array_split_lines
,array_array_split_lines
functions.
Enhancements
- A new method
get_with_default
, with return type that of the default, has been added tojson
- A new template parameter,
JsonTraits
, has been added to thebasic_json
class template. - New instantiations of
basic_json
,ojson
andwojson
, have been added for users who wish to preserve the alphabetical sort of parsed json text and to insert new members in arbitrary name order. - Added support for
json
is<T>
,as<T>
, constructor, and assignment operator for any sequence container (std::array
,std::vector
,std::deque
,std::forward_list
,std::list
) whose values are assignable to JSON types (e.g., ints, doubles, bools, strings, STL containers of same) and for associative containers (std::set
,std::multiset
,std::unordered_set
,std::unordered_multiset
.) - Added static method
null()
tojson
class to return null value - A new extension jsonx that supports serializing JSON values to JSONx (XML)
- json parser will skip
bom
in input if present
Fixes:
- Fixes to the
jsonpath
extension, including the union operator and applying index operations to string values - Fixes to remove warnings and issues reported by VS2015 with 4-th warnings level, PVS-Studio static analyzer tool, and UBSAN.
Release 0.99.2
-
Included workaround for a C++11 issue in GCC 4.8, contributed by Alex Merry
-
Fixed operator== so that json() == json(json::object())
-
Fixed issue with
json
assignment to initializer list -
Fixed issue with assignment to empty json object with multiple keys, e.g.
json val;
val["key1"]["key2"] = 1;
Release 0.99.1
- Fix to json_filter class
- Fix to readme_examples
Release 0.99
- Fixes to deprecated json parse functions (deprecated, but still supposed to work)
- The Visual C++ specific implementation for reading floating point numbers should have freed a
_locale_t
object, fixed - Added
json_type_traits
specialization to support assignment from non-const strings - When parsing fractional numbers in text, floating point number precision is retained, and made available to serialization to preserve round-trip. The default output precision has been changed from 15 to 16.
- Added json
std::initializer_list
constructor for constructing arrays - The deprecated json member constants null, an_object, and an_array have been removed
- Microsoft VC++ versions earlier than 2013 are no longer supported
Release 0.98.4.1
Includes fixes contributed by massimomorara for g++ "4.9.2"
Release 0.98.3.1
0.98.3.1
Fixes an issue with object key comparisons introduced in 0.98.3.
0.98.3
New features
Supports Stefan Goessner's JsonPath. See example below and documentation.
json member function find added
json member function count added
json array range accessor elements() added, which supports range-based for loops over json arrays, and replaces begin_elements and end_elements
json object range accessor members() added, which supports range-based for loops over json objects, and replaces begin_members and end_members
New version of json add member function that takes a parameter array_iterator
json member function shrink_to_fit added
API Changes
The json internal representation of signed and unsigned integers has been changed from long long and unsigned long long to int64_t and uint64_t. This should not impact you unless you've implemented your own json_input_handler or json_output_handler, in which case you'll need to change your json_input_handler function signatures
void do_longlong_value(long long value, const basic_parsing_context& context) override
void do_ulonglong_integer_value(unsigned long long value, const basic_parsing_context& context) override
to
void do_integer_value(int64_t value, const basic_parsing_context& context) override
void do_uinteger_value(uint64_t value, const basic_parsing_context& context) override
and your json_output_handler function signatures from
void do_longlong_value(long long value) override
void do_ulonglong_integer_value(unsigned long long value) override
to
void do_integer_value(int64_t value) override
void do_uinteger_value(uint64_t value) override
output_format drops support for floatfield property
Non-beaking API Changes
remove_range has been deprecated, use erase(array_iterator first, array_iterator last) instead
remove has been deprecated, use erase(const std::string& name ) instead
json::parse_string has been renamed to json::parse, parse_string is deprecated but still works
json member functionis_emptyhas been renamed toempty,is_empty` is deprecated but still works. Rationale: consistency with C++ containers
json member functions begin_elements and end_elements have been deprecated, instead use elements().begin() and elements.end()
json member functions begin_members and end_members have been deprecated, instead use members().begin() and members.end()
json member function has_member has been deprecated, instead use count. Rationale: consistency with C++ containers
json member function remove_member has been deprecated, instead use remove. Rationale: only member function left with _element or _member suffix
json_parse_exception renamed to parse_exception, json_parse_exception typedef to parse_exception
json::parse(std::istream& is) renamed to json::parse_stream. json::parse(std::istream is) is deprecated but still works.