]>
Commit | Line | Data |
---|---|---|
11fdf7f2 TL |
1 | // |
2 | // Copyright (c) 2016-2017 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/boostorg/beast | |
8 | // | |
9 | ||
10 | #ifndef BOOST_BEAST_WEBSOCKET_DETAIL_ERROR_IPP | |
11 | #define BOOST_BEAST_WEBSOCKET_DETAIL_ERROR_IPP | |
12 | ||
13 | #include <boost/beast/core/error.hpp> | |
14 | #include <boost/beast/core/string.hpp> | |
15 | ||
16 | namespace boost { | |
17 | ||
18 | namespace beast { | |
19 | namespace websocket { | |
20 | enum class error; | |
21 | enum class condition; | |
22 | } // websocket | |
23 | } // beast | |
24 | ||
25 | namespace system { | |
26 | template<> | |
27 | struct is_error_code_enum<beast::websocket::error> | |
28 | { | |
29 | static bool const value = true; | |
30 | }; | |
31 | template<> | |
32 | struct is_error_condition_enum<beast::websocket::condition> | |
33 | { | |
34 | static bool const value = true; | |
35 | }; | |
36 | } // system | |
37 | ||
38 | namespace beast { | |
39 | namespace websocket { | |
40 | namespace detail { | |
41 | ||
42 | class error_codes : public error_category | |
43 | { | |
44 | public: | |
45 | const char* | |
46 | name() const noexcept override; | |
47 | ||
48 | std::string | |
49 | message(int ev) const override; | |
50 | ||
51 | error_condition | |
52 | default_error_condition(int ev) const noexcept override; | |
53 | }; | |
54 | ||
55 | class error_conditions : public error_category | |
56 | { | |
57 | public: | |
58 | const char* | |
59 | name() const noexcept override; | |
60 | ||
61 | std::string | |
62 | message(int cv) const override; | |
63 | }; | |
64 | ||
65 | } // detail | |
66 | ||
67 | error_code | |
68 | make_error_code(error e); | |
69 | ||
70 | error_condition | |
71 | make_error_condition(condition c); | |
72 | ||
73 | } // websocket | |
74 | } // beast | |
75 | ||
76 | } // boost | |
77 | ||
78 | #endif |