GCC Code Coverage Report


Directory: libs/http_proto/
File: libs/http_proto/src/fields.cpp
Date: 2024-06-18 18:03:14
Exec Total Coverage
Lines: 41 41 100.0%
Functions: 8 8 100.0%
Branches: 0 0 -%

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