1  
//
1  
//
2  
// Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
2  
// Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
3  
// Copyright (c) 2022 Alan de Freitas (alandefreitas@gmail.com)
3  
// Copyright (c) 2022 Alan de Freitas (alandefreitas@gmail.com)
4  
//
4  
//
5  
// Distributed under the Boost Software License, Version 1.0. (See accompanying
5  
// Distributed under the Boost Software License, Version 1.0. (See accompanying
6  
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6  
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7  
//
7  
//
8  
// Official repository: https://github.com/boostorg/url
8  
// Official repository: https://github.com/boostorg/url
9  
//
9  
//
10  

10  

11  

11  

12  
#include <boost/url/detail/config.hpp>
12  
#include <boost/url/detail/config.hpp>
13  
#include <boost/url/parse.hpp>
13  
#include <boost/url/parse.hpp>
14  
#include <boost/url/rfc/absolute_uri_rule.hpp>
14  
#include <boost/url/rfc/absolute_uri_rule.hpp>
15  
#include <boost/url/rfc/relative_ref_rule.hpp>
15  
#include <boost/url/rfc/relative_ref_rule.hpp>
16  
#include <boost/url/rfc/uri_rule.hpp>
16  
#include <boost/url/rfc/uri_rule.hpp>
17  
#include <boost/url/rfc/uri_reference_rule.hpp>
17  
#include <boost/url/rfc/uri_reference_rule.hpp>
18  
#include <boost/url/rfc/origin_form_rule.hpp>
18  
#include <boost/url/rfc/origin_form_rule.hpp>
19  
#include <boost/url/grammar/parse.hpp>
19  
#include <boost/url/grammar/parse.hpp>
20  

20  

21  
namespace boost {
21  
namespace boost {
22  
namespace urls {
22  
namespace urls {
23  

23  

24  
system::result<url_view>
24  
system::result<url_view>
25  
parse_absolute_uri(
25  
parse_absolute_uri(
26  
    core::string_view s)
26  
    core::string_view s)
27  
{
27  
{
28  
    return grammar::parse(
28  
    return grammar::parse(
29  
        s, absolute_uri_rule);
29  
        s, absolute_uri_rule);
30  
}
30  
}
31  

31  

32  
system::result<url_view>
32  
system::result<url_view>
33  
parse_origin_form(
33  
parse_origin_form(
34  
    core::string_view s)
34  
    core::string_view s)
35  
{
35  
{
36  
    return grammar::parse(
36  
    return grammar::parse(
37  
        s, origin_form_rule);
37  
        s, origin_form_rule);
38  
}
38  
}
39  

39  

40  
system::result<url_view>
40  
system::result<url_view>
41  
parse_relative_ref(
41  
parse_relative_ref(
42  
    core::string_view s)
42  
    core::string_view s)
43  
{
43  
{
44  
    return grammar::parse(
44  
    return grammar::parse(
45  
        s, relative_ref_rule);
45  
        s, relative_ref_rule);
46  
}
46  
}
47  
system::result<url_view>
47  
system::result<url_view>
48  
parse_uri(
48  
parse_uri(
49  
    core::string_view s)
49  
    core::string_view s)
50  
{
50  
{
51  
    return grammar::parse(
51  
    return grammar::parse(
52  
        s, uri_rule);
52  
        s, uri_rule);
53  
}
53  
}
54  

54  

55  
system::result<url_view>
55  
system::result<url_view>
56  
parse_uri_reference(
56  
parse_uri_reference(
57  
    core::string_view s)
57  
    core::string_view s)
58  
{
58  
{
59  
    return grammar::parse(
59  
    return grammar::parse(
60  
        s, uri_reference_rule);
60  
        s, uri_reference_rule);
61  
}
61  
}
62  

62  

63  
} // urls
63  
} // urls
64  
} // boost
64  
} // boost
65  

65