Skip to content

Releases: danielaparker/jsoncons

Release 0.99.3a

30 Sep 13:21
Compare
Choose a tag to compare

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 as json::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 to write, 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 to json
  • A new template parameter, JsonTraits, has been added to the basic_json class template.
  • New instantiations of basic_json, ojson and wojson, 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() to json 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

05 Jul 17:16
Compare
Choose a tag to compare
  • 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

09 May 16:34
Compare
Choose a tag to compare
  • Fix to json_filter class
  • Fix to readme_examples

Release 0.99

27 Apr 18:53
Compare
Choose a tag to compare
  • 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

25 Feb 00:33
Compare
Choose a tag to compare

Includes fixes contributed by massimomorara for g++ "4.9.2"

Release 0.98.3.1

25 Jan 15:08
Compare
Choose a tag to compare

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.

Release 0.98.2.1

20 Dec 21:47
Compare
Choose a tag to compare

0.98.2.1

Fixes an issue with json variant operator=

0.98.2

json constructor is now templated, so constructors now accept extended types
Following RFC7159, json_parser now accepts any JSON value, removing the constraint that it be an object or array.
The member json_type_traits member functions is, as, and assign have been changed to static functions. if you have implemented your own type specializations, you will also have to change your is, as and assign functions to be static.
Removed json deprecated functions custom_data, set_custom_data, add_custom_data
json_reader member function max_depth has been renamed to max_nesting_depth, the former name is still supported.
json member function resize_array has been renamed to resize, the former name is still supported.
jsoncons supports alternative ways for constructing null, object, and array values.

null:

json a = jsoncons::null_type(); // Using type constructor
json b = json::null_type(); // Using alias
json c(json::null); // From static data member prototype
object:

json a(); // Default is empty object
json b = json::object(); // Using type constructor
json c(json::an_object); // From static data member prototype
array:

json a = json::array(); // Using type constructor
json b = json::make_array(); // Using factory method
json c(json::an_array); // From static data member prototype
Since C++ has possible order issues with static data members, the jsoncons examples and documentation have been changed to consistently use the other ways, and json::null, json::an_object and json::an_array have been, while still usable, deprecated.

Release 0.98.1

08 Nov 04:25
Compare
Choose a tag to compare
  • Enhances parser for CSV files that outputs JSON, see example below.
  • Adds get_result member function to json_deserializer, which returns the json value v stored in a json_deserializer as std::move(v). The root() member function has been deprecated but is still supported.
  • Adds is_valid member function to json_deserializer
  • Enhances json::any class, adds type checks when casting back to original value
  • Fixes some warning messages

Release 0.98

12 Oct 11:18
Compare
Choose a tag to compare

Bug fixes:

  • Fixes the noexcept specification (required for Visual Studio 2015 and later.) Fix
    contributed by Rupert Steel.
  • Fixes bug with proxy operator== when comparing object member values,
    such as in val["field"] == json("abc")

Enhancements:

  • Refines error codes and improves error messages
  • Renames json_reader method read to read_next, reflecting the fact that it supports reading a sequence of JSON texts from a stream. The
    former name is deprecated but still works.
  • Adds json_reader method check_done that throws if there are unconsumed non-whitespace characters after one or more calls to read_next.
  • Adds getter and setter max_depth methods to allow setting the maximum JSON parse tree depth if desired, by default
    it is arbitrarily large (limited by heap memory.)
  • Modifies json static methods parse_string, parse_file, and parse_stream behaviour to throw if there are unconsumed non-whitespace characters after reading one JSON text.

Changes to extensions:

  • Changes the top level namespace for the extensions from jsoncons_ext to jsoncons, e.g. jsoncons_ext::csv::csv_reader becomes jsoncons::csv::csv_reader
  • Modifies csv_reader and csv_serializer so that the constructors are passed parameters in a csv_parameters object rather than a json object.
  • Supports user defined header names for columns in CSV files

Release 0.97.2

21 Jul 04:26
Compare
Choose a tag to compare
  • Incorporates test suite files from http://www.json.org/JSON_checker/ into test suite

  • The jsoncons parser accepts all of the JSON_checker files that its supposed to accept.

  • Failures to reject incorrect exponential notation (e.g. [0e+-1]) have been fixed.

  • The jsoncons parser now rejects all of the JSON_checker files that its supposed to reject except ones with stuff after the end of the document, e.g.

    ["Extra close"]]

    (Currently the jsoncons parser stops after reading a complete JSON text, and supports reading a sequence of JSON texts.)

  • Incorporates a fix to operator== on json objects, contributed by Alex Merry