LCOV - code coverage report
Current view: top level - libs/http_proto/src - fields.cpp (source / functions) Hit Total Coverage
Test: coverage_filtered.info Lines: 40 40 100.0 %
Date: 2024-04-23 10:22:13 Functions: 8 15 53.3 %

          Line data    Source code
       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          23 : fields::
      22          23 : fields() noexcept
      23             :     : fields_view_base(
      24          23 :         &this->fields_base::h_)
      25             :     , fields_base(
      26          23 :         detail::kind::fields)
      27             : {
      28          23 : }
      29             : 
      30         241 : fields::
      31             : fields(
      32         241 :     core::string_view s)
      33             :     : fields_view_base(
      34         241 :         &this->fields_base::h_)
      35             :     , fields_base(
      36         241 :         detail::kind::fields, s)
      37             : {
      38         240 : }
      39             : 
      40           4 : fields::
      41             : fields(
      42           4 :     std::size_t storage_size)
      43           4 :     : fields_view_base(&this->fields_base::h_)
      44             :     , fields_base(
      45           4 :         detail::kind::fields, storage_size)
      46             : {
      47           4 : }
      48             : 
      49          10 : fields::
      50             : fields(
      51             :     std::size_t storage_size,
      52          10 :     std::size_t max_storage_size)
      53          10 :     : fields_view_base(&this->fields_base::h_)
      54             :     , fields_base(
      55             :         detail::kind::fields,
      56          10 :         storage_size, max_storage_size)
      57             : {
      58           6 : }
      59             : 
      60           6 : fields::
      61             : fields(
      62           6 :     fields&& other) noexcept
      63             :     : fields_view_base(
      64           6 :         &this->fields_base::h_)
      65           6 :     , fields_base(other.h_.kind)
      66             : {
      67           6 :     swap(other);
      68           6 : }
      69             : 
      70           2 : fields::
      71             : fields(
      72           2 :     fields const& other)
      73             :     : fields_view_base(
      74           2 :         &this->fields_base::h_)
      75           2 :     , fields_base(*other.ph_)
      76             : {
      77           2 : }
      78             : 
      79           2 : fields::
      80             : fields(
      81           2 :     fields_view const& other)
      82             :     : fields_view_base(
      83           2 :         &this->fields_base::h_)
      84           2 :     , fields_base(*other.ph_)
      85             : {
      86           2 : }
      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           4 :     return *this;
      96             : }
      97             : 
      98             : } // http_proto
      99             : } // boost

Generated by: LCOV version 1.15