100.00% Lines (8/8) 100.00% Functions (3/3)
TLA Baseline Branch
Line Hits Code Line Hits Code
1   // 1   //
2   // Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com) 2   // Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
3   // 3   //
4   // Distributed under the Boost Software License, Version 1.0. (See accompanying 4   // Distributed under the Boost Software License, Version 1.0. (See accompanying
5   // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5   // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6   // 6   //
7   // Official repository: https://github.com/boostorg/url 7   // Official repository: https://github.com/boostorg/url
8   // 8   //
9   9  
10   #ifndef BOOST_URL_DETAIL_PARAMS_ITER_IMPL_HPP 10   #ifndef BOOST_URL_DETAIL_PARAMS_ITER_IMPL_HPP
11   #define BOOST_URL_DETAIL_PARAMS_ITER_IMPL_HPP 11   #define BOOST_URL_DETAIL_PARAMS_ITER_IMPL_HPP
12   12  
13   #include <boost/url/param.hpp> 13   #include <boost/url/param.hpp>
14   #include <boost/url/detail/parts_base.hpp> 14   #include <boost/url/detail/parts_base.hpp>
15   #include <boost/url/detail/url_impl.hpp> 15   #include <boost/url/detail/url_impl.hpp>
16   #include <boost/assert.hpp> 16   #include <boost/assert.hpp>
17   17  
18   namespace boost { 18   namespace boost {
19   namespace urls { 19   namespace urls {
20   namespace detail { 20   namespace detail {
21   21  
22   struct BOOST_SYMBOL_VISIBLE params_iter_impl 22   struct BOOST_SYMBOL_VISIBLE params_iter_impl
23   : parts_base 23   : parts_base
24   { 24   {
25   query_ref ref; 25   query_ref ref;
26   std::size_t index = 0; 26   std::size_t index = 0;
27   std::size_t pos; 27   std::size_t pos;
28   std::size_t nk; 28   std::size_t nk;
29   std::size_t nv; 29   std::size_t nv;
30   std::size_t dk; 30   std::size_t dk;
31   std::size_t dv; 31   std::size_t dv;
32   32  
HITCBC 33   8 params_iter_impl() = default; 33   8 params_iter_impl() = default;
34   params_iter_impl( 34   params_iter_impl(
35   params_iter_impl const&) = default; 35   params_iter_impl const&) = default;
36   params_iter_impl& operator=( 36   params_iter_impl& operator=(
37   params_iter_impl const&) = default; 37   params_iter_impl const&) = default;
38   38  
39   // begin 39   // begin
40   params_iter_impl( 40   params_iter_impl(
41   query_ref const&) noexcept; 41   query_ref const&) noexcept;
42   42  
43   // end 43   // end
44   params_iter_impl( 44   params_iter_impl(
45   query_ref const&, 45   query_ref const&,
46   int) noexcept; 46   int) noexcept;
47   47  
48   // at index 48   // at index
49   params_iter_impl( 49   params_iter_impl(
50   query_ref const&, 50   query_ref const&,
51   std::size_t, 51   std::size_t,
52   std::size_t) noexcept; 52   std::size_t) noexcept;
53   void setup() noexcept; 53   void setup() noexcept;
54   void increment() noexcept; 54   void increment() noexcept;
55   void decrement() noexcept; 55   void decrement() noexcept;
56   param_pct_view 56   param_pct_view
57   dereference() const noexcept; 57   dereference() const noexcept;
58   pct_string_view key() const noexcept; 58   pct_string_view key() const noexcept;
59   59  
60   auto 60   auto
HITCBC 61   17 next() const noexcept -> 61   17 next() const noexcept ->
62   params_iter_impl 62   params_iter_impl
63   { 63   {
HITCBC 64   17 auto next = *this; 64   17 auto next = *this;
HITCBC 65   17 next.increment(); 65   17 next.increment();
HITCBC 66   17 return next; 66   17 return next;
67   } 67   }
68   68  
69   bool 69   bool
HITCBC 70   13890 equal( 70   13895 equal(
71   params_iter_impl const& 71   params_iter_impl const&
72   other) const noexcept 72   other) const noexcept
73   { 73   {
74   // different containers 74   // different containers
HITCBC 75   13890 BOOST_ASSERT(ref.alias_of(other.ref)); 75   13895 BOOST_ASSERT(ref.alias_of(other.ref));
HITCBC 76   13890 return index == other.index; 76   13895 return index == other.index;
77   } 77   }
78   }; 78   };
79   79  
80   } // detail 80   } // detail
81   } // urls 81   } // urls
82   } // boost 82   } // boost
83   83  
84   #include <boost/url/detail/impl/params_iter_impl.hpp> 84   #include <boost/url/detail/impl/params_iter_impl.hpp>
85   85  
86   #endif 86   #endif