100.00% Lines (9/9)
100.00% Functions (2/2)
| TLA | Baseline | Branch | ||||||
|---|---|---|---|---|---|---|---|---|
| Line | Hits | Code | Line | Hits | Code | |||
| 1 | // | 1 | // | |||||
| 2 | // Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com) | 2 | // Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com) | |||||
| 3 | // | 3 | // | |||||
| 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying | 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) | 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |||||
| 6 | // | 6 | // | |||||
| 7 | // Official repository: https://github.com/cppalliance/http | 7 | // Official repository: https://github.com/cppalliance/http | |||||
| 8 | // | 8 | // | |||||
| 9 | 9 | |||||||
| 10 | #include <boost/http/version.hpp> | 10 | #include <boost/http/version.hpp> | |||||
| 11 | #include <ostream> | 11 | #include <ostream> | |||||
| 12 | 12 | |||||||
| 13 | namespace boost { | 13 | namespace boost { | |||||
| 14 | namespace http { | 14 | namespace http { | |||||
| 15 | 15 | |||||||
| 16 | core::string_view | 16 | core::string_view | |||||
| HITCBC | 17 | 72 | to_string( | 17 | 72 | to_string( | ||
| 18 | version v) | 18 | version v) | |||||
| 19 | { | 19 | { | |||||
| HITCBC | 20 | 72 | switch(v) | 20 | 72 | switch(v) | ||
| 21 | { | 21 | { | |||||
| HITCBC | 22 | 14 | case version::http_1_0: | 22 | 14 | case version::http_1_0: | ||
| HITCBC | 23 | 14 | return "HTTP/1.0"; | 23 | 14 | return "HTTP/1.0"; | ||
| HITCBC | 24 | 58 | default: | 24 | 58 | default: | ||
| 25 | case version::http_1_1: | 25 | case version::http_1_1: | |||||
| HITCBC | 26 | 58 | return "HTTP/1.1"; | 26 | 58 | return "HTTP/1.1"; | ||
| 27 | } | 27 | } | |||||
| 28 | } | 28 | } | |||||
| 29 | 29 | |||||||
| 30 | std::ostream& | 30 | std::ostream& | |||||
| HITCBC | 31 | 2 | operator<<( | 31 | 2 | operator<<( | ||
| 32 | std::ostream& os, | 32 | std::ostream& os, | |||||
| 33 | version v) | 33 | version v) | |||||
| 34 | { | 34 | { | |||||
| HITCBC | 35 | 2 | os << to_string(v); | 35 | 2 | os << to_string(v); | ||
| HITCBC | 36 | 2 | return os; | 36 | 2 | return os; | ||
| 37 | } | 37 | } | |||||
| 38 | 38 | |||||||
| 39 | } // http | 39 | } // http | |||||
| 40 | } // boost | 40 | } // boost | |||||