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  
#ifndef BOOST_URL_IMPL_SEGMENTS_ENCODED_VIEW_HPP
11  
#ifndef BOOST_URL_IMPL_SEGMENTS_ENCODED_VIEW_HPP
12  
#define BOOST_URL_IMPL_SEGMENTS_ENCODED_VIEW_HPP
12  
#define BOOST_URL_IMPL_SEGMENTS_ENCODED_VIEW_HPP
13  

13  

14  
#include <boost/url/detail/segments_range.hpp>
14  
#include <boost/url/detail/segments_range.hpp>
15  

15  

16  
namespace boost {
16  
namespace boost {
17  
namespace urls {
17  
namespace urls {
18  

18  

19  
inline
19  
inline
20  
segments_encoded_view::
20  
segments_encoded_view::
21  
segments_encoded_view() noexcept = default;
21  
segments_encoded_view() noexcept = default;
22  

22  

23  
inline
23  
inline
24  
segments_encoded_view::
24  
segments_encoded_view::
25  
segments_encoded_view(
25  
segments_encoded_view(
26  
    detail::path_ref const& ref) noexcept
26  
    detail::path_ref const& ref) noexcept
27  
    : segments_encoded_base(ref)
27  
    : segments_encoded_base(ref)
28  
{
28  
{
29  
}
29  
}
30  

30  

31  
inline
31  
inline
32  
segments_encoded_view::
32  
segments_encoded_view::
33  
segments_encoded_view(
33  
segments_encoded_view(
34  
    core::string_view s)
34  
    core::string_view s)
35  
    : segments_encoded_view(
35  
    : segments_encoded_view(
36  
        parse_path(s).value(
36  
        parse_path(s).value(
37  
            BOOST_URL_POS))
37  
            BOOST_URL_POS))
38  
{
38  
{
39  
}
39  
}
40  

40  

41  
inline
41  
inline
42  
segments_encoded_view::
42  
segments_encoded_view::
43  
segments_encoded_view(iterator first, iterator last) noexcept
43  
segments_encoded_view(iterator first, iterator last) noexcept
44  
    : segments_encoded_base(detail::make_subref(first, last))
44  
    : segments_encoded_base(detail::make_subref(first, last))
45  
{
45  
{
46  
}
46  
}
47  

47  

48  
inline
48  
inline
49  
segments_encoded_view::
49  
segments_encoded_view::
50  
operator
50  
operator
51  
segments_view() const noexcept
51  
segments_view() const noexcept
52  
{
52  
{
53  
    return { ref_ };
53  
    return { ref_ };
54  
}
54  
}
55  

55  

56  
} // urls
56  
} // urls
57  
} // boost
57  
} // boost
58  

58  

59  
#endif
59  
#endif