diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 092a6a849e..e22e3d3d75 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -24,6 +24,6 @@ assignees: '' **What jsoncons library version?** - - [ ] Latest release 0.168.5 + - [ ] Latest release 0.169.0 - [ ] Other release ______ - [ ] master diff --git a/CHANGELOG.md b/CHANGELOG.md index 90dc5fcbea..ad14c404cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ -master ------ +0.169.0 +------- + +Defect fixes: + +- Fixed issue with boost_interprocess examples not working with gcc, +contributed by [raplonu](https://github.com/raplonu) + +- Fixed and enhance basic_json_diagnostics_visitor, +contributed by [ecorm](https://github.com/ecorm) Performance Enhancement: @@ -15,6 +23,10 @@ If the event type is a `begin_object` or a `begin_array`, returns the size of th or array if known, otherwise 0. For all other event types, returns 0. +- Extended the parsers/cursors/encoder for JSON, CBOR, Msgpack, +BSON, CSV, UBJSON so that they are resettable to new sources/sinks, +contributed by [ecorm](https://github.com/ecorm) + Changes: - For consistency with library naming conventions, the directory diff --git a/doc/ref/basic_json_cursor.md b/doc/ref/basic_json_cursor.md index a66639e115..4d61b68c37 100644 --- a/doc/ref/basic_json_cursor.md +++ b/doc/ref/basic_json_cursor.md @@ -108,6 +108,13 @@ Advances to the next event. If a parsing error is encountered, sets `ec`. const ser_context& context() const override; Returns the current [context](ser_context.md) + void reset(); +Reset cursor to read another value from the same source + + template + reset(Sourceable&& source) +Reset cursor to read new value from a new source + #### Non-member functions template diff --git a/doc/ref/basic_json_encoder.md b/doc/ref/basic_json_encoder.md index 1c1dc36bf2..112272c013 100644 --- a/doc/ref/basic_json_encoder.md +++ b/doc/ref/basic_json_encoder.md @@ -54,10 +54,16 @@ and uses the specified [json options](basic_json_options.md). virtual ~basic_json_encoder() noexcept -#### Inherited from [basic_json_visitor](../basic_json_visitor.md) - #### Member functions + void reset(); +Reset encoder to write another value to the same sink + + void reset(Sink&& sink) +Reset encoder to write a new value to a new sink + +#### Inherited from [basic_json_visitor](../basic_json_visitor.md) + void flush(); (1) bool begin_object(semantic_tag tag=semantic_tag::none, diff --git a/doc/ref/bson/basic_bson_cursor.md b/doc/ref/bson/basic_bson_cursor.md index b8766b4058..f6ee50cb2e 100644 --- a/doc/ref/bson/basic_bson_cursor.md +++ b/doc/ref/bson/basic_bson_cursor.md @@ -94,6 +94,13 @@ Advances to the next event. If a parsing error is encountered, sets `ec`. const ser_context& context() const override; Returns the current [context](ser_context.md) + void reset(); +Reset cursor to read another value from the same source + + template + reset(Sourceable&& source) +Reset cursor to read new value from a new source + #### Non-member functions template diff --git a/doc/ref/bson/basic_bson_encoder.md b/doc/ref/bson/basic_bson_encoder.md index a1bbc87bd7..99e6bb2e93 100644 --- a/doc/ref/bson/basic_bson_encoder.md +++ b/doc/ref/bson/basic_bson_encoder.md @@ -36,6 +36,13 @@ Constructs a new encoder that writes to the specified destination. virtual ~basic_bson_encoder() noexcept +#### Member functions + + void reset(); +Reset encoder to write another value to the same sink + + void reset(Sink&& sink) +Reset encoder to write a new value to a new sink #### Inherited from [jsoncons::basic_json_visitor](basic_json_visitor.md) diff --git a/doc/ref/cbor/basic_cbor_cursor.md b/doc/ref/cbor/basic_cbor_cursor.md index 976d23ee2b..675e5105c5 100644 --- a/doc/ref/cbor/basic_cbor_cursor.md +++ b/doc/ref/cbor/basic_cbor_cursor.md @@ -93,6 +93,13 @@ Advances to the next event. If a parsing error is encountered, sets `ec`. const ser_context& context() const override; Returns the current [context](ser_context.md) + void reset(); +Reset cursor to read another value from the same source + + template + reset(Sourceable&& source) +Reset cursor to read new value from a new sources + #### Non-member functions template diff --git a/doc/ref/cbor/basic_cbor_encoder.md b/doc/ref/cbor/basic_cbor_encoder.md index 86970dcb19..7f8f754291 100644 --- a/doc/ref/cbor/basic_cbor_encoder.md +++ b/doc/ref/cbor/basic_cbor_encoder.md @@ -36,6 +36,13 @@ Constructs a new encoder that writes to the specified destination. virtual ~basic_cbor_encoder() noexcept +#### Member functions + + void reset(); +Reset encoder to write another value to the same sink + + void reset(Sink&& sink) +Reset encoder to write a new value to a new sink #### Inherited from [jsoncons::json_visitor](../basic_json_visitor.md) diff --git a/doc/ref/csv/basic_csv_cursor.md b/doc/ref/csv/basic_csv_cursor.md index e4a1a57cb8..c40b665290 100644 --- a/doc/ref/csv/basic_csv_cursor.md +++ b/doc/ref/csv/basic_csv_cursor.md @@ -109,6 +109,13 @@ Advances to the next event. If a parsing error is encountered, sets `ec`. const ser_context& context() const override; Returns the current [context](../ser_context.md) + void reset(); +Reset cursor to read another value from the same source + + template + reset(Sourceable&& source) +Reset cursor to read new value from a new sources + #### Non-member functions template diff --git a/doc/ref/csv/basic_csv_encoder.md b/doc/ref/csv/basic_csv_encoder.md index 7c96ff04b2..2e4087f60a 100644 --- a/doc/ref/csv/basic_csv_encoder.md +++ b/doc/ref/csv/basic_csv_encoder.md @@ -45,10 +45,16 @@ and uses the specified [csv options](basic_csv_options.md). virtual ~basic_csv_encoder() noexcept -#### Inherited from [basic_json_visitor](../basic_json_visitor.md) - #### Member functions + void reset(); +Reset encoder to write another value to the same sink + + void reset(Sink&& sink) +Reset encoder to write a new value to a new sink + +#### Inherited from [basic_json_visitor](../basic_json_visitor.md) + void flush(); (1) bool begin_object(semantic_tag tag=semantic_tag::none, diff --git a/doc/ref/msgpack/basic_msgpack_cursor.md b/doc/ref/msgpack/basic_msgpack_cursor.md index 48af284bd6..1569e7b1eb 100644 --- a/doc/ref/msgpack/basic_msgpack_cursor.md +++ b/doc/ref/msgpack/basic_msgpack_cursor.md @@ -93,6 +93,13 @@ Advances to the next event. If a parsing error is encountered, sets `ec`. const ser_context& context() const override; Returns the current [context](ser_context.md) + void reset(); +Reset cursor to read another value from the same source + + template + reset(Sourceable&& source) +Reset cursor to read new value from a new sources + #### Non-member functions template diff --git a/doc/ref/msgpack/basic_msgpack_encoder.md b/doc/ref/msgpack/basic_msgpack_encoder.md index 8e005494d6..b42f07e42a 100644 --- a/doc/ref/msgpack/basic_msgpack_encoder.md +++ b/doc/ref/msgpack/basic_msgpack_encoder.md @@ -37,6 +37,13 @@ Constructs a new encoder that writes to the specified destination. virtual ~basic_msgpack_encoder() noexcept +#### Member functions + + void reset(); +Reset encoder to write another value to the same sink + + void reset(Sink&& sink) +Reset encoder to write a new value to a new sink #### Inherited from [jsoncons::basic_json_visitor](basic_json_visitor.md) diff --git a/doc/ref/ubjson/basic_ubjson_cursor.md b/doc/ref/ubjson/basic_ubjson_cursor.md index 895d225255..0ac3dff7ae 100644 --- a/doc/ref/ubjson/basic_ubjson_cursor.md +++ b/doc/ref/ubjson/basic_ubjson_cursor.md @@ -94,6 +94,13 @@ Advances to the next event. If a parsing error is encountered, sets `ec`. const ser_context& context() const override; Returns the current [context](ser_context.md) + void reset(); +Reset cursor to read another value from the same source + + template + reset(Sourceable&& source) +Reset cursor to read new value from a new sources + #### Non-member functions template diff --git a/doc/ref/ubjson/basic_ubjson_encoder.md b/doc/ref/ubjson/basic_ubjson_encoder.md index e3fd6a09f0..ad8009840a 100644 --- a/doc/ref/ubjson/basic_ubjson_encoder.md +++ b/doc/ref/ubjson/basic_ubjson_encoder.md @@ -36,6 +36,13 @@ Constructs a new encoder that writes to the specified destination. virtual ~basic_ubjson_encoder() noexcept +#### Member functions + + void reset(); +Reset encoder to write another value to the same sink + + void reset(Sink&& sink) +Reset encoder to write a new value to a new sink #### Inherited from [jsoncons::basic_json_visitor](basic_json_visitor.md) diff --git a/include/jsoncons/config/version.hpp b/include/jsoncons/config/version.hpp index 7f11eef462..b743dc2948 100644 --- a/include/jsoncons/config/version.hpp +++ b/include/jsoncons/config/version.hpp @@ -10,8 +10,8 @@ #include #define JSONCONS_VERSION_MAJOR 0 -#define JSONCONS_VERSION_MINOR 168 -#define JSONCONS_VERSION_PATCH 7 +#define JSONCONS_VERSION_MINOR 169 +#define JSONCONS_VERSION_PATCH 0 namespace jsoncons {