Line data Source code
1 : //
2 : // Copyright (c) 2021 Vinnie Falco (vinnie.falco@gmail.com)
3 : // Copyright (c) 2024 Christian Mazakas
4 : // Copyright (c) 2025 Mohammad Nejati
5 : //
6 : // Distributed under the Boost Software License, Version 1.0. (See accompanying
7 : // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 : //
9 : // Official repository: https://github.com/cppalliance/http_proto
10 : //
11 :
12 : #include <boost/http_proto/response.hpp>
13 : #include <boost/http_proto/version.hpp>
14 :
15 : #include <utility>
16 :
17 : namespace boost {
18 : namespace http_proto {
19 :
20 98 : response::
21 98 : response() noexcept
22 : : fields_view_base(
23 98 : &this->fields_base::h_)
24 98 : , response_base()
25 : {
26 98 : }
27 :
28 100 : response::
29 : response(
30 100 : core::string_view s)
31 : : fields_view_base(
32 100 : &this->fields_base::h_)
33 100 : , response_base(s)
34 : {
35 99 : }
36 :
37 10 : response::
38 : response(
39 : std::size_t cap,
40 10 : std::size_t max_cap)
41 10 : : response()
42 : {
43 10 : reserve_bytes(cap);
44 10 : set_max_capacity_in_bytes(max_cap);
45 10 : }
46 :
47 3 : response::
48 : response(
49 3 : response&& other) noexcept
50 3 : : response()
51 : {
52 3 : swap(other);
53 3 : }
54 :
55 2 : response::
56 : response(
57 2 : response const& other)
58 : : fields_view_base(
59 2 : &this->fields_base::h_)
60 2 : , response_base(*other.ph_)
61 : {
62 2 : }
63 :
64 2 : response::
65 : response(
66 2 : response_view const& other)
67 : : fields_view_base(
68 2 : &this->fields_base::h_)
69 2 : , response_base(*other.ph_)
70 : {
71 2 : }
72 :
73 : response&
74 1 : response::
75 : operator=(
76 : response&& other) noexcept
77 : {
78 : response temp(
79 1 : std::move(other));
80 1 : temp.swap(*this);
81 2 : return *this;
82 1 : }
83 :
84 3 : response::
85 : response(
86 3 : http_proto::status sc)
87 : : response(
88 3 : sc, http_proto::version::http_1_1)
89 : {
90 3 : }
91 :
92 11 : response::
93 : response(
94 : http_proto::status sc,
95 11 : http_proto::version v)
96 11 : : response()
97 : {
98 11 : set_start_line(sc, v);
99 11 : }
100 :
101 : } // http_proto
102 : } // boost
|