Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-18 09:07:54

0001 //
0002 // Copyright (c) 2021 Vinnie Falco (vinnie dot falco at gmail dot com)
0003 //
0004 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0005 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 //
0007 // Official repository: https://github.com/boostorg/url
0008 //
0009 
0010 #ifndef BOOST_URL_GRAMMAR_ALNUM_CHARS_HPP
0011 #define BOOST_URL_GRAMMAR_ALNUM_CHARS_HPP
0012 
0013 #include <boost/url/detail/config.hpp>
0014 #include <boost/url/grammar/detail/charset.hpp>
0015 
0016 namespace boost {
0017 namespace urls {
0018 namespace grammar {
0019 
0020 /** The set of letters and digits
0021 
0022     @par Example
0023     Character sets are used with rules and the
0024     functions @ref find_if and @ref find_if_not.
0025     @code
0026     system::result< core::string_view > = parse( "Johnny42", token_rule( alnumchars ) );
0027     @endcode
0028 
0029     @par BNF
0030     @code
0031     ALNUM       = ALPHA / DIGIT
0032 
0033     ALPHA       = %x41-5A / %x61-7A
0034                 ; A-Z / a-z
0035 
0036     DIGIT       = %x30-39
0037                 ; 0-9
0038     @endcode
0039 
0040     @par Specification
0041     @li <a href="https://datatracker.ietf.org/doc/html/rfc5234#appendix-B.1"
0042         >B.1. Core Rules (rfc5234)</a>
0043 
0044     @see
0045         @ref find_if,
0046         @ref find_if_not,
0047         @ref parse,
0048         @ref token_rule.
0049 */
0050 #ifdef BOOST_URL_DOCS
0051 constexpr __implementation_defined__ alnum_chars;
0052 #else
0053 namespace implementation_defined {
0054 struct alnum_chars_t
0055 {
0056     constexpr
0057     bool
0058     operator()(char c) const noexcept
0059     {
0060         return
0061             (c >= '0' && c <= '9') ||
0062             (c >= 'A' && c <= 'Z') ||
0063             (c >= 'a' && c <= 'z');
0064     }
0065 
0066 #ifdef BOOST_URL_USE_SSE2
0067     char const*
0068     find_if(
0069         char const* first,
0070         char const* last) const noexcept
0071     {
0072         return detail::find_if_pred(
0073             *this, first, last);
0074     }
0075 
0076     char const*
0077     find_if_not(
0078         char const* first,
0079         char const* last) const noexcept
0080     {
0081         return detail::find_if_not_pred(
0082             *this, first, last);
0083     }
0084 #endif
0085 };
0086 } // implementation_defined
0087 
0088 /** The set of letters and digits
0089 
0090     @par Example
0091     Character sets are used with rules and the
0092     functions @ref find_if and @ref find_if_not.
0093     @code
0094     system::result< core::string_view > = parse( "Johnny42", token_rule( alnumchars ) );
0095     @endcode
0096 
0097     @par BNF
0098     @code
0099     ALNUM       = ALPHA / DIGIT
0100 
0101     ALPHA       = %x41-5A / %x61-7A
0102                 ; A-Z / a-z
0103 
0104     DIGIT       = %x30-39
0105                 ; 0-9
0106     @endcode
0107 
0108     @par Specification
0109     @li <a href="https://datatracker.ietf.org/doc/html/rfc5234#appendix-B.1"
0110         >B.1. Core Rules (rfc5234)</a>
0111 
0112     @see
0113         @ref find_if,
0114         @ref find_if_not,
0115         @ref parse,
0116         @ref token_rule.
0117 */
0118 constexpr implementation_defined::alnum_chars_t alnum_chars{};
0119 #endif
0120 
0121 } // grammar
0122 } // urls
0123 } // boost
0124 
0125 #endif