100.00% Lines (3/3) 100.00% Functions (1/1)
TLA Baseline Branch
Line Hits Code Line Hits Code
1   // 1   //
2   // Copyright (c) 2026 Mohammad Nejati 2   // Copyright (c) 2026 Mohammad Nejati
3   // 3   //
4   // Distributed under the Boost Software License, Version 1.0. (See accompanying 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) 5   // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6   // 6   //
7   // Official repository: https://github.com/cppalliance/http 7   // Official repository: https://github.com/cppalliance/http
8   // 8   //
9   9  
10   #ifndef BOOST_HTTP_ZSTD_IMPL_ERROR_HPP 10   #ifndef BOOST_HTTP_ZSTD_IMPL_ERROR_HPP
11   #define BOOST_HTTP_ZSTD_IMPL_ERROR_HPP 11   #define BOOST_HTTP_ZSTD_IMPL_ERROR_HPP
12   12  
13   #include <boost/http/detail/config.hpp> 13   #include <boost/http/detail/config.hpp>
14 - #include <boost/system/error_category.hpp>  
15 - #include <boost/system/is_error_code_enum.hpp>  
16   14  
17   #include <system_error> 15   #include <system_error>
18 - namespace boost {  
19 -  
20 - namespace system {  
21 - template<>  
22 - struct is_error_code_enum<  
23 - ::boost::http::zstd::error>  
24 - {  
25 - static bool const value = true;  
26 - };  
27 - } // system  
28 - } // boost  
29 -  
30   16  
31   namespace std { 17   namespace std {
32   template<> 18   template<>
33   struct is_error_code_enum< 19   struct is_error_code_enum<
34   ::boost::http::zstd::error> 20   ::boost::http::zstd::error>
35   : std::true_type {}; 21   : std::true_type {};
36   } // std 22   } // std
37   23  
38   namespace boost { 24   namespace boost {
39   namespace http { 25   namespace http {
40   namespace zstd { 26   namespace zstd {
41   27  
42   namespace detail { 28   namespace detail {
43   29  
44   struct BOOST_SYMBOL_VISIBLE 30   struct BOOST_SYMBOL_VISIBLE
45   error_cat_type 31   error_cat_type
46 - : system::error_category 32 + : std::error_category
47   { 33   {
48   BOOST_HTTP_DECL const char* name( 34   BOOST_HTTP_DECL const char* name(
49 - BOOST_HTTP_DECL bool failed(  
50 - int) const noexcept override;  
51   ) const noexcept override; 35   ) const noexcept override;
52   BOOST_HTTP_DECL std::string message( 36   BOOST_HTTP_DECL std::string message(
53   int) const override; 37   int) const override;
54 - BOOST_HTTP_DECL char const* message( 38 + constexpr error_cat_type() noexcept = default;
55 - int, char*, std::size_t  
56 - ) const noexcept override;  
57 - BOOST_SYSTEM_CONSTEXPR error_cat_type()  
58 - : error_category(0x9971e0803a6de4e7)  
59 - {  
60 - }  
61   }; 39   };
62   40  
63   BOOST_HTTP_DECL extern 41   BOOST_HTTP_DECL extern
64   error_cat_type error_cat; 42   error_cat_type error_cat;
65   43  
66   } // detail 44   } // detail
67   45  
68   inline 46   inline
69 - BOOST_SYSTEM_CONSTEXPR 47 + std::error_code
70 - system::error_code  
HITCBC 71   5 make_error_code( 48   5 make_error_code(
72   error ev) noexcept 49   error ev) noexcept
73   { 50   {
HITGIC 74 - return system::error_code{ 51 + 5 return std::error_code{
75   static_cast<std::underlying_type< 52   static_cast<std::underlying_type<
76   error>::type>(ev), 53   error>::type>(ev),
HITCBC 77   5 detail::error_cat}; 54   5 detail::error_cat};
78   } 55   }
79   56  
80   } // zstd 57   } // zstd
81   } // http 58   } // http
82   } // boost 59   } // boost
83   60  
84   #endif 61   #endif