Coverage Report

Created: 2023-03-26 06:57

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