GCC Code Coverage Report


Directory: libs/url/
File: boost/url/grammar/impl/optional_rule.hpp
Date: 2024-03-13 19:32:03
Exec Total Coverage
Lines: 10 10 100.0%
Functions: 3 4 75.0%
Branches: 5 8 62.5%

Line Branch Exec Source
1 //
2 // Copyright (c) 2016-2019 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_IMPL_OPTIONAL_RULE_HPP
11 #define BOOST_URL_GRAMMAR_IMPL_OPTIONAL_RULE_HPP
12
13 #include <boost/url/grammar/error.hpp>
14
15 namespace boost {
16 namespace urls {
17 namespace grammar {
18
19 template<class R>
20 auto
21 3968 optional_rule_t<R>::
22 parse(
23 char const*& it,
24 char const* end) const ->
25 system::result<value_type>
26 {
27
2/2
✓ Branch 0 taken 87 times.
✓ Branch 1 taken 1812 times.
3968 if(it == end)
28 255 return boost::none;
29 3713 auto const it0 = it;
30
0/2
✗ Branch 1 not taken.
✗ Branch 2 not taken.
3713 auto rv =
31 3713 this->get().parse(it, end);
32
2/2
✓ Branch 1 taken 383 times.
✓ Branch 2 taken 1429 times.
3713 if(rv)
33
1/2
✓ Branch 2 taken 383 times.
✗ Branch 3 not taken.
1537 return value_type(*rv);
34 2176 it = it0;
35 2176 return boost::none;
36 }
37
38 } // grammar
39 } // urls
40 } // boost
41
42 #endif
43