ext-boost/boost/url/grammar/all_chars.hpp

89 lines
1.7 KiB
C++
Raw Normal View History

2023-05-22 18:45:02 +10:00
//
// Copyright (c) 2021 Vinnie Falco (vinnie dot falco at gmail dot 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_GRAMMAR_ALL_CHARS_HPP
#define BOOST_URL_GRAMMAR_ALL_CHARS_HPP
#include <boost/url/detail/config.hpp>
#include <boost/url/grammar/detail/charset.hpp>
namespace boost {
namespace urls {
namespace grammar {
/** The set of all characters
@par Example
Character sets are used with rules and the
functions @ref find_if and @ref find_if_not.
@code
2023-11-04 21:30:42 +02:00
system::result< core::string_view > rv = parse( "JohnDoe", token_rule( all_chars ) );
2023-05-22 18:45:02 +10:00
@endcode
@par BNF
@code
ALL = %x00-FF
@endcode
@see
@ref find_if,
@ref find_if_not,
@ref parse,
@ref token_rule.
*/
#ifdef BOOST_URL_DOCS
constexpr __implementation_defined__ all_chars;
#else
struct all_chars_t
{
constexpr
all_chars_t() noexcept = default;
constexpr
bool
operator()(char) const noexcept
{
return true;
}
#ifdef BOOST_URL_USE_SSE2
char const*
find_if(
char const* first,
char const* last) const noexcept
{
return detail::find_if_pred(
*this, first, last);
}
char const*
find_if_not(
char const* first,
char const* last) const noexcept
{
return detail::find_if_not_pred(
*this, first, last);
}
#endif
};
/** A character set containing all characters.
@see
@ref all_chars_t
*/
constexpr all_chars_t all_chars{};
#endif
} // grammar
} // urls
} // boost
#endif