include/boost/url/grammar/impl/delim_rule.hpp
100.0% Lines (7/7)
100.0% Functions (1/1)
100.0% Branches (4/4)
include/boost/url/grammar/impl/delim_rule.hpp
| Line | Branch | Hits | Source Code |
|---|---|---|---|
| 1 | // | ||
| 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) | ||
| 3 | // Copyright (c) 2023 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/url | ||
| 9 | // | ||
| 10 | |||
| 11 | #ifndef BOOST_URL_GRAMMAR_IMPL_DELIM_RULE_HPP | ||
| 12 | #define BOOST_URL_GRAMMAR_IMPL_DELIM_RULE_HPP | ||
| 13 | |||
| 14 | #include <boost/url/detail/config.hpp> | ||
| 15 | |||
| 16 | namespace boost { | ||
| 17 | namespace urls { | ||
| 18 | namespace grammar { | ||
| 19 | |||
| 20 | inline BOOST_URL_CXX20_CONSTEXPR | ||
| 21 | auto | ||
| 22 | 8934 | implementation_defined::ch_delim_rule:: | |
| 23 | parse( | ||
| 24 | char const*& it, | ||
| 25 | char const* end) const noexcept -> | ||
| 26 | system::result<value_type> | ||
| 27 | { | ||
| 28 |
2/2✓ Branch 0 taken 1183 times.
✓ Branch 1 taken 7751 times.
|
8934 | if(it == end) |
| 29 | { | ||
| 30 | 1183 | BOOST_URL_CONSTEXPR_RETURN_EC( | |
| 31 | error::need_more); | ||
| 32 | } | ||
| 33 |
2/2✓ Branch 0 taken 2676 times.
✓ Branch 1 taken 5075 times.
|
7751 | if(*it != ch_) |
| 34 | { | ||
| 35 | 2676 | BOOST_URL_CONSTEXPR_RETURN_EC( | |
| 36 | error::mismatch); | ||
| 37 | } | ||
| 38 | 5075 | return core::string_view{ | |
| 39 | 5075 | it++, 1 }; | |
| 40 | } | ||
| 41 | |||
| 42 | } // grammar | ||
| 43 | } // urls | ||
| 44 | } // boost | ||
| 45 | |||
| 46 | #endif | ||
| 47 |