Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:53:27

0001 //
0002 // Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
0003 //
0004 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0005 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 //
0007 // Official repository: https://github.com/boostorg/url
0008 //
0009 
0010 #ifndef BOOST_URL_GRAMMAR_IMPL_ERROR_HPP
0011 #define BOOST_URL_GRAMMAR_IMPL_ERROR_HPP
0012 
0013 #include <type_traits>
0014 
0015 namespace boost {
0016 namespace system {
0017 template<>
0018 struct is_error_code_enum<
0019     ::boost::urls::grammar::error>
0020 {
0021     static bool const value = true;
0022 };
0023 template<>
0024 struct is_error_condition_enum<
0025     ::boost::urls::grammar::condition>
0026 {
0027     static bool const value = true;
0028 };
0029 } // system
0030 } // boost
0031 
0032 namespace boost {
0033 namespace urls {
0034 namespace grammar {
0035 
0036 namespace detail {
0037 
0038 struct BOOST_SYMBOL_VISIBLE
0039     error_cat_type
0040     : system::error_category
0041 {
0042     BOOST_URL_DECL
0043     const char* name(
0044         ) const noexcept override;
0045 
0046     BOOST_URL_DECL
0047     std::string message(
0048         int) const override;
0049 
0050     BOOST_URL_DECL
0051     char const* message(
0052         int, char*, std::size_t
0053             ) const noexcept override;
0054 
0055     BOOST_URL_DECL
0056     system::error_condition
0057         default_error_condition(
0058             int code) const noexcept override;
0059 
0060     BOOST_SYSTEM_CONSTEXPR error_cat_type() noexcept
0061         : error_category(0x0536e50a30f9e9f2)
0062     {
0063     }
0064 };
0065 
0066 struct BOOST_SYMBOL_VISIBLE
0067     condition_cat_type
0068     : system::error_category
0069 {
0070     BOOST_URL_DECL
0071     const char* name(
0072         ) const noexcept override;
0073 
0074     BOOST_URL_DECL
0075     std::string message(
0076         int) const override;
0077 
0078     BOOST_URL_DECL
0079     char const* message(
0080         int, char*, std::size_t
0081             ) const noexcept override;
0082 
0083     BOOST_SYSTEM_CONSTEXPR condition_cat_type()
0084         : error_category(0x0536e50a30f9e9f2)
0085     {
0086     }
0087 };
0088 
0089 BOOST_URL_DECL extern
0090     error_cat_type error_cat;
0091 
0092 BOOST_URL_DECL extern
0093     condition_cat_type condition_cat;
0094 
0095 } // detail
0096 
0097 inline
0098 system::error_code
0099 make_error_code(
0100     error ev) noexcept
0101 {
0102     return system::error_code{
0103         static_cast<std::underlying_type<
0104             error>::type>(ev),
0105                 detail::error_cat};
0106 }
0107 
0108 inline
0109 system::error_condition
0110 make_error_condition(
0111     condition c) noexcept
0112 {
0113     return system::error_condition{
0114         static_cast<std::underlying_type<
0115             condition>::type>(c),
0116                 detail::condition_cat};
0117 }
0118 
0119 } // grammar
0120 } // urls
0121 } // boost
0122 
0123 #endif