Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:53:27

0001 //
0002 // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
0003 //
0004 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0005 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 //
0007 // Official repository: https://github.com/boostorg/http_proto
0008 //
0009 
0010 #ifndef BOOST_URL_IMPL_GRAMMAR_TOKEN_RULE_HPP
0011 #define BOOST_URL_IMPL_GRAMMAR_TOKEN_RULE_HPP
0012 
0013 #include <boost/url/grammar/error.hpp>
0014 
0015 namespace boost {
0016 namespace urls {
0017 namespace grammar {
0018 
0019 template<class CharSet>
0020 auto
0021 token_rule_t<CharSet>::
0022 parse(
0023     char const*& it,
0024     char const* end
0025         ) const noexcept ->
0026     system::result<value_type>
0027 {
0028     auto const it0 = it;
0029     if(it == end)
0030     {
0031         BOOST_URL_RETURN_EC(
0032             error::need_more);
0033     }
0034     it = (find_if_not)(it, end, cs_);
0035     if(it != it0)
0036         return core::string_view(it0, it - it0);
0037     BOOST_URL_RETURN_EC(
0038         error::mismatch);
0039 }
0040 
0041 } // grammar
0042 } // urls
0043 } // boost
0044 
0045 #endif