GCC Code Coverage Report


Directory: libs/url/
File: boost/url/detail/params_iter_impl.hpp
Date: 2024-02-29 20:02:56
Exec Total Coverage
Lines: 8 8 100.0%
Functions: 3 3 100.0%
Branches: 1 2 50.0%

Line Branch Exec Source
1 //
2 // Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
3 //
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)
6 //
7 // Official repository: https://github.com/boostorg/url
8 //
9
10 #ifndef BOOST_URL_DETAIL_PARAMS_ITER_IMPL_HPP
11 #define BOOST_URL_DETAIL_PARAMS_ITER_IMPL_HPP
12
13 #include <boost/url/param.hpp>
14 #include <boost/url/detail/parts_base.hpp>
15 #include <boost/url/detail/url_impl.hpp>
16 #include <boost/assert.hpp>
17
18 namespace boost {
19 namespace urls {
20 namespace detail {
21
22 struct BOOST_URL_DECL params_iter_impl
23 : parts_base
24 {
25 query_ref ref;
26 std::size_t index = 0;
27 std::size_t pos;
28 std::size_t nk;
29 std::size_t nv;
30 std::size_t dk;
31 std::size_t dv;
32
33 8 params_iter_impl() = default;
34 params_iter_impl(
35 params_iter_impl const&) = default;
36 params_iter_impl& operator=(
37 params_iter_impl const&) = default;
38
39 // begin
40 params_iter_impl(
41 query_ref const&) noexcept;
42
43 // end
44 params_iter_impl(
45 query_ref const&,
46 int) noexcept;
47
48 // at index
49 params_iter_impl(
50 query_ref const&,
51 std::size_t,
52 std::size_t) noexcept;
53 void setup() noexcept;
54 void increment() noexcept;
55 void decrement() noexcept;
56 param_pct_view
57 dereference() const noexcept;
58 pct_string_view key() const noexcept;
59
60 auto
61 17 next() const noexcept ->
62 params_iter_impl
63 {
64 17 auto next = *this;
65 17 next.increment();
66 17 return next;
67 }
68
69 bool
70 2447 equal(
71 params_iter_impl const&
72 other) const noexcept
73 {
74 // different containers
75
1/2
✗ Branch 1 not taken.
✓ Branch 2 taken 2447 times.
2447 BOOST_ASSERT(ref.alias_of(other.ref));
76 2447 return index == other.index;
77 }
78 };
79
80 } // detail
81 } // urls
82 } // boost
83
84 #endif
85