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