| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // | ||
| 2 | // Copyright (c) 2025 Vinnie Falco (vinnie dot falco at gmail dot 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/server/router_types.hpp> | ||
| 11 | #include <boost/assert.hpp> | ||
| 12 | #include <cstring> | ||
| 13 | |||
| 14 | namespace boost { | ||
| 15 | namespace http_proto { | ||
| 16 | |||
| 17 | namespace detail { | ||
| 18 | |||
| 19 | const char* | ||
| 20 | ✗ | route_cat_type:: | |
| 21 | name() const noexcept | ||
| 22 | { | ||
| 23 | ✗ | return "boost.http_proto.route"; | |
| 24 | } | ||
| 25 | |||
| 26 | std::string | ||
| 27 | 294 | route_cat_type:: | |
| 28 | message(int code) const | ||
| 29 | { | ||
| 30 |
1/1✓ Branch 2 taken 294 times.
|
588 | return message(code, nullptr, 0); |
| 31 | } | ||
| 32 | |||
| 33 | char const* | ||
| 34 | 294 | route_cat_type:: | |
| 35 | message( | ||
| 36 | int code, | ||
| 37 | char*, | ||
| 38 | std::size_t) const noexcept | ||
| 39 | { | ||
| 40 |
5/7✓ Branch 0 taken 2 times.
✓ Branch 1 taken 2 times.
✓ Branch 2 taken 4 times.
✓ Branch 3 taken 98 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 188 times.
✗ Branch 6 not taken.
|
294 | switch(static_cast<route>(code)) |
| 41 | { | ||
| 42 | 2 | case route::close: return "http_proto::route::close"; | |
| 43 | 2 | case route::complete: return "http_proto::route::complete"; | |
| 44 | 4 | case route::detach: return "http_proto::route::detach"; | |
| 45 | 98 | case route::next: return "http_proto::route::next"; | |
| 46 | ✗ | case route::next_route: return "http_proto::route::next_route"; | |
| 47 | 188 | case route::send: return "http_proto::route::send"; | |
| 48 | ✗ | default: | |
| 49 | ✗ | return "http_proto::route::?"; | |
| 50 | } | ||
| 51 | } | ||
| 52 | |||
| 53 | // msvc 14.0 has a bug that warns about inability | ||
| 54 | // to use constexpr construction here, even though | ||
| 55 | // there's no constexpr construction | ||
| 56 | #if defined(_MSC_VER) && _MSC_VER <= 1900 | ||
| 57 | # pragma warning( push ) | ||
| 58 | # pragma warning( disable : 4592 ) | ||
| 59 | #endif | ||
| 60 | |||
| 61 | #if defined(__cpp_constinit) && __cpp_constinit >= 201907L | ||
| 62 | constinit route_cat_type route_cat; | ||
| 63 | #else | ||
| 64 | route_cat_type route_cat; | ||
| 65 | #endif | ||
| 66 | |||
| 67 | #if defined(_MSC_VER) && _MSC_VER <= 1900 | ||
| 68 | # pragma warning( pop ) | ||
| 69 | #endif | ||
| 70 | |||
| 71 | } // detail | ||
| 72 | |||
| 73 | resumer | ||
| 74 | ✗ | detacher:: | |
| 75 | owner:: | ||
| 76 | do_detach() | ||
| 77 | { | ||
| 78 | ✗ | detail::throw_logic_error(); | |
| 79 | } | ||
| 80 | |||
| 81 | } // http_proto | ||
| 82 | } // boost | ||
| 83 |