LCOV - code coverage report
Current view: top level - url/grammar - alnum_chars.hpp (source / functions) Coverage Total Hit
Test: coverage_remapped.info Lines: 100.0 % 10 10
Test Date: 2026-02-25 21:00:01 Functions: 100.0 % 3 3

           TLA  Line data    Source code
       1                 : //
       2                 : // Copyright (c) 2021 Vinnie Falco (vinnie dot falco at gmail dot com)
       3                 : //
       4                 : // Distributed under the Boost Software License, Version 1.0. (See accompanying
       5                 : // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
       6                 : //
       7                 : // Official repository: https://github.com/boostorg/url
       8                 : //
       9                 : 
      10                 : #ifndef BOOST_URL_GRAMMAR_ALNUM_CHARS_HPP
      11                 : #define BOOST_URL_GRAMMAR_ALNUM_CHARS_HPP
      12                 : 
      13                 : #include <boost/url/detail/config.hpp>
      14                 : #include <boost/url/grammar/detail/charset.hpp>
      15                 : 
      16                 : namespace boost {
      17                 : namespace urls {
      18                 : namespace grammar {
      19                 : namespace implementation_defined {
      20                 : struct alnum_chars_t
      21                 : {
      22                 :     constexpr
      23                 :     bool
      24 HIT        5496 :     operator()(char c) const noexcept
      25                 :     {
      26                 :         return
      27            5496 :             (c >= '0' && c <= '9') ||
      28           12028 :             (c >= 'A' && c <= 'Z') ||
      29            6532 :             (c >= 'a' && c <= 'z');
      30                 :     }
      31                 : 
      32                 : #ifdef BOOST_URL_USE_SSE2
      33                 :     char const*
      34             256 :     find_if(
      35                 :         char const* first,
      36                 :         char const* last) const noexcept
      37                 :     {
      38             256 :         return detail::find_if_pred(
      39             256 :             *this, first, last);
      40                 :     }
      41                 : 
      42                 :     char const*
      43             269 :     find_if_not(
      44                 :         char const* first,
      45                 :         char const* last) const noexcept
      46                 :     {
      47             269 :         return detail::find_if_not_pred(
      48             269 :             *this, first, last);
      49                 :     }
      50                 : #endif
      51                 : };
      52                 : } // implementation_defined
      53                 : 
      54                 : /** The set of letters and digits
      55                 : 
      56                 :     @par Example
      57                 :     Character sets are used with rules and the
      58                 :     functions @ref find_if and @ref find_if_not.
      59                 :     @code
      60                 :     system::result< core::string_view > = parse( "Johnny42", token_rule( alnumchars ) );
      61                 :     @endcode
      62                 : 
      63                 :     @par BNF
      64                 :     @code
      65                 :     ALNUM       = ALPHA / DIGIT
      66                 : 
      67                 :     ALPHA       = %x41-5A / %x61-7A
      68                 :                 ; A-Z / a-z
      69                 : 
      70                 :     DIGIT       = %x30-39
      71                 :                 ; 0-9
      72                 :     @endcode
      73                 : 
      74                 :     @par Specification
      75                 :     @li <a href="https://datatracker.ietf.org/doc/html/rfc5234#appendix-B.1"
      76                 :         >B.1. Core Rules (rfc5234)</a>
      77                 : 
      78                 :     @see
      79                 :         @ref find_if,
      80                 :         @ref find_if_not,
      81                 :         @ref parse,
      82                 :         @ref token_rule.
      83                 : */
      84                 : constexpr implementation_defined::alnum_chars_t alnum_chars{};
      85                 : 
      86                 : } // grammar
      87                 : } // urls
      88                 : } // boost
      89                 : 
      90                 : #endif
        

Generated by: LCOV version 2.3