0.00% Lines (0/0)
0.00% Functions (0/0)
| TLA | Baseline | Branch | ||||||
|---|---|---|---|---|---|---|---|---|
| Line | Hits | Code | Line | Hits | Code | |||
| 1 | - | // | ||||||
| 2 | - | // Copyright (c) 2026 Mohammad Nejati | ||||||
| 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 | ||||||
| 8 | - | // | ||||||
| 9 | - | |||||||
| 10 | - | #ifndef BOOST_HTTP_ZSTD_IMPL_ERROR_HPP | ||||||
| 11 | - | #define BOOST_HTTP_ZSTD_IMPL_ERROR_HPP | ||||||
| 12 | - | |||||||
| 13 | - | #include <boost/http/detail/config.hpp> | ||||||
| 14 | - | |||||||
| 15 | - | #include <system_error> | ||||||
| 16 | - | |||||||
| 17 | - | namespace std { | ||||||
| 18 | - | template<> | ||||||
| 19 | - | struct is_error_code_enum< | ||||||
| 20 | - | ::boost::http::zstd::error> | ||||||
| 21 | - | : std::true_type {}; | ||||||
| 22 | - | } // std | ||||||
| 23 | - | |||||||
| 24 | - | namespace boost { | ||||||
| 25 | - | namespace http { | ||||||
| 26 | - | namespace zstd { | ||||||
| 27 | - | |||||||
| 28 | - | namespace detail { | ||||||
| 29 | - | |||||||
| 30 | - | struct BOOST_SYMBOL_VISIBLE | ||||||
| 31 | - | error_cat_type | ||||||
| 32 | - | : std::error_category | ||||||
| 33 | - | { | ||||||
| 34 | - | BOOST_HTTP_DECL const char* name( | ||||||
| 35 | - | ) const noexcept override; | ||||||
| 36 | - | BOOST_HTTP_DECL std::string message( | ||||||
| 37 | - | int) const override; | ||||||
| 38 | - | constexpr error_cat_type() noexcept = default; | ||||||
| 39 | - | }; | ||||||
| 40 | - | |||||||
| 41 | - | BOOST_HTTP_DECL extern | ||||||
| 42 | - | error_cat_type error_cat; | ||||||
| 43 | - | |||||||
| 44 | - | } // detail | ||||||
| 45 | - | |||||||
| 46 | - | inline | ||||||
| 47 | - | std::error_code | ||||||
| DCB | 48 | - | 5 | make_error_code( | ||||
| 49 | - | error ev) noexcept | ||||||
| 50 | - | { | ||||||
| DCB | 51 | - | 5 | return std::error_code{ | ||||
| 52 | - | static_cast<std::underlying_type< | ||||||
| 53 | - | error>::type>(ev), | ||||||
| DCB | 54 | - | 5 | detail::error_cat}; | ||||
| 55 | - | } | ||||||
| 56 | - | |||||||
| 57 | - | } // zstd | ||||||
| 58 | - | } // http | ||||||
| 59 | - | } // boost | ||||||
| 60 | - | |||||||
| 61 | - | #endif | ||||||