GCC Code Coverage Report


Directory: libs/http_proto/include/boost/http_proto/
File: boost/http_proto/impl/version.ipp
Date: 2023-02-02 18:17:22
Exec Total Coverage
Lines: 9 9 100.0%
Functions: 2 2 100.0%
Branches: 2 2 100.0%

Line Branch Exec Source
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
2/2
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 9 times.
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
45