LCOV - code coverage report
Current view: top level - boost/url/grammar/impl - optional_rule.hpp (source / functions) Hit Total Coverage
Test: coverage_filtered.info Lines: 10 10 100.0 %
Date: 2023-12-15 15:31:48 Functions: 12 12 100.0 %

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

Generated by: LCOV version 1.15