GCC Code Coverage Report


Directory: ./
File: libs/url/example/router/detail/router.hpp
Date: 2026-01-20 17:25:06
Exec Total Coverage
Lines: 1 1 100.0%
Functions: 1 1 100.0%
Branches: 0 0 -%

Line Branch Exec Source
1 //
2 // Copyright (c) 2022 Alan de Freitas (alandefreitas@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_ROUTER_HPP
11 #define BOOST_URL_DETAIL_ROUTER_HPP
12
13 #include <boost/url/pct_string_view.hpp>
14 #include <boost/url/segments_encoded_view.hpp>
15 #include <boost/url/grammar/delim_rule.hpp>
16 #include <boost/url/grammar/optional_rule.hpp>
17 #include <boost/url/grammar/range_rule.hpp>
18 #include <boost/url/grammar/tuple_rule.hpp>
19 #include <string>
20
21 namespace boost {
22 namespace urls {
23 namespace detail {
24
25 class router_base
26 {
27 void* impl_{nullptr};
28
29 public:
30 // A type-erased router resource
31 struct any_resource
32 {
33 226 virtual ~any_resource() = default;
34 virtual void const* get() const noexcept = 0;
35 };
36
37 protected:
38 router_base();
39
40 virtual ~router_base();
41
42 router_base(router_base const&) = delete;
43 router_base& operator=(router_base const&) = delete;
44 router_base(router_base&&) noexcept = default;
45 router_base& operator=(router_base&&) noexcept = default;
46
47 void
48 insert_impl(
49 core::string_view s,
50 any_resource const* v);
51
52 any_resource const*
53 find_impl(
54 segments_encoded_view path,
55 core::string_view*& matches,
56 core::string_view*& names) const noexcept;
57 };
58
59 } // detail
60 } // urls
61 } // boost
62
63 #endif
64