Line data Source code
1 : //
2 : // Copyright (c) 2022 alandefreitas (alandefreitas@gmail.com)
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/boostorg/url
8 : //
9 :
10 : #ifndef BOOST_URL_RFC_DETAIL_CHARSETS_HPP
11 : #define BOOST_URL_RFC_DETAIL_CHARSETS_HPP
12 :
13 : #include "boost/url/rfc/pchars.hpp"
14 : #include "boost/url/rfc/sub_delim_chars.hpp"
15 : #include "boost/url/rfc/unreserved_chars.hpp"
16 :
17 : namespace boost {
18 : namespace urls {
19 : namespace detail {
20 :
21 : struct empty_chars_t
22 : {
23 : constexpr
24 : bool
25 75 : operator()(char) const noexcept
26 : {
27 75 : return false;
28 : }
29 : };
30 :
31 : constexpr
32 : empty_chars_t
33 : empty_chars{};
34 :
35 : constexpr
36 : auto
37 : user_chars =
38 : unreserved_chars + sub_delim_chars;
39 :
40 : constexpr
41 : auto
42 : password_chars =
43 : unreserved_chars + sub_delim_chars + ':';
44 :
45 : constexpr
46 : auto
47 : userinfo_chars =
48 : password_chars;
49 :
50 : constexpr
51 : auto
52 : host_chars =
53 : unreserved_chars + sub_delim_chars;
54 :
55 : constexpr
56 : auto
57 : reg_name_chars =
58 : unreserved_chars + '-' + '.';
59 :
60 : constexpr
61 : auto
62 : segment_chars =
63 : pchars;
64 :
65 : constexpr
66 : auto
67 : path_chars =
68 : segment_chars + '/';
69 :
70 : constexpr
71 : auto
72 : query_chars =
73 : pchars + '/' + '?' + '[' + ']';
74 :
75 : constexpr
76 : grammar::lut_chars
77 : query_ignore_chars =
78 : "&=+";
79 :
80 : constexpr
81 : auto
82 : param_key_chars = pchars
83 : + '/' + '?' + '[' + ']'
84 : - '&' - '=';
85 :
86 : constexpr
87 : auto
88 : param_value_chars = pchars
89 : + '/' + '?'
90 : - '&';
91 :
92 : constexpr
93 : auto
94 : fragment_chars =
95 : pchars + '/' + '?' + '#';
96 :
97 : constexpr
98 : auto
99 : nocolon_pchars =
100 : pchars - ':';
101 :
102 : } // detail
103 : } // urls
104 : } // boost
105 :
106 : #endif
|