Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:53:26

0001 //
0002 // Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
0003 // Copyright (c) 2022 Alan de Freitas (alandefreitas@gmail.com)
0004 //
0005 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0006 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0007 //
0008 // Official repository: https://github.com/boostorg/url
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     // begin
0042     segments_iter_impl(
0043         detail::path_ref const&) noexcept;
0044 
0045     // end
0046     segments_iter_impl(
0047         detail::path_ref const&,
0048         int) noexcept;
0049 
0050     // at index
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 } // detail
0082 } // urls
0083 } // boost
0084 
0085 #endif