1  
//
1  
//
2  
// Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
2  
// Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
3  
//
3  
//
4  
// Distributed under the Boost Software License, Version 1.0. (See accompanying
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)
5  
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6  
//
6  
//
7  
// Official repository: https://github.com/boostorg/url
7  
// Official repository: https://github.com/boostorg/url
8  
//
8  
//
9  

9  

10  

10  

11  
#include <boost/url/detail/config.hpp>
11  
#include <boost/url/detail/config.hpp>
12  
#include <boost/url/detail/config.hpp>
12  
#include <boost/url/detail/config.hpp>
13  
#include <boost/url/grammar/delim_rule.hpp>
13  
#include <boost/url/grammar/delim_rule.hpp>
14  

14  

15  
namespace boost {
15  
namespace boost {
16  
namespace urls {
16  
namespace urls {
17  
namespace grammar {
17  
namespace grammar {
18  

18  

19  
auto
19  
auto
20  
implementation_defined::ch_delim_rule::
20  
implementation_defined::ch_delim_rule::
21  
parse(
21  
parse(
22  
    char const*& it,
22  
    char const*& it,
23  
    char const* end) const noexcept ->
23  
    char const* end) const noexcept ->
24  
        system::result<value_type>
24  
        system::result<value_type>
25  
{
25  
{
26  
    if(it == end)
26  
    if(it == end)
27  
    {
27  
    {
28  
        // end
28  
        // end
29  
        BOOST_URL_RETURN_EC(
29  
        BOOST_URL_RETURN_EC(
30  
            error::need_more);
30  
            error::need_more);
31  
    }
31  
    }
32  
    if(*it != ch_)
32  
    if(*it != ch_)
33  
    {
33  
    {
34  
        // wrong character
34  
        // wrong character
35  
        BOOST_URL_RETURN_EC(
35  
        BOOST_URL_RETURN_EC(
36  
            error::mismatch);
36  
            error::mismatch);
37  
    }
37  
    }
38  
    return core::string_view{
38  
    return core::string_view{
39  
        it++, 1 };
39  
        it++, 1 };
40  
};
40  
};
41  

41  

42  
} // grammar
42  
} // grammar
43  
} // urls
43  
} // urls
44  
} // boost
44  
} // boost
45  

45