Skip to content

Commit

Permalink
0.179.0 -> 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
danielaparker committed Dec 1, 2024
1 parent 09b300d commit a68e42f
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ assignees: ''

**What jsoncons library version?**

- [ ] Latest release 0.178.0
- [ ] Latest release 1.0.0
- [ ] Other release ______
- [ ] master
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
0.179.0 (on master)
1.0.0 (on master)
-------

Changes to basic_json::operator[]:
Expand Down
2 changes: 1 addition & 1 deletion doc/ref/corelib/basic_json.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Member type |Definition
`const_object_range_type`|range<const_object_iterator,const_array_iterator> (since 0.173.3)
`array_range_type`|range<array_iterator,const_array_iterator> (since 0.173.3)
`const_array_range_type`|range<const_array_iterator,const_array_iterator> (since 0.173.3)
`proxy_type`|proxy<basic_json>. The `proxy_type` class supports conversion to `basic_json&`. (removed in 0.179.0)
`proxy_type`|proxy<basic_json>. The `proxy_type` class supports conversion to `basic_json&`. (removed in 1.0.0)
### Static member functions
Expand Down
24 changes: 12 additions & 12 deletions doc/ref/corelib/basic_json_parser.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,26 @@ temp_allocator_type |TempAllocator

#### Constructors

basic_json_parser(const TempAllocator& temp_alloc = TempAllocator()); (1)
basic_json_parser(const TempAllocator& temp_alloc = TempAllocator()); (1)

basic_json_parser(const basic_json_decode_options<CharT>& options,
const TempAllocator& temp_alloc = TempAllocator()); (2)
const TempAllocator& temp_alloc = TempAllocator()); (2)

basic_json_parser(std::function<bool(json_errc,const ser_context&)> err_handler,
const TempAllocator& temp_alloc = TempAllocator()); (3) (deprecated since 0.171.0)
const TempAllocator& temp_alloc = TempAllocator()); (3) (deprecated since 0.171.0)

basic_json_parser(const basic_json_decode_options<CharT>& options,
std::function<bool(json_errc,const ser_context&)> err_handler, (4) (deprecated since 0.171.0)
std::function<bool(json_errc,const ser_context&)> err_handler, (4) (deprecated since 0.171.0)
const TempAllocator& temp_alloc = TempAllocator());

basic_json_parser(
std::function<bool(basic_parser_input<CharT>& input, std::error_code& ec)> chunk_rdr,
const TempAllocator& temp_alloc = TempAllocator()); (5) (since 0.179.0)
std::function<bool(basic_parser_input<CharT>& input, std::error_code& ec)> read_chunk,
const TempAllocator& temp_alloc = TempAllocator()); (5) (since 1.0.0)

basic_json_parser(
std::function<bool(basic_parser_input<CharT>& input, std::error_code& ec)> chunk_rdr,
std::function<bool(basic_parser_input<CharT>& input, std::error_code& ec)> read_chunk,
const basic_json_decode_options<CharT>& options,
const TempAllocator& temp_alloc = TempAllocator()); (6) (since 0.179.0)
const TempAllocator& temp_alloc = TempAllocator()); (6) (since 1.0.0)


(1) Constructs a `json_parser` that uses default [basic_json_options](basic_json_options.md)
Expand All @@ -71,10 +71,10 @@ and a specified [err_handler](err_handler.md).
#### Member functions

void update(const string_view_type& sv)
void update(const CharT* data, std::size_t length) (deprecated in 0.179.0)
void update(const CharT* data, std::size_t length) (deprecated in 1.0.0)
Update the parser with a chunk of JSON

void set_buffer(const CharT* data, std::size_t length) final (since 0.179.0)
void set_buffer(const CharT* data, std::size_t length) final (since 1.0.0)
Initializes the buffer to parse from with a chunk of JSON text

