Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 08:52:40

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_ALPHA_CHARS_HPP
0011 #define BOOST_URL_GRAMMAR_ALPHA_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 all letters
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 > rv = parse( "JohnDoe", token_rule( alpha_chars ) );
0027     @endcode
0028 
0029     @par BNF
0030     @code
0031     ALPHA       = %x41-5A / %x61-7A
0032                 ; A-Z / a-z
0033     @endcode
0034 
0035     @par Specification
0036     @li <a href="https://datatracker.ietf.org/doc/html/rfc5234#appendix-B.1"
0037         >B.1. Core Rules (rfc5234)</a>
0038 
0039     @see
0040         @ref find_if,
0041         @ref find_if_not,
0042         @ref parse,
0043         @ref token_rule.
0044 */
0045 #ifdef BOOST_URL_DOCS
0046 constexpr __implementation_defined__ alpha_chars;
0047 #else
0048 namespace implementation_defined {
0049 struct alpha_chars_t
0050 {
0051     constexpr
0052     alpha_chars_t() noexcept = default;
0053 
0054     constexpr
0055     bool
0056     operator()(char c) const noexcept
0057     {
0058         return
0059             (c >= 'A' && c <= 'Z') ||
0060             (c >= 'a' && c <= 'z');
0061     }
0062 
0063 #ifdef BOOST_URL_USE_SSE2
0064     char const*
0065     find_if(
0066         char const* first,
0067         char const* last) const noexcept
0068     {
0069         return detail::find_if_pred(
0070             *this, first, last);
0071     }
0072 
0073     char const*
0074     find_if_not(
0075         char const* first,
0076         char const* last) const noexcept
0077     {
0078         return detail::find_if_not_pred(
0079             *this, first, last);
0080     }
0081 #endif
0082 };
0083 } // implementation_defined
0084 
0085 /** The set of all letters
0086 
0087     @par Example
0088     Character sets are used with rules and the
0089     functions @ref find_if and @ref find_if_not.
0090     @code
0091     system::result< core::string_view > rv = parse( "JohnDoe", token_rule( alpha_chars ) );
0092     @endcode
0093 
0094     @par BNF
0095     @code
0096     ALPHA       = %x41-5A / %x61-7A
0097                 ; A-Z / a-z
0098     @endcode
0099 
0100     @par Specification
0101     @li <a href="https://datatracker.ietf.org/doc/html/rfc5234#appendix-B.1"
0102         >B.1. Core Rules (rfc5234)</a>
0103 
0104     @see
0105         @ref find_if,
0106         @ref find_if_not,
0107         @ref parse,
0108         @ref token_rule.
0109 */
0110 constexpr implementation_defined::alpha_chars_t alpha_chars{};
0111 #endif
0112 
0113 } // grammar
0114 } // urls
0115 } // boost
0116 
0117 #endif