detail/impl/handler.ipp

100.0% Lines (53/53) 100.0% List of functions (20/20)
f(x) Functions (20)
Function Calls Lines Branches Blocks
boost::json::detail::handler::handler<boost::json::storage_ptr, decltype(nullptr), int>(boost::json::storage_ptr&&, decltype(nullptr)&&, int&&) :21 75359x 100.0% 100.0% boost::json::detail::handler::handler<boost::json::storage_ptr, unsigned char*&, unsigned long&>(boost::json::storage_ptr&&, unsigned char*&, unsigned long&) :21 2001530x 100.0% 100.0% boost::json::detail::handler::on_document_begin(boost::system::error_code&) :28 2076874x 100.0% 100.0% boost::json::detail::handler::on_document_end(boost::system::error_code&) :36 2076683x 100.0% 100.0% boost::json::detail::handler::on_object_begin(boost::system::error_code&) :44 34953x 100.0% 100.0% boost::json::detail::handler::on_object_end(unsigned long, boost::system::error_code&) :52 34877x 100.0% 100.0% boost::json::detail::handler::on_array_begin(boost::system::error_code&) :62 2136x 100.0% 100.0% boost::json::detail::handler::on_array_end(unsigned long, boost::system::error_code&) :70 2119x 100.0% 100.0% boost::json::detail::handler::on_key_part(boost::core::basic_string_view<char>, unsigned long, boost::system::error_code&) :80 8065x 100.0% 100.0% boost::json::detail::handler::on_key(boost::core::basic_string_view<char>, unsigned long, boost::system::error_code&) :91 38352x 100.0% 100.0% boost::json::detail::handler::on_string_part(boost::core::basic_string_view<char>, unsigned long, boost::system::error_code&) :102 9080x 100.0% 100.0% boost::json::detail::handler::on_string(boost::core::basic_string_view<char>, unsigned long, boost::system::error_code&) :113 26107x 100.0% 100.0% boost::json::detail::handler::on_number_part(boost::core::basic_string_view<char>, boost::system::error_code&) :124 30915x 100.0% 100.0% boost::json::detail::handler::on_int64(long, boost::core::basic_string_view<char>, boost::system::error_code&) :133 5811x 100.0% 100.0% boost::json::detail::handler::on_uint64(unsigned long, boost::core::basic_string_view<char>, boost::system::error_code&) :144 70x 100.0% 100.0% boost::json::detail::handler::on_double(double, boost::core::basic_string_view<char>, boost::system::error_code&) :155 2039817x 100.0% 100.0% boost::json::detail::handler::on_bool(bool, boost::system::error_code&) :166 399x 100.0% 100.0% boost::json::detail::handler::on_null(boost::system::error_code&) :176 9367x 100.0% 100.0% boost::json::detail::handler::on_comment_part(boost::core::basic_string_view<char>, boost::system::error_code&) :184 188x 100.0% 100.0% boost::json::detail::handler::on_comment(boost::core::basic_string_view<char>, boost::system::error_code&) :193 499x 100.0% 100.0%
Line TLA Hits Source Code
1 //
2 // Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
3 //
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 //
7 // Official repository: https://github.com/boostorg/json
8 //
9
10 #ifndef BOOST_JSON_DETAIL_IMPL_HANDLER_HPP
11 #define BOOST_JSON_DETAIL_IMPL_HANDLER_HPP
12
13 #include <boost/json/detail/handler.hpp>
14 #include <utility>
15
16 namespace boost {
17 namespace json {
18 namespace detail {
19
20 template<class... Args>
21 2076889x handler::
22 handler(Args&&... args)
23 2076889x : st(std::forward<Args>(args)...)
24 {
25 2076889x }
26
27 bool
28 2076874x handler::
29 on_document_begin(
30 system::error_code&)
31 {
32 2076874x return true;
33 }
34
35 bool
36 2076683x handler::
37 on_document_end(
38 system::error_code&)
39 {
40 2076683x return true;
41 }
42
43 bool
44 34953x handler::
45 on_object_begin(
46 system::error_code&)
47 {
48 34953x return true;
49 }
50
51 bool
52 34877x handler::
53 on_object_end(
54 std::size_t n,
55 system::error_code&)
56 {
57 34877x st.push_object(n);
58 34838x return true;
59 }
60
61 bool
62 2136x handler::
63 on_array_begin(
64 system::error_code&)
65 {
66 2136x return true;
67 }
68
69 bool
70 2119x handler::
71 on_array_end(
72 std::size_t n,
73 system::error_code&)
74 {
75 2119x st.push_array(n);
76 2081x return true;
77 }
78
79 bool
80 8065x handler::
81 on_key_part(
82 string_view s,
83 std::size_t,
84 system::error_code&)
85 {
86 8065x st.push_chars(s);
87 8065x return true;
88 }
89
90 bool
91 38352x handler::
92 on_key(
93 string_view s,
94 std::size_t,
95 system::error_code&)
96 {
97 38352x st.push_key(s);
98 38292x return true;
99 }
100
101 bool
102 9080x handler::
103 on_string_part(
104 string_view s,
105 std::size_t,
106 system::error_code&)
107 {
108 9080x st.push_chars(s);
109 9080x return true;
110 }
111
112 bool
113 26107x handler::
114 on_string(
115 string_view s,
116 std::size_t,
117 system::error_code&)
118 {
119 26107x st.push_string(s);
120 26103x return true;
121 }
122
123 bool
124 30915x handler::
125 on_number_part(
126 string_view,
127 system::error_code&)
128 {
129 30915x return true;
130 }
131
132 bool
133 5811x handler::
134 on_int64(
135 std::int64_t i,
136 string_view,
137 system::error_code&)
138 {
139 5811x st.push_int64(i);
140 5811x return true;
141 }
142
143 bool
144 70x handler::
145 on_uint64(
146 std::uint64_t u,
147 string_view,
148 system::error_code&)
149 {
150 70x st.push_uint64(u);
151 70x return true;
152 }
153
154 bool
155 2039817x handler::
156 on_double(
157 double d,
158 string_view,
159 system::error_code&)
160 {
161 2039817x st.push_double(d);
162 2039817x return true;
163 }
164
165 bool
166 399x handler::
167 on_bool(
168 bool b,
169 system::error_code&)
170 {
171 399x st.push_bool(b);
172 399x return true;
173 }
174
175 bool
176 9367x handler::
177 on_null(system::error_code&)
178 {
179 9367x st.push_null();
180 9367x return true;
181 }
182
183 bool
184 188x handler::
185 on_comment_part(
186 string_view,
187 system::error_code&)
188 {
189 188x return true;
190 }
191
192 bool
193 499x handler::
194 on_comment(
195 string_view, system::error_code&)
196 {
197 499x return true;
198 }
199
200 } // detail
201 } // namespace json
202 } // namespace boost
203
204 #endif
205