GCC Code Coverage Report


Directory: libs/http_proto/
File: libs/http_proto/src/fields.cpp
Date: 2024-03-22 19:51:41
Exec Total Coverage
Lines: 40 40 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 size)
43 8 : fields_view_base(&this->fields_base::h_)
44 , fields_base(
45 8 detail::kind::fields, size)
46 {
47 8 }
48
49 16 fields::
50 fields(
51 std::size_t size,
52 16 std::size_t max_size)
53 16 : fields_view_base(&this->fields_base::h_)
54 , fields_base(
55 16 detail::kind::fields, size, max_size)
56 {
57 12 }
58
59 12 fields::
60 fields(
61 12 fields&& other) noexcept
62 : fields_view_base(
63 12 &this->fields_base::h_)
64 12 , fields_base(other.h_.kind)
65 {
66 12 swap(other);
67 12 }
68
69 4 fields::
70 fields(
71 4 fields const& other)
72 : fields_view_base(
73 4 &this->fields_base::h_)
74 4 , fields_base(*other.ph_)
75 {
76 4 }
77
78 4 fields::
79 fields(
80 4 fields_view const& other)
81 : fields_view_base(
82 4 &this->fields_base::h_)
83 4 , fields_base(*other.ph_)
84 {
85 4 }
86
87 fields&
88 4 fields::
89 operator=(
90 fields&& other) noexcept
91 {
92 4 fields tmp(std::move(other));
93 4 tmp.swap(*this);
94 4 return *this;
95 }
96
97 } // http_proto
98 } // boost
99