| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // | ||
| 2 | // Copyright (c) 2021 Vinnie Falco (vinnie.falco@gmail.com) | ||
| 3 | // Copyright (c) 2024 Mohammad Nejati | ||
| 4 | // | ||
| 5 | // Distributed under the Boost Software License, Version 1.0. (See accompanying | ||
| 6 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
| 7 | // | ||
| 8 | // Official repository: https://github.com/cppalliance/http_proto | ||
| 9 | // | ||
| 10 | |||
| 11 | #ifndef BOOST_HTTP_PROTO_SERVICE_IMPL_ZLIB_SERVICE_HPP | ||
| 12 | #define BOOST_HTTP_PROTO_SERVICE_IMPL_ZLIB_SERVICE_HPP | ||
| 13 | |||
| 14 | #include <boost/system/is_error_code_enum.hpp> | ||
| 15 | |||
| 16 | namespace boost { | ||
| 17 | |||
| 18 | namespace system { | ||
| 19 | template<> | ||
| 20 | struct is_error_code_enum< | ||
| 21 | ::boost::http_proto::zlib::error> | ||
| 22 | { | ||
| 23 | static bool const value = true; | ||
| 24 | }; | ||
| 25 | } // system | ||
| 26 | |||
| 27 | namespace http_proto { | ||
| 28 | namespace zlib { | ||
| 29 | |||
| 30 | namespace detail { | ||
| 31 | |||
| 32 | struct BOOST_SYMBOL_VISIBLE | ||
| 33 | error_cat_type | ||
| 34 | : system::error_category | ||
| 35 | { | ||
| 36 | BOOST_HTTP_PROTO_DECL const char* name( | ||
| 37 | ) const noexcept override; | ||
| 38 | BOOST_HTTP_PROTO_DECL bool failed( | ||
| 39 | int) const noexcept override; | ||
| 40 | BOOST_HTTP_PROTO_DECL std::string message( | ||
| 41 | int) const override; | ||
| 42 | BOOST_HTTP_PROTO_DECL char const* message( | ||
| 43 | int, char*, std::size_t | ||
| 44 | ) const noexcept override; | ||
| 45 | 48 | BOOST_SYSTEM_CONSTEXPR error_cat_type() | |
| 46 | 48 | : error_category(0xe6c6d0215d1d6e22) | |
| 47 | { | ||
| 48 | 48 | } | |
| 49 | }; | ||
| 50 | |||
| 51 | BOOST_HTTP_PROTO_DECL extern | ||
| 52 | error_cat_type error_cat; | ||
| 53 | |||
| 54 | } // detail | ||
| 55 | |||
| 56 | inline | ||
| 57 | BOOST_SYSTEM_CONSTEXPR | ||
| 58 | system::error_code | ||
| 59 | 60148 | make_error_code( | |
| 60 | error ev) noexcept | ||
| 61 | { | ||
| 62 | return system::error_code{ | ||
| 63 | static_cast<std::underlying_type< | ||
| 64 | error>::type>(ev), | ||
| 65 | 60148 | detail::error_cat}; | |
| 66 | } | ||
| 67 | |||
| 68 | } // zip | ||
| 69 | } // http_proto | ||
| 70 | } // boost | ||
| 71 | |||
| 72 | #endif | ||
| 73 |