0.00% Lines (0/15) 0.00% Functions (0/2)
TLA Baseline Branch
Line Hits Code Line Hits Code
1   // 1   //
2   // Copyright (c) 2024 Mohammad Nejati 2   // Copyright (c) 2024 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   #include <boost/http/zlib/error.hpp> 10   #include <boost/http/zlib/error.hpp>
11   11  
12   namespace boost { 12   namespace boost {
13   namespace http { 13   namespace http {
14   namespace zlib { 14   namespace zlib {
15   namespace detail { 15   namespace detail {
16   16  
17   const char* 17   const char*
MISUBC 18   error_cat_type:: 18   error_cat_type::
19   name() const noexcept 19   name() const noexcept
20   { 20   {
MISUBC 21   return "boost.http.zlib"; 21   return "boost.http.zlib";
22   } 22   }
23   23  
24   std::string 24   std::string
MISUBC 25   error_cat_type:: 25   error_cat_type::
26   message(int ev) const 26   message(int ev) const
27   { 27   {
MISUBC 28   switch(static_cast<error>(ev)) 28   switch(static_cast<error>(ev))
29   { 29   {
MISUBC 30   case error::ok: return "Z_OK"; 30   case error::ok: return "Z_OK";
MISUBC 31   case error::stream_end: return "Z_STREAM_END"; 31   case error::stream_end: return "Z_STREAM_END";
MISUBC 32   case error::need_dict: return "Z_NEED_DICT"; 32   case error::need_dict: return "Z_NEED_DICT";
MISUBC 33   case error::errno_: return "Z_ERRNO"; 33   case error::errno_: return "Z_ERRNO";
MISUBC 34   case error::stream_err: return "Z_STREAM_ERROR"; 34   case error::stream_err: return "Z_STREAM_ERROR";
MISUBC 35   case error::data_err: return "Z_DATA_ERROR"; 35   case error::data_err: return "Z_DATA_ERROR";
MISUBC 36   case error::mem_err: return "Z_MEM_ERROR"; 36   case error::mem_err: return "Z_MEM_ERROR";
MISUBC 37   case error::buf_err: return "Z_BUF_ERROR"; 37   case error::buf_err: return "Z_BUF_ERROR";
MISUBC 38   case error::version_err: return "Z_VERSION_ERROR"; 38   case error::version_err: return "Z_VERSION_ERROR";
MISUBC 39   default: 39   default:
MISUBC 40   return "unknown"; 40   return "unknown";
41   } 41   }
42   } 42   }
43   43  
44   // msvc 14.0 has a bug that warns about inability 44   // msvc 14.0 has a bug that warns about inability
45   // to use constexpr construction here, even though 45   // to use constexpr construction here, even though
46   // there's no constexpr construction 46   // there's no constexpr construction
47   #if defined(_MSC_VER) && _MSC_VER <= 1900 47   #if defined(_MSC_VER) && _MSC_VER <= 1900
48   # pragma warning( push ) 48   # pragma warning( push )
49   # pragma warning( disable : 4592 ) 49   # pragma warning( disable : 4592 )
50   #endif 50   #endif
51   51  
52   #if defined(__cpp_constinit) && __cpp_constinit >= 201907L 52   #if defined(__cpp_constinit) && __cpp_constinit >= 201907L
53   constinit error_cat_type error_cat; 53   constinit error_cat_type error_cat;
54   #else 54   #else
55   error_cat_type error_cat; 55   error_cat_type error_cat;
56   #endif 56   #endif
57   57  
58   #if defined(_MSC_VER) && _MSC_VER <= 1900 58   #if defined(_MSC_VER) && _MSC_VER <= 1900
59   # pragma warning( pop ) 59   # pragma warning( pop )
60   #endif 60   #endif
61   61  
62   } // detail 62   } // detail
63   } // zlib 63   } // zlib
64   } // http 64   } // http
65   } // boost 65   } // boost