]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/beast/http/detail/rfc7230.hpp
bump version to 18.2.4-pve3
[ceph.git] / ceph / src / boost / boost / beast / http / detail / rfc7230.hpp
1 //
2 // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot 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/beast
8 //
9
10 #ifndef BOOST_BEAST_HTTP_DETAIL_RFC7230_HPP
11 #define BOOST_BEAST_HTTP_DETAIL_RFC7230_HPP
12
13 #include <boost/beast/core/string.hpp>
14 #include <iterator>
15 #include <utility>
16
17 namespace boost {
18 namespace beast {
19 namespace http {
20 namespace detail {
21
22 BOOST_BEAST_DECL
23 bool
24 is_digit(char c);
25
26 BOOST_BEAST_DECL
27 char
28 is_alpha(char c);
29
30 BOOST_BEAST_DECL
31 char
32 is_text(char c);
33
34 BOOST_BEAST_DECL
35 char
36 is_token_char(char c);
37
38 BOOST_BEAST_DECL
39 char
40 is_qdchar(char c);
41
42 BOOST_BEAST_DECL
43 char
44 is_qpchar(char c);
45
46
47 // converts to lower case,
48 // returns 0 if not a valid text char
49 //
50 BOOST_BEAST_DECL
51 char
52 to_value_char(char c);
53
54 // VFALCO TODO Make this return unsigned?
55 BOOST_BEAST_DECL
56 std::int8_t
57 unhex(char c);
58
59 BOOST_BEAST_DECL
60 string_view
61 trim(string_view s);
62
63 struct param_iter
64 {
65 using iter_type = string_view::const_iterator;
66
67 iter_type it;
68 iter_type first;
69 iter_type last;
70 std::pair<string_view, string_view> v;
71
72 bool
73 empty() const
74 {
75 return first == it;
76 }
77
78 BOOST_BEAST_DECL
79 void
80 increment();
81 };
82
83 /*
84 #token = [ ( "," / token ) *( OWS "," [ OWS token ] ) ]
85 */
86 struct opt_token_list_policy
87 {
88 using value_type = string_view;
89
90 BOOST_BEAST_DECL
91 bool
92 operator()(value_type& v,
93 char const*& it, string_view s) const;
94 };
95
96 } // detail
97 } // http
98 } // beast
99 } // boost
100
101 #ifdef BOOST_BEAST_HEADER_ONLY
102 #include <boost/beast/http/detail/rfc7230.ipp>
103 #endif
104
105 #endif
106