| 1 |
|
|
1 |
|
|
| 2 |
|
// Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
|
2 |
|
// Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
|
| 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/boostorg/url
|
7 |
|
// Official repository: https://github.com/boostorg/url
|
| 8 |
|
|
8 |
|
|
| 9 |
|
|
9 |
|
|
| 10 |
|
#ifndef BOOST_URL_IMPL_ERROR_HPP
|
10 |
|
#ifndef BOOST_URL_IMPL_ERROR_HPP
|
| 11 |
|
#define BOOST_URL_IMPL_ERROR_HPP
|
11 |
|
#define BOOST_URL_IMPL_ERROR_HPP
|
| 12 |
|
|
12 |
|
|
| 13 |
|
#include <boost/url/grammar/error.hpp>
|
13 |
|
#include <boost/url/grammar/error.hpp>
|
| 14 |
|
|
14 |
|
|
| 15 |
|
|
15 |
|
|
| 16 |
|
|
16 |
|
|
| 17 |
|
|
17 |
|
|
| 18 |
|
//-----------------------------------------------
|
18 |
|
//-----------------------------------------------
|
| 19 |
|
|
19 |
|
|
| 20 |
|
|
20 |
|
|
| 21 |
|
struct is_error_code_enum<::boost::urls::error>
|
21 |
|
struct is_error_code_enum<::boost::urls::error>
|
| 22 |
|
|
22 |
|
|
| 23 |
|
static bool const value = true;
|
23 |
|
static bool const value = true;
|
| 24 |
|
|
24 |
|
|
| 25 |
|
|
25 |
|
|
| 26 |
|
//-----------------------------------------------
|
26 |
|
//-----------------------------------------------
|
| 27 |
|
|
27 |
|
|
| 28 |
|
|
28 |
|
|
| 29 |
|
|
29 |
|
|
| 30 |
|
|
30 |
|
|
| 31 |
|
|
31 |
|
|
| 32 |
|
struct BOOST_SYMBOL_VISIBLE
|
32 |
|
struct BOOST_SYMBOL_VISIBLE
|
| 33 |
|
|
33 |
|
|
| 34 |
|
|
34 |
|
|
| 35 |
|
|
35 |
|
|
| 36 |
|
BOOST_URL_CXX20_CONSTEXPR
|
36 |
|
BOOST_URL_CXX20_CONSTEXPR
|
| 37 |
|
|
37 |
|
|
| 38 |
|
) const noexcept override
|
38 |
|
) const noexcept override
|
| 39 |
|
|
39 |
|
|
| 40 |
|
|
40 |
|
|
| 41 |
|
|
41 |
|
|
| 42 |
|
|
42 |
|
|
| 43 |
|
|
43 |
|
|
| 44 |
|
|
44 |
|
|
| 45 |
|
|
45 |
|
|
| 46 |
|
return message(code, nullptr, 0);
|
46 |
|
return message(code, nullptr, 0);
|
| 47 |
|
|
47 |
|
|
| 48 |
|
|
48 |
|
|
| 49 |
|
BOOST_URL_CXX20_CONSTEXPR
|
49 |
|
BOOST_URL_CXX20_CONSTEXPR
|
| 50 |
|
|
50 |
|
|
| 51 |
|
|
51 |
|
|
| 52 |
|
|
52 |
|
|
| 53 |
|
std::size_t) const noexcept override
|
53 |
|
std::size_t) const noexcept override
|
| 54 |
|
|
54 |
|
|
| 55 |
|
switch(static_cast<error>(code))
|
55 |
|
switch(static_cast<error>(code))
|
| 56 |
|
|
56 |
|
|
| 57 |
|
case error::success: return "success";
|
57 |
|
case error::success: return "success";
|
| 58 |
|
case error::illegal_null: return "illegal null";
|
58 |
|
case error::illegal_null: return "illegal null";
|
| 59 |
|
case error::illegal_reserved_char: return "illegal reserved char";
|
59 |
|
case error::illegal_reserved_char: return "illegal reserved char";
|
| 60 |
|
case error::non_canonical: return "non canonical";
|
60 |
|
case error::non_canonical: return "non canonical";
|
| 61 |
|
case error::bad_pct_hexdig: return "bad hexdig in pct-encoding";
|
61 |
|
case error::bad_pct_hexdig: return "bad hexdig in pct-encoding";
|
| 62 |
|
case error::incomplete_encoding: return "incomplete pct-encoding";
|
62 |
|
case error::incomplete_encoding: return "incomplete pct-encoding";
|
| 63 |
|
case error::missing_pct_hexdig: return "missing hexdig in pct-encoding";
|
63 |
|
case error::missing_pct_hexdig: return "missing hexdig in pct-encoding";
|
| 64 |
|
case error::no_space: return "no space";
|
64 |
|
case error::no_space: return "no space";
|
| 65 |
|
case error::not_a_base: return "not a base";
|
65 |
|
case error::not_a_base: return "not a base";
|
| 66 |
|
|
66 |
|
|
| 67 |
|
|
67 |
|
|
| 68 |
|
|
68 |
|
|
| 69 |
|
|
69 |
|
|
| 70 |
|
BOOST_URL_CXX20_CONSTEXPR
|
70 |
|
BOOST_URL_CXX20_CONSTEXPR
|
| 71 |
|
|
71 |
|
|
| 72 |
|
|
72 |
|
|
| 73 |
|
int ev) const noexcept override;
|
73 |
|
int ev) const noexcept override;
|
| 74 |
|
|
74 |
|
|
| 75 |
|
BOOST_SYSTEM_CONSTEXPR error_cat_type() noexcept
|
75 |
|
BOOST_SYSTEM_CONSTEXPR error_cat_type() noexcept
|
| 76 |
|
: error_category(0xbc15399d7a4ce829)
|
76 |
|
: error_category(0xbc15399d7a4ce829)
|
| 77 |
|
|
77 |
|
|
| 78 |
|
|
78 |
|
|
| 79 |
|
|
79 |
|
|
| 80 |
|
|
80 |
|
|
| 81 |
|
#if defined(BOOST_URL_HAS_CXX20_CONSTEXPR)
|
81 |
|
#if defined(BOOST_URL_HAS_CXX20_CONSTEXPR)
|
| 82 |
|
inline constexpr error_cat_type error_cat{};
|
82 |
|
inline constexpr error_cat_type error_cat{};
|
| 83 |
|
|
83 |
|
|
| 84 |
|
BOOST_URL_DECL extern error_cat_type error_cat;
|
84 |
|
BOOST_URL_DECL extern error_cat_type error_cat;
|
| 85 |
|
|
85 |
|
|
| 86 |
|
|
86 |
|
|
| 87 |
|
|
87 |
|
|
| 88 |
|
|
88 |
|
|
| 89 |
|
|
89 |
|
|
| 90 |
|
|
90 |
|
|
| 91 |
|
|
91 |
|
|
| 92 |
|
|
92 |
|
|
| 93 |
|
|
93 |
|
|
| 94 |
|
|
94 |
|
|
| 95 |
|
return system::error_code{
|
95 |
|
return system::error_code{
|
| 96 |
|
static_cast<std::underlying_type<
|
96 |
|
static_cast<std::underlying_type<
|
| 97 |
|
|
97 |
|
|
| 98 |
|
|
98 |
|
|
| 99 |
|
|
99 |
|
|
| 100 |
|
|
100 |
|
|
| 101 |
|
BOOST_URL_CXX20_CONSTEXPR_OR_INLINE
|
101 |
|
BOOST_URL_CXX20_CONSTEXPR_OR_INLINE
|
| 102 |
|
|
102 |
|
|
| 103 |
|
|
103 |
|
|
| 104 |
|
|
104 |
|
|
| 105 |
|
|
105 |
|
|
| 106 |
|
|
106 |
|
|
| 107 |
|
switch(static_cast<error>(ev))
|
107 |
|
switch(static_cast<error>(ev))
|
| 108 |
|
|
108 |
|
|
| 109 |
|
|
109 |
|
|
| 110 |
|
|
110 |
|
|
| 111 |
|
case error::bad_pct_hexdig:
|
111 |
|
case error::bad_pct_hexdig:
|
| 112 |
|
case error::incomplete_encoding:
|
112 |
|
case error::incomplete_encoding:
|
| 113 |
|
case error::missing_pct_hexdig:
|
113 |
|
case error::missing_pct_hexdig:
|
| 114 |
|
return grammar::condition::fatal;
|
114 |
|
return grammar::condition::fatal;
|
| 115 |
|
|
115 |
|
|
| 116 |
|
|
116 |
|
|
| 117 |
|
|
117 |
|
|
| 118 |
|
|
118 |
|
|
| 119 |
|
|
119 |
|
|
| 120 |
|
|
120 |
|
|
| 121 |
|
|
121 |
|
|