LCOV - code coverage report
Current view: top level - libs/http_proto/src/file_sink.cpp (source / functions) Coverage Total Hit
Test: coverage_filtered.info Lines: 91.7 % 12 11
Test Date: 2025-09-21 18:08:14 Functions: 75.0 % 4 3

            Line data    Source code
       1              : //
       2              : // Copyright (c) 2022 Vinnie Falco (vinnie.falco@gmail.com)
       3              : // Copyright (c) 2025 Mohammad Nejati
       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/file_sink.hpp>
      12              : 
      13              : namespace boost {
      14              : namespace http_proto {
      15              : 
      16            2 : file_sink::
      17            2 : file_sink(file&& f) noexcept
      18            2 :     : f_(std::move(f))
      19              : {
      20            2 : }
      21              : 
      22            0 : file_sink::
      23              : file_sink(file_sink&&) noexcept = default;
      24              : 
      25            2 : file_sink::
      26              : ~file_sink() = default;
      27              : 
      28              : auto
      29            5 : file_sink::
      30              : on_write(
      31              :     buffers::const_buffer b,
      32              :     bool more) -> results
      33              : {
      34            5 :     results rv;
      35            5 :     rv.bytes = f_.write(
      36              :         b.data(), b.size(), rv.ec);
      37            5 :     if(!more && !rv.ec)
      38            1 :         f_.close(rv.ec);
      39            5 :     return rv;
      40              : }
      41              : 
      42              : } // http_proto
      43              : } // boost
        

Generated by: LCOV version 2.1