| Line | Branch | Exec | Source |
|---|---|---|---|
| 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 | 212 | response:: | |
| 21 | 212 | response() noexcept | |
| 22 | : fields_view_base( | ||
| 23 | 212 | &this->fields_base::h_) | |
| 24 | 212 | , response_base() | |
| 25 | { | ||
| 26 | 212 | } | |
| 27 | |||
| 28 | 194 | response:: | |
| 29 | response( | ||
| 30 | 194 | core::string_view s) | |
| 31 | : fields_view_base( | ||
| 32 | 194 | &this->fields_base::h_) | |
| 33 | 194 | , response_base(s) | |
| 34 | { | ||
| 35 | 192 | } | |
| 36 | |||
| 37 | 8 | response:: | |
| 38 | response( | ||
| 39 | 8 | std::size_t storage_size) | |
| 40 | : fields_view_base( | ||
| 41 | 8 | &this->fields_base::h_) | |
| 42 | 8 | , response_base(storage_size) | |
| 43 | { | ||
| 44 | 8 | } | |
| 45 | |||
| 46 | 20 | response:: | |
| 47 | response( | ||
| 48 | std::size_t storage_size, | ||
| 49 | 20 | std::size_t max_storage_size) | |
| 50 | : fields_view_base( | ||
| 51 | 20 | &this->fields_base::h_) | |
| 52 | , response_base( | ||
| 53 | 20 | storage_size, max_storage_size) | |
| 54 | { | ||
| 55 | 12 | } | |
| 56 | |||
| 57 | 6 | response:: | |
| 58 | response( | ||
| 59 | 6 | response&& other) noexcept | |
| 60 | 6 | : response() | |
| 61 | { | ||
| 62 | 6 | swap(other); | |
| 63 | 6 | } | |
| 64 | |||
| 65 | 4 | response:: | |
| 66 | response( | ||
| 67 | 4 | response const& other) | |
| 68 | : fields_view_base( | ||
| 69 | 4 | &this->fields_base::h_) | |
| 70 | 4 | , response_base(*other.ph_) | |
| 71 | { | ||
| 72 | 4 | } | |
| 73 | |||
| 74 | 4 | response:: | |
| 75 | response( | ||
| 76 | 4 | response_view const& other) | |
| 77 | : fields_view_base( | ||
| 78 | 4 | &this->fields_base::h_) | |
| 79 | 4 | , response_base(*other.ph_) | |
| 80 | { | ||
| 81 | 4 | } | |
| 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 | 12 | response:: | |
| 95 | response( | ||
| 96 | 12 | http_proto::status sc) | |
| 97 | : response( | ||
| 98 | 12 | sc, http_proto::version::http_1_1) | |
| 99 | { | ||
| 100 | 12 | } | |
| 101 | |||
| 102 | 28 | response:: | |
| 103 | response( | ||
| 104 | http_proto::status sc, | ||
| 105 | 28 | http_proto::version v) | |
| 106 | 28 | : response() | |
| 107 | { | ||
| 108 |
2/2✓ Branch 0 taken 4 times.
✓ Branch 1 taken 10 times.
|
28 | if( sc != h_.res.status || |
| 109 |
2/2✓ Branch 0 taken 1 times.
✓ Branch 1 taken 3 times.
|
8 | v != h_.version) |
| 110 |
1/2✓ Branch 1 taken 11 times.
✗ Branch 2 not taken.
|
22 | set_start_line(sc, v); |
| 111 | 28 | } | |
| 112 | |||
| 113 | } // http_proto | ||
| 114 | } // boost | ||
| 115 |