| 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 | #include <boost/http_proto/version.hpp> | ||
| 11 | #include <ostream> | ||
| 12 | |||
| 13 | namespace boost { | ||
| 14 | namespace http_proto { | ||
| 15 | |||
| 16 | core::string_view | ||
| 17 | 45 | to_string( | |
| 18 | version v) | ||
| 19 | { | ||
| 20 |
2/2✓ Branch 0 taken 14 times.
✓ Branch 1 taken 31 times.
|
45 | switch(v) |
| 21 | { | ||
| 22 | 14 | case version::http_1_0: | |
| 23 | 14 | return "HTTP/1.0"; | |
| 24 | 31 | default: | |
| 25 | case version::http_1_1: | ||
| 26 | 31 | return "HTTP/1.1"; | |
| 27 | } | ||
| 28 | } | ||
| 29 | |||
| 30 | std::ostream& | ||
| 31 | 2 | operator<<( | |
| 32 | std::ostream& os, | ||
| 33 | version v) | ||
| 34 | { | ||
| 35 | 2 | os << to_string(v); | |
| 36 | 2 | return os; | |
| 37 | } | ||
| 38 | |||
| 39 | } // http_proto | ||
| 40 | } // boost | ||
| 41 |