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 //
0004 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0005 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 //
0007 // Official repository: https://github.com/boostorg/url
0008 //
0009 
0010 #ifndef BOOST_URL_DETAIL_PARAMS_ITER_IMPL_HPP
0011 #define BOOST_URL_DETAIL_PARAMS_ITER_IMPL_HPP
0012 
0013 #include <boost/url/param.hpp>
0014 #include <boost/url/detail/parts_base.hpp>
0015 #include <boost/url/detail/url_impl.hpp>
0016 #include <boost/assert.hpp>
0017 
0018 namespace boost {
0019 namespace urls {
0020 namespace detail {
0021 
0022 struct BOOST_URL_DECL params_iter_impl
0023     : parts_base
0024 {
0025     query_ref ref;
0026     std::size_t index = 0;
0027     std::size_t pos;
0028     std::size_t nk;
0029     std::size_t nv;
0030     std::size_t dk;
0031     std::size_t dv;
0032 
0033     params_iter_impl() = default;
0034     params_iter_impl(
0035         params_iter_impl const&) = default;
0036     params_iter_impl& operator=(
0037         params_iter_impl const&) = default;
0038 
0039     // begin
0040     params_iter_impl(
0041         query_ref const&) noexcept;
0042 
0043     // end
0044     params_iter_impl(
0045         query_ref const&,
0046         int) noexcept;
0047 
0048     // at index
0049     params_iter_impl(
0050         query_ref const&,
0051         std::size_t,
0052         std::size_t) noexcept;
0053     void setup() noexcept;
0054     void increment() noexcept;
0055     void decrement() noexcept;
0056     param_pct_view
0057         dereference() const noexcept;
0058     pct_string_view key() const noexcept;
0059 
0060     auto
0061     next() const noexcept ->
0062         params_iter_impl
0063     {
0064         auto next = *this;
0065         next.increment();
0066         return next;
0067     }
0068 
0069     bool
0070     equal(
0071         params_iter_impl const&
0072             other) const noexcept
0073     {
0074         // different containers
0075         BOOST_ASSERT(ref.alias_of(other.ref));
0076         return index == other.index;
0077     }
0078 };
0079 
0080 } // detail
0081 } // urls
0082 } // boost
0083 
0084 #endif