LCOV - code coverage report
Current view: top level - http_proto/impl - version.ipp (source / functions) Hit Total Coverage
Test: coverage_filtered.info Lines: 9 9 100.0 %
Date: 2023-02-02 18:17:21 Functions: 2 2 100.0 %

          Line data    Source code
       1             : //
       2             : // Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
       3             : //
       4             : // Distributed under the Boost Software License, Version 1.0. (See accompanying
       5             : // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
       6             : //
       7             : // Official repository: https://github.com/CPPAlliance/http_proto
       8             : //
       9             : 
      10             : #ifndef BOOST_HTTP_PROTO_IMPL_VERSION_IPP
      11             : #define BOOST_HTTP_PROTO_IMPL_VERSION_IPP
      12             : 
      13             : #include <boost/http_proto/version.hpp>
      14             : #include <ostream>
      15             : 
      16             : namespace boost {
      17             : namespace http_proto {
      18             : 
      19             : string_view
      20          12 : to_string(version v) noexcept
      21             : {
      22          12 :     switch(v)
      23             :     {
      24           3 :     case version::http_1_0:
      25           3 :         return "HTTP/1.0";
      26           9 :     default:
      27             :     case version::http_1_1:
      28           9 :         return "HTTP/1.1";
      29             :     }
      30             : }
      31             : 
      32             : std::ostream&
      33           2 : operator<<(
      34             :     std::ostream& os,
      35             :     version v)
      36             : {
      37           2 :     os << to_string(v);
      38           2 :     return os;
      39             : }
      40             : 
      41             : } // http_proto
      42             : } // boost
      43             : 
      44             : #endif

Generated by: LCOV version 1.15