-
Notifications
You must be signed in to change notification settings - Fork 50
/
encoding_opts.hpp
81 lines (66 loc) · 2.19 KB
/
encoding_opts.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//
// Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
// Copyright (c) 2022 Alan de Freitas (alandefreitas@gmail.com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Official repository: https://github.com/boostorg/url
//
#ifndef BOOST_URL_ENCODING_OPTS_HPP
#define BOOST_URL_ENCODING_OPTS_HPP
#include <boost/url/detail/config.hpp>
namespace boost {
namespace urls {
/** Percent-encoding options
These options are used to customize
the behavior of algorithms which use
percent escapes, such as encoding
or decoding.
@see
@ref encode,
@ref encoded_size,
@ref pct_string_view.
*/
struct BOOST_URL_DECL encoding_opts
{
/** True if spaces encode to and from plus signs
This option controls whether or not
the PLUS character ("+") is used to
represent the SP character (" ") when
encoding or decoding.
Although not prescribed by the RFC, plus
signs are commonly treated as spaces upon
decoding when used in the query of URLs
using well known schemes such as HTTP.
@par Specification
@li <a href="https://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1">
application/x-www-form-urlencoded (w3.org)</a>
*/
bool space_as_plus = false;
/** True if hexadecimal digits are emitted as lower case
By default, percent-encoding algorithms
emit hexadecimal digits A through F as
uppercase letters. When this option is
`true`, lowercase letters are used.
*/
bool lower_case = false;
/** True if nulls are not allowed
Normally all possible character values
(from 0 to 255) are allowed, with reserved
characters being replaced with escapes
upon encoding. When this option is true,
attempting to decode a null will result
in an error.
*/
bool disallow_null = false;
#ifndef BOOST_URL_DOCS
encoding_opts(
bool space_as_plus_ = false,
bool lower_case_ = false,
bool disallow_null_ = false) noexcept;
#endif
};
} // urls
} // boost
#endif