bool done() const
Expand Down Expand Up @@ -190,7 +190,7 @@ B: inf
C: -inf
```

#### Incremental parsing (until 0.179.0)
#### Incremental parsing (until 1.0.0)

```cpp
#include <jsoncons/json.hpp>
Expand Down Expand Up @@ -252,7 +252,7 @@ Output:
(7) [false,90]
```

#### Incremental parsing (since 0.179.0)
#### Incremental parsing (since 1.0.0)

```cpp
#include <jsoncons/json.hpp>
Expand Down
2 changes: 1 addition & 1 deletion doc/ref/corelib/json/constructor.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ basic_json(byte_string_arg_t,

basic_json(json_const_pointer_arg, const basic_json* j_ptr); (25) (since 0.156.0)

basic_json(json_reference_arg, basic_json& j); (26) (since 0.179.0)
basic_json(json_reference_arg, basic_json& j); (26) (since 1.0.0)
```
(1) Constructs an empty json object.
Expand Down
18 changes: 9 additions & 9 deletions doc/ref/corelib/json/operator_at.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
### jsoncons::basic_json::operator[]

```cpp
proxy_type operator[](const string_view_type& key); (1) (until 0.179.0)
reference operator[](const string_view_type& key); (since 0.179.0)
proxy_type operator[](const string_view_type& key); (1) (until 1.0.0)
reference operator[](const string_view_type& key); (since 1.0.0)

const_reference operator[](const string_view_type& key) const; (2)

Expand All @@ -11,16 +11,16 @@ reference operator[](std::size_t i); (3)
const_reference operator[](std::size_t i) const; (4)
```

(1) Unitl 0.179.0, returns a "reference-like" proxy object that can be used to access
(1) Unitl 1.0.0, returns a "reference-like" proxy object that can be used to access
or assign to the underlying keyed value.

Since 0.179, returns a reference to the value mapped to `key`,
inserting a default constructed value mapped to `key` if no such key already exists
(a default constructed value is an empty object.)

(2) Until 0.179.0, if `key` exists, returns a const reference to the `basic_json` value mapped to `key`, otherwise throws.
(2) Until 1.0.0, if `key` exists, returns a const reference to the `basic_json` value mapped to `key`, otherwise throws.

Since 0.179.0, returns a const reference to the `basic_json` value mapped to `key`, returning a const reference to a default
Since 1.0.0, returns a const reference to the `basic_json` value mapped to `key`, returning a const reference to a default
constructed `basic_json` value with static storage duration if no such key already exists.

(3) Returns a reference to the value at index i in a `basic_json` object or array.
Expand All @@ -31,12 +31,12 @@ Throws `std::domain_error` if not an object or array.

Exceptions

(1) Throws `std::domain_error` if not an object. Until 0.179.0, throws a `std::out_of_range` if
assigning to a `basic_json` and the key does not exist. Since 0.179.0, inserts a default constructed
(1) Throws `std::domain_error` if not an object. Until 1.0.0, throws a `std::out_of_range` if
assigning to a `basic_json` and the key does not exist. Since 1.0.0, inserts a default constructed
key-value pair if the key does not exist.

(2) Throws `std::domain_error` if not an object. Until 0.179.0, throws a `std::out_of_range` if
the key does not exist. Since 0.179.0, does
(2) Throws `std::domain_error` if not an object. Until 1.0.0, throws a `std::out_of_range` if
the key does not exist. Since 1.0.0, does

(3) Throws `std::domain_error` if not an array.

Expand Down
4 changes: 2 additions & 2 deletions examples/src/json_parser_examples.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ void parse_nan_replacement_example()
try
{
#if JSONCONS_VERSION_MAJOR == 0 && JSONCONS_VERSION_MINOR < 179
parser.update(s); // until 0.179.0
parser.update(s); // until 1.0.0
#else
parser.set_buffer(s.data(), s.size()); // since 0.179.0
parser.set_buffer(s.data(), s.size()); // since 1.0.0
#endif
parser.parse_some(decoder);
parser.finish_parse(decoder);
Expand Down
22 changes: 11 additions & 11 deletions include/jsoncons/json_parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class basic_json_parser : public ser_context, public virtual basic_parser_input<
public:
using char_type = CharT;
using string_view_type = typename basic_json_visitor<CharT>::string_view_type;
using chunk_reader_type = std::function<bool(basic_parser_input<CharT>& input, std::error_code& ec)>;
using read_chunk_type = std::function<bool(basic_parser_input<CharT>& input, std::error_code& ec)>;
private:

struct string_maps_to_double
Expand Down Expand Up @@ -100,7 +100,7 @@ class basic_json_parser : public ser_context, public virtual basic_parser_input<
std::vector<json_parse_state,parse_state_allocator_type> state_stack_;
std::vector<std::pair<std::basic_string<char_type>,double>> string_double_map_;

chunk_reader_adaptor<char_type> chk_rdr_;
chunk_reader_adaptor<char_type> read_chunk_;
chunk_reader<char_type>* chunk_rdr_;

// Noncopyable and nonmoveable
Expand All @@ -113,8 +113,8 @@ class basic_json_parser : public ser_context, public virtual basic_parser_input<
{
}

basic_json_parser(chunk_reader_type chunk_rdr, const TempAllocator& temp_alloc = TempAllocator())
: basic_json_parser(chunk_rdr, basic_json_decode_options<char_type>(), default_json_parsing(),
basic_json_parser(read_chunk_type read_chunk, const TempAllocator& temp_alloc = TempAllocator())
: basic_json_parser(read_chunk, basic_json_decode_options<char_type>(), default_json_parsing(),
temp_alloc)
{
}
Expand All @@ -132,17 +132,17 @@ class basic_json_parser : public ser_context, public virtual basic_parser_input<
{
}

basic_json_parser(chunk_reader_type chunk_rdr, const basic_json_decode_options<CharT>& options,
basic_json_parser(read_chunk_type read_chunk, const basic_json_decode_options<CharT>& options,
const TempAllocator& temp_alloc = TempAllocator())
: basic_json_parser(chunk_rdr, options, options.err_handler(), temp_alloc)
: basic_json_parser(read_chunk, options, options.err_handler(), temp_alloc)
{
}

#if !defined(JSONCONS_NO_DEPRECATED)
basic_json_parser(const basic_json_decode_options<char_type>& options,
std::function<bool(json_errc,const ser_context&)> err_handler,
const TempAllocator& temp_alloc = TempAllocator())
: basic_json_parser(&chk_rdr_, options, err_handler, temp_alloc)
: basic_json_parser(&read_chunk_, options, err_handler, temp_alloc)
{
}
#endif
Expand All @@ -167,7 +167,7 @@ class basic_json_parser : public ser_context, public virtual basic_parser_input<
done_(false),
string_buffer_(temp_alloc),
state_stack_(temp_alloc),
chk_rdr_{},
read_chunk_{},
chunk_rdr_(chunk_rdr)
{
string_buffer_.reserve(initial_string_buffer_capacity);
Expand All @@ -190,7 +190,7 @@ class basic_json_parser : public ser_context, public virtual basic_parser_input<
}
}

basic_json_parser(chunk_reader_type chunk_rdr,
basic_json_parser(read_chunk_type read_chunk,
const basic_json_decode_options<char_type>& options,
std::function<bool(json_errc,const ser_context&)> err_handler,
const TempAllocator& temp_alloc = TempAllocator())
Expand All @@ -211,8 +211,8 @@ class basic_json_parser : public ser_context, public virtual basic_parser_input<
done_(false),
string_buffer_(temp_alloc),
state_stack_(temp_alloc),
chk_rdr_(chunk_rdr),
chunk_rdr_(&chk_rdr_)
read_chunk_(read_chunk),
chunk_rdr_(&read_chunk_)
{
string_buffer_.reserve(initial_string_buffer_capacity);

Expand Down

0 comments on commit a68e42f

Please sign in to comment.