GCC Code Coverage Report


Directory: libs/url/
File: include/boost/url/grammar/vchars.hpp
Date: 2025-11-10 19:06:22
Exec Total Coverage
Lines: 5 5 100.0%
Functions: 2 2 100.0%
Branches: 2 4 50.0%

Line Branch Exec Source
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_VCHARS_HPP
11 #define BOOST_URL_GRAMMAR_VCHARS_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 vchars_t
21 {
22 constexpr
23 bool
24 7 operator()(char c) const noexcept
25 {
26
2/4
✓ Branch 0 taken 7 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 7 times.
✗ Branch 3 not taken.
7 return c >= 0x21 && c <= 0x7e;
27 }
28
29 #ifdef BOOST_URL_USE_SSE2
30 char const*
31 find_if(
32 char const* first,
33 char const* last) const noexcept
34 {
35 return detail::find_if_pred(
36 *this, first, last);
37 }
38
39 char const*
40 1 find_if_not(
41 char const* first,
42 char const* last) const noexcept
43 {
44 1 return detail::find_if_not_pred(
45 1 *this, first, last);
46 }
47 #endif
48 };
49 } // implementation_defined
50
51 /** The set of visible characters
52
53 @par Example
54 Character sets are used with rules and the
55 functions @ref find_if and @ref find_if_not.
56 @code
57 system::result< core::string_view > rv = parse( "JohnDoe", token_rule( vchars ) );
58 @endcode
59
60 @par BNF
61 @code
62 VCHAR = 0x21-0x7E
63 ; visible (printing) characters
64 @endcode
65
66 @par Specification
67 @li <a href="https://datatracker.ietf.org/doc/html/rfc5234#appendix-B.1"
68 >B.1. Core Rules (rfc5234)</a>
69
70 @see
71 @ref find_if,
72 @ref find_if_not,
73 @ref parse,
74 @ref token_rule.
75 */
76 constexpr implementation_defined::vchars_t vchars{};
77
78 } // grammar
79 } // urls
80 } // boost
81
82 #endif
83