Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-15 08:53:57

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/url
0008 //
0009 
0010 #ifndef BOOST_URL_GRAMMAR_IMPL_NOT_EMPTY_RULE_HPP
0011 #define BOOST_URL_GRAMMAR_IMPL_NOT_EMPTY_RULE_HPP
0012 
0013 #include <boost/url/grammar/error.hpp>
0014 #include <boost/url/grammar/parse.hpp>
0015 
0016 namespace boost {
0017 namespace urls {
0018 namespace grammar {
0019 
0020 namespace implementation_defined {
0021 template<class R>
0022 auto
0023 not_empty_rule_t<R>::
0024 parse(
0025     char const*& it,
0026     char const* end) const ->
0027         system::result<value_type>
0028 {
0029     if(it == end)
0030     {
0031         // empty
0032         BOOST_URL_RETURN_EC(
0033             error::mismatch);
0034     }
0035     auto const it0 = it;
0036     auto rv = r_.parse(it, end);
0037     if(  !rv )
0038     {
0039         // error
0040         return rv;
0041     }
0042     if(it == it0)
0043     {
0044         // empty
0045         BOOST_URL_RETURN_EC(
0046             error::mismatch);
0047     }
0048     // value
0049     return rv;
0050 }
0051 }
0052 
0053 } // grammar
0054 } // urls
0055 } // boost
0056 
0057 #endif