include/boost/url/grammar/impl/token_rule.hpp
83.3% Lines (60/72)
100.0% List of functions (7/8)
Functions (8)
Function
Calls
Lines
Blocks
<unknown function 23>
:23
–
–
–
boost::urls::grammar::implementation_defined::token_rule_t<boost::urls::grammar::implementation_defined::alnum_chars_t>::parse(char const*&, char const*) const
:23
1x
77.8%
50.0%
boost::urls::grammar::implementation_defined::token_rule_t<boost::urls::grammar::implementation_defined::alpha_chars_t>::parse(char const*&, char const*) const
:23
82x
100.0%
100.0%
boost::urls::grammar::implementation_defined::token_rule_t<boost::urls::grammar::implementation_defined::charset_ref<boost::urls::grammar::implementation_defined::alpha_chars_t> >::parse(char const*&, char const*) const
:23
1x
77.8%
50.0%
boost::urls::grammar::implementation_defined::token_rule_t<boost::urls::grammar::implementation_defined::digit_chars_t>::parse(char const*&, char const*) const
:23
3x
77.8%
50.0%
boost::urls::grammar::implementation_defined::token_rule_t<boost::urls::grammar::implementation_defined::hexdig_chars_t>::parse(char const*&, char const*) const
:23
1x
77.8%
50.0%
boost::urls::grammar::implementation_defined::token_rule_t<boost::urls::grammar::implementation_defined::vchars_t>::parse(char const*&, char const*) const
:23
1x
77.8%
50.0%
boost::urls::grammar::implementation_defined::token_rule_t<boost::urls::grammar::lut_chars>::parse(char const*&, char const*) const
:23
509x
88.9%
75.0%
| Line | TLA | Hits | Source Code |
|---|---|---|---|
| 1 | // | ||
| 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) | ||
| 3 | // Copyright (c) 2022 Alan de Freitas (alandefreitas@gmail.com) | ||
| 4 | // | ||
| 5 | // Distributed under the Boost Software License, Version 1.0. (See accompanying | ||
| 6 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
| 7 | // | ||
| 8 | // Official repository: https://github.com/boostorg/http_proto | ||
| 9 | // | ||
| 10 | |||
| 11 | #ifndef BOOST_URL_IMPL_GRAMMAR_TOKEN_RULE_HPP | ||
| 12 | #define BOOST_URL_IMPL_GRAMMAR_TOKEN_RULE_HPP | ||
| 13 | |||
| 14 | #include <boost/url/grammar/error.hpp> | ||
| 15 | |||
| 16 | namespace boost { | ||
| 17 | namespace urls { | ||
| 18 | namespace grammar { | ||
| 19 | |||
| 20 | template<class CharSet> | ||
| 21 | BOOST_URL_CXX20_CONSTEXPR | ||
| 22 | auto | ||
| 23 | 678x | implementation_defined::token_rule_t<CharSet>:: | |
| 24 | parse( | ||
| 25 | char const*& it, | ||
| 26 | char const* end | ||
| 27 | ) const noexcept -> | ||
| 28 | system::result<value_type> | ||
| 29 | { | ||
| 30 | 678x | auto const it0 = it; | |
| 31 | 678x | if(it == end) | |
| 32 | { | ||
| 33 | 6x | BOOST_URL_CONSTEXPR_RETURN_EC( | |
| 34 | error::need_more); | ||
| 35 | } | ||
| 36 | 672x | auto const& cs = this->get(); | |
| 37 | 672x | it = grammar::find_if_not(it, end, cs); | |
| 38 | 672x | if(it != it0) | |
| 39 | 607x | return core::string_view(it0, it - it0); | |
| 40 | 65x | BOOST_URL_CONSTEXPR_RETURN_EC( | |
| 41 | error::mismatch); | ||
| 42 | } | ||
| 43 | |||
| 44 | } // grammar | ||
| 45 | } // urls | ||
| 46 | } // boost | ||
| 47 | |||
| 48 | #endif | ||
| 49 |