Back to home page

EIC code displayed by LXR

 
 

    


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

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_ALL_CHARS_HPP
0011 #define BOOST_URL_GRAMMAR_ALL_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 characters
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( all_chars ) );
0027     @endcode
0028 
0029     @par BNF
0030     @code
0031     ALL       = %x00-FF
0032     @endcode
0033 
0034     @see
0035         @ref find_if,
0036         @ref find_if_not,
0037         @ref parse,
0038         @ref token_rule.
0039 */
0040 #ifdef BOOST_URL_DOCS
0041 constexpr __implementation_defined__ all_chars;
0042 #else
0043 struct all_chars_t
0044 {
0045     constexpr
0046     all_chars_t() noexcept = default;
0047 
0048     constexpr
0049     bool
0050     operator()(char) const noexcept
0051     {
0052         return true;
0053     }
0054 
0055 #ifdef BOOST_URL_USE_SSE2
0056     char const*
0057     find_if(
0058         char const* first,
0059         char const* last) const noexcept
0060     {
0061         return detail::find_if_pred(
0062             *this, first, last);
0063     }
0064 
0065     char const*
0066     find_if_not(
0067         char const* first,
0068         char const* last) const noexcept
0069     {
0070         return detail::find_if_not_pred(
0071             *this, first, last);
0072     }
0073 #endif
0074 };
0075 
0076 /** A character set containing all characters.
0077 
0078     @see
0079         @ref all_chars_t
0080 */
0081 constexpr all_chars_t all_chars{};
0082 #endif
0083 
0084 } // grammar
0085 } // urls
0086 } // boost
0087 
0088 #endif