include/boost/burl/detail/response_parser.hpp

100.0% Lines (11/11) 100.0% List of functions (6/6) 100.0% Branches (1/1)
response_parser.hpp
f(x) Functions (6)
Line Branch TLA Hits Source Code
1 //
2 // Copyright (c) 2026 Mohammad Nejati
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/cppalliance/burl
8 //
9
10 #ifndef BOOST_BURL_DETAIL_RESPONSE_PARSER_HPP
11 #define BOOST_BURL_DETAIL_RESPONSE_PARSER_HPP
12
13 #include <boost/burl/detail/parser.hpp>
14
15 #include <boost/http/static_response.hpp>
16
17 #include <utility>
18
19 namespace boost
20 {
21 namespace burl
22 {
23 namespace detail
24 {
25
26 class response_parser
27 : public parser
28 {
29 public:
30 3x response_parser() = default;
31
32 explicit
33 124x response_parser(
34 config const& cfg,
35 capy::any_read_stream stream = {})
36
1/1
✓ Branch 3 taken 124 times.
124x : parser(cfg, http::detail::kind::response, std::move(stream))
37 {
38 124x }
39
40 334x response_parser(response_parser&&) noexcept = default;
41
42 response_parser&
43 2x operator=(response_parser&&) noexcept = default;
44
45 void
46 136x start(bool head = false)
47 {
48 136x parser::start(head);
49 136x }
50
51 http::static_response const&
52 293x get() const
53 {
54 293x return get_response();
55 }
56 };
57
58 } // namespace detail
59 } // namespace burl
60 } // namespace boost
61
62 #endif
63