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 | 258 | to_string(version v) noexcept | |
21 | { | ||
22 |
2/2✓ Branch 0 taken 27 times.
✓ Branch 1 taken 231 times.
|
258 | switch(v) |
23 | { | ||
24 | 27 | case version::http_1_0: | |
25 | 27 | return "HTTP/1.0"; | |
26 | 231 | default: | |
27 | case version::http_1_1: | ||
28 | 231 | 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 |