File indexing completed on 2025-01-18 09:53:26
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_URL_DETAIL_SEGMENTS_ITER_IMPL_HPP
0012 #define BOOST_URL_DETAIL_SEGMENTS_ITER_IMPL_HPP
0013
0014 #include <boost/url/detail/parts_base.hpp>
0015 #include <boost/url/detail/url_impl.hpp>
0016 #include <boost/core/detail/string_view.hpp>
0017 #include <string>
0018
0019 namespace boost {
0020 namespace urls {
0021 namespace detail {
0022
0023 struct segments_iter_impl
0024 : private parts_base
0025 {
0026 path_ref ref;
0027 std::size_t pos = 0;
0028 std::size_t next = 0;
0029 std::size_t index = 0;
0030 std::size_t dn = 0;
0031 private:
0032 pct_string_view s_;
0033 public:
0034
0035 segments_iter_impl() = default;
0036 segments_iter_impl(
0037 segments_iter_impl const&) noexcept = default;
0038 segments_iter_impl& operator=(
0039 segments_iter_impl const&) noexcept = default;
0040
0041
0042 segments_iter_impl(
0043 detail::path_ref const&) noexcept;
0044
0045
0046 segments_iter_impl(
0047 detail::path_ref const&,
0048 int) noexcept;
0049
0050
0051 segments_iter_impl(
0052 url_impl const& u_,
0053 std::size_t pos_,
0054 std::size_t i_) noexcept;
0055
0056 void update() noexcept;
0057
0058 BOOST_URL_DECL
0059 void
0060 increment() noexcept;
0061
0062 BOOST_URL_DECL
0063 void
0064 decrement() noexcept;
0065
0066 pct_string_view
0067 dereference() const noexcept
0068 {
0069 return s_;
0070 }
0071
0072 bool
0073 equal(
0074 segments_iter_impl const& other) const noexcept
0075 {
0076 BOOST_ASSERT(ref.alias_of(other.ref));
0077 return index == other.index;
0078 }
0079 };
0080
0081 }
0082 }
0083 }
0084
0085 #endif