Back to home page

EIC code displayed by LXR

 
 

    


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

0001 //
0002 // Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
0003 // Copyright (c) 2022 Alan de Freitas (alandefreitas@gmail.com)
0004 //
0005 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0006 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0007 //
0008 // Official repository: https://github.com/boostorg/url
0009 //
0010 
0011 #ifndef BOOST_URL_ENCODING_OPTS_HPP
0012 #define BOOST_URL_ENCODING_OPTS_HPP
0013 
0014 #include <boost/url/detail/config.hpp>
0015 
0016 namespace boost {
0017 namespace urls {
0018 
0019 /** Percent-encoding options
0020 
0021     These options are used to customize
0022     the behavior of algorithms which use
0023     percent escapes, such as encoding
0024     or decoding.
0025 
0026     @see
0027         @ref encode,
0028         @ref encoded_size,
0029         @ref pct_string_view.
0030 */
0031 struct BOOST_URL_DECL encoding_opts
0032 {
0033     /** True if spaces encode to and from plus signs
0034 
0035         This option controls whether or not
0036         the PLUS character ("+") is used to
0037         represent the SP character (" ") when
0038         encoding or decoding.
0039         Although not prescribed by the RFC, plus
0040         signs are commonly treated as spaces upon
0041         decoding when used in the query of URLs
0042         using well known schemes such as HTTP.
0043 
0044         @par Specification
0045         @li <a href="https://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.1">
0046             application/x-www-form-urlencoded (w3.org)</a>
0047     */
0048     bool space_as_plus = false;
0049 
0050     /** True if hexadecimal digits are emitted as lower case
0051 
0052         By default, percent-encoding algorithms
0053         emit hexadecimal digits A through F as
0054         uppercase letters. When this option is
0055         `true`, lowercase letters are used.
0056     */
0057     bool lower_case = false;
0058 
0059     /** True if nulls are not allowed
0060 
0061         Normally all possible character values
0062         (from 0 to 255) are allowed, with reserved
0063         characters being replaced with escapes
0064         upon encoding. When this option is true,
0065         attempting to decode a null will result
0066         in an error.
0067     */
0068     bool disallow_null = false;
0069 
0070 #ifndef BOOST_URL_DOCS
0071     encoding_opts(
0072         bool space_as_plus_ = false,
0073         bool lower_case_ = false,
0074         bool disallow_null_ = false) noexcept;
0075 #endif
0076 };
0077 
0078 } // urls
0079 } // boost
0080 
0081 #endif