/src/jsoncons/include/jsoncons/json_decoder.hpp
Line | Count | Source (jump to first uncovered line) |
1 | | // Copyright 2013-2025 Daniel Parker |
2 | | // Distributed under the Boost license, Version 1.0. |
3 | | // (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
4 | | |
5 | | // See https://github.com/danielaparker/jsoncons for latest version |
6 | | |
7 | | #ifndef JSONCONS_JSON_DECODER_HPP |
8 | | #define JSONCONS_JSON_DECODER_HPP |
9 | | |
10 | | #include <cstddef> |
11 | | #include <cstdint> |
12 | | #include <memory> // std::allocator |
13 | | #include <system_error> |
14 | | #include <utility> // std::move |
15 | | #include <vector> |
16 | | |
17 | | #include <jsoncons/json_object.hpp> |
18 | | #include <jsoncons/json_type.hpp> |
19 | | #include <jsoncons/json_visitor.hpp> |
20 | | #include <jsoncons/semantic_tag.hpp> |
21 | | #include <jsoncons/ser_context.hpp> |
22 | | |
23 | | namespace jsoncons { |
24 | | |
25 | | template <typename Json,typename TempAlloc =std::allocator<char>> |
26 | | class json_decoder final : public basic_json_visitor<typename Json::char_type> |
27 | | { |
28 | | public: |
29 | | using char_type = typename Json::char_type; |
30 | | using typename basic_json_visitor<char_type>::string_view_type; |
31 | | |
32 | | using key_value_type = typename Json::key_value_type; |
33 | | using key_type = typename Json::key_type; |
34 | | using array = typename Json::array; |
35 | | using object = typename Json::object; |
36 | | using allocator_type = typename Json::allocator_type; |
37 | | using json_string_allocator = typename key_type::allocator_type; |
38 | | using json_array_allocator = typename array::allocator_type; |
39 | | using json_object_allocator = typename object::allocator_type; |
40 | | using json_byte_allocator_type = typename std::allocator_traits<allocator_type>:: template rebind_alloc<uint8_t>; |
41 | | private: |
42 | | |
43 | | enum class structure_type {root_t, array_t, object_t}; |
44 | | |
45 | | struct structure_info |
46 | | { |
47 | | structure_type type_; |
48 | | std::size_t container_index_{0}; |
49 | | |
50 | | structure_info(structure_type type, std::size_t offset) noexcept |
51 | 32.9M | : type_(type), container_index_(offset) |
52 | 32.9M | { |
53 | 32.9M | } jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::structure_info::structure_info(jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::structure_type, unsigned long) Line | Count | Source | 51 | 29.8M | : type_(type), container_index_(offset) | 52 | 29.8M | { | 53 | 29.8M | } |
jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::structure_info::structure_info(jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::structure_type, unsigned long) Line | Count | Source | 51 | 3.06M | : type_(type), container_index_(offset) | 52 | 3.06M | { | 53 | 3.06M | } |
|
54 | | ~structure_info() = default; |
55 | | }; |
56 | | |
57 | | using temp_allocator_type = TempAlloc; |
58 | | using stack_item_allocator_type = typename std::allocator_traits<allocator_type>:: template rebind_alloc<index_key_value<Json>>; |
59 | | using structure_info_allocator_type = typename std::allocator_traits<temp_allocator_type>:: template rebind_alloc<structure_info>; |
60 | | |
61 | | allocator_type allocator_; |
62 | | |
63 | | Json result_; |
64 | | |
65 | | std::size_t index_{0}; |
66 | | key_type name_; |
67 | | std::vector<index_key_value<Json>,stack_item_allocator_type> item_stack_; |
68 | | std::vector<structure_info,structure_info_allocator_type> structure_stack_; |
69 | | bool is_valid_{false}; |
70 | | |
71 | | public: |
72 | | json_decoder(const allocator_type& alloc = allocator_type(), |
73 | | const temp_allocator_type& temp_alloc = temp_allocator_type()) |
74 | 31.1k | : allocator_(alloc), |
75 | 31.1k | result_(), |
76 | 31.1k | name_(alloc), |
77 | 31.1k | item_stack_(alloc), |
78 | 31.1k | structure_stack_(temp_alloc) |
79 | 31.1k | { |
80 | 31.1k | item_stack_.reserve(1000); |
81 | 31.1k | structure_stack_.reserve(100); |
82 | 31.1k | structure_stack_.emplace_back(structure_type::root_t, 0); |
83 | 31.1k | } jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::json_decoder(std::__1::allocator<char> const&, std::__1::allocator<char> const&) Line | Count | Source | 74 | 28.5k | : allocator_(alloc), | 75 | 28.5k | result_(), | 76 | 28.5k | name_(alloc), | 77 | 28.5k | item_stack_(alloc), | 78 | 28.5k | structure_stack_(temp_alloc) | 79 | 28.5k | { | 80 | 28.5k | item_stack_.reserve(1000); | 81 | 28.5k | structure_stack_.reserve(100); | 82 | 28.5k | structure_stack_.emplace_back(structure_type::root_t, 0); | 83 | 28.5k | } |
jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::json_decoder(std::__1::allocator<char> const&, std::__1::allocator<char> const&) Line | Count | Source | 74 | 2.60k | : allocator_(alloc), | 75 | 2.60k | result_(), | 76 | 2.60k | name_(alloc), | 77 | 2.60k | item_stack_(alloc), | 78 | 2.60k | structure_stack_(temp_alloc) | 79 | 2.60k | { | 80 | 2.60k | item_stack_.reserve(1000); | 81 | 2.60k | structure_stack_.reserve(100); | 82 | 2.60k | structure_stack_.emplace_back(structure_type::root_t, 0); | 83 | 2.60k | } |
|
84 | | |
85 | | json_decoder(temp_allocator_arg_t, |
86 | | const temp_allocator_type& temp_alloc = temp_allocator_type()) |
87 | | : allocator_(), |
88 | | result_(), |
89 | | name_(), |
90 | | item_stack_(), |
91 | | structure_stack_(temp_alloc) |
92 | | { |
93 | | item_stack_.reserve(1000); |
94 | | structure_stack_.reserve(100); |
95 | | structure_stack_.emplace_back(structure_type::root_t, 0); |
96 | | } |
97 | | |
98 | | void reset() |
99 | | { |
100 | | is_valid_ = false; |
101 | | index_ = 0; |
102 | | item_stack_.clear(); |
103 | | structure_stack_.clear(); |
104 | | structure_stack_.emplace_back(structure_type::root_t, 0); |
105 | | } |
106 | | |
107 | | bool is_valid() const |
108 | 8.16k | { |
109 | 8.16k | return is_valid_; |
110 | 8.16k | } jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::is_valid() const Line | Count | Source | 108 | 8.16k | { | 109 | 8.16k | return is_valid_; | 110 | 8.16k | } |
Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<wchar_t, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::is_valid() const Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::is_valid() const Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<wchar_t, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::is_valid() const |
111 | | |
112 | | Json get_result() |
113 | 8.16k | { |
114 | 8.16k | JSONCONS_ASSERT(is_valid_); |
115 | 8.16k | is_valid_ = false; |
116 | 8.16k | return std::move(result_); |
117 | 8.16k | } jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::get_result() Line | Count | Source | 113 | 8.16k | { | 114 | 8.16k | JSONCONS_ASSERT(is_valid_); | 115 | 8.16k | is_valid_ = false; | 116 | 8.16k | return std::move(result_); | 117 | 8.16k | } |
Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<wchar_t, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::get_result() Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::get_result() Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<wchar_t, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::get_result() |
118 | | |
119 | | private: |
120 | | |
121 | | void visit_flush() override |
122 | 11.0k | { |
123 | 11.0k | } jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_flush() Line | Count | Source | 122 | 8.55k | { | 123 | 8.55k | } |
Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<wchar_t, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_flush() Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<wchar_t, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_flush() jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_flush() Line | Count | Source | 122 | 2.51k | { | 123 | 2.51k | } |
|
124 | | |
125 | | JSONCONS_VISITOR_RETURN_TYPE visit_begin_object(semantic_tag tag, const ser_context&, std::error_code&) override |
126 | 17.1M | { |
127 | 17.1M | if (structure_stack_.back().type_ == structure_type::root_t) |
128 | 16.3k | { |
129 | 16.3k | index_ = 0; |
130 | 16.3k | item_stack_.clear(); |
131 | 16.3k | is_valid_ = false; |
132 | 16.3k | } |
133 | 17.1M | item_stack_.emplace_back(std::move(name_), index_++, json_object_arg, tag); |
134 | 17.1M | structure_stack_.emplace_back(structure_type::object_t, item_stack_.size()-1); |
135 | 17.1M | JSONCONS_VISITOR_RETURN; |
136 | 17.1M | } jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_begin_object(jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) Line | Count | Source | 126 | 17.1M | { | 127 | 17.1M | if (structure_stack_.back().type_ == structure_type::root_t) | 128 | 16.3k | { | 129 | 16.3k | index_ = 0; | 130 | 16.3k | item_stack_.clear(); | 131 | 16.3k | is_valid_ = false; | 132 | 16.3k | } | 133 | 17.1M | item_stack_.emplace_back(std::move(name_), index_++, json_object_arg, tag); | 134 | 17.1M | structure_stack_.emplace_back(structure_type::object_t, item_stack_.size()-1); | 135 | 17.1M | JSONCONS_VISITOR_RETURN; | 136 | 17.1M | } |
Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<wchar_t, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_begin_object(jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_begin_object(jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<wchar_t, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_begin_object(jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_begin_object(jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) |
137 | | |
138 | | JSONCONS_VISITOR_RETURN_TYPE visit_end_object(const ser_context&, std::error_code&) override |
139 | 17.1M | { |
140 | 17.1M | JSONCONS_ASSERT(structure_stack_.size() > 0); |
141 | 17.1M | JSONCONS_ASSERT(structure_stack_.back().type_ == structure_type::object_t); |
142 | 17.1M | const size_t structure_index = structure_stack_.back().container_index_; |
143 | 17.1M | JSONCONS_ASSERT(item_stack_.size() > structure_index); |
144 | 17.1M | const size_t count = item_stack_.size() - (structure_index + 1); |
145 | 17.1M | auto first = item_stack_.begin() + (structure_index+1); |
146 | | |
147 | 17.1M | if (count > 0) |
148 | 116k | { |
149 | 116k | item_stack_[structure_index].value.template cast<typename Json::object_storage>().value().uninitialized_init( |
150 | 116k | &item_stack_[structure_index+1], count); |
151 | 116k | } |
152 | | |
153 | 17.1M | item_stack_.erase(first, item_stack_.end()); |
154 | 17.1M | structure_stack_.pop_back(); |
155 | 17.1M | if (structure_stack_.back().type_ == structure_type::root_t) |
156 | 5.56k | { |
157 | 5.56k | result_.swap(item_stack_.front().value); |
158 | 5.56k | item_stack_.pop_back(); |
159 | 5.56k | is_valid_ = true; |
160 | 5.56k | JSONCONS_VISITOR_RETURN; |
161 | 5.56k | } |
162 | 17.1M | JSONCONS_VISITOR_RETURN; |
163 | 17.1M | } jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_end_object(jsoncons::ser_context const&, std::__1::error_code&) Line | Count | Source | 139 | 17.1M | { | 140 | 17.1M | JSONCONS_ASSERT(structure_stack_.size() > 0); | 141 | 17.1M | JSONCONS_ASSERT(structure_stack_.back().type_ == structure_type::object_t); | 142 | 17.1M | const size_t structure_index = structure_stack_.back().container_index_; | 143 | 17.1M | JSONCONS_ASSERT(item_stack_.size() > structure_index); | 144 | 17.1M | const size_t count = item_stack_.size() - (structure_index + 1); | 145 | 17.1M | auto first = item_stack_.begin() + (structure_index+1); | 146 | | | 147 | 17.1M | if (count > 0) | 148 | 116k | { | 149 | 116k | item_stack_[structure_index].value.template cast<typename Json::object_storage>().value().uninitialized_init( | 150 | 116k | &item_stack_[structure_index+1], count); | 151 | 116k | } | 152 | | | 153 | 17.1M | item_stack_.erase(first, item_stack_.end()); | 154 | 17.1M | structure_stack_.pop_back(); | 155 | 17.1M | if (structure_stack_.back().type_ == structure_type::root_t) | 156 | 5.56k | { | 157 | 5.56k | result_.swap(item_stack_.front().value); | 158 | 5.56k | item_stack_.pop_back(); | 159 | 5.56k | is_valid_ = true; | 160 | 5.56k | JSONCONS_VISITOR_RETURN; | 161 | 5.56k | } | 162 | 17.1M | JSONCONS_VISITOR_RETURN; | 163 | 17.1M | } |
Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<wchar_t, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_end_object(jsoncons::ser_context const&, std::__1::error_code&) Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_end_object(jsoncons::ser_context const&, std::__1::error_code&) Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<wchar_t, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_end_object(jsoncons::ser_context const&, std::__1::error_code&) Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_end_object(jsoncons::ser_context const&, std::__1::error_code&) Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_end_object(jsoncons::ser_context const&, std::__1::error_code&) |
164 | | |
165 | | JSONCONS_VISITOR_RETURN_TYPE visit_begin_array(semantic_tag tag, const ser_context&, std::error_code&) override |
166 | 15.7M | { |
167 | 15.7M | if (structure_stack_.back().type_ == structure_type::root_t) |
168 | 8.24k | { |
169 | 8.24k | index_ = 0; |
170 | 8.24k | item_stack_.clear(); |
171 | 8.24k | is_valid_ = false; |
172 | 8.24k | } |
173 | 15.7M | item_stack_.emplace_back(std::move(name_), index_++, json_array_arg, tag); |
174 | 15.7M | structure_stack_.emplace_back(structure_type::array_t, item_stack_.size()-1); |
175 | 15.7M | JSONCONS_VISITOR_RETURN; |
176 | 15.7M | } jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_begin_array(jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) Line | Count | Source | 166 | 12.6M | { | 167 | 12.6M | if (structure_stack_.back().type_ == structure_type::root_t) | 168 | 5.64k | { | 169 | 5.64k | index_ = 0; | 170 | 5.64k | item_stack_.clear(); | 171 | 5.64k | is_valid_ = false; | 172 | 5.64k | } | 173 | 12.6M | item_stack_.emplace_back(std::move(name_), index_++, json_array_arg, tag); | 174 | 12.6M | structure_stack_.emplace_back(structure_type::array_t, item_stack_.size()-1); | 175 | 12.6M | JSONCONS_VISITOR_RETURN; | 176 | 12.6M | } |
Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<wchar_t, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_begin_array(jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<wchar_t, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_begin_array(jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_begin_array(jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) Line | Count | Source | 166 | 3.06M | { | 167 | 3.06M | if (structure_stack_.back().type_ == structure_type::root_t) | 168 | 2.59k | { | 169 | 2.59k | index_ = 0; | 170 | 2.59k | item_stack_.clear(); | 171 | 2.59k | is_valid_ = false; | 172 | 2.59k | } | 173 | 3.06M | item_stack_.emplace_back(std::move(name_), index_++, json_array_arg, tag); | 174 | 3.06M | structure_stack_.emplace_back(structure_type::array_t, item_stack_.size()-1); | 175 | 3.06M | JSONCONS_VISITOR_RETURN; | 176 | 3.06M | } |
|
177 | | |
178 | | JSONCONS_VISITOR_RETURN_TYPE visit_end_array(const ser_context&, std::error_code&) override |
179 | 14.7M | { |
180 | 14.7M | JSONCONS_ASSERT(structure_stack_.size() > 1); |
181 | 14.7M | JSONCONS_ASSERT(structure_stack_.back().type_ == structure_type::array_t); |
182 | 14.7M | const size_t container_index = structure_stack_.back().container_index_; |
183 | 14.7M | JSONCONS_ASSERT(item_stack_.size() > container_index); |
184 | | |
185 | 14.7M | auto& container = item_stack_[container_index].value; |
186 | | |
187 | 14.7M | const size_t size = item_stack_.size() - (container_index + 1); |
188 | | //std::cout << "size on item stack: " << size << "\n"; |
189 | | |
190 | 14.7M | if (size > 0) |
191 | 3.40M | { |
192 | 3.40M | container.reserve(size); |
193 | 3.40M | auto first = item_stack_.begin() + (container_index+1); |
194 | 3.40M | auto last = first + size; |
195 | 93.8M | for (auto it = first; it != last; ++it) |
196 | 90.4M | { |
197 | 90.4M | container.push_back(std::move((*it).value)); |
198 | 90.4M | } |
199 | 3.40M | item_stack_.erase(first, item_stack_.end()); |
200 | 3.40M | } |
201 | | |
202 | 14.7M | structure_stack_.pop_back(); |
203 | 14.7M | if (structure_stack_.back().type_ == structure_type::root_t) |
204 | 3.39k | { |
205 | 3.39k | result_.swap(item_stack_.front().value); |
206 | 3.39k | item_stack_.pop_back(); |
207 | 3.39k | is_valid_ = true; |
208 | 3.39k | JSONCONS_VISITOR_RETURN; |
209 | 3.39k | } |
210 | 14.7M | JSONCONS_VISITOR_RETURN; |
211 | 14.7M | } jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_end_array(jsoncons::ser_context const&, std::__1::error_code&) Line | Count | Source | 179 | 11.7M | { | 180 | 11.7M | JSONCONS_ASSERT(structure_stack_.size() > 1); | 181 | 11.7M | JSONCONS_ASSERT(structure_stack_.back().type_ == structure_type::array_t); | 182 | 11.7M | const size_t container_index = structure_stack_.back().container_index_; | 183 | 11.7M | JSONCONS_ASSERT(item_stack_.size() > container_index); | 184 | | | 185 | 11.7M | auto& container = item_stack_[container_index].value; | 186 | | | 187 | 11.7M | const size_t size = item_stack_.size() - (container_index + 1); | 188 | | //std::cout << "size on item stack: " << size << "\n"; | 189 | | | 190 | 11.7M | if (size > 0) | 191 | 336k | { | 192 | 336k | container.reserve(size); | 193 | 336k | auto first = item_stack_.begin() + (container_index+1); | 194 | 336k | auto last = first + size; | 195 | 59.4M | for (auto it = first; it != last; ++it) | 196 | 59.0M | { | 197 | 59.0M | container.push_back(std::move((*it).value)); | 198 | 59.0M | } | 199 | 336k | item_stack_.erase(first, item_stack_.end()); | 200 | 336k | } | 201 | | | 202 | 11.7M | structure_stack_.pop_back(); | 203 | 11.7M | if (structure_stack_.back().type_ == structure_type::root_t) | 204 | 968 | { | 205 | 968 | result_.swap(item_stack_.front().value); | 206 | 968 | item_stack_.pop_back(); | 207 | 968 | is_valid_ = true; | 208 | 968 | JSONCONS_VISITOR_RETURN; | 209 | 968 | } | 210 | 11.7M | JSONCONS_VISITOR_RETURN; | 211 | 11.7M | } |
Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<wchar_t, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_end_array(jsoncons::ser_context const&, std::__1::error_code&) Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_end_array(jsoncons::ser_context const&, std::__1::error_code&) Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<wchar_t, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_end_array(jsoncons::ser_context const&, std::__1::error_code&) Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_end_array(jsoncons::ser_context const&, std::__1::error_code&) jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_end_array(jsoncons::ser_context const&, std::__1::error_code&) Line | Count | Source | 179 | 3.06M | { | 180 | 3.06M | JSONCONS_ASSERT(structure_stack_.size() > 1); | 181 | 3.06M | JSONCONS_ASSERT(structure_stack_.back().type_ == structure_type::array_t); | 182 | 3.06M | const size_t container_index = structure_stack_.back().container_index_; | 183 | 3.06M | JSONCONS_ASSERT(item_stack_.size() > container_index); | 184 | | | 185 | 3.06M | auto& container = item_stack_[container_index].value; | 186 | | | 187 | 3.06M | const size_t size = item_stack_.size() - (container_index + 1); | 188 | | //std::cout << "size on item stack: " << size << "\n"; | 189 | | | 190 | 3.06M | if (size > 0) | 191 | 3.06M | { | 192 | 3.06M | container.reserve(size); | 193 | 3.06M | auto first = item_stack_.begin() + (container_index+1); | 194 | 3.06M | auto last = first + size; | 195 | 34.3M | for (auto it = first; it != last; ++it) | 196 | 31.3M | { | 197 | 31.3M | container.push_back(std::move((*it).value)); | 198 | 31.3M | } | 199 | 3.06M | item_stack_.erase(first, item_stack_.end()); | 200 | 3.06M | } | 201 | | | 202 | 3.06M | structure_stack_.pop_back(); | 203 | 3.06M | if (structure_stack_.back().type_ == structure_type::root_t) | 204 | 2.42k | { | 205 | 2.42k | result_.swap(item_stack_.front().value); | 206 | 2.42k | item_stack_.pop_back(); | 207 | 2.42k | is_valid_ = true; | 208 | 2.42k | JSONCONS_VISITOR_RETURN; | 209 | 2.42k | } | 210 | 3.06M | JSONCONS_VISITOR_RETURN; | 211 | 3.06M | } |
|
212 | | |
213 | | JSONCONS_VISITOR_RETURN_TYPE visit_key(const string_view_type& name, const ser_context&, std::error_code&) override |
214 | 21.0M | { |
215 | 21.0M | name_ = key_type(name.data(),name.length(),allocator_); |
216 | 21.0M | JSONCONS_VISITOR_RETURN; |
217 | 21.0M | } jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_key(std::__1::basic_string_view<char, std::__1::char_traits<char> > const&, jsoncons::ser_context const&, std::__1::error_code&) Line | Count | Source | 214 | 21.0M | { | 215 | 21.0M | name_ = key_type(name.data(),name.length(),allocator_); | 216 | 21.0M | JSONCONS_VISITOR_RETURN; | 217 | 21.0M | } |
Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<wchar_t, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_key(std::__1::basic_string_view<wchar_t, std::__1::char_traits<wchar_t> > const&, jsoncons::ser_context const&, std::__1::error_code&) Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_key(std::__1::basic_string_view<char, std::__1::char_traits<char> > const&, jsoncons::ser_context const&, std::__1::error_code&) Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<wchar_t, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_key(std::__1::basic_string_view<wchar_t, std::__1::char_traits<wchar_t> > const&, jsoncons::ser_context const&, std::__1::error_code&) Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_key(std::__1::basic_string_view<char, std::__1::char_traits<char> > const&, jsoncons::ser_context const&, std::__1::error_code&) |
218 | | |
219 | | JSONCONS_VISITOR_RETURN_TYPE visit_string(const string_view_type& sv, semantic_tag tag, const ser_context&, std::error_code&) override |
220 | 35.1M | { |
221 | 35.1M | switch (structure_stack_.back().type_) |
222 | 35.1M | { |
223 | 301k | case structure_type::object_t: |
224 | 35.1M | case structure_type::array_t: |
225 | 35.1M | item_stack_.emplace_back(std::move(name_), index_++, sv, tag); |
226 | 35.1M | break; |
227 | 2.86k | case structure_type::root_t: |
228 | 2.86k | result_ = Json(sv, tag, allocator_); |
229 | 2.86k | is_valid_ = true; |
230 | 2.86k | JSONCONS_VISITOR_RETURN; |
231 | 35.1M | } |
232 | 35.1M | JSONCONS_VISITOR_RETURN; |
233 | 35.1M | } jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_string(std::__1::basic_string_view<char, std::__1::char_traits<char> > const&, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) Line | Count | Source | 220 | 6.69M | { | 221 | 6.69M | switch (structure_stack_.back().type_) | 222 | 6.69M | { | 223 | 301k | case structure_type::object_t: | 224 | 6.68M | case structure_type::array_t: | 225 | 6.68M | item_stack_.emplace_back(std::move(name_), index_++, sv, tag); | 226 | 6.68M | break; | 227 | 2.86k | case structure_type::root_t: | 228 | 2.86k | result_ = Json(sv, tag, allocator_); | 229 | 2.86k | is_valid_ = true; | 230 | 2.86k | JSONCONS_VISITOR_RETURN; | 231 | 6.69M | } | 232 | 6.68M | JSONCONS_VISITOR_RETURN; | 233 | 6.69M | } |
Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<wchar_t, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_string(std::__1::basic_string_view<wchar_t, std::__1::char_traits<wchar_t> > const&, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<wchar_t, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_string(std::__1::basic_string_view<wchar_t, std::__1::char_traits<wchar_t> > const&, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_string(std::__1::basic_string_view<char, std::__1::char_traits<char> > const&, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) Line | Count | Source | 220 | 28.4M | { | 221 | 28.4M | switch (structure_stack_.back().type_) | 222 | 28.4M | { | 223 | 0 | case structure_type::object_t: | 224 | 28.4M | case structure_type::array_t: | 225 | 28.4M | item_stack_.emplace_back(std::move(name_), index_++, sv, tag); | 226 | 28.4M | break; | 227 | 0 | case structure_type::root_t: | 228 | 0 | result_ = Json(sv, tag, allocator_); | 229 | 0 | is_valid_ = true; | 230 | 0 | JSONCONS_VISITOR_RETURN; | 231 | 28.4M | } | 232 | 28.4M | JSONCONS_VISITOR_RETURN; | 233 | 28.4M | } |
|
234 | | |
235 | | JSONCONS_VISITOR_RETURN_TYPE visit_byte_string(const byte_string_view& b, |
236 | | semantic_tag tag, |
237 | | const ser_context&, |
238 | | std::error_code&) override |
239 | 3.34M | { |
240 | 3.34M | switch (structure_stack_.back().type_) |
241 | 3.34M | { |
242 | 602k | case structure_type::object_t: |
243 | 3.34M | case structure_type::array_t: |
244 | 3.34M | item_stack_.emplace_back(std::move(name_), index_++, byte_string_arg, b, tag); |
245 | 3.34M | break; |
246 | 44 | case structure_type::root_t: |
247 | 44 | result_ = Json(byte_string_arg, b, tag, allocator_); |
248 | 44 | is_valid_ = true; |
249 | 44 | JSONCONS_VISITOR_RETURN; |
250 | 3.34M | } |
251 | 3.34M | JSONCONS_VISITOR_RETURN; |
252 | 3.34M | } jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_byte_string(jsoncons::byte_string_view const&, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) Line | Count | Source | 239 | 3.34M | { | 240 | 3.34M | switch (structure_stack_.back().type_) | 241 | 3.34M | { | 242 | 602k | case structure_type::object_t: | 243 | 3.34M | case structure_type::array_t: | 244 | 3.34M | item_stack_.emplace_back(std::move(name_), index_++, byte_string_arg, b, tag); | 245 | 3.34M | break; | 246 | 44 | case structure_type::root_t: | 247 | 44 | result_ = Json(byte_string_arg, b, tag, allocator_); | 248 | 44 | is_valid_ = true; | 249 | 44 | JSONCONS_VISITOR_RETURN; | 250 | 3.34M | } | 251 | 3.34M | JSONCONS_VISITOR_RETURN; | 252 | 3.34M | } |
Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<wchar_t, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_byte_string(jsoncons::byte_string_view const&, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_byte_string(jsoncons::byte_string_view const&, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<wchar_t, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_byte_string(jsoncons::byte_string_view const&, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_byte_string(jsoncons::byte_string_view const&, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) |
253 | | |
254 | | JSONCONS_VISITOR_RETURN_TYPE visit_byte_string(const byte_string_view& b, |
255 | | uint64_t ext_tag, |
256 | | const ser_context&, |
257 | | std::error_code&) override |
258 | 203k | { |
259 | 203k | switch (structure_stack_.back().type_) |
260 | 203k | { |
261 | 27.3k | case structure_type::object_t: |
262 | 203k | case structure_type::array_t: |
263 | 203k | item_stack_.emplace_back(std::move(name_), index_++, byte_string_arg, b, ext_tag); |
264 | 203k | break; |
265 | 8 | case structure_type::root_t: |
266 | 8 | result_ = Json(byte_string_arg, b, ext_tag, allocator_); |
267 | 8 | is_valid_ = true; |
268 | 8 | JSONCONS_VISITOR_RETURN; |
269 | 203k | } |
270 | 203k | JSONCONS_VISITOR_RETURN; |
271 | 203k | } jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_byte_string(jsoncons::byte_string_view const&, unsigned long, jsoncons::ser_context const&, std::__1::error_code&) Line | Count | Source | 258 | 203k | { | 259 | 203k | switch (structure_stack_.back().type_) | 260 | 203k | { | 261 | 27.3k | case structure_type::object_t: | 262 | 203k | case structure_type::array_t: | 263 | 203k | item_stack_.emplace_back(std::move(name_), index_++, byte_string_arg, b, ext_tag); | 264 | 203k | break; | 265 | 8 | case structure_type::root_t: | 266 | 8 | result_ = Json(byte_string_arg, b, ext_tag, allocator_); | 267 | 8 | is_valid_ = true; | 268 | 8 | JSONCONS_VISITOR_RETURN; | 269 | 203k | } | 270 | 203k | JSONCONS_VISITOR_RETURN; | 271 | 203k | } |
Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<wchar_t, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_byte_string(jsoncons::byte_string_view const&, unsigned long, jsoncons::ser_context const&, std::__1::error_code&) Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_byte_string(jsoncons::byte_string_view const&, unsigned long, jsoncons::ser_context const&, std::__1::error_code&) Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<wchar_t, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_byte_string(jsoncons::byte_string_view const&, unsigned long, jsoncons::ser_context const&, std::__1::error_code&) Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_byte_string(jsoncons::byte_string_view const&, unsigned long, jsoncons::ser_context const&, std::__1::error_code&) |
272 | | |
273 | | JSONCONS_VISITOR_RETURN_TYPE visit_int64(int64_t value, |
274 | | semantic_tag tag, |
275 | | const ser_context&, |
276 | | std::error_code&) override |
277 | 25.8M | { |
278 | 25.8M | switch (structure_stack_.back().type_) |
279 | 25.8M | { |
280 | 627k | case structure_type::object_t: |
281 | 25.8M | case structure_type::array_t: |
282 | 25.8M | item_stack_.emplace_back(std::move(name_), index_++, value, tag); |
283 | 25.8M | break; |
284 | 288 | case structure_type::root_t: |
285 | 288 | result_ = Json(value,tag); |
286 | 288 | is_valid_ = true; |
287 | 288 | JSONCONS_VISITOR_RETURN; |
288 | 25.8M | } |
289 | 25.8M | JSONCONS_VISITOR_RETURN; |
290 | 25.8M | } jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_int64(long, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) Line | Count | Source | 277 | 25.4M | { | 278 | 25.4M | switch (structure_stack_.back().type_) | 279 | 25.4M | { | 280 | 627k | case structure_type::object_t: | 281 | 25.4M | case structure_type::array_t: | 282 | 25.4M | item_stack_.emplace_back(std::move(name_), index_++, value, tag); | 283 | 25.4M | break; | 284 | 288 | case structure_type::root_t: | 285 | 288 | result_ = Json(value,tag); | 286 | 288 | is_valid_ = true; | 287 | 288 | JSONCONS_VISITOR_RETURN; | 288 | 25.4M | } | 289 | 25.4M | JSONCONS_VISITOR_RETURN; | 290 | 25.4M | } |
Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<wchar_t, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_int64(long, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<wchar_t, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_int64(long, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_int64(long, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) Line | Count | Source | 277 | 394k | { | 278 | 394k | switch (structure_stack_.back().type_) | 279 | 394k | { | 280 | 0 | case structure_type::object_t: | 281 | 394k | case structure_type::array_t: | 282 | 394k | item_stack_.emplace_back(std::move(name_), index_++, value, tag); | 283 | 394k | break; | 284 | 0 | case structure_type::root_t: | 285 | 0 | result_ = Json(value,tag); | 286 | 0 | is_valid_ = true; | 287 | 0 | JSONCONS_VISITOR_RETURN; | 288 | 394k | } | 289 | 394k | JSONCONS_VISITOR_RETURN; | 290 | 394k | } |
|
291 | | |
292 | | JSONCONS_VISITOR_RETURN_TYPE visit_uint64(uint64_t value, |
293 | | semantic_tag tag, |
294 | | const ser_context&, |
295 | | std::error_code&) override |
296 | 46.6M | { |
297 | 46.6M | switch (structure_stack_.back().type_) |
298 | 46.6M | { |
299 | 6.61M | case structure_type::object_t: |
300 | 46.6M | case structure_type::array_t: |
301 | 46.6M | item_stack_.emplace_back(std::move(name_), index_++, value, tag); |
302 | 46.6M | break; |
303 | 286 | case structure_type::root_t: |
304 | 286 | result_ = Json(value,tag); |
305 | 286 | is_valid_ = true; |
306 | 286 | JSONCONS_VISITOR_RETURN; |
307 | 46.6M | } |
308 | 46.6M | JSONCONS_VISITOR_RETURN; |
309 | 46.6M | } jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_uint64(unsigned long, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) Line | Count | Source | 296 | 46.2M | { | 297 | 46.2M | switch (structure_stack_.back().type_) | 298 | 46.2M | { | 299 | 6.61M | case structure_type::object_t: | 300 | 46.2M | case structure_type::array_t: | 301 | 46.2M | item_stack_.emplace_back(std::move(name_), index_++, value, tag); | 302 | 46.2M | break; | 303 | 286 | case structure_type::root_t: | 304 | 286 | result_ = Json(value,tag); | 305 | 286 | is_valid_ = true; | 306 | 286 | JSONCONS_VISITOR_RETURN; | 307 | 46.2M | } | 308 | 46.2M | JSONCONS_VISITOR_RETURN; | 309 | 46.2M | } |
Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<wchar_t, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_uint64(unsigned long, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<wchar_t, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_uint64(unsigned long, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_uint64(unsigned long, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) Line | Count | Source | 296 | 330k | { | 297 | 330k | switch (structure_stack_.back().type_) | 298 | 330k | { | 299 | 0 | case structure_type::object_t: | 300 | 330k | case structure_type::array_t: | 301 | 330k | item_stack_.emplace_back(std::move(name_), index_++, value, tag); | 302 | 330k | break; | 303 | 0 | case structure_type::root_t: | 304 | 0 | result_ = Json(value,tag); | 305 | 0 | is_valid_ = true; | 306 | 0 | JSONCONS_VISITOR_RETURN; | 307 | 330k | } | 308 | 330k | JSONCONS_VISITOR_RETURN; | 309 | 330k | } |
|
310 | | |
311 | | JSONCONS_VISITOR_RETURN_TYPE visit_half(uint16_t value, |
312 | | semantic_tag tag, |
313 | | const ser_context&, |
314 | | std::error_code&) override |
315 | 20.7M | { |
316 | 20.7M | switch (structure_stack_.back().type_) |
317 | 20.7M | { |
318 | 1.09k | case structure_type::object_t: |
319 | 20.7M | case structure_type::array_t: |
320 | 20.7M | item_stack_.emplace_back(std::move(name_), index_++, half_arg, value, tag); |
321 | 20.7M | break; |
322 | 2 | case structure_type::root_t: |
323 | 2 | result_ = Json(half_arg, value, tag); |
324 | 2 | is_valid_ = true; |
325 | 2 | JSONCONS_VISITOR_RETURN; |
326 | 20.7M | } |
327 | 20.7M | JSONCONS_VISITOR_RETURN; |
328 | 20.7M | } jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_half(unsigned short, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) Line | Count | Source | 315 | 20.7M | { | 316 | 20.7M | switch (structure_stack_.back().type_) | 317 | 20.7M | { | 318 | 1.09k | case structure_type::object_t: | 319 | 20.7M | case structure_type::array_t: | 320 | 20.7M | item_stack_.emplace_back(std::move(name_), index_++, half_arg, value, tag); | 321 | 20.7M | break; | 322 | 2 | case structure_type::root_t: | 323 | 2 | result_ = Json(half_arg, value, tag); | 324 | 2 | is_valid_ = true; | 325 | 2 | JSONCONS_VISITOR_RETURN; | 326 | 20.7M | } | 327 | 20.7M | JSONCONS_VISITOR_RETURN; | 328 | 20.7M | } |
Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<wchar_t, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_half(unsigned short, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_half(unsigned short, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<wchar_t, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_half(unsigned short, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_half(unsigned short, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) |
329 | | |
330 | | JSONCONS_VISITOR_RETURN_TYPE visit_double(double value, |
331 | | semantic_tag tag, |
332 | | const ser_context&, |
333 | | std::error_code&) override |
334 | 748k | { |
335 | 748k | switch (structure_stack_.back().type_) |
336 | 748k | { |
337 | 19.0k | case structure_type::object_t: |
338 | 748k | case structure_type::array_t: |
339 | 748k | item_stack_.emplace_back(std::move(name_), index_++, value, tag); |
340 | 748k | break; |
341 | 121 | case structure_type::root_t: |
342 | 121 | result_ = Json(value, tag); |
343 | 121 | is_valid_ = true; |
344 | 121 | JSONCONS_VISITOR_RETURN; |
345 | 748k | } |
346 | 748k | JSONCONS_VISITOR_RETURN; |
347 | 748k | } jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_double(double, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) Line | Count | Source | 334 | 689k | { | 335 | 689k | switch (structure_stack_.back().type_) | 336 | 689k | { | 337 | 19.0k | case structure_type::object_t: | 338 | 689k | case structure_type::array_t: | 339 | 689k | item_stack_.emplace_back(std::move(name_), index_++, value, tag); | 340 | 689k | break; | 341 | 121 | case structure_type::root_t: | 342 | 121 | result_ = Json(value, tag); | 343 | 121 | is_valid_ = true; | 344 | 121 | JSONCONS_VISITOR_RETURN; | 345 | 689k | } | 346 | 689k | JSONCONS_VISITOR_RETURN; | 347 | 689k | } |
Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<wchar_t, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_double(double, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<wchar_t, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_double(double, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_double(double, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) Line | Count | Source | 334 | 59.1k | { | 335 | 59.1k | switch (structure_stack_.back().type_) | 336 | 59.1k | { | 337 | 0 | case structure_type::object_t: | 338 | 59.1k | case structure_type::array_t: | 339 | 59.1k | item_stack_.emplace_back(std::move(name_), index_++, value, tag); | 340 | 59.1k | break; | 341 | 0 | case structure_type::root_t: | 342 | 0 | result_ = Json(value, tag); | 343 | 0 | is_valid_ = true; | 344 | 0 | JSONCONS_VISITOR_RETURN; | 345 | 59.1k | } | 346 | 59.1k | JSONCONS_VISITOR_RETURN; | 347 | 59.1k | } |
|
348 | | |
349 | | JSONCONS_VISITOR_RETURN_TYPE visit_bool(bool value, semantic_tag tag, const ser_context&, std::error_code&) override |
350 | 9.60M | { |
351 | 9.60M | switch (structure_stack_.back().type_) |
352 | 9.60M | { |
353 | 184k | case structure_type::object_t: |
354 | 9.60M | case structure_type::array_t: |
355 | 9.60M | item_stack_.emplace_back(std::move(name_), index_++, value, tag); |
356 | 9.60M | break; |
357 | 13 | case structure_type::root_t: |
358 | 13 | result_ = Json(value, tag); |
359 | 13 | is_valid_ = true; |
360 | 13 | JSONCONS_VISITOR_RETURN; |
361 | 9.60M | } |
362 | 9.60M | JSONCONS_VISITOR_RETURN; |
363 | 9.60M | } jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_bool(bool, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) Line | Count | Source | 350 | 9.48M | { | 351 | 9.48M | switch (structure_stack_.back().type_) | 352 | 9.48M | { | 353 | 184k | case structure_type::object_t: | 354 | 9.48M | case structure_type::array_t: | 355 | 9.48M | item_stack_.emplace_back(std::move(name_), index_++, value, tag); | 356 | 9.48M | break; | 357 | 13 | case structure_type::root_t: | 358 | 13 | result_ = Json(value, tag); | 359 | 13 | is_valid_ = true; | 360 | 13 | JSONCONS_VISITOR_RETURN; | 361 | 9.48M | } | 362 | 9.48M | JSONCONS_VISITOR_RETURN; | 363 | 9.48M | } |
Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<wchar_t, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_bool(bool, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<wchar_t, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_bool(bool, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_bool(bool, jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) Line | Count | Source | 350 | 122k | { | 351 | 122k | switch (structure_stack_.back().type_) | 352 | 122k | { | 353 | 0 | case structure_type::object_t: | 354 | 122k | case structure_type::array_t: | 355 | 122k | item_stack_.emplace_back(std::move(name_), index_++, value, tag); | 356 | 122k | break; | 357 | 0 | case structure_type::root_t: | 358 | 0 | result_ = Json(value, tag); | 359 | 0 | is_valid_ = true; | 360 | 0 | JSONCONS_VISITOR_RETURN; | 361 | 122k | } | 362 | 122k | JSONCONS_VISITOR_RETURN; | 363 | 122k | } |
|
364 | | |
365 | | JSONCONS_VISITOR_RETURN_TYPE visit_null(semantic_tag tag, const ser_context&, std::error_code&) override |
366 | 37.3M | { |
367 | 37.3M | switch (structure_stack_.back().type_) |
368 | 37.3M | { |
369 | 11.1M | case structure_type::object_t: |
370 | 37.3M | case structure_type::array_t: |
371 | 37.3M | item_stack_.emplace_back(std::move(name_), index_++, null_type(), tag); |
372 | 37.3M | break; |
373 | 11 | case structure_type::root_t: |
374 | 11 | result_ = Json(null_type(), tag); |
375 | 11 | is_valid_ = true; |
376 | 11 | JSONCONS_VISITOR_RETURN; |
377 | 37.3M | } |
378 | 37.3M | JSONCONS_VISITOR_RETURN; |
379 | 37.3M | } jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_null(jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) Line | Count | Source | 366 | 37.2M | { | 367 | 37.2M | switch (structure_stack_.back().type_) | 368 | 37.2M | { | 369 | 11.1M | case structure_type::object_t: | 370 | 37.2M | case structure_type::array_t: | 371 | 37.2M | item_stack_.emplace_back(std::move(name_), index_++, null_type(), tag); | 372 | 37.2M | break; | 373 | 11 | case structure_type::root_t: | 374 | 11 | result_ = Json(null_type(), tag); | 375 | 11 | is_valid_ = true; | 376 | 11 | JSONCONS_VISITOR_RETURN; | 377 | 37.2M | } | 378 | 37.2M | JSONCONS_VISITOR_RETURN; | 379 | 37.2M | } |
Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<wchar_t, jsoncons::sorted_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_null(jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) Unexecuted instantiation: jsoncons::json_decoder<jsoncons::basic_json<wchar_t, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_null(jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) jsoncons::json_decoder<jsoncons::basic_json<char, jsoncons::order_preserving_policy, std::__1::allocator<char> >, std::__1::allocator<char> >::visit_null(jsoncons::semantic_tag, jsoncons::ser_context const&, std::__1::error_code&) Line | Count | Source | 366 | 65.3k | { | 367 | 65.3k | switch (structure_stack_.back().type_) | 368 | 65.3k | { | 369 | 0 | case structure_type::object_t: | 370 | 65.3k | case structure_type::array_t: | 371 | 65.3k | item_stack_.emplace_back(std::move(name_), index_++, null_type(), tag); | 372 | 65.3k | break; | 373 | 0 | case structure_type::root_t: | 374 | 0 | result_ = Json(null_type(), tag); | 375 | 0 | is_valid_ = true; | 376 | 0 | JSONCONS_VISITOR_RETURN; | 377 | 65.3k | } | 378 | 65.3k | JSONCONS_VISITOR_RETURN; | 379 | 65.3k | } |
|
380 | | }; |
381 | | |
382 | | } // namespace jsoncons |
383 | | |
384 | | #endif // JSONCONS_JSON_DECODER_HPP |