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_FORMAT_HPP | ||
11 | #define BOOST_URL_DETAIL_FORMAT_HPP | ||
12 | |||
13 | #include <boost/url/detail/format_args.hpp> | ||
14 | #include <boost/url/detail/pattern.hpp> | ||
15 | #include <boost/core/detail/string_view.hpp> | ||
16 | #include <boost/url/url.hpp> | ||
17 | |||
18 | namespace boost { | ||
19 | namespace urls { | ||
20 | namespace detail { | ||
21 | |||
22 | inline | ||
23 | void | ||
24 | 147 | vformat_to( | |
25 | url_base& u, | ||
26 | core::string_view fmt, | ||
27 | detail::format_args args) | ||
28 | { | ||
29 | 147 | parse_pattern(fmt) | |
30 |
4/4✓ Branch 2 taken 140 times.
✓ Branch 3 taken 7 times.
✓ Branch 5 taken 136 times.
✓ Branch 6 taken 4 times.
|
147 | .value().apply(u, args); |
31 | 136 | } | |
32 | |||
33 | inline | ||
34 | url | ||
35 | 143 | vformat( | |
36 | core::string_view fmt, | ||
37 | detail::format_args args) | ||
38 | { | ||
39 | 143 | url u; | |
40 |
2/2✓ Branch 1 taken 133 times.
✓ Branch 2 taken 10 times.
|
143 | vformat_to(u, fmt, args); |
41 | 133 | return u; | |
42 | } | ||
43 | |||
44 | } // detail | ||
45 | } // url | ||
46 | } // boost | ||
47 | |||
48 | #endif | ||
49 |