LCOV - code coverage report
Current view: top level - boost/url/grammar/impl/optional_rule.hpp (source / functions) Coverage Total Hit
Test: coverage_filtered.info Lines: 100.0 % 9 9
Test Date: 2024-09-08 09:46:47 Functions: 100.0 % 12 12

            Line data    Source code
       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         3976 : implementation_defined::optional_rule_t<R>::
      22              : parse(
      23              :     char const*& it,
      24              :     char const* end) const ->
      25              :         system::result<value_type>
      26              : {
      27         3976 :     if(it == end)
      28          256 :         return boost::none;
      29         3720 :     auto const it0 = it;
      30              :     auto rv =
      31         3720 :         this->get().parse(it, end);
      32         3720 :     if(rv)
      33         1538 :         return value_type(*rv);
      34         2182 :     it = it0;
      35         2182 :     return boost::none;
      36              : }
      37              : 
      38              : } // grammar
      39              : } // urls
      40              : } // boost
      41              : 
      42              : #endif
        

Generated by: LCOV version 2.1