GCC Code Coverage Report


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