LCOV - code coverage report
Current view: top level - libs/url/src/grammar - delim_rule.cpp (source / functions) Hit Total Coverage
Test: coverage_filtered.info Lines: 7 7 100.0 %
Date: 2024-02-29 20:02:55 Functions: 1 1 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_DELIM_RULE_IPP
      11             : #define BOOST_URL_GRAMMAR_IMPL_DELIM_RULE_IPP
      12             : 
      13             : #include <boost/url/detail/config.hpp>
      14             : #include <boost/url/detail/config.hpp>
      15             : #include <boost/url/grammar/delim_rule.hpp>
      16             : 
      17             : namespace boost {
      18             : namespace urls {
      19             : namespace grammar {
      20             : 
      21             : auto
      22        8181 : ch_delim_rule::
      23             : parse(
      24             :     char const*& it,
      25             :     char const* end) const noexcept ->
      26             :         system::result<value_type>
      27             : {
      28        8181 :     if(it == end)
      29             :     {
      30             :         // end
      31        1100 :         BOOST_URL_RETURN_EC(
      32             :             error::need_more);
      33             :     }
      34        7081 :     if(*it != ch_)
      35             :     {
      36             :         // wrong character
      37        2366 :         BOOST_URL_RETURN_EC(
      38             :             error::mismatch);
      39             :     }
      40        4715 :     return core::string_view{
      41        4715 :         it++, 1 };
      42             : };
      43             : 
      44             : } // grammar
      45             : } // urls
      46             : } // boost
      47             : 
      48             : #endif

Generated by: LCOV version 1.15