Line data Source code
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 0 : route_cat_type::
21 : name() const noexcept
22 : {
23 0 : return "boost.http_proto.route";
24 : }
25 :
26 : std::string
27 294 : route_cat_type::
28 : message(int code) const
29 : {
30 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 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 0 : case route::next_route: return "http_proto::route::next_route";
47 188 : case route::send: return "http_proto::route::send";
48 0 : default:
49 0 : 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 0 : detacher::
75 : owner::
76 : do_detach()
77 : {
78 0 : detail::throw_logic_error();
79 : }
80 :
81 : } // http_proto
82 : } // boost
|