]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/json/detail/impl/handler.ipp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / boost / json / detail / impl / handler.ipp
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 BOOST_JSON_NS_BEGIN
17 namespace detail {
18
19 template<class... Args>
20 handler::
21 handler(Args&&... args)
22 : st(std::forward<Args>(args)...)
23 {
24 }
25
26 bool
27 handler::
28 on_document_begin(
29 error_code&)
30 {
31 return true;
32 }
33
34 bool
35 handler::
36 on_document_end(
37 error_code&)
38 {
39 return true;
40 }
41
42 bool
43 handler::
44 on_object_begin(
45 error_code&)
46 {
47 return true;
48 }
49
50 bool
51 handler::
52 on_object_end(
53 std::size_t n,
54 error_code&)
55 {
56 st.push_object(n);
57 return true;
58 }
59
60 bool
61 handler::
62 on_array_begin(
63 error_code&)
64 {
65 return true;
66 }
67
68 bool
69 handler::
70 on_array_end(
71 std::size_t n,
72 error_code&)
73 {
74 st.push_array(n);
75 return true;
76 }
77
78 bool
79 handler::
80 on_key_part(
81 string_view s,
82 std::size_t,
83 error_code&)
84 {
85 st.push_chars(s);
86 return true;
87 }
88
89 bool
90 handler::
91 on_key(
92 string_view s,
93 std::size_t,
94 error_code&)
95 {
96 st.push_key(s);
97 return true;
98 }
99
100 bool
101 handler::
102 on_string_part(
103 string_view s,
104 std::size_t,
105 error_code&)
106 {
107 st.push_chars(s);
108 return true;
109 }
110
111 bool
112 handler::
113 on_string(
114 string_view s,
115 std::size_t,
116 error_code&)
117 {
118 st.push_string(s);
119 return true;
120 }
121
122 bool
123 handler::
124 on_number_part(
125 string_view,
126 error_code&)
127 {
128 return true;
129 }
130
131 bool
132 handler::
133 on_int64(
134 std::int64_t i,
135 string_view,
136 error_code&)
137 {
138 st.push_int64(i);
139 return true;
140 }
141
142 bool
143 handler::
144 on_uint64(
145 std::uint64_t u,
146 string_view,
147 error_code&)
148 {
149 st.push_uint64(u);
150 return true;
151 }
152
153 bool
154 handler::
155 on_double(
156 double d,
157 string_view,
158 error_code&)
159 {
160 st.push_double(d);
161 return true;
162 }
163
164 bool
165 handler::
166 on_bool(
167 bool b,
168 error_code&)
169 {
170 st.push_bool(b);
171 return true;
172 }
173
174 bool
175 handler::
176 on_null(error_code&)
177 {
178 st.push_null();
179 return true;
180 }
181
182 bool
183 handler::
184 on_comment_part(
185 string_view,
186 error_code&)
187 {
188 return true;
189 }
190
191 bool
192 handler::
193 on_comment(
194 string_view, error_code&)
195 {
196 return true;
197 }
198
199 } // detail
200 BOOST_JSON_NS_END
201
202 #endif