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 82 : response::
21 82 : response() noexcept
22 : : fields_view_base(
23 82 : &this->fields_base::h_)
24 82 : , response_base()
25 : {
26 82 : }
27 :
28 97 : response::
29 : response(
30 97 : core::string_view s)
31 : : fields_view_base(
32 97 : &this->fields_base::h_)
33 97 : , response_base(s)
34 : {
35 96 : }
36 :
37 4 : response::
38 : response(
39 4 : std::size_t storage_size)
40 : : fields_view_base(
41 4 : &this->fields_base::h_)
42 4 : , response_base(storage_size)
43 : {
44 4 : }
45 :
46 10 : response::
47 : response(
48 : std::size_t storage_size,
49 10 : std::size_t max_storage_size)
50 : : fields_view_base(
51 10 : &this->fields_base::h_)
52 : , response_base(
53 10 : storage_size, max_storage_size)
54 : {
55 6 : }
56 :
57 3 : response::
58 : response(
59 3 : response&& other) noexcept
60 3 : : response()
61 : {
62 3 : swap(other);
63 3 : }
64 :
65 2 : response::
66 : response(
67 2 : response const& other)
68 : : fields_view_base(
69 2 : &this->fields_base::h_)
70 2 : , response_base(*other.ph_)
71 : {
72 2 : }
73 :
74 2 : response::
75 : response(
76 2 : response_view const& other)
77 : : fields_view_base(
78 2 : &this->fields_base::h_)
79 2 : , response_base(*other.ph_)
80 : {
81 2 : }
82 :
83 : response&
84 1 : response::
85 : operator=(
86 : response&& other) noexcept
87 : {
88 : response temp(
89 1 : std::move(other));
90 1 : temp.swap(*this);
91 2 : return *this;
92 1 : }
93 :
94 6 : response::
95 : response(
96 6 : http_proto::status sc)
97 : : response(
98 6 : sc, http_proto::version::http_1_1)
99 : {
100 6 : }
101 :
102 14 : response::
103 : response(
104 : http_proto::status sc,
105 14 : http_proto::version v)
106 14 : : response()
107 : {
108 14 : if( sc != h_.res.status ||
109 4 : v != h_.version)
110 11 : set_start_line(sc, v);
111 14 : }
112 :
113 : } // http_proto
114 : } // boost
|