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 | core::string_view | ||
20 | 12 | to_string( | |
21 | version v) noexcept | ||
22 | { | ||
23 |
2/2✓ Branch 0 taken 3 times.
✓ Branch 1 taken 9 times.
|
12 | switch(v) |
24 | { | ||
25 | 3 | case version::http_1_0: | |
26 | 3 | return "HTTP/1.0"; | |
27 | 9 | default: | |
28 | case version::http_1_1: | ||
29 | 9 | return "HTTP/1.1"; | |
30 | } | ||
31 | } | ||
32 | |||
33 | std::ostream& | ||
34 | 2 | operator<<( | |
35 | std::ostream& os, | ||
36 | version v) | ||
37 | { | ||
38 | 2 | os << to_string(v); | |
39 | 2 | return os; | |
40 | } | ||
41 | |||
42 | } // http_proto | ||
43 | } // boost | ||
44 | |||
45 | #endif | ||
46 |