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