| 1 |
|
|
1 |
|
|
| 2 |
|
// Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
|
2 |
|
// Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
|
| 3 |
|
// Copyright (c) 2022 Alan de Freitas (alandefreitas@gmail.com)
|
3 |
|
// Copyright (c) 2022 Alan de Freitas (alandefreitas@gmail.com)
|
| 4 |
|
|
4 |
|
|
| 5 |
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
5 |
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
| 6 |
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
6 |
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
| 7 |
|
|
7 |
|
|
| 8 |
|
// Official repository: https://github.com/boostorg/url
|
8 |
|
// Official repository: https://github.com/boostorg/url
|
| 9 |
|
|
9 |
|
|
| 10 |
|
|
10 |
|
|
| 11 |
|
#ifndef BOOST_URL_URL_BASE_HPP
|
11 |
|
#ifndef BOOST_URL_URL_BASE_HPP
|
| 12 |
|
#define BOOST_URL_URL_BASE_HPP
|
12 |
|
#define BOOST_URL_URL_BASE_HPP
|
| 13 |
|
|
13 |
|
|
| 14 |
|
#include <boost/url/detail/config.hpp>
|
14 |
|
#include <boost/url/detail/config.hpp>
|
| 15 |
|
#include <boost/url/ipv4_address.hpp>
|
15 |
|
#include <boost/url/ipv4_address.hpp>
|
| 16 |
|
#include <boost/url/ipv6_address.hpp>
|
16 |
|
#include <boost/url/ipv6_address.hpp>
|
| 17 |
|
#include <boost/url/params_encoded_ref.hpp>
|
17 |
|
#include <boost/url/params_encoded_ref.hpp>
|
| 18 |
|
#include <boost/url/params_ref.hpp>
|
18 |
|
#include <boost/url/params_ref.hpp>
|
| 19 |
|
#include <boost/url/pct_string_view.hpp>
|
19 |
|
#include <boost/url/pct_string_view.hpp>
|
| 20 |
|
#include <boost/url/scheme.hpp>
|
20 |
|
#include <boost/url/scheme.hpp>
|
| 21 |
|
#include <boost/url/segments_encoded_ref.hpp>
|
21 |
|
#include <boost/url/segments_encoded_ref.hpp>
|
| 22 |
|
#include <boost/url/segments_ref.hpp>
|
22 |
|
#include <boost/url/segments_ref.hpp>
|
| 23 |
|
#include <boost/url/url_view_base.hpp>
|
23 |
|
#include <boost/url/url_view_base.hpp>
|
| 24 |
|
|
24 |
|
|
| 25 |
|
#include <initializer_list>
|
25 |
|
#include <initializer_list>
|
| 26 |
|
|
26 |
|
|
| 27 |
|
|
27 |
|
|
| 28 |
|
|
28 |
|
|
| 29 |
|
|
29 |
|
|
| 30 |
|
|
30 |
|
|
| 31 |
|
|
31 |
|
|
| 32 |
|
|
32 |
|
|
| 33 |
|
|
33 |
|
|
| 34 |
|
|
34 |
|
|
| 35 |
|
struct any_segments_iter;
|
35 |
|
struct any_segments_iter;
|
| 36 |
|
|
36 |
|
|
| 37 |
|
struct segments_iter_impl;
|
37 |
|
struct segments_iter_impl;
|
| 38 |
|
|
38 |
|
|
| 39 |
|
|
39 |
|
|
| 40 |
|
|
40 |
|
|
| 41 |
|
/** Common functionality for containers
|
41 |
|
/** Common functionality for containers
|
| 42 |
|
|
42 |
|
|
| 43 |
|
This base class is used by the library
|
43 |
|
This base class is used by the library
|
| 44 |
|
to provide common member functions for
|
44 |
|
to provide common member functions for
|
| 45 |
|
containers. This cannot be instantiated
|
45 |
|
containers. This cannot be instantiated
|
| 46 |
|
directly; Instead, use one of the
|
46 |
|
directly; Instead, use one of the
|
| 47 |
|
|
47 |
|
|
| 48 |
|
|
48 |
|
|
| 49 |
|
|
49 |
|
|
| 50 |
|
|
50 |
|
|
| 51 |
|
|
51 |
|
|
| 52 |
|
|
52 |
|
|
| 53 |
|
|
53 |
|
|
| 54 |
|
|
54 |
|
|
| 55 |
|
@li @ref parse_absolute_uri
|
55 |
|
@li @ref parse_absolute_uri
|
| 56 |
|
@li @ref parse_origin_form
|
56 |
|
@li @ref parse_origin_form
|
| 57 |
|
@li @ref parse_relative_ref
|
57 |
|
@li @ref parse_relative_ref
|
| 58 |
|
|
58 |
|
|
| 59 |
|
@li @ref parse_uri_reference
|
59 |
|
@li @ref parse_uri_reference
|
| 60 |
|
|
60 |
|
|
| 61 |
|
|
61 |
|
|
| 62 |
|
|
62 |
|
|
| 63 |
|
|
63 |
|
|
| 64 |
|
|
64 |
|
|
| 65 |
|
|
65 |
|
|
| 66 |
|
|
66 |
|
|
| 67 |
|
|
67 |
|
|
| 68 |
|
|
68 |
|
|
| 69 |
|
friend class static_url_base;
|
69 |
|
friend class static_url_base;
|
| 70 |
|
|
70 |
|
|
| 71 |
|
friend class segments_ref;
|
71 |
|
friend class segments_ref;
|
| 72 |
|
friend class segments_encoded_ref;
|
72 |
|
friend class segments_encoded_ref;
|
| 73 |
|
friend class params_encoded_ref;
|
73 |
|
friend class params_encoded_ref;
|
| 74 |
|
friend struct detail::pattern;
|
74 |
|
friend struct detail::pattern;
|
| 75 |
|
|
75 |
|
|
| 76 |
|
|
76 |
|
|
| 77 |
|
|
77 |
|
|
| 78 |
|
|
78 |
|
|
| 79 |
|
|
79 |
|
|
| 80 |
|
core::string_view* = nullptr,
|
80 |
|
core::string_view* = nullptr,
|
| 81 |
|
core::string_view* = nullptr) noexcept;
|
81 |
|
core::string_view* = nullptr) noexcept;
|
| 82 |
|
void move(char*, char const*,
|
82 |
|
void move(char*, char const*,
|
| 83 |
|
|
83 |
|
|
| 84 |
|
|
84 |
|
|
| 85 |
|
|
85 |
|
|
| 86 |
|
core::string_view* s0 = nullptr;
|
86 |
|
core::string_view* s0 = nullptr;
|
| 87 |
|
core::string_view* s1 = nullptr;
|
87 |
|
core::string_view* s1 = nullptr;
|
| 88 |
|
|
88 |
|
|
| 89 |
|
|
89 |
|
|
| 90 |
|
|
90 |
|
|
| 91 |
|
virtual ~url_base() noexcept = default;
|
91 |
|
virtual ~url_base() noexcept = default;
|
| 92 |
|
url_base() noexcept = default;
|
92 |
|
url_base() noexcept = default;
|
| 93 |
|
url_base(detail::url_impl const&) noexcept;
|
93 |
|
url_base(detail::url_impl const&) noexcept;
|
| 94 |
|
explicit url_base(core::string_view);
|
94 |
|
explicit url_base(core::string_view);
|
| 95 |
|
void reserve_impl(std::size_t n);
|
95 |
|
void reserve_impl(std::size_t n);
|
| 96 |
|
void copy(url_view_base const&);
|
96 |
|
void copy(url_view_base const&);
|
| 97 |
|
virtual void clear_impl() noexcept = 0;
|
97 |
|
virtual void clear_impl() noexcept = 0;
|
| 98 |
|
virtual void reserve_impl(
|
98 |
|
virtual void reserve_impl(
|
| 99 |
|
|
99 |
|
|
| 100 |
|
virtual void cleanup(op_t&) = 0;
|
100 |
|
virtual void cleanup(op_t&) = 0;
|
| 101 |
|
|
101 |
|
|
| 102 |
|
|
102 |
|
|
| 103 |
|
//--------------------------------------------
|
103 |
|
//--------------------------------------------
|
| 104 |
|
|
104 |
|
|
| 105 |
|
|
105 |
|
|
| 106 |
|
|
106 |
|
|
| 107 |
|
//--------------------------------------------
|
107 |
|
//--------------------------------------------
|
| 108 |
|
|
108 |
|
|
| 109 |
|
/** Return the url as a null-terminated string
|
109 |
|
/** Return the url as a null-terminated string
|
| 110 |
|
|
110 |
|
|
| 111 |
|
This function returns a pointer to a null
|
111 |
|
This function returns a pointer to a null
|
| 112 |
|
terminated string representing the url,
|
112 |
|
terminated string representing the url,
|
| 113 |
|
which may contain percent escapes.
|
113 |
|
which may contain percent escapes.
|
| 114 |
|
|
114 |
|
|
| 115 |
|
@return A pointer to a null-terminated string containing the URL.
|
115 |
|
@return A pointer to a null-terminated string containing the URL.
|
| 116 |
|
|
116 |
|
|
| 117 |
|
|
117 |
|
|
| 118 |
|
|
118 |
|
|
| 119 |
|
assert( std::strlen( url( "http://www.example.com" ).c_str() ) == 22 );
|
119 |
|
assert( std::strlen( url( "http://www.example.com" ).c_str() ) == 22 );
|
| 120 |
|
|
120 |
|
|
| 121 |
|
|
121 |
|
|
| 122 |
|
|
122 |
|
|
| 123 |
|
|
123 |
|
|
| 124 |
|
|
124 |
|
|
| 125 |
|
|
125 |
|
|
| 126 |
|
|
126 |
|
|
| 127 |
|
|
127 |
|
|
| 128 |
|
|
128 |
|
|
| 129 |
|
|
129 |
|
|
| 130 |
|
|
130 |
|
|
| 131 |
|
|
131 |
|
|
| 132 |
|
|
132 |
|
|
| 133 |
|
|
133 |
|
|
| 134 |
|
/** Return the number of characters that can be stored without reallocating
|
134 |
|
/** Return the number of characters that can be stored without reallocating
|
| 135 |
|
|
135 |
|
|
| 136 |
|
This does not include the null terminator,
|
136 |
|
This does not include the null terminator,
|
| 137 |
|
|
137 |
|
|
| 138 |
|
|
138 |
|
|
| 139 |
|
|
139 |
|
|
| 140 |
|
|
140 |
|
|
| 141 |
|
|
141 |
|
|
| 142 |
|
|
142 |
|
|
| 143 |
|
|
143 |
|
|
| 144 |
|
|
144 |
|
|
| 145 |
|
|
145 |
|
|
| 146 |
|
|
146 |
|
|
| 147 |
|
|
147 |
|
|
| 148 |
|
capacity() const noexcept
|
148 |
|
capacity() const noexcept
|
| 149 |
|
|
149 |
|
|
| 150 |
|
|
150 |
|
|
| 151 |
|
|
151 |
|
|
| 152 |
|
|
152 |
|
|
| 153 |
|
/** Clear the contents while preserving the capacity
|
153 |
|
/** Clear the contents while preserving the capacity
|
| 154 |
|
|
154 |
|
|
| 155 |
|
|
155 |
|
|
| 156 |
|
|
156 |
|
|
| 157 |
|
|
157 |
|
|
| 158 |
|
|
158 |
|
|
| 159 |
|
|
159 |
|
|
| 160 |
|
|
160 |
|
|
| 161 |
|
|
161 |
|
|
| 162 |
|
|
162 |
|
|
| 163 |
|
|
163 |
|
|
| 164 |
|
|
164 |
|
|
| 165 |
|
|
165 |
|
|
| 166 |
|
|
166 |
|
|
| 167 |
|
|
167 |
|
|
| 168 |
|
|
168 |
|
|
| 169 |
|
|
169 |
|
|
| 170 |
|
|
170 |
|
|
| 171 |
|
|
171 |
|
|
| 172 |
|
/** Adjust the capacity without changing the size
|
172 |
|
/** Adjust the capacity without changing the size
|
| 173 |
|
|
173 |
|
|
| 174 |
|
This function adjusts the capacity
|
174 |
|
This function adjusts the capacity
|
| 175 |
|
of the container in characters, without
|
175 |
|
of the container in characters, without
|
| 176 |
|
affecting the current contents. Has
|
176 |
|
affecting the current contents. Has
|
| 177 |
|
no effect if `n <= this->capacity()`.
|
177 |
|
no effect if `n <= this->capacity()`.
|
| 178 |
|
|
178 |
|
|
| 179 |
|
|
179 |
|
|
| 180 |
|
|
180 |
|
|
| 181 |
|
Calls to allocate may throw.
|
181 |
|
Calls to allocate may throw.
|
| 182 |
|
|
182 |
|
|
| 183 |
|
@throw bad_alloc Allocation failure
|
183 |
|
@throw bad_alloc Allocation failure
|
| 184 |
|
|
184 |
|
|
| 185 |
|
@param n The capacity in characters,
|
185 |
|
@param n The capacity in characters,
|
| 186 |
|
excluding any null terminator.
|
186 |
|
excluding any null terminator.
|
| 187 |
|
|
187 |
|
|
| 188 |
|
|
188 |
|
|
| 189 |
|
|
189 |
|
|
| 190 |
|
|
190 |
|
|
| 191 |
|
|
191 |
|
|
| 192 |
|
|
192 |
|
|
| 193 |
|
|
193 |
|
|
| 194 |
|
//--------------------------------------------
|
194 |
|
//--------------------------------------------
|
| 195 |
|
|
195 |
|
|
| 196 |
|
|
196 |
|
|
| 197 |
|
|
197 |
|
|
| 198 |
|
|
198 |
|
|
| 199 |
|
//--------------------------------------------
|
199 |
|
//--------------------------------------------
|
| 200 |
|
|
200 |
|
|
| 201 |
|
|
201 |
|
|
| 202 |
|
|
202 |
|
|
| 203 |
|
//--------------------------------------------
|
203 |
|
//--------------------------------------------
|
| 204 |
|
|
204 |
|
|
| 205 |
|
|
205 |
|
|
| 206 |
|
|
206 |
|
|
| 207 |
|
The scheme is set to the specified
|
207 |
|
The scheme is set to the specified
|
| 208 |
|
string, which must contain a valid
|
208 |
|
string, which must contain a valid
|
| 209 |
|
scheme without any trailing colon
|
209 |
|
scheme without any trailing colon
|
| 210 |
|
|
210 |
|
|
| 211 |
|
Note that schemes are case-insensitive,
|
211 |
|
Note that schemes are case-insensitive,
|
| 212 |
|
and the canonical form is lowercased.
|
212 |
|
and the canonical form is lowercased.
|
| 213 |
|
|
213 |
|
|
| 214 |
|
|
214 |
|
|
| 215 |
|
|
215 |
|
|
| 216 |
|
assert( url( "http://www.example.com" ).set_scheme( "https" ).scheme_id() == scheme::https );
|
216 |
|
assert( url( "http://www.example.com" ).set_scheme( "https" ).scheme_id() == scheme::https );
|
| 217 |
|
|
217 |
|
|
| 218 |
|
|
218 |
|
|
| 219 |
|
|
219 |
|
|
| 220 |
|
Linear in `this->size() + s.size()`.
|
220 |
|
Linear in `this->size() + s.size()`.
|
| 221 |
|
|
221 |
|
|
| 222 |
|
|
222 |
|
|
| 223 |
|
|
223 |
|
|
| 224 |
|
Calls to allocate may throw.
|
224 |
|
Calls to allocate may throw.
|
| 225 |
|
Exceptions thrown on invalid input.
|
225 |
|
Exceptions thrown on invalid input.
|
| 226 |
|
|
226 |
|
|
| 227 |
|
|
227 |
|
|
| 228 |
|
`s` contains an invalid scheme.
|
228 |
|
`s` contains an invalid scheme.
|
| 229 |
|
|
229 |
|
|
| 230 |
|
@param s The scheme to set.
|
230 |
|
@param s The scheme to set.
|
| 231 |
|
|
231 |
|
|
| 232 |
|
|
232 |
|
|
| 233 |
|
|
233 |
|
|
| 234 |
|
|
234 |
|
|
| 235 |
|
|
235 |
|
|
| 236 |
|
scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
|
236 |
|
scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
|
| 237 |
|
|
237 |
|
|
| 238 |
|
|
238 |
|
|
| 239 |
|
|
239 |
|
|
| 240 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.1">
|
240 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.1">
|
| 241 |
|
3.1. Scheme (rfc3986)</a>
|
241 |
|
3.1. Scheme (rfc3986)</a>
|
| 242 |
|
|
242 |
|
|
| 243 |
|
|
243 |
|
|
| 244 |
|
|
244 |
|
|
| 245 |
|
|
245 |
|
|
| 246 |
|
|
246 |
|
|
| 247 |
|
set_scheme(core::string_view s);
|
247 |
|
set_scheme(core::string_view s);
|
| 248 |
|
|
248 |
|
|
| 249 |
|
|
249 |
|
|
| 250 |
|
|
250 |
|
|
| 251 |
|
This function sets the scheme to the specified
|
251 |
|
This function sets the scheme to the specified
|
| 252 |
|
known @ref urls::scheme id, which may not be
|
252 |
|
known @ref urls::scheme id, which may not be
|
| 253 |
|
@ref scheme::unknown or else an exception is
|
253 |
|
@ref scheme::unknown or else an exception is
|
| 254 |
|
thrown. If the id is @ref scheme::none, this
|
254 |
|
thrown. If the id is @ref scheme::none, this
|
| 255 |
|
function behaves as if @ref remove_scheme
|
255 |
|
function behaves as if @ref remove_scheme
|
| 256 |
|
|
256 |
|
|
| 257 |
|
|
257 |
|
|
| 258 |
|
|
258 |
|
|
| 259 |
|
|
259 |
|
|
| 260 |
|
assert( url( "http://example.com/echo.cgi" ).set_scheme_id( scheme::wss ).buffer() == "wss://example.com/echo.cgi" );
|
260 |
|
assert( url( "http://example.com/echo.cgi" ).set_scheme_id( scheme::wss ).buffer() == "wss://example.com/echo.cgi" );
|
| 261 |
|
|
261 |
|
|
| 262 |
|
|
262 |
|
|
| 263 |
|
|
263 |
|
|
| 264 |
|
Linear in `this->size()`.
|
264 |
|
Linear in `this->size()`.
|
| 265 |
|
|
265 |
|
|
| 266 |
|
|
266 |
|
|
| 267 |
|
|
267 |
|
|
| 268 |
|
Calls to allocate may throw.
|
268 |
|
Calls to allocate may throw.
|
| 269 |
|
Exceptions thrown on invalid input.
|
269 |
|
Exceptions thrown on invalid input.
|
| 270 |
|
|
270 |
|
|
| 271 |
|
|
271 |
|
|
| 272 |
|
|
272 |
|
|
| 273 |
|
|
273 |
|
|
| 274 |
|
@param id The scheme to set.
|
274 |
|
@param id The scheme to set.
|
| 275 |
|
|
275 |
|
|
| 276 |
|
|
276 |
|
|
| 277 |
|
|
277 |
|
|
| 278 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.1">
|
278 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.1">
|
| 279 |
|
3.1. Scheme (rfc3986)</a>
|
279 |
|
3.1. Scheme (rfc3986)</a>
|
| 280 |
|
|
280 |
|
|
| 281 |
|
|
281 |
|
|
| 282 |
|
set_scheme_id(urls::scheme id);
|
282 |
|
set_scheme_id(urls::scheme id);
|
| 283 |
|
|
283 |
|
|
| 284 |
|
|
284 |
|
|
| 285 |
|
|
285 |
|
|
| 286 |
|
This function removes the scheme if it
|
286 |
|
This function removes the scheme if it
|
| 287 |
|
|
287 |
|
|
| 288 |
|
|
288 |
|
|
| 289 |
|
|
289 |
|
|
| 290 |
|
|
290 |
|
|
| 291 |
|
assert( url("http://www.example.com/index.htm" ).remove_scheme().buffer() == "//www.example.com/index.htm" );
|
291 |
|
assert( url("http://www.example.com/index.htm" ).remove_scheme().buffer() == "//www.example.com/index.htm" );
|
| 292 |
|
|
292 |
|
|
| 293 |
|
|
293 |
|
|
| 294 |
|
|
294 |
|
|
| 295 |
|
|
295 |
|
|
| 296 |
|
this->has_scheme() == false && this->scheme_id() == scheme::none
|
296 |
|
this->has_scheme() == false && this->scheme_id() == scheme::none
|
| 297 |
|
|
297 |
|
|
| 298 |
|
|
298 |
|
|
| 299 |
|
|
299 |
|
|
| 300 |
|
Linear in `this->size()`.
|
300 |
|
Linear in `this->size()`.
|
| 301 |
|
|
301 |
|
|
| 302 |
|
|
302 |
|
|
| 303 |
|
|
303 |
|
|
| 304 |
|
|
304 |
|
|
| 305 |
|
|
305 |
|
|
| 306 |
|
|
306 |
|
|
| 307 |
|
|
307 |
|
|
| 308 |
|
|
308 |
|
|
| 309 |
|
URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
|
309 |
|
URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
|
| 310 |
|
|
310 |
|
|
| 311 |
|
|
311 |
|
|
| 312 |
|
|
312 |
|
|
| 313 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.1">
|
313 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.1">
|
| 314 |
|
3.1. Scheme (rfc3986)</a>
|
314 |
|
3.1. Scheme (rfc3986)</a>
|
| 315 |
|
|
315 |
|
|
| 316 |
|
|
316 |
|
|
| 317 |
|
|
317 |
|
|
| 318 |
|
|
318 |
|
|
| 319 |
|
|
319 |
|
|
| 320 |
|
|
320 |
|
|
| 321 |
|
|
321 |
|
|
| 322 |
|
//--------------------------------------------
|
322 |
|
//--------------------------------------------
|
| 323 |
|
|
323 |
|
|
| 324 |
|
|
324 |
|
|
| 325 |
|
|
325 |
|
|
| 326 |
|
//--------------------------------------------
|
326 |
|
//--------------------------------------------
|
| 327 |
|
|
327 |
|
|
| 328 |
|
|
328 |
|
|
| 329 |
|
|
329 |
|
|
| 330 |
|
This function sets the authority
|
330 |
|
This function sets the authority
|
| 331 |
|
|
331 |
|
|
| 332 |
|
The string may contain percent-escapes.
|
332 |
|
The string may contain percent-escapes.
|
| 333 |
|
|
333 |
|
|
| 334 |
|
|
334 |
|
|
| 335 |
|
|
335 |
|
|
| 336 |
|
assert( url().set_encoded_authority( "My%20Computer" ).has_authority() );
|
336 |
|
assert( url().set_encoded_authority( "My%20Computer" ).has_authority() );
|
| 337 |
|
|
337 |
|
|
| 338 |
|
|
338 |
|
|
| 339 |
|
|
339 |
|
|
| 340 |
|
|
340 |
|
|
| 341 |
|
Calls to allocate may throw.
|
341 |
|
Calls to allocate may throw.
|
| 342 |
|
Exceptions thrown on invalid input.
|
342 |
|
Exceptions thrown on invalid input.
|
| 343 |
|
|
343 |
|
|
| 344 |
|
|
344 |
|
|
| 345 |
|
The string contains an invalid percent-encoding.
|
345 |
|
The string contains an invalid percent-encoding.
|
| 346 |
|
|
346 |
|
|
| 347 |
|
@param s The authority string to set.
|
347 |
|
@param s The authority string to set.
|
| 348 |
|
|
348 |
|
|
| 349 |
|
|
349 |
|
|
| 350 |
|
|
350 |
|
|
| 351 |
|
|
351 |
|
|
| 352 |
|
authority = [ userinfo "@" ] host [ ":" port ]
|
352 |
|
authority = [ userinfo "@" ] host [ ":" port ]
|
| 353 |
|
|
353 |
|
|
| 354 |
|
userinfo = *( unreserved / pct-encoded / sub-delims / ":" )
|
354 |
|
userinfo = *( unreserved / pct-encoded / sub-delims / ":" )
|
| 355 |
|
host = IP-literal / IPv4address / reg-name
|
355 |
|
host = IP-literal / IPv4address / reg-name
|
| 356 |
|
|
356 |
|
|
| 357 |
|
|
357 |
|
|
| 358 |
|
|
358 |
|
|
| 359 |
|
|
359 |
|
|
| 360 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2">
|
360 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2">
|
| 361 |
|
3.2. Authority (rfc3986)</a>
|
361 |
|
3.2. Authority (rfc3986)</a>
|
| 362 |
|
|
362 |
|
|
| 363 |
|
|
363 |
|
|
| 364 |
|
|
364 |
|
|
| 365 |
|
|
365 |
|
|
| 366 |
|
|
366 |
|
|
| 367 |
|
|
367 |
|
|
| 368 |
|
|
368 |
|
|
| 369 |
|
|
369 |
|
|
| 370 |
|
|
370 |
|
|
| 371 |
|
This function removes the authority,
|
371 |
|
This function removes the authority,
|
| 372 |
|
which includes the userinfo, host, and
|
372 |
|
which includes the userinfo, host, and
|
| 373 |
|
|
373 |
|
|
| 374 |
|
|
374 |
|
|
| 375 |
|
|
375 |
|
|
| 376 |
|
|
376 |
|
|
| 377 |
|
assert( url( "http://example.com/echo.cgi" ).remove_authority().buffer() == "http:/echo.cgi" );
|
377 |
|
assert( url( "http://example.com/echo.cgi" ).remove_authority().buffer() == "http:/echo.cgi" );
|
| 378 |
|
|
378 |
|
|
| 379 |
|
|
379 |
|
|
| 380 |
|
|
380 |
|
|
| 381 |
|
|
381 |
|
|
| 382 |
|
this->has_authority() == false && this->has_userinfo() == false && this->has_port() == false
|
382 |
|
this->has_authority() == false && this->has_userinfo() == false && this->has_port() == false
|
| 383 |
|
|
383 |
|
|
| 384 |
|
|
384 |
|
|
| 385 |
|
|
385 |
|
|
| 386 |
|
Linear in `this->size()`.
|
386 |
|
Linear in `this->size()`.
|
| 387 |
|
|
387 |
|
|
| 388 |
|
|
388 |
|
|
| 389 |
|
|
389 |
|
|
| 390 |
|
|
390 |
|
|
| 391 |
|
|
391 |
|
|
| 392 |
|
|
392 |
|
|
| 393 |
|
|
393 |
|
|
| 394 |
|
|
394 |
|
|
| 395 |
|
authority = [ userinfo "@" ] host [ ":" port ]
|
395 |
|
authority = [ userinfo "@" ] host [ ":" port ]
|
| 396 |
|
|
396 |
|
|
| 397 |
|
userinfo = *( unreserved / pct-encoded / sub-delims / ":" )
|
397 |
|
userinfo = *( unreserved / pct-encoded / sub-delims / ":" )
|
| 398 |
|
host = IP-literal / IPv4address / reg-name
|
398 |
|
host = IP-literal / IPv4address / reg-name
|
| 399 |
|
|
399 |
|
|
| 400 |
|
|
400 |
|
|
| 401 |
|
|
401 |
|
|
| 402 |
|
|
402 |
|
|
| 403 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2">
|
403 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2">
|
| 404 |
|
3.2. Authority (rfc3986)</a>
|
404 |
|
3.2. Authority (rfc3986)</a>
|
| 405 |
|
|
405 |
|
|
| 406 |
|
|
406 |
|
|
| 407 |
|
@ref set_encoded_authority.
|
407 |
|
@ref set_encoded_authority.
|
| 408 |
|
|
408 |
|
|
| 409 |
|
|
409 |
|
|
| 410 |
|
|
410 |
|
|
| 411 |
|
|
411 |
|
|
| 412 |
|
//--------------------------------------------
|
412 |
|
//--------------------------------------------
|
| 413 |
|
|
413 |
|
|
| 414 |
|
|
414 |
|
|
| 415 |
|
|
415 |
|
|
| 416 |
|
//--------------------------------------------
|
416 |
|
//--------------------------------------------
|
| 417 |
|
|
417 |
|
|
| 418 |
|
|
418 |
|
|
| 419 |
|
|
419 |
|
|
| 420 |
|
The userinfo is set to the given string,
|
420 |
|
The userinfo is set to the given string,
|
| 421 |
|
which may contain percent-escapes.
|
421 |
|
which may contain percent-escapes.
|
| 422 |
|
Any special or reserved characters in the
|
422 |
|
Any special or reserved characters in the
|
| 423 |
|
string are automatically percent-encoded.
|
423 |
|
string are automatically percent-encoded.
|
| 424 |
|
The effects on the user and password
|
424 |
|
The effects on the user and password
|
| 425 |
|
depend on the presence of a colon (':')
|
425 |
|
depend on the presence of a colon (':')
|
| 426 |
|
|
426 |
|
|
| 427 |
|
|
427 |
|
|
| 428 |
|
@li If an unescaped colon exists, the
|
428 |
|
@li If an unescaped colon exists, the
|
| 429 |
|
characters up to the colon become
|
429 |
|
characters up to the colon become
|
| 430 |
|
the user and the rest of the characters
|
430 |
|
the user and the rest of the characters
|
| 431 |
|
after the colon become the password.
|
431 |
|
after the colon become the password.
|
| 432 |
|
In this case @ref has_password returns
|
432 |
|
In this case @ref has_password returns
|
| 433 |
|
|
433 |
|
|
| 434 |
|
|
434 |
|
|
| 435 |
|
@li If there is no colon, the user is
|
435 |
|
@li If there is no colon, the user is
|
| 436 |
|
set to the string. The function
|
436 |
|
set to the string. The function
|
| 437 |
|
@ref has_password returns false.
|
437 |
|
@ref has_password returns false.
|
| 438 |
|
|
438 |
|
|
| 439 |
|
|
439 |
|
|
| 440 |
|
The interpretation of the userinfo as
|
440 |
|
The interpretation of the userinfo as
|
| 441 |
|
individual user and password components
|
441 |
|
individual user and password components
|
| 442 |
|
is scheme-dependent. Transmitting
|
442 |
|
is scheme-dependent. Transmitting
|
| 443 |
|
passwords in URLs is deprecated.
|
443 |
|
passwords in URLs is deprecated.
|
| 444 |
|
|
444 |
|
|
| 445 |
|
|
445 |
|
|
| 446 |
|
|
446 |
|
|
| 447 |
|
assert( url( "http://example.com" ).set_userinfo( "user:pass" ).encoded_user() == "user" );
|
447 |
|
assert( url( "http://example.com" ).set_userinfo( "user:pass" ).encoded_user() == "user" );
|
| 448 |
|
|
448 |
|
|
| 449 |
|
|
449 |
|
|
| 450 |
|
|
450 |
|
|
| 451 |
|
Linear in `this->size() + s.size()`.
|
451 |
|
Linear in `this->size() + s.size()`.
|
| 452 |
|
|
452 |
|
|
| 453 |
|
|
453 |
|
|
| 454 |
|
|
454 |
|
|
| 455 |
|
Calls to allocate may throw.
|
455 |
|
Calls to allocate may throw.
|
| 456 |
|
|
456 |
|
|
| 457 |
|
@param s The string to set.
|
457 |
|
@param s The string to set.
|
| 458 |
|
|
458 |
|
|
| 459 |
|
|
459 |
|
|
| 460 |
|
|
460 |
|
|
| 461 |
|
|
461 |
|
|
| 462 |
|
userinfo = [ [ user ] [ ':' password ] ]
|
462 |
|
userinfo = [ [ user ] [ ':' password ] ]
|
| 463 |
|
|
463 |
|
|
| 464 |
|
user = *( unreserved / pct-encoded / sub-delims )
|
464 |
|
user = *( unreserved / pct-encoded / sub-delims )
|
| 465 |
|
password = *( unreserved / pct-encoded / sub-delims / ":" )
|
465 |
|
password = *( unreserved / pct-encoded / sub-delims / ":" )
|
| 466 |
|
|
466 |
|
|
| 467 |
|
|
467 |
|
|
| 468 |
|
|
468 |
|
|
| 469 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1">
|
469 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1">
|
| 470 |
|
3.2.1. User Information (rfc3986)</a>
|
470 |
|
3.2.1. User Information (rfc3986)</a>
|
| 471 |
|
|
471 |
|
|
| 472 |
|
|
472 |
|
|
| 473 |
|
|
473 |
|
|
| 474 |
|
@ref set_encoded_userinfo.
|
474 |
|
@ref set_encoded_userinfo.
|
| 475 |
|
|
475 |
|
|
| 476 |
|
|
476 |
|
|
| 477 |
|
|
477 |
|
|
| 478 |
|
|
478 |
|
|
| 479 |
|
|
479 |
|
|
| 480 |
|
|
480 |
|
|
| 481 |
|
|
481 |
|
|
| 482 |
|
The userinfo is set to the given string,
|
482 |
|
The userinfo is set to the given string,
|
| 483 |
|
which may contain percent-escapes.
|
483 |
|
which may contain percent-escapes.
|
| 484 |
|
Escapes in the string are preserved,
|
484 |
|
Escapes in the string are preserved,
|
| 485 |
|
and reserved characters in the string
|
485 |
|
and reserved characters in the string
|
| 486 |
|
are percent-escaped in the result.
|
486 |
|
are percent-escaped in the result.
|
| 487 |
|
The effects on the user and password
|
487 |
|
The effects on the user and password
|
| 488 |
|
depend on the presence of a colon (':')
|
488 |
|
depend on the presence of a colon (':')
|
| 489 |
|
|
489 |
|
|
| 490 |
|
|
490 |
|
|
| 491 |
|
@li If an unescaped colon exists, the
|
491 |
|
@li If an unescaped colon exists, the
|
| 492 |
|
characters up to the colon become
|
492 |
|
characters up to the colon become
|
| 493 |
|
the user and the rest of the characters
|
493 |
|
the user and the rest of the characters
|
| 494 |
|
after the colon become the password.
|
494 |
|
after the colon become the password.
|
| 495 |
|
In this case @ref has_password returns
|
495 |
|
In this case @ref has_password returns
|
| 496 |
|
|
496 |
|
|
| 497 |
|
|
497 |
|
|
| 498 |
|
@li If there is no colon, the user is
|
498 |
|
@li If there is no colon, the user is
|
| 499 |
|
set to the string. The function
|
499 |
|
set to the string. The function
|
| 500 |
|
@ref has_password returns false.
|
500 |
|
@ref has_password returns false.
|
| 501 |
|
|
501 |
|
|
| 502 |
|
|
502 |
|
|
| 503 |
|
The interpretation of the userinfo as
|
503 |
|
The interpretation of the userinfo as
|
| 504 |
|
individual user and password components
|
504 |
|
individual user and password components
|
| 505 |
|
is scheme-dependent. Transmitting
|
505 |
|
is scheme-dependent. Transmitting
|
| 506 |
|
passwords in URLs is deprecated.
|
506 |
|
passwords in URLs is deprecated.
|
| 507 |
|
|
507 |
|
|
| 508 |
|
|
508 |
|
|
| 509 |
|
|
509 |
|
|
| 510 |
|
assert( url( "http://example.com" ).set_encoded_userinfo( "john%20doe" ).user() == "john doe" );
|
510 |
|
assert( url( "http://example.com" ).set_encoded_userinfo( "john%20doe" ).user() == "john doe" );
|
| 511 |
|
|
511 |
|
|
| 512 |
|
|
512 |
|
|
| 513 |
|
|
513 |
|
|
| 514 |
|
Linear in `this->size() + s.size()`.
|
514 |
|
Linear in `this->size() + s.size()`.
|
| 515 |
|
|
515 |
|
|
| 516 |
|
|
516 |
|
|
| 517 |
|
|
517 |
|
|
| 518 |
|
Calls to allocate may throw.
|
518 |
|
Calls to allocate may throw.
|
| 519 |
|
Exceptions thrown on invalid input.
|
519 |
|
Exceptions thrown on invalid input.
|
| 520 |
|
|
520 |
|
|
| 521 |
|
|
521 |
|
|
| 522 |
|
`s` contains an invalid percent-encoding.
|
522 |
|
`s` contains an invalid percent-encoding.
|
| 523 |
|
|
523 |
|
|
| 524 |
|
@param s The string to set.
|
524 |
|
@param s The string to set.
|
| 525 |
|
|
525 |
|
|
| 526 |
|
|
526 |
|
|
| 527 |
|
|
527 |
|
|
| 528 |
|
|
528 |
|
|
| 529 |
|
userinfo = [ [ user ] [ ':' password ] ]
|
529 |
|
userinfo = [ [ user ] [ ':' password ] ]
|
| 530 |
|
|
530 |
|
|
| 531 |
|
user = *( unreserved / pct-encoded / sub-delims )
|
531 |
|
user = *( unreserved / pct-encoded / sub-delims )
|
| 532 |
|
password = *( unreserved / pct-encoded / sub-delims / ":" )
|
532 |
|
password = *( unreserved / pct-encoded / sub-delims / ":" )
|
| 533 |
|
|
533 |
|
|
| 534 |
|
|
534 |
|
|
| 535 |
|
|
535 |
|
|
| 536 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1">
|
536 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1">
|
| 537 |
|
3.2.1. User Information (rfc3986)</a>
|
537 |
|
3.2.1. User Information (rfc3986)</a>
|
| 538 |
|
|
538 |
|
|
| 539 |
|
|
539 |
|
|
| 540 |
|
|
540 |
|
|
| 541 |
|
|
541 |
|
|
| 542 |
|
|
542 |
|
|
| 543 |
|
|
543 |
|
|
| 544 |
|
|
544 |
|
|
| 545 |
|
|
545 |
|
|
| 546 |
|
|
546 |
|
|
| 547 |
|
|
547 |
|
|
| 548 |
|
|
548 |
|
|
| 549 |
|
This function removes the userinfo if
|
549 |
|
This function removes the userinfo if
|
| 550 |
|
present, without removing any authority.
|
550 |
|
present, without removing any authority.
|
| 551 |
|
|
551 |
|
|
| 552 |
|
|
552 |
|
|
| 553 |
|
|
553 |
|
|
| 554 |
|
assert( url( "http://user@example.com" ).remove_userinfo().has_userinfo() == false );
|
554 |
|
assert( url( "http://user@example.com" ).remove_userinfo().has_userinfo() == false );
|
| 555 |
|
|
555 |
|
|
| 556 |
|
|
556 |
|
|
| 557 |
|
|
557 |
|
|
| 558 |
|
|
558 |
|
|
| 559 |
|
this->has_userinfo() == false && this->encoded_userinfo().empty == true
|
559 |
|
this->has_userinfo() == false && this->encoded_userinfo().empty == true
|
| 560 |
|
|
560 |
|
|
| 561 |
|
|
561 |
|
|
| 562 |
|
|
562 |
|
|
| 563 |
|
Linear in `this->size()`.
|
563 |
|
Linear in `this->size()`.
|
| 564 |
|
|
564 |
|
|
| 565 |
|
|
565 |
|
|
| 566 |
|
|
566 |
|
|
| 567 |
|
|
567 |
|
|
| 568 |
|
|
568 |
|
|
| 569 |
|
|
569 |
|
|
| 570 |
|
|
570 |
|
|
| 571 |
|
|
571 |
|
|
| 572 |
|
userinfo = [ [ user ] [ ':' password ] ]
|
572 |
|
userinfo = [ [ user ] [ ':' password ] ]
|
| 573 |
|
|
573 |
|
|
| 574 |
|
user = *( unreserved / pct-encoded / sub-delims )
|
574 |
|
user = *( unreserved / pct-encoded / sub-delims )
|
| 575 |
|
password = *( unreserved / pct-encoded / sub-delims / ":" )
|
575 |
|
password = *( unreserved / pct-encoded / sub-delims / ":" )
|
| 576 |
|
|
576 |
|
|
| 577 |
|
|
577 |
|
|
| 578 |
|
|
578 |
|
|
| 579 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1">
|
579 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1">
|
| 580 |
|
3.2.1. User Information (rfc3986)</a>
|
580 |
|
3.2.1. User Information (rfc3986)</a>
|
| 581 |
|
|
581 |
|
|
| 582 |
|
|
582 |
|
|
| 583 |
|
@ref set_encoded_userinfo,
|
583 |
|
@ref set_encoded_userinfo,
|
| 584 |
|
|
584 |
|
|
| 585 |
|
|
585 |
|
|
| 586 |
|
|
586 |
|
|
| 587 |
|
remove_userinfo() noexcept;
|
587 |
|
remove_userinfo() noexcept;
|
| 588 |
|
|
588 |
|
|
| 589 |
|
//--------------------------------------------
|
589 |
|
//--------------------------------------------
|
| 590 |
|
|
590 |
|
|
| 591 |
|
|
591 |
|
|
| 592 |
|
|
592 |
|
|
| 593 |
|
This function sets the user part of the
|
593 |
|
This function sets the user part of the
|
| 594 |
|
|
594 |
|
|
| 595 |
|
Any special or reserved characters in the
|
595 |
|
Any special or reserved characters in the
|
| 596 |
|
string are automatically percent-encoded.
|
596 |
|
string are automatically percent-encoded.
|
| 597 |
|
|
597 |
|
|
| 598 |
|
|
598 |
|
|
| 599 |
|
|
599 |
|
|
| 600 |
|
assert( url().set_user("john doe").encoded_userinfo() == "john%20doe" );
|
600 |
|
assert( url().set_user("john doe").encoded_userinfo() == "john%20doe" );
|
| 601 |
|
|
601 |
|
|
| 602 |
|
|
602 |
|
|
| 603 |
|
|
603 |
|
|
| 604 |
|
|
604 |
|
|
| 605 |
|
this->has_authority() == true && this->has_userinfo() == true
|
605 |
|
this->has_authority() == true && this->has_userinfo() == true
|
| 606 |
|
|
606 |
|
|
| 607 |
|
|
607 |
|
|
| 608 |
|
|
608 |
|
|
| 609 |
|
Linear in `this->size() + s.size()`.
|
609 |
|
Linear in `this->size() + s.size()`.
|
| 610 |
|
|
610 |
|
|
| 611 |
|
|
611 |
|
|
| 612 |
|
|
612 |
|
|
| 613 |
|
Calls to allocate may throw.
|
613 |
|
Calls to allocate may throw.
|
| 614 |
|
|
614 |
|
|
| 615 |
|
@param s The string to set.
|
615 |
|
@param s The string to set.
|
| 616 |
|
|
616 |
|
|
| 617 |
|
|
617 |
|
|
| 618 |
|
|
618 |
|
|
| 619 |
|
|
619 |
|
|
| 620 |
|
userinfo = [ [ user ] [ ':' password ] ]
|
620 |
|
userinfo = [ [ user ] [ ':' password ] ]
|
| 621 |
|
|
621 |
|
|
| 622 |
|
user = *( unreserved / pct-encoded / sub-delims )
|
622 |
|
user = *( unreserved / pct-encoded / sub-delims )
|
| 623 |
|
password = *( unreserved / pct-encoded / sub-delims / ":" )
|
623 |
|
password = *( unreserved / pct-encoded / sub-delims / ":" )
|
| 624 |
|
|
624 |
|
|
| 625 |
|
|
625 |
|
|
| 626 |
|
|
626 |
|
|
| 627 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1">
|
627 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1">
|
| 628 |
|
3.2.1. User Information (rfc3986)</a>
|
628 |
|
3.2.1. User Information (rfc3986)</a>
|
| 629 |
|
|
629 |
|
|
| 630 |
|
|
630 |
|
|
| 631 |
|
|
631 |
|
|
| 632 |
|
@ref set_encoded_password,
|
632 |
|
@ref set_encoded_password,
|
| 633 |
|
|
633 |
|
|
| 634 |
|
|
634 |
|
|
| 635 |
|
|
635 |
|
|
| 636 |
|
|
636 |
|
|
| 637 |
|
|
637 |
|
|
| 638 |
|
|
638 |
|
|
| 639 |
|
|
639 |
|
|
| 640 |
|
|
640 |
|
|
| 641 |
|
|
641 |
|
|
| 642 |
|
This function sets the user part of the
|
642 |
|
This function sets the user part of the
|
| 643 |
|
userinfo the the string, which may
|
643 |
|
userinfo the the string, which may
|
| 644 |
|
|
644 |
|
|
| 645 |
|
Escapes in the string are preserved,
|
645 |
|
Escapes in the string are preserved,
|
| 646 |
|
and reserved characters in the string
|
646 |
|
and reserved characters in the string
|
| 647 |
|
are percent-escaped in the result.
|
647 |
|
are percent-escaped in the result.
|
| 648 |
|
|
648 |
|
|
| 649 |
|
|
649 |
|
|
| 650 |
|
|
650 |
|
|
| 651 |
|
assert( url().set_encoded_user("john%20doe").userinfo() == "john doe" );
|
651 |
|
assert( url().set_encoded_user("john%20doe").userinfo() == "john doe" );
|
| 652 |
|
|
652 |
|
|
| 653 |
|
|
653 |
|
|
| 654 |
|
|
654 |
|
|
| 655 |
|
|
655 |
|
|
| 656 |
|
this->has_authority() == true && this->has_userinfo() == true
|
656 |
|
this->has_authority() == true && this->has_userinfo() == true
|
| 657 |
|
|
657 |
|
|
| 658 |
|
|
658 |
|
|
| 659 |
|
|
659 |
|
|
| 660 |
|
Linear in `this->size() + s.size()`.
|
660 |
|
Linear in `this->size() + s.size()`.
|
| 661 |
|
|
661 |
|
|
| 662 |
|
|
662 |
|
|
| 663 |
|
|
663 |
|
|
| 664 |
|
Calls to allocate may throw.
|
664 |
|
Calls to allocate may throw.
|
| 665 |
|
|
665 |
|
|
| 666 |
|
|
666 |
|
|
| 667 |
|
`s` contains an invalid percent-encoding.
|
667 |
|
`s` contains an invalid percent-encoding.
|
| 668 |
|
|
668 |
|
|
| 669 |
|
@param s The string to set.
|
669 |
|
@param s The string to set.
|
| 670 |
|
|
670 |
|
|
| 671 |
|
|
671 |
|
|
| 672 |
|
|
672 |
|
|
| 673 |
|
|
673 |
|
|
| 674 |
|
|
674 |
|
|
| 675 |
|
|
675 |
|
|
| 676 |
|
|
676 |
|
|
| 677 |
|
userinfo = [ [ user ] [ ':' password ] ]
|
677 |
|
userinfo = [ [ user ] [ ':' password ] ]
|
| 678 |
|
|
678 |
|
|
| 679 |
|
user = *( unreserved / pct-encoded / sub-delims )
|
679 |
|
user = *( unreserved / pct-encoded / sub-delims )
|
| 680 |
|
password = *( unreserved / pct-encoded / sub-delims / ":" )
|
680 |
|
password = *( unreserved / pct-encoded / sub-delims / ":" )
|
| 681 |
|
|
681 |
|
|
| 682 |
|
|
682 |
|
|
| 683 |
|
|
683 |
|
|
| 684 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1">
|
684 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1">
|
| 685 |
|
3.2.1. User Information (rfc3986)</a>
|
685 |
|
3.2.1. User Information (rfc3986)</a>
|
| 686 |
|
|
686 |
|
|
| 687 |
|
|
687 |
|
|
| 688 |
|
|
688 |
|
|
| 689 |
|
@ref set_encoded_password,
|
689 |
|
@ref set_encoded_password,
|
| 690 |
|
|
690 |
|
|
| 691 |
|
|
691 |
|
|
| 692 |
|
|
692 |
|
|
| 693 |
|
|
693 |
|
|
| 694 |
|
|
694 |
|
|
| 695 |
|
|
695 |
|
|
| 696 |
|
|
696 |
|
|
| 697 |
|
|
697 |
|
|
| 698 |
|
|
698 |
|
|
| 699 |
|
This function sets the password in
|
699 |
|
This function sets the password in
|
| 700 |
|
the userinfo to the string.
|
700 |
|
the userinfo to the string.
|
| 701 |
|
Reserved characters in the string are
|
701 |
|
Reserved characters in the string are
|
| 702 |
|
percent-escaped in the result.
|
702 |
|
percent-escaped in the result.
|
| 703 |
|
|
703 |
|
|
| 704 |
|
|
704 |
|
|
| 705 |
|
The interpretation of the userinfo as
|
705 |
|
The interpretation of the userinfo as
|
| 706 |
|
individual user and password components
|
706 |
|
individual user and password components
|
| 707 |
|
is scheme-dependent. Transmitting
|
707 |
|
is scheme-dependent. Transmitting
|
| 708 |
|
passwords in URLs is deprecated.
|
708 |
|
passwords in URLs is deprecated.
|
| 709 |
|
|
709 |
|
|
| 710 |
|
|
710 |
|
|
| 711 |
|
|
711 |
|
|
| 712 |
|
assert( url("http://user@example.com").set_password( "pass" ).encoded_userinfo() == "user:pass" );
|
712 |
|
assert( url("http://user@example.com").set_password( "pass" ).encoded_userinfo() == "user:pass" );
|
| 713 |
|
|
713 |
|
|
| 714 |
|
|
714 |
|
|
| 715 |
|
|
715 |
|
|
| 716 |
|
|
716 |
|
|
| 717 |
|
this->has_password() == true && this->password() == s
|
717 |
|
this->has_password() == true && this->password() == s
|
| 718 |
|
|
718 |
|
|
| 719 |
|
|
719 |
|
|
| 720 |
|
|
720 |
|
|
| 721 |
|
|
721 |
|
|
| 722 |
|
Calls to allocate may throw.
|
722 |
|
Calls to allocate may throw.
|
| 723 |
|
|
723 |
|
|
| 724 |
|
@param s The string to set. This string may
|
724 |
|
@param s The string to set. This string may
|
| 725 |
|
contain any characters, including nulls.
|
725 |
|
contain any characters, including nulls.
|
| 726 |
|
|
726 |
|
|
| 727 |
|
|
727 |
|
|
| 728 |
|
|
728 |
|
|
| 729 |
|
|
729 |
|
|
| 730 |
|
|
730 |
|
|
| 731 |
|
userinfo = [ [ user ] [ ':' password ] ]
|
731 |
|
userinfo = [ [ user ] [ ':' password ] ]
|
| 732 |
|
|
732 |
|
|
| 733 |
|
user = *( unreserved / pct-encoded / sub-delims )
|
733 |
|
user = *( unreserved / pct-encoded / sub-delims )
|
| 734 |
|
password = *( unreserved / pct-encoded / sub-delims / ":" )
|
734 |
|
password = *( unreserved / pct-encoded / sub-delims / ":" )
|
| 735 |
|
|
735 |
|
|
| 736 |
|
|
736 |
|
|
| 737 |
|
|
737 |
|
|
| 738 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1">
|
738 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1">
|
| 739 |
|
3.2.1. User Information (rfc3986)</a>
|
739 |
|
3.2.1. User Information (rfc3986)</a>
|
| 740 |
|
|
740 |
|
|
| 741 |
|
|
741 |
|
|
| 742 |
|
|
742 |
|
|
| 743 |
|
@ref set_encoded_password,
|
743 |
|
@ref set_encoded_password,
|
| 744 |
|
|
744 |
|
|
| 745 |
|
|
745 |
|
|
| 746 |
|
|
746 |
|
|
| 747 |
|
|
747 |
|
|
| 748 |
|
|
748 |
|
|
| 749 |
|
|
749 |
|
|
| 750 |
|
|
750 |
|
|
| 751 |
|
|
751 |
|
|
| 752 |
|
|
752 |
|
|
| 753 |
|
This function sets the password in
|
753 |
|
This function sets the password in
|
| 754 |
|
the userinfo to the string, which
|
754 |
|
the userinfo to the string, which
|
| 755 |
|
may contain percent-escapes.
|
755 |
|
may contain percent-escapes.
|
| 756 |
|
Escapes in the string are preserved,
|
756 |
|
Escapes in the string are preserved,
|
| 757 |
|
and reserved characters in the string
|
757 |
|
and reserved characters in the string
|
| 758 |
|
are percent-escaped in the result.
|
758 |
|
are percent-escaped in the result.
|
| 759 |
|
|
759 |
|
|
| 760 |
|
|
760 |
|
|
| 761 |
|
The interpretation of the userinfo as
|
761 |
|
The interpretation of the userinfo as
|
| 762 |
|
individual user and password components
|
762 |
|
individual user and password components
|
| 763 |
|
is scheme-dependent. Transmitting
|
763 |
|
is scheme-dependent. Transmitting
|
| 764 |
|
passwords in URLs is deprecated.
|
764 |
|
passwords in URLs is deprecated.
|
| 765 |
|
|
765 |
|
|
| 766 |
|
|
766 |
|
|
| 767 |
|
|
767 |
|
|
| 768 |
|
assert( url("http://user@example.com").set_encoded_password( "pass" ).encoded_userinfo() == "user:pass" );
|
768 |
|
assert( url("http://user@example.com").set_encoded_password( "pass" ).encoded_userinfo() == "user:pass" );
|
| 769 |
|
|
769 |
|
|
| 770 |
|
|
770 |
|
|
| 771 |
|
|
771 |
|
|
| 772 |
|
|
772 |
|
|
| 773 |
|
this->has_password() == true
|
773 |
|
this->has_password() == true
|
| 774 |
|
|
774 |
|
|
| 775 |
|
|
775 |
|
|
| 776 |
|
|
776 |
|
|
| 777 |
|
|
777 |
|
|
| 778 |
|
Calls to allocate may throw.
|
778 |
|
Calls to allocate may throw.
|
| 779 |
|
|
779 |
|
|
| 780 |
|
|
780 |
|
|
| 781 |
|
`s` contains an invalid percent-encoding.
|
781 |
|
`s` contains an invalid percent-encoding.
|
| 782 |
|
|
782 |
|
|
| 783 |
|
@param s The string to set. This string may
|
783 |
|
@param s The string to set. This string may
|
| 784 |
|
contain any characters, including nulls.
|
784 |
|
contain any characters, including nulls.
|
| 785 |
|
|
785 |
|
|
| 786 |
|
|
786 |
|
|
| 787 |
|
|
787 |
|
|
| 788 |
|
|
788 |
|
|
| 789 |
|
userinfo = [ [ user ] [ ':' password ] ]
|
789 |
|
userinfo = [ [ user ] [ ':' password ] ]
|
| 790 |
|
|
790 |
|
|
| 791 |
|
user = *( unreserved / pct-encoded / sub-delims )
|
791 |
|
user = *( unreserved / pct-encoded / sub-delims )
|
| 792 |
|
password = *( unreserved / pct-encoded / sub-delims / ":" )
|
792 |
|
password = *( unreserved / pct-encoded / sub-delims / ":" )
|
| 793 |
|
|
793 |
|
|
| 794 |
|
|
794 |
|
|
| 795 |
|
|
795 |
|
|
| 796 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1">
|
796 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1">
|
| 797 |
|
3.2.1. User Information (rfc3986)</a>
|
797 |
|
3.2.1. User Information (rfc3986)</a>
|
| 798 |
|
|
798 |
|
|
| 799 |
|
|
799 |
|
|
| 800 |
|
|
800 |
|
|
| 801 |
|
@ref set_encoded_password,
|
801 |
|
@ref set_encoded_password,
|
| 802 |
|
|
802 |
|
|
| 803 |
|
|
803 |
|
|
| 804 |
|
|
804 |
|
|
| 805 |
|
|
805 |
|
|
| 806 |
|
|
806 |
|
|
| 807 |
|
|
807 |
|
|
| 808 |
|
|
808 |
|
|
| 809 |
|
|
809 |
|
|
| 810 |
|
|
810 |
|
|
| 811 |
|
This function removes the password from
|
811 |
|
This function removes the password from
|
| 812 |
|
the userinfo if a password exists. If
|
812 |
|
the userinfo if a password exists. If
|
| 813 |
|
there is no userinfo or no authority,
|
813 |
|
there is no userinfo or no authority,
|
| 814 |
|
|
814 |
|
|
| 815 |
|
|
815 |
|
|
| 816 |
|
|
816 |
|
|
| 817 |
|
The interpretation of the userinfo as
|
817 |
|
The interpretation of the userinfo as
|
| 818 |
|
individual user and password components
|
818 |
|
individual user and password components
|
| 819 |
|
is scheme-dependent. Transmitting
|
819 |
|
is scheme-dependent. Transmitting
|
| 820 |
|
passwords in URLs is deprecated.
|
820 |
|
passwords in URLs is deprecated.
|
| 821 |
|
|
821 |
|
|
| 822 |
|
|
822 |
|
|
| 823 |
|
|
823 |
|
|
| 824 |
|
assert( url( "http://user:pass@example.com" ).remove_password().authority().buffer() == "user@example.com" );
|
824 |
|
assert( url( "http://user:pass@example.com" ).remove_password().authority().buffer() == "user@example.com" );
|
| 825 |
|
|
825 |
|
|
| 826 |
|
|
826 |
|
|
| 827 |
|
|
827 |
|
|
| 828 |
|
|
828 |
|
|
| 829 |
|
this->has_password() == false && this->encoded_password().empty() == true
|
829 |
|
this->has_password() == false && this->encoded_password().empty() == true
|
| 830 |
|
|
830 |
|
|
| 831 |
|
|
831 |
|
|
| 832 |
|
|
832 |
|
|
| 833 |
|
Linear in `this->size()`.
|
833 |
|
Linear in `this->size()`.
|
| 834 |
|
|
834 |
|
|
| 835 |
|
|
835 |
|
|
| 836 |
|
|
836 |
|
|
| 837 |
|
|
837 |
|
|
| 838 |
|
|
838 |
|
|
| 839 |
|
|
839 |
|
|
| 840 |
|
userinfo = [ [ user ] [ ':' password ] ]
|
840 |
|
userinfo = [ [ user ] [ ':' password ] ]
|
| 841 |
|
|
841 |
|
|
| 842 |
|
user = *( unreserved / pct-encoded / sub-delims )
|
842 |
|
user = *( unreserved / pct-encoded / sub-delims )
|
| 843 |
|
password = *( unreserved / pct-encoded / sub-delims / ":" )
|
843 |
|
password = *( unreserved / pct-encoded / sub-delims / ":" )
|
| 844 |
|
|
844 |
|
|
| 845 |
|
|
845 |
|
|
| 846 |
|
|
846 |
|
|
| 847 |
|
|
847 |
|
|
| 848 |
|
|
848 |
|
|
| 849 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1">
|
849 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1">
|
| 850 |
|
3.2.1. User Information (rfc3986)</a>
|
850 |
|
3.2.1. User Information (rfc3986)</a>
|
| 851 |
|
|
851 |
|
|
| 852 |
|
|
852 |
|
|
| 853 |
|
@ref set_encoded_password,
|
853 |
|
@ref set_encoded_password,
|
| 854 |
|
|
854 |
|
|
| 855 |
|
|
855 |
|
|
| 856 |
|
|
856 |
|
|
| 857 |
|
|
857 |
|
|
| 858 |
|
|
858 |
|
|
| 859 |
|
remove_password() noexcept;
|
859 |
|
remove_password() noexcept;
|
| 860 |
|
|
860 |
|
|
| 861 |
|
//--------------------------------------------
|
861 |
|
//--------------------------------------------
|
| 862 |
|
|
862 |
|
|
| 863 |
|
|
863 |
|
|
| 864 |
|
|
864 |
|
|
| 865 |
|
//--------------------------------------------
|
865 |
|
//--------------------------------------------
|
| 866 |
|
|
866 |
|
|
| 867 |
|
|
867 |
|
|
| 868 |
|
|
868 |
|
|
| 869 |
|
Depending on the contents of the passed
|
869 |
|
Depending on the contents of the passed
|
| 870 |
|
string, this function sets the host:
|
870 |
|
string, this function sets the host:
|
| 871 |
|
|
871 |
|
|
| 872 |
|
@li If the string is a valid IPv4 address,
|
872 |
|
@li If the string is a valid IPv4 address,
|
| 873 |
|
then the host is set to the address.
|
873 |
|
then the host is set to the address.
|
| 874 |
|
The host type is @ref host_type::ipv4.
|
874 |
|
The host type is @ref host_type::ipv4.
|
| 875 |
|
|
875 |
|
|
| 876 |
|
@li If the string is a valid IPv6 address
|
876 |
|
@li If the string is a valid IPv6 address
|
| 877 |
|
enclosed in square brackets, then the
|
877 |
|
enclosed in square brackets, then the
|
| 878 |
|
host is set to that address.
|
878 |
|
host is set to that address.
|
| 879 |
|
The host type is @ref host_type::ipv6.
|
879 |
|
The host type is @ref host_type::ipv6.
|
| 880 |
|
|
880 |
|
|
| 881 |
|
@li If the string is a valid IPvFuture
|
881 |
|
@li If the string is a valid IPvFuture
|
| 882 |
|
address enclosed in square brackets, then
|
882 |
|
address enclosed in square brackets, then
|
| 883 |
|
the host is set to that address.
|
883 |
|
the host is set to that address.
|
| 884 |
|
The host type is @ref host_type::ipvfuture.
|
884 |
|
The host type is @ref host_type::ipvfuture.
|
| 885 |
|
|
885 |
|
|
| 886 |
|
@li Otherwise, the host name is set to
|
886 |
|
@li Otherwise, the host name is set to
|
| 887 |
|
the string, which may be empty.
|
887 |
|
the string, which may be empty.
|
| 888 |
|
Reserved characters in the string are
|
888 |
|
Reserved characters in the string are
|
| 889 |
|
percent-escaped in the result.
|
889 |
|
percent-escaped in the result.
|
| 890 |
|
The host type is @ref host_type::name.
|
890 |
|
The host type is @ref host_type::name.
|
| 891 |
|
|
891 |
|
|
| 892 |
|
In all cases, when this function returns,
|
892 |
|
In all cases, when this function returns,
|
| 893 |
|
the URL contains an authority.
|
893 |
|
the URL contains an authority.
|
| 894 |
|
|
894 |
|
|
| 895 |
|
|
895 |
|
|
| 896 |
|
|
896 |
|
|
| 897 |
|
assert( url( "http://www.example.com" ).set_host( "127.0.0.1" ).buffer() == "http://127.0.0.1" );
|
897 |
|
assert( url( "http://www.example.com" ).set_host( "127.0.0.1" ).buffer() == "http://127.0.0.1" );
|
| 898 |
|
|
898 |
|
|
| 899 |
|
|
899 |
|
|
| 900 |
|
|
900 |
|
|
| 901 |
|
|
901 |
|
|
| 902 |
|
this->has_authority() == true
|
902 |
|
this->has_authority() == true
|
| 903 |
|
|
903 |
|
|
| 904 |
|
|
904 |
|
|
| 905 |
|
|
905 |
|
|
| 906 |
|
Linear in `this->size() + s.size()`.
|
906 |
|
Linear in `this->size() + s.size()`.
|
| 907 |
|
|
907 |
|
|
| 908 |
|
|
908 |
|
|
| 909 |
|
|
909 |
|
|
| 910 |
|
Calls to allocate may throw.
|
910 |
|
Calls to allocate may throw.
|
| 911 |
|
|
911 |
|
|
| 912 |
|
|
912 |
|
|
| 913 |
|
|
913 |
|
|
| 914 |
|
host = IP-literal / IPv4address / reg-name
|
914 |
|
host = IP-literal / IPv4address / reg-name
|
| 915 |
|
|
915 |
|
|
| 916 |
|
IP-literal = "[" ( IPv6address / IPvFuture ) "]"
|
916 |
|
IP-literal = "[" ( IPv6address / IPvFuture ) "]"
|
| 917 |
|
|
917 |
|
|
| 918 |
|
reg-name = *( unreserved / pct-encoded / "-" / ".")
|
918 |
|
reg-name = *( unreserved / pct-encoded / "-" / ".")
|
| 919 |
|
|
919 |
|
|
| 920 |
|
|
920 |
|
|
| 921 |
|
@param s The string to set.
|
921 |
|
@param s The string to set.
|
| 922 |
|
|
922 |
|
|
| 923 |
|
|
923 |
|
|
| 924 |
|
|
924 |
|
|
| 925 |
|
@li <a href="https://en.wikipedia.org/wiki/IPv4"
|
925 |
|
@li <a href="https://en.wikipedia.org/wiki/IPv4"
|
| 926 |
|
|
926 |
|
|
| 927 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc4291"
|
927 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc4291"
|
| 928 |
|
>IP Version 6 Addressing Architecture (rfc4291)</a>
|
928 |
|
>IP Version 6 Addressing Architecture (rfc4291)</a>
|
| 929 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2">
|
929 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2">
|
| 930 |
|
3.2.2. Host (rfc3986)</a>
|
930 |
|
3.2.2. Host (rfc3986)</a>
|
| 931 |
|
|
931 |
|
|
| 932 |
|
|
932 |
|
|
| 933 |
|
|
933 |
|
|
| 934 |
|
@ref set_encoded_host_address,
|
934 |
|
@ref set_encoded_host_address,
|
| 935 |
|
@ref set_encoded_host_name,
|
935 |
|
@ref set_encoded_host_name,
|
| 936 |
|
|
936 |
|
|
| 937 |
|
|
937 |
|
|
| 938 |
|
|
938 |
|
|
| 939 |
|
|
939 |
|
|
| 940 |
|
|
940 |
|
|
| 941 |
|
|
941 |
|
|
| 942 |
|
|
942 |
|
|
| 943 |
|
|
943 |
|
|
| 944 |
|
|
944 |
|
|
| 945 |
|
|
945 |
|
|
| 946 |
|
|
946 |
|
|
| 947 |
|
|
947 |
|
|
| 948 |
|
Depending on the contents of the passed
|
948 |
|
Depending on the contents of the passed
|
| 949 |
|
string, this function sets the host:
|
949 |
|
string, this function sets the host:
|
| 950 |
|
|
950 |
|
|
| 951 |
|
@li If the string is a valid IPv4 address,
|
951 |
|
@li If the string is a valid IPv4 address,
|
| 952 |
|
then the host is set to the address.
|
952 |
|
then the host is set to the address.
|
| 953 |
|
The host type is @ref host_type::ipv4.
|
953 |
|
The host type is @ref host_type::ipv4.
|
| 954 |
|
|
954 |
|
|
| 955 |
|
@li If the string is a valid IPv6 address
|
955 |
|
@li If the string is a valid IPv6 address
|
| 956 |
|
enclosed in square brackets, then the
|
956 |
|
enclosed in square brackets, then the
|
| 957 |
|
host is set to that address.
|
957 |
|
host is set to that address.
|
| 958 |
|
The host type is @ref host_type::ipv6.
|
958 |
|
The host type is @ref host_type::ipv6.
|
| 959 |
|
|
959 |
|
|
| 960 |
|
@li If the string is a valid IPvFuture
|
960 |
|
@li If the string is a valid IPvFuture
|
| 961 |
|
address enclosed in square brackets, then
|
961 |
|
address enclosed in square brackets, then
|
| 962 |
|
the host is set to that address.
|
962 |
|
the host is set to that address.
|
| 963 |
|
The host type is @ref host_type::ipvfuture.
|
963 |
|
The host type is @ref host_type::ipvfuture.
|
| 964 |
|
|
964 |
|
|
| 965 |
|
@li Otherwise, the host name is set to
|
965 |
|
@li Otherwise, the host name is set to
|
| 966 |
|
the string. This string can contain percent
|
966 |
|
the string. This string can contain percent
|
| 967 |
|
escapes, or can be empty.
|
967 |
|
escapes, or can be empty.
|
| 968 |
|
Escapes in the string are preserved,
|
968 |
|
Escapes in the string are preserved,
|
| 969 |
|
and reserved characters in the string
|
969 |
|
and reserved characters in the string
|
| 970 |
|
are percent-escaped in the result.
|
970 |
|
are percent-escaped in the result.
|
| 971 |
|
The host type is @ref host_type::name.
|
971 |
|
The host type is @ref host_type::name.
|
| 972 |
|
|
972 |
|
|
| 973 |
|
In all cases, when this function returns,
|
973 |
|
In all cases, when this function returns,
|
| 974 |
|
the URL contains an authority.
|
974 |
|
the URL contains an authority.
|
| 975 |
|
|
975 |
|
|
| 976 |
|
|
976 |
|
|
| 977 |
|
|
977 |
|
|
| 978 |
|
assert( url( "http://www.example.com" ).set_host( "127.0.0.1" ).buffer() == "http://127.0.0.1" );
|
978 |
|
assert( url( "http://www.example.com" ).set_host( "127.0.0.1" ).buffer() == "http://127.0.0.1" );
|
| 979 |
|
|
979 |
|
|
| 980 |
|
|
980 |
|
|
| 981 |
|
|
981 |
|
|
| 982 |
|
|
982 |
|
|
| 983 |
|
this->has_authority() == true
|
983 |
|
this->has_authority() == true
|
| 984 |
|
|
984 |
|
|
| 985 |
|
|
985 |
|
|
| 986 |
|
|
986 |
|
|
| 987 |
|
Linear in `this->size() + s.size()`.
|
987 |
|
Linear in `this->size() + s.size()`.
|
| 988 |
|
|
988 |
|
|
| 989 |
|
|
989 |
|
|
| 990 |
|
|
990 |
|
|
| 991 |
|
Calls to allocate may throw.
|
991 |
|
Calls to allocate may throw.
|
| 992 |
|
Exceptions thrown on invalid input.
|
992 |
|
Exceptions thrown on invalid input.
|
| 993 |
|
|
993 |
|
|
| 994 |
|
|
994 |
|
|
| 995 |
|
`s` contains an invalid percent-encoding.
|
995 |
|
`s` contains an invalid percent-encoding.
|
| 996 |
|
|
996 |
|
|
| 997 |
|
@param s The string to set.
|
997 |
|
@param s The string to set.
|
| 998 |
|
|
998 |
|
|
| 999 |
|
|
999 |
|
|
| 1000 |
|
|
1000 |
|
|
| 1001 |
|
|
1001 |
|
|
| 1002 |
|
|
1002 |
|
|
| 1003 |
|
host = IP-literal / IPv4address / reg-name
|
1003 |
|
host = IP-literal / IPv4address / reg-name
|
| 1004 |
|
|
1004 |
|
|
| 1005 |
|
IP-literal = "[" ( IPv6address / IPvFuture ) "]"
|
1005 |
|
IP-literal = "[" ( IPv6address / IPvFuture ) "]"
|
| 1006 |
|
|
1006 |
|
|
| 1007 |
|
reg-name = *( unreserved / pct-encoded / "-" / ".")
|
1007 |
|
reg-name = *( unreserved / pct-encoded / "-" / ".")
|
| 1008 |
|
|
1008 |
|
|
| 1009 |
|
|
1009 |
|
|
| 1010 |
|
|
1010 |
|
|
| 1011 |
|
@li <a href="https://en.wikipedia.org/wiki/IPv4"
|
1011 |
|
@li <a href="https://en.wikipedia.org/wiki/IPv4"
|
| 1012 |
|
|
1012 |
|
|
| 1013 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc4291"
|
1013 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc4291"
|
| 1014 |
|
>IP Version 6 Addressing Architecture (rfc4291)</a>
|
1014 |
|
>IP Version 6 Addressing Architecture (rfc4291)</a>
|
| 1015 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2">
|
1015 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2">
|
| 1016 |
|
3.2.2. Host (rfc3986)</a>
|
1016 |
|
3.2.2. Host (rfc3986)</a>
|
| 1017 |
|
|
1017 |
|
|
| 1018 |
|
|
1018 |
|
|
| 1019 |
|
@ref set_encoded_host_address,
|
1019 |
|
@ref set_encoded_host_address,
|
| 1020 |
|
@ref set_encoded_host_name,
|
1020 |
|
@ref set_encoded_host_name,
|
| 1021 |
|
|
1021 |
|
|
| 1022 |
|
|
1022 |
|
|
| 1023 |
|
|
1023 |
|
|
| 1024 |
|
|
1024 |
|
|
| 1025 |
|
|
1025 |
|
|
| 1026 |
|
|
1026 |
|
|
| 1027 |
|
|
1027 |
|
|
| 1028 |
|
|
1028 |
|
|
| 1029 |
|
set_encoded_host(pct_string_view s);
|
1029 |
|
set_encoded_host(pct_string_view s);
|
| 1030 |
|
|
1030 |
|
|
| 1031 |
|
/** Set the host to an address
|
1031 |
|
/** Set the host to an address
|
| 1032 |
|
|
1032 |
|
|
| 1033 |
|
Depending on the contents of the passed
|
1033 |
|
Depending on the contents of the passed
|
| 1034 |
|
string, this function sets the host:
|
1034 |
|
string, this function sets the host:
|
| 1035 |
|
|
1035 |
|
|
| 1036 |
|
@li If the string is a valid IPv4 address,
|
1036 |
|
@li If the string is a valid IPv4 address,
|
| 1037 |
|
then the host is set to the address.
|
1037 |
|
then the host is set to the address.
|
| 1038 |
|
The host type is @ref host_type::ipv4.
|
1038 |
|
The host type is @ref host_type::ipv4.
|
| 1039 |
|
|
1039 |
|
|
| 1040 |
|
@li If the string is a valid IPv6 address,
|
1040 |
|
@li If the string is a valid IPv6 address,
|
| 1041 |
|
then the host is set to that address.
|
1041 |
|
then the host is set to that address.
|
| 1042 |
|
The host type is @ref host_type::ipv6.
|
1042 |
|
The host type is @ref host_type::ipv6.
|
| 1043 |
|
|
1043 |
|
|
| 1044 |
|
@li If the string is a valid IPvFuture,
|
1044 |
|
@li If the string is a valid IPvFuture,
|
| 1045 |
|
then the host is set to that address.
|
1045 |
|
then the host is set to that address.
|
| 1046 |
|
The host type is @ref host_type::ipvfuture.
|
1046 |
|
The host type is @ref host_type::ipvfuture.
|
| 1047 |
|
|
1047 |
|
|
| 1048 |
|
@li Otherwise, the host name is set to
|
1048 |
|
@li Otherwise, the host name is set to
|
| 1049 |
|
the string, which may be empty.
|
1049 |
|
the string, which may be empty.
|
| 1050 |
|
Reserved characters in the string are
|
1050 |
|
Reserved characters in the string are
|
| 1051 |
|
percent-escaped in the result.
|
1051 |
|
percent-escaped in the result.
|
| 1052 |
|
The host type is @ref host_type::name.
|
1052 |
|
The host type is @ref host_type::name.
|
| 1053 |
|
|
1053 |
|
|
| 1054 |
|
In all cases, when this function returns,
|
1054 |
|
In all cases, when this function returns,
|
| 1055 |
|
the URL contains an authority.
|
1055 |
|
the URL contains an authority.
|
| 1056 |
|
|
1056 |
|
|
| 1057 |
|
|
1057 |
|
|
| 1058 |
|
|
1058 |
|
|
| 1059 |
|
assert( url( "http://www.example.com" ).set_host_address( "127.0.0.1" ).buffer() == "http://127.0.0.1" );
|
1059 |
|
assert( url( "http://www.example.com" ).set_host_address( "127.0.0.1" ).buffer() == "http://127.0.0.1" );
|
| 1060 |
|
|
1060 |
|
|
| 1061 |
|
|
1061 |
|
|
| 1062 |
|
|
1062 |
|
|
| 1063 |
|
|
1063 |
|
|
| 1064 |
|
this->has_authority() == true
|
1064 |
|
this->has_authority() == true
|
| 1065 |
|
|
1065 |
|
|
| 1066 |
|
|
1066 |
|
|
| 1067 |
|
|
1067 |
|
|
| 1068 |
|
|
1068 |
|
|
| 1069 |
|
|
1069 |
|
|
| 1070 |
|
|
1070 |
|
|
| 1071 |
|
|
1071 |
|
|
| 1072 |
|
Calls to allocate may throw.
|
1072 |
|
Calls to allocate may throw.
|
| 1073 |
|
|
1073 |
|
|
| 1074 |
|
|
1074 |
|
|
| 1075 |
|
|
1075 |
|
|
| 1076 |
|
IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet
|
1076 |
|
IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet
|
| 1077 |
|
|
1077 |
|
|
| 1078 |
|
|
1078 |
|
|
| 1079 |
|
|
1079 |
|
|
| 1080 |
|
|
1080 |
|
|
| 1081 |
|
/ "2" %x30-34 DIGIT ; 200-249
|
1081 |
|
/ "2" %x30-34 DIGIT ; 200-249
|
| 1082 |
|
|
1082 |
|
|
| 1083 |
|
|
1083 |
|
|
| 1084 |
|
IPv6address = 6( h16 ":" ) ls32
|
1084 |
|
IPv6address = 6( h16 ":" ) ls32
|
| 1085 |
|
|
1085 |
|
|
| 1086 |
|
/ [ h16 ] "::" 4( h16 ":" ) ls32
|
1086 |
|
/ [ h16 ] "::" 4( h16 ":" ) ls32
|
| 1087 |
|
/ [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
|
1087 |
|
/ [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
|
| 1088 |
|
/ [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
|
1088 |
|
/ [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
|
| 1089 |
|
/ [ *3( h16 ":" ) h16 ] "::" h16 ":" ls32
|
1089 |
|
/ [ *3( h16 ":" ) h16 ] "::" h16 ":" ls32
|
| 1090 |
|
/ [ *4( h16 ":" ) h16 ] "::" ls32
|
1090 |
|
/ [ *4( h16 ":" ) h16 ] "::" ls32
|
| 1091 |
|
/ [ *5( h16 ":" ) h16 ] "::" h16
|
1091 |
|
/ [ *5( h16 ":" ) h16 ] "::" h16
|
| 1092 |
|
/ [ *6( h16 ":" ) h16 ] "::"
|
1092 |
|
/ [ *6( h16 ":" ) h16 ] "::"
|
| 1093 |
|
|
1093 |
|
|
| 1094 |
|
ls32 = ( h16 ":" h16 ) / IPv4address
|
1094 |
|
ls32 = ( h16 ":" h16 ) / IPv4address
|
| 1095 |
|
; least-significant 32 bits of address
|
1095 |
|
; least-significant 32 bits of address
|
| 1096 |
|
|
1096 |
|
|
| 1097 |
|
|
1097 |
|
|
| 1098 |
|
; 16 bits of address represented in hexadecimal
|
1098 |
|
; 16 bits of address represented in hexadecimal
|
| 1099 |
|
|
1099 |
|
|
| 1100 |
|
IPvFuture = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )
|
1100 |
|
IPvFuture = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )
|
| 1101 |
|
|
1101 |
|
|
| 1102 |
|
reg-name = *( unreserved / pct-encoded / "-" / ".")
|
1102 |
|
reg-name = *( unreserved / pct-encoded / "-" / ".")
|
| 1103 |
|
|
1103 |
|
|
| 1104 |
|
|
1104 |
|
|
| 1105 |
|
@param s The string to set.
|
1105 |
|
@param s The string to set.
|
| 1106 |
|
|
1106 |
|
|
| 1107 |
|
|
1107 |
|
|
| 1108 |
|
|
1108 |
|
|
| 1109 |
|
@li <a href="https://en.wikipedia.org/wiki/IPv4"
|
1109 |
|
@li <a href="https://en.wikipedia.org/wiki/IPv4"
|
| 1110 |
|
|
1110 |
|
|
| 1111 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc4291"
|
1111 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc4291"
|
| 1112 |
|
>IP Version 6 Addressing Architecture (rfc4291)</a>
|
1112 |
|
>IP Version 6 Addressing Architecture (rfc4291)</a>
|
| 1113 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2">
|
1113 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2">
|
| 1114 |
|
3.2.2. Host (rfc3986)</a>
|
1114 |
|
3.2.2. Host (rfc3986)</a>
|
| 1115 |
|
|
1115 |
|
|
| 1116 |
|
|
1116 |
|
|
| 1117 |
|
|
1117 |
|
|
| 1118 |
|
@ref set_encoded_host_address,
|
1118 |
|
@ref set_encoded_host_address,
|
| 1119 |
|
@ref set_encoded_host_name,
|
1119 |
|
@ref set_encoded_host_name,
|
| 1120 |
|
|
1120 |
|
|
| 1121 |
|
|
1121 |
|
|
| 1122 |
|
|
1122 |
|
|
| 1123 |
|
|
1123 |
|
|
| 1124 |
|
|
1124 |
|
|
| 1125 |
|
|
1125 |
|
|
| 1126 |
|
|
1126 |
|
|
| 1127 |
|
|
1127 |
|
|
| 1128 |
|
set_host_address(core::string_view s);
|
1128 |
|
set_host_address(core::string_view s);
|
| 1129 |
|
|
1129 |
|
|
| 1130 |
|
/** Set the host to an address
|
1130 |
|
/** Set the host to an address
|
| 1131 |
|
|
1131 |
|
|
| 1132 |
|
Depending on the contents of the passed
|
1132 |
|
Depending on the contents of the passed
|
| 1133 |
|
string, this function sets the host:
|
1133 |
|
string, this function sets the host:
|
| 1134 |
|
|
1134 |
|
|
| 1135 |
|
@li If the string is a valid IPv4 address,
|
1135 |
|
@li If the string is a valid IPv4 address,
|
| 1136 |
|
then the host is set to the address.
|
1136 |
|
then the host is set to the address.
|
| 1137 |
|
The host type is @ref host_type::ipv4.
|
1137 |
|
The host type is @ref host_type::ipv4.
|
| 1138 |
|
|
1138 |
|
|
| 1139 |
|
@li If the string is a valid IPv6 address,
|
1139 |
|
@li If the string is a valid IPv6 address,
|
| 1140 |
|
then the host is set to that address.
|
1140 |
|
then the host is set to that address.
|
| 1141 |
|
The host type is @ref host_type::ipv6.
|
1141 |
|
The host type is @ref host_type::ipv6.
|
| 1142 |
|
|
1142 |
|
|
| 1143 |
|
@li If the string is a valid IPvFuture,
|
1143 |
|
@li If the string is a valid IPvFuture,
|
| 1144 |
|
then the host is set to that address.
|
1144 |
|
then the host is set to that address.
|
| 1145 |
|
The host type is @ref host_type::ipvfuture.
|
1145 |
|
The host type is @ref host_type::ipvfuture.
|
| 1146 |
|
|
1146 |
|
|
| 1147 |
|
@li Otherwise, the host name is set to
|
1147 |
|
@li Otherwise, the host name is set to
|
| 1148 |
|
the string. This string can contain percent
|
1148 |
|
the string. This string can contain percent
|
| 1149 |
|
escapes, or can be empty.
|
1149 |
|
escapes, or can be empty.
|
| 1150 |
|
Escapes in the string are preserved,
|
1150 |
|
Escapes in the string are preserved,
|
| 1151 |
|
and reserved characters in the string
|
1151 |
|
and reserved characters in the string
|
| 1152 |
|
are percent-escaped in the result.
|
1152 |
|
are percent-escaped in the result.
|
| 1153 |
|
The host type is @ref host_type::name.
|
1153 |
|
The host type is @ref host_type::name.
|
| 1154 |
|
|
1154 |
|
|
| 1155 |
|
In all cases, when this function returns,
|
1155 |
|
In all cases, when this function returns,
|
| 1156 |
|
the URL contains an authority.
|
1156 |
|
the URL contains an authority.
|
| 1157 |
|
|
1157 |
|
|
| 1158 |
|
|
1158 |
|
|
| 1159 |
|
|
1159 |
|
|
| 1160 |
|
assert( url( "http://www.example.com" ).set_host( "127.0.0.1" ).buffer() == "http://127.0.0.1" );
|
1160 |
|
assert( url( "http://www.example.com" ).set_host( "127.0.0.1" ).buffer() == "http://127.0.0.1" );
|
| 1161 |
|
|
1161 |
|
|
| 1162 |
|
|
1162 |
|
|
| 1163 |
|
|
1163 |
|
|
| 1164 |
|
|
1164 |
|
|
| 1165 |
|
this->has_authority() == true
|
1165 |
|
this->has_authority() == true
|
| 1166 |
|
|
1166 |
|
|
| 1167 |
|
|
1167 |
|
|
| 1168 |
|
|
1168 |
|
|
| 1169 |
|
Linear in `this->size() + s.size()`.
|
1169 |
|
Linear in `this->size() + s.size()`.
|
| 1170 |
|
|
1170 |
|
|
| 1171 |
|
|
1171 |
|
|
| 1172 |
|
|
1172 |
|
|
| 1173 |
|
Calls to allocate may throw.
|
1173 |
|
Calls to allocate may throw.
|
| 1174 |
|
Exceptions thrown on invalid input.
|
1174 |
|
Exceptions thrown on invalid input.
|
| 1175 |
|
|
1175 |
|
|
| 1176 |
|
|
1176 |
|
|
| 1177 |
|
`s` contains an invalid percent-encoding.
|
1177 |
|
`s` contains an invalid percent-encoding.
|
| 1178 |
|
|
1178 |
|
|
| 1179 |
|
|
1179 |
|
|
| 1180 |
|
|
1180 |
|
|
| 1181 |
|
IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet
|
1181 |
|
IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet
|
| 1182 |
|
|
1182 |
|
|
| 1183 |
|
|
1183 |
|
|
| 1184 |
|
|
1184 |
|
|
| 1185 |
|
|
1185 |
|
|
| 1186 |
|
/ "2" %x30-34 DIGIT ; 200-249
|
1186 |
|
/ "2" %x30-34 DIGIT ; 200-249
|
| 1187 |
|
|
1187 |
|
|
| 1188 |
|
|
1188 |
|
|
| 1189 |
|
IPv6address = 6( h16 ":" ) ls32
|
1189 |
|
IPv6address = 6( h16 ":" ) ls32
|
| 1190 |
|
|
1190 |
|
|
| 1191 |
|
/ [ h16 ] "::" 4( h16 ":" ) ls32
|
1191 |
|
/ [ h16 ] "::" 4( h16 ":" ) ls32
|
| 1192 |
|
/ [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
|
1192 |
|
/ [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
|
| 1193 |
|
/ [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
|
1193 |
|
/ [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
|
| 1194 |
|
/ [ *3( h16 ":" ) h16 ] "::" h16 ":" ls32
|
1194 |
|
/ [ *3( h16 ":" ) h16 ] "::" h16 ":" ls32
|
| 1195 |
|
/ [ *4( h16 ":" ) h16 ] "::" ls32
|
1195 |
|
/ [ *4( h16 ":" ) h16 ] "::" ls32
|
| 1196 |
|
/ [ *5( h16 ":" ) h16 ] "::" h16
|
1196 |
|
/ [ *5( h16 ":" ) h16 ] "::" h16
|
| 1197 |
|
/ [ *6( h16 ":" ) h16 ] "::"
|
1197 |
|
/ [ *6( h16 ":" ) h16 ] "::"
|
| 1198 |
|
|
1198 |
|
|
| 1199 |
|
ls32 = ( h16 ":" h16 ) / IPv4address
|
1199 |
|
ls32 = ( h16 ":" h16 ) / IPv4address
|
| 1200 |
|
; least-significant 32 bits of address
|
1200 |
|
; least-significant 32 bits of address
|
| 1201 |
|
|
1201 |
|
|
| 1202 |
|
|
1202 |
|
|
| 1203 |
|
; 16 bits of address represented in hexadecimal
|
1203 |
|
; 16 bits of address represented in hexadecimal
|
| 1204 |
|
|
1204 |
|
|
| 1205 |
|
IPvFuture = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )
|
1205 |
|
IPvFuture = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )
|
| 1206 |
|
|
1206 |
|
|
| 1207 |
|
reg-name = *( unreserved / pct-encoded / "-" / ".")
|
1207 |
|
reg-name = *( unreserved / pct-encoded / "-" / ".")
|
| 1208 |
|
|
1208 |
|
|
| 1209 |
|
|
1209 |
|
|
| 1210 |
|
@param s The string to set.
|
1210 |
|
@param s The string to set.
|
| 1211 |
|
|
1211 |
|
|
| 1212 |
|
|
1212 |
|
|
| 1213 |
|
|
1213 |
|
|
| 1214 |
|
@li <a href="https://en.wikipedia.org/wiki/IPv4"
|
1214 |
|
@li <a href="https://en.wikipedia.org/wiki/IPv4"
|
| 1215 |
|
|
1215 |
|
|
| 1216 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc4291"
|
1216 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc4291"
|
| 1217 |
|
>IP Version 6 Addressing Architecture (rfc4291)</a>
|
1217 |
|
>IP Version 6 Addressing Architecture (rfc4291)</a>
|
| 1218 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2">
|
1218 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2">
|
| 1219 |
|
3.2.2. Host (rfc3986)</a>
|
1219 |
|
3.2.2. Host (rfc3986)</a>
|
| 1220 |
|
|
1220 |
|
|
| 1221 |
|
|
1221 |
|
|
| 1222 |
|
|
1222 |
|
|
| 1223 |
|
@ref set_encoded_host_name,
|
1223 |
|
@ref set_encoded_host_name,
|
| 1224 |
|
|
1224 |
|
|
| 1225 |
|
|
1225 |
|
|
| 1226 |
|
|
1226 |
|
|
| 1227 |
|
|
1227 |
|
|
| 1228 |
|
|
1228 |
|
|
| 1229 |
|
|
1229 |
|
|
| 1230 |
|
|
1230 |
|
|
| 1231 |
|
|
1231 |
|
|
| 1232 |
|
set_encoded_host_address(
|
1232 |
|
set_encoded_host_address(
|
| 1233 |
|
|
1233 |
|
|
| 1234 |
|
|
1234 |
|
|
| 1235 |
|
/** Set the host to an address
|
1235 |
|
/** Set the host to an address
|
| 1236 |
|
|
1236 |
|
|
| 1237 |
|
The host is set to the specified IPv4
|
1237 |
|
The host is set to the specified IPv4
|
| 1238 |
|
|
1238 |
|
|
| 1239 |
|
The host type is @ref host_type::ipv4.
|
1239 |
|
The host type is @ref host_type::ipv4.
|
| 1240 |
|
|
1240 |
|
|
| 1241 |
|
|
1241 |
|
|
| 1242 |
|
|
1242 |
|
|
| 1243 |
|
assert( url("http://www.example.com").set_host_ipv4( ipv4_address( "127.0.0.1" ) ).buffer() == "http://127.0.0.1" );
|
1243 |
|
assert( url("http://www.example.com").set_host_ipv4( ipv4_address( "127.0.0.1" ) ).buffer() == "http://127.0.0.1" );
|
| 1244 |
|
|
1244 |
|
|
| 1245 |
|
|
1245 |
|
|
| 1246 |
|
|
1246 |
|
|
| 1247 |
|
Linear in `this->size()`.
|
1247 |
|
Linear in `this->size()`.
|
| 1248 |
|
|
1248 |
|
|
| 1249 |
|
|
1249 |
|
|
| 1250 |
|
|
1250 |
|
|
| 1251 |
|
this->has_authority() == true && this->host_ipv4_address() == addr && this->host_type() == host_type::ipv4
|
1251 |
|
this->has_authority() == true && this->host_ipv4_address() == addr && this->host_type() == host_type::ipv4
|
| 1252 |
|
|
1252 |
|
|
| 1253 |
|
|
1253 |
|
|
| 1254 |
|
|
1254 |
|
|
| 1255 |
|
|
1255 |
|
|
| 1256 |
|
Calls to allocate may throw.
|
1256 |
|
Calls to allocate may throw.
|
| 1257 |
|
|
1257 |
|
|
| 1258 |
|
@param addr The address to set.
|
1258 |
|
@param addr The address to set.
|
| 1259 |
|
|
1259 |
|
|
| 1260 |
|
|
1260 |
|
|
| 1261 |
|
|
1261 |
|
|
| 1262 |
|
|
1262 |
|
|
| 1263 |
|
IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet
|
1263 |
|
IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet
|
| 1264 |
|
|
1264 |
|
|
| 1265 |
|
|
1265 |
|
|
| 1266 |
|
|
1266 |
|
|
| 1267 |
|
|
1267 |
|
|
| 1268 |
|
/ "2" %x30-34 DIGIT ; 200-249
|
1268 |
|
/ "2" %x30-34 DIGIT ; 200-249
|
| 1269 |
|
|
1269 |
|
|
| 1270 |
|
|
1270 |
|
|
| 1271 |
|
|
1271 |
|
|
| 1272 |
|
|
1272 |
|
|
| 1273 |
|
@li <a href="https://en.wikipedia.org/wiki/IPv4"
|
1273 |
|
@li <a href="https://en.wikipedia.org/wiki/IPv4"
|
| 1274 |
|
|
1274 |
|
|
| 1275 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2">
|
1275 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2">
|
| 1276 |
|
3.2.2. Host (rfc3986)</a>
|
1276 |
|
3.2.2. Host (rfc3986)</a>
|
| 1277 |
|
|
1277 |
|
|
| 1278 |
|
|
1278 |
|
|
| 1279 |
|
|
1279 |
|
|
| 1280 |
|
@ref set_encoded_host_address,
|
1280 |
|
@ref set_encoded_host_address,
|
| 1281 |
|
@ref set_encoded_host_name,
|
1281 |
|
@ref set_encoded_host_name,
|
| 1282 |
|
|
1282 |
|
|
| 1283 |
|
|
1283 |
|
|
| 1284 |
|
|
1284 |
|
|
| 1285 |
|
|
1285 |
|
|
| 1286 |
|
|
1286 |
|
|
| 1287 |
|
|
1287 |
|
|
| 1288 |
|
|
1288 |
|
|
| 1289 |
|
|
1289 |
|
|
| 1290 |
|
ipv4_address const& addr);
|
1290 |
|
ipv4_address const& addr);
|
| 1291 |
|
|
1291 |
|
|
| 1292 |
|
/** Set the host to an address
|
1292 |
|
/** Set the host to an address
|
| 1293 |
|
|
1293 |
|
|
| 1294 |
|
The host is set to the specified IPv6
|
1294 |
|
The host is set to the specified IPv6
|
| 1295 |
|
|
1295 |
|
|
| 1296 |
|
The host type is @ref host_type::ipv6.
|
1296 |
|
The host type is @ref host_type::ipv6.
|
| 1297 |
|
|
1297 |
|
|
| 1298 |
|
|
1298 |
|
|
| 1299 |
|
|
1299 |
|
|
| 1300 |
|
assert( url().set_host_ipv6( ipv6_address( "1::6:c0a8:1" ) ).authority().buffer() == "[1::6:c0a8:1]" );
|
1300 |
|
assert( url().set_host_ipv6( ipv6_address( "1::6:c0a8:1" ) ).authority().buffer() == "[1::6:c0a8:1]" );
|
| 1301 |
|
|
1301 |
|
|
| 1302 |
|
|
1302 |
|
|
| 1303 |
|
|
1303 |
|
|
| 1304 |
|
|
1304 |
|
|
| 1305 |
|
this->has_authority() == true && this->host_ipv6_address() == addr && this->host_type() == host_type::ipv6
|
1305 |
|
this->has_authority() == true && this->host_ipv6_address() == addr && this->host_type() == host_type::ipv6
|
| 1306 |
|
|
1306 |
|
|
| 1307 |
|
|
1307 |
|
|
| 1308 |
|
|
1308 |
|
|
| 1309 |
|
Linear in `this->size()`.
|
1309 |
|
Linear in `this->size()`.
|
| 1310 |
|
|
1310 |
|
|
| 1311 |
|
|
1311 |
|
|
| 1312 |
|
|
1312 |
|
|
| 1313 |
|
Calls to allocate may throw.
|
1313 |
|
Calls to allocate may throw.
|
| 1314 |
|
|
1314 |
|
|
| 1315 |
|
@param addr The address to set.
|
1315 |
|
@param addr The address to set.
|
| 1316 |
|
|
1316 |
|
|
| 1317 |
|
|
1317 |
|
|
| 1318 |
|
|
1318 |
|
|
| 1319 |
|
|
1319 |
|
|
| 1320 |
|
|
1320 |
|
|
| 1321 |
|
IPv6address = 6( h16 ":" ) ls32
|
1321 |
|
IPv6address = 6( h16 ":" ) ls32
|
| 1322 |
|
|
1322 |
|
|
| 1323 |
|
/ [ h16 ] "::" 4( h16 ":" ) ls32
|
1323 |
|
/ [ h16 ] "::" 4( h16 ":" ) ls32
|
| 1324 |
|
/ [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
|
1324 |
|
/ [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
|
| 1325 |
|
/ [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
|
1325 |
|
/ [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
|
| 1326 |
|
/ [ *3( h16 ":" ) h16 ] "::" h16 ":" ls32
|
1326 |
|
/ [ *3( h16 ":" ) h16 ] "::" h16 ":" ls32
|
| 1327 |
|
/ [ *4( h16 ":" ) h16 ] "::" ls32
|
1327 |
|
/ [ *4( h16 ":" ) h16 ] "::" ls32
|
| 1328 |
|
/ [ *5( h16 ":" ) h16 ] "::" h16
|
1328 |
|
/ [ *5( h16 ":" ) h16 ] "::" h16
|
| 1329 |
|
/ [ *6( h16 ":" ) h16 ] "::"
|
1329 |
|
/ [ *6( h16 ":" ) h16 ] "::"
|
| 1330 |
|
|
1330 |
|
|
| 1331 |
|
ls32 = ( h16 ":" h16 ) / IPv4address
|
1331 |
|
ls32 = ( h16 ":" h16 ) / IPv4address
|
| 1332 |
|
; least-significant 32 bits of address
|
1332 |
|
; least-significant 32 bits of address
|
| 1333 |
|
|
1333 |
|
|
| 1334 |
|
|
1334 |
|
|
| 1335 |
|
; 16 bits of address represented in hexadecimal
|
1335 |
|
; 16 bits of address represented in hexadecimal
|
| 1336 |
|
|
1336 |
|
|
| 1337 |
|
|
1337 |
|
|
| 1338 |
|
|
1338 |
|
|
| 1339 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc4291"
|
1339 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc4291"
|
| 1340 |
|
>IP Version 6 Addressing Architecture (rfc4291)</a>
|
1340 |
|
>IP Version 6 Addressing Architecture (rfc4291)</a>
|
| 1341 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2">
|
1341 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2">
|
| 1342 |
|
3.2.2. Host (rfc3986)</a>
|
1342 |
|
3.2.2. Host (rfc3986)</a>
|
| 1343 |
|
|
1343 |
|
|
| 1344 |
|
|
1344 |
|
|
| 1345 |
|
|
1345 |
|
|
| 1346 |
|
@ref set_encoded_host_address,
|
1346 |
|
@ref set_encoded_host_address,
|
| 1347 |
|
@ref set_encoded_host_name,
|
1347 |
|
@ref set_encoded_host_name,
|
| 1348 |
|
|
1348 |
|
|
| 1349 |
|
|
1349 |
|
|
| 1350 |
|
|
1350 |
|
|
| 1351 |
|
|
1351 |
|
|
| 1352 |
|
|
1352 |
|
|
| 1353 |
|
|
1353 |
|
|
| 1354 |
|
|
1354 |
|
|
| 1355 |
|
|
1355 |
|
|
| 1356 |
|
ipv6_address const& addr);
|
1356 |
|
ipv6_address const& addr);
|
| 1357 |
|
|
1357 |
|
|
| 1358 |
|
/** Set the zone ID for an IPv6 address.
|
1358 |
|
/** Set the zone ID for an IPv6 address.
|
| 1359 |
|
|
1359 |
|
|
| 1360 |
|
This function sets the zone ID for the host if the host is an IPv6 address.
|
1360 |
|
This function sets the zone ID for the host if the host is an IPv6 address.
|
| 1361 |
|
Reserved characters in the string are percent-escaped in the result.
|
1361 |
|
Reserved characters in the string are percent-escaped in the result.
|
| 1362 |
|
|
1362 |
|
|
| 1363 |
|
|
1363 |
|
|
| 1364 |
|
|
1364 |
|
|
| 1365 |
|
assert( u.set_host_ipv6( ipv6_address( "fe80::1" ) ).set_zone_id( "eth0" ).buffer() == "https://[fe80::1%25eth0]" );
|
1365 |
|
assert( u.set_host_ipv6( ipv6_address( "fe80::1" ) ).set_zone_id( "eth0" ).buffer() == "https://[fe80::1%25eth0]" );
|
| 1366 |
|
|
1366 |
|
|
| 1367 |
|
|
1367 |
|
|
| 1368 |
|
|
1368 |
|
|
| 1369 |
|
Linear in `this->size()`.
|
1369 |
|
Linear in `this->size()`.
|
| 1370 |
|
|
1370 |
|
|
| 1371 |
|
|
1371 |
|
|
| 1372 |
|
Strong guarantee. Calls to allocate may throw.
|
1372 |
|
Strong guarantee. Calls to allocate may throw.
|
| 1373 |
|
|
1373 |
|
|
| 1374 |
|
@param s The zone ID to set.
|
1374 |
|
@param s The zone ID to set.
|
| 1375 |
|
|
1375 |
|
|
| 1376 |
|
|
1376 |
|
|
| 1377 |
|
|
1377 |
|
|
| 1378 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc6874">RFC 6874</a>
|
1378 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc6874">RFC 6874</a>
|
| 1379 |
|
|
1379 |
|
|
| 1380 |
|
|
1380 |
|
|
| 1381 |
|
|
1381 |
|
|
| 1382 |
|
set_zone_id(core::string_view s);
|
1382 |
|
set_zone_id(core::string_view s);
|
| 1383 |
|
|
1383 |
|
|
| 1384 |
|
/** Set the zone ID for an IPv6 address (percent-encoded).
|
1384 |
|
/** Set the zone ID for an IPv6 address (percent-encoded).
|
| 1385 |
|
|
1385 |
|
|
| 1386 |
|
This function sets the zone ID for the host if the host is an IPv6 address.
|
1386 |
|
This function sets the zone ID for the host if the host is an IPv6 address.
|
| 1387 |
|
Escapes in the string are preserved, and reserved characters in the string
|
1387 |
|
Escapes in the string are preserved, and reserved characters in the string
|
| 1388 |
|
are percent-escaped in the result.
|
1388 |
|
are percent-escaped in the result.
|
| 1389 |
|
|
1389 |
|
|
| 1390 |
|
|
1390 |
|
|
| 1391 |
|
|
1391 |
|
|
| 1392 |
|
assert( u.set_host_ipv6( ipv6_address( "fe80::1" ) ).set_encoded_zone_id( "eth0" ).buffer() == "https://[fe80::1%25eth0]" );
|
1392 |
|
assert( u.set_host_ipv6( ipv6_address( "fe80::1" ) ).set_encoded_zone_id( "eth0" ).buffer() == "https://[fe80::1%25eth0]" );
|
| 1393 |
|
|
1393 |
|
|
| 1394 |
|
|
1394 |
|
|
| 1395 |
|
|
1395 |
|
|
| 1396 |
|
Linear in `this->size()`.
|
1396 |
|
Linear in `this->size()`.
|
| 1397 |
|
|
1397 |
|
|
| 1398 |
|
|
1398 |
|
|
| 1399 |
|
Strong guarantee. Calls to allocate may throw.
|
1399 |
|
Strong guarantee. Calls to allocate may throw.
|
| 1400 |
|
Exceptions thrown on invalid input.
|
1400 |
|
Exceptions thrown on invalid input.
|
| 1401 |
|
|
1401 |
|
|
| 1402 |
|
|
1402 |
|
|
| 1403 |
|
`s` contains an invalid percent-encoding.
|
1403 |
|
`s` contains an invalid percent-encoding.
|
| 1404 |
|
|
1404 |
|
|
| 1405 |
|
@param s The zone ID to set.
|
1405 |
|
@param s The zone ID to set.
|
| 1406 |
|
|
1406 |
|
|
| 1407 |
|
|
1407 |
|
|
| 1408 |
|
|
1408 |
|
|
| 1409 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc6874">RFC 6874</a>
|
1409 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc6874">RFC 6874</a>
|
| 1410 |
|
|
1410 |
|
|
| 1411 |
|
|
1411 |
|
|
| 1412 |
|
|
1412 |
|
|
| 1413 |
|
set_encoded_zone_id(pct_string_view s);
|
1413 |
|
set_encoded_zone_id(pct_string_view s);
|
| 1414 |
|
|
1414 |
|
|
| 1415 |
|
/** Set the host to an address
|
1415 |
|
/** Set the host to an address
|
| 1416 |
|
|
1416 |
|
|
| 1417 |
|
The host is set to the specified IPvFuture
|
1417 |
|
The host is set to the specified IPvFuture
|
| 1418 |
|
|
1418 |
|
|
| 1419 |
|
The host type is @ref host_type::ipvfuture.
|
1419 |
|
The host type is @ref host_type::ipvfuture.
|
| 1420 |
|
|
1420 |
|
|
| 1421 |
|
|
1421 |
|
|
| 1422 |
|
|
1422 |
|
|
| 1423 |
|
assert( url().set_host_ipvfuture( "v42.bis" ).buffer() == "//[v42.bis]" );
|
1423 |
|
assert( url().set_host_ipvfuture( "v42.bis" ).buffer() == "//[v42.bis]" );
|
| 1424 |
|
|
1424 |
|
|
| 1425 |
|
|
1425 |
|
|
| 1426 |
|
|
1426 |
|
|
| 1427 |
|
Linear in `this->size() + s.size()`.
|
1427 |
|
Linear in `this->size() + s.size()`.
|
| 1428 |
|
|
1428 |
|
|
| 1429 |
|
|
1429 |
|
|
| 1430 |
|
|
1430 |
|
|
| 1431 |
|
this->has_authority() == true && this->host_ipvfuture) == s && this->host_type() == host_type::ipvfuture
|
1431 |
|
this->has_authority() == true && this->host_ipvfuture) == s && this->host_type() == host_type::ipvfuture
|
| 1432 |
|
|
1432 |
|
|
| 1433 |
|
|
1433 |
|
|
| 1434 |
|
|
1434 |
|
|
| 1435 |
|
|
1435 |
|
|
| 1436 |
|
Calls to allocate may throw.
|
1436 |
|
Calls to allocate may throw.
|
| 1437 |
|
Exceptions thrown on invalid input.
|
1437 |
|
Exceptions thrown on invalid input.
|
| 1438 |
|
|
1438 |
|
|
| 1439 |
|
|
1439 |
|
|
| 1440 |
|
`s` contains an invalid percent-encoding.
|
1440 |
|
`s` contains an invalid percent-encoding.
|
| 1441 |
|
|
1441 |
|
|
| 1442 |
|
@param s The string to set.
|
1442 |
|
@param s The string to set.
|
| 1443 |
|
|
1443 |
|
|
| 1444 |
|
|
1444 |
|
|
| 1445 |
|
|
1445 |
|
|
| 1446 |
|
|
1446 |
|
|
| 1447 |
|
|
1447 |
|
|
| 1448 |
|
IPvFuture = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )
|
1448 |
|
IPvFuture = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )
|
| 1449 |
|
|
1449 |
|
|
| 1450 |
|
|
1450 |
|
|
| 1451 |
|
|
1451 |
|
|
| 1452 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2">
|
1452 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2">
|
| 1453 |
|
3.2.2. Host (rfc3986)</a>
|
1453 |
|
3.2.2. Host (rfc3986)</a>
|
| 1454 |
|
|
1454 |
|
|
| 1455 |
|
|
1455 |
|
|
| 1456 |
|
|
1456 |
|
|
| 1457 |
|
@ref set_encoded_host_address,
|
1457 |
|
@ref set_encoded_host_address,
|
| 1458 |
|
@ref set_encoded_host_name,
|
1458 |
|
@ref set_encoded_host_name,
|
| 1459 |
|
|
1459 |
|
|
| 1460 |
|
|
1460 |
|
|
| 1461 |
|
|
1461 |
|
|
| 1462 |
|
|
1462 |
|
|
| 1463 |
|
|
1463 |
|
|
| 1464 |
|
|
1464 |
|
|
| 1465 |
|
|
1465 |
|
|
| 1466 |
|
|
1466 |
|
|
| 1467 |
|
|
1467 |
|
|
| 1468 |
|
|
1468 |
|
|
| 1469 |
|
/** Set the host to a name
|
1469 |
|
/** Set the host to a name
|
| 1470 |
|
|
1470 |
|
|
| 1471 |
|
The host is set to the specified string,
|
1471 |
|
The host is set to the specified string,
|
| 1472 |
|
|
1472 |
|
|
| 1473 |
|
Reserved characters in the string are
|
1473 |
|
Reserved characters in the string are
|
| 1474 |
|
percent-escaped in the result.
|
1474 |
|
percent-escaped in the result.
|
| 1475 |
|
The host type is @ref host_type::name.
|
1475 |
|
The host type is @ref host_type::name.
|
| 1476 |
|
|
1476 |
|
|
| 1477 |
|
|
1477 |
|
|
| 1478 |
|
|
1478 |
|
|
| 1479 |
|
assert( url( "http://www.example.com/index.htm").set_host_name( "localhost" ).host_address() == "localhost" );
|
1479 |
|
assert( url( "http://www.example.com/index.htm").set_host_name( "localhost" ).host_address() == "localhost" );
|
| 1480 |
|
|
1480 |
|
|
| 1481 |
|
|
1481 |
|
|
| 1482 |
|
|
1482 |
|
|
| 1483 |
|
|
1483 |
|
|
| 1484 |
|
this->has_authority() == true && this->host_ipv6_address() == addr && this->host_type() == host_type::name
|
1484 |
|
this->has_authority() == true && this->host_ipv6_address() == addr && this->host_type() == host_type::name
|
| 1485 |
|
|
1485 |
|
|
| 1486 |
|
|
1486 |
|
|
| 1487 |
|
|
1487 |
|
|
| 1488 |
|
|
1488 |
|
|
| 1489 |
|
Calls to allocate may throw.
|
1489 |
|
Calls to allocate may throw.
|
| 1490 |
|
|
1490 |
|
|
| 1491 |
|
@param s The string to set.
|
1491 |
|
@param s The string to set.
|
| 1492 |
|
|
1492 |
|
|
| 1493 |
|
|
1493 |
|
|
| 1494 |
|
|
1494 |
|
|
| 1495 |
|
|
1495 |
|
|
| 1496 |
|
reg-name = *( unreserved / pct-encoded / "-" / ".")
|
1496 |
|
reg-name = *( unreserved / pct-encoded / "-" / ".")
|
| 1497 |
|
|
1497 |
|
|
| 1498 |
|
|
1498 |
|
|
| 1499 |
|
|
1499 |
|
|
| 1500 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2">
|
1500 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2">
|
| 1501 |
|
3.2.2. Host (rfc3986)</a>
|
1501 |
|
3.2.2. Host (rfc3986)</a>
|
| 1502 |
|
|
1502 |
|
|
| 1503 |
|
|
1503 |
|
|
| 1504 |
|
|
1504 |
|
|
| 1505 |
|
@ref set_encoded_host_address,
|
1505 |
|
@ref set_encoded_host_address,
|
| 1506 |
|
@ref set_encoded_host_name,
|
1506 |
|
@ref set_encoded_host_name,
|
| 1507 |
|
|
1507 |
|
|
| 1508 |
|
|
1508 |
|
|
| 1509 |
|
|
1509 |
|
|
| 1510 |
|
|
1510 |
|
|
| 1511 |
|
|
1511 |
|
|
| 1512 |
|
|
1512 |
|
|
| 1513 |
|
|
1513 |
|
|
| 1514 |
|
|
1514 |
|
|
| 1515 |
|
|
1515 |
|
|
| 1516 |
|
|
1516 |
|
|
| 1517 |
|
/** Set the host to a name
|
1517 |
|
/** Set the host to a name
|
| 1518 |
|
|
1518 |
|
|
| 1519 |
|
The host is set to the specified string,
|
1519 |
|
The host is set to the specified string,
|
| 1520 |
|
which may contain percent-escapes and
|
1520 |
|
which may contain percent-escapes and
|
| 1521 |
|
|
1521 |
|
|
| 1522 |
|
Escapes in the string are preserved,
|
1522 |
|
Escapes in the string are preserved,
|
| 1523 |
|
and reserved characters in the string
|
1523 |
|
and reserved characters in the string
|
| 1524 |
|
are percent-escaped in the result.
|
1524 |
|
are percent-escaped in the result.
|
| 1525 |
|
The host type is @ref host_type::name.
|
1525 |
|
The host type is @ref host_type::name.
|
| 1526 |
|
|
1526 |
|
|
| 1527 |
|
|
1527 |
|
|
| 1528 |
|
|
1528 |
|
|
| 1529 |
|
assert( url( "http://www.example.com/index.htm").set_encoded_host_name( "localhost" ).host_address() == "localhost" );
|
1529 |
|
assert( url( "http://www.example.com/index.htm").set_encoded_host_name( "localhost" ).host_address() == "localhost" );
|
| 1530 |
|
|
1530 |
|
|
| 1531 |
|
|
1531 |
|
|
| 1532 |
|
|
1532 |
|
|
| 1533 |
|
|
1533 |
|
|
| 1534 |
|
this->has_authority() == true && this->host_ipv6_address() == addr && this->host_type() == host_type::name
|
1534 |
|
this->has_authority() == true && this->host_ipv6_address() == addr && this->host_type() == host_type::name
|
| 1535 |
|
|
1535 |
|
|
| 1536 |
|
|
1536 |
|
|
| 1537 |
|
|
1537 |
|
|
| 1538 |
|
|
1538 |
|
|
| 1539 |
|
Calls to allocate may throw.
|
1539 |
|
Calls to allocate may throw.
|
| 1540 |
|
Exceptions thrown on invalid input.
|
1540 |
|
Exceptions thrown on invalid input.
|
| 1541 |
|
|
1541 |
|
|
| 1542 |
|
|
1542 |
|
|
| 1543 |
|
`s` contains an invalid percent-encoding.
|
1543 |
|
`s` contains an invalid percent-encoding.
|
| 1544 |
|
|
1544 |
|
|
| 1545 |
|
@param s The string to set.
|
1545 |
|
@param s The string to set.
|
| 1546 |
|
|
1546 |
|
|
| 1547 |
|
|
1547 |
|
|
| 1548 |
|
|
1548 |
|
|
| 1549 |
|
|
1549 |
|
|
| 1550 |
|
reg-name = *( unreserved / pct-encoded / "-" / ".")
|
1550 |
|
reg-name = *( unreserved / pct-encoded / "-" / ".")
|
| 1551 |
|
|
1551 |
|
|
| 1552 |
|
|
1552 |
|
|
| 1553 |
|
|
1553 |
|
|
| 1554 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2">
|
1554 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2">
|
| 1555 |
|
3.2.2. Host (rfc3986)</a>
|
1555 |
|
3.2.2. Host (rfc3986)</a>
|
| 1556 |
|
|
1556 |
|
|
| 1557 |
|
|
1557 |
|
|
| 1558 |
|
|
1558 |
|
|
| 1559 |
|
@ref set_encoded_host_address,
|
1559 |
|
@ref set_encoded_host_address,
|
| 1560 |
|
|
1560 |
|
|
| 1561 |
|
|
1561 |
|
|
| 1562 |
|
|
1562 |
|
|
| 1563 |
|
|
1563 |
|
|
| 1564 |
|
|
1564 |
|
|
| 1565 |
|
|
1565 |
|
|
| 1566 |
|
|
1566 |
|
|
| 1567 |
|
|
1567 |
|
|
| 1568 |
|
|
1568 |
|
|
| 1569 |
|
|
1569 |
|
|
| 1570 |
|
|
1570 |
|
|
| 1571 |
|
//--------------------------------------------
|
1571 |
|
//--------------------------------------------
|
| 1572 |
|
|
1572 |
|
|
| 1573 |
|
|
1573 |
|
|
| 1574 |
|
|
1574 |
|
|
| 1575 |
|
The port is set to the specified integer.
|
1575 |
|
The port is set to the specified integer.
|
| 1576 |
|
|
1576 |
|
|
| 1577 |
|
|
1577 |
|
|
| 1578 |
|
|
1578 |
|
|
| 1579 |
|
assert( url( "http://www.example.com" ).set_port_number( 8080 ).authority().buffer() == "www.example.com:8080" );
|
1579 |
|
assert( url( "http://www.example.com" ).set_port_number( 8080 ).authority().buffer() == "www.example.com:8080" );
|
| 1580 |
|
|
1580 |
|
|
| 1581 |
|
|
1581 |
|
|
| 1582 |
|
|
1582 |
|
|
| 1583 |
|
|
1583 |
|
|
| 1584 |
|
this->has_authority() == true && this->has_port() == true && this->port_number() == n
|
1584 |
|
this->has_authority() == true && this->has_port() == true && this->port_number() == n
|
| 1585 |
|
|
1585 |
|
|
| 1586 |
|
|
1586 |
|
|
| 1587 |
|
|
1587 |
|
|
| 1588 |
|
Linear in `this->size()`.
|
1588 |
|
Linear in `this->size()`.
|
| 1589 |
|
|
1589 |
|
|
| 1590 |
|
|
1590 |
|
|
| 1591 |
|
|
1591 |
|
|
| 1592 |
|
Calls to allocate may throw.
|
1592 |
|
Calls to allocate may throw.
|
| 1593 |
|
|
1593 |
|
|
| 1594 |
|
@param n The port number to set.
|
1594 |
|
@param n The port number to set.
|
| 1595 |
|
|
1595 |
|
|
| 1596 |
|
|
1596 |
|
|
| 1597 |
|
|
1597 |
|
|
| 1598 |
|
|
1598 |
|
|
| 1599 |
|
|
1599 |
|
|
| 1600 |
|
authority = [ userinfo "@" ] host [ ":" port ]
|
1600 |
|
authority = [ userinfo "@" ] host [ ":" port ]
|
| 1601 |
|
|
1601 |
|
|
| 1602 |
|
|
1602 |
|
|
| 1603 |
|
|
1603 |
|
|
| 1604 |
|
|
1604 |
|
|
| 1605 |
|
|
1605 |
|
|
| 1606 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3">
|
1606 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3">
|
| 1607 |
|
3.2.3. Port (rfc3986)</a>
|
1607 |
|
3.2.3. Port (rfc3986)</a>
|
| 1608 |
|
|
1608 |
|
|
| 1609 |
|
|
1609 |
|
|
| 1610 |
|
|
1610 |
|
|
| 1611 |
|
|
1611 |
|
|
| 1612 |
|
|
1612 |
|
|
| 1613 |
|
|
1613 |
|
|
| 1614 |
|
set_port_number(std::uint16_t n);
|
1614 |
|
set_port_number(std::uint16_t n);
|
| 1615 |
|
|
1615 |
|
|
| 1616 |
|
|
1616 |
|
|
| 1617 |
|
|
1617 |
|
|
| 1618 |
|
This port is set to the string, which
|
1618 |
|
This port is set to the string, which
|
| 1619 |
|
must contain only digits or be empty.
|
1619 |
|
must contain only digits or be empty.
|
| 1620 |
|
An empty port string is distinct from
|
1620 |
|
An empty port string is distinct from
|
| 1621 |
|
|
1621 |
|
|
| 1622 |
|
|
1622 |
|
|
| 1623 |
|
|
1623 |
|
|
| 1624 |
|
|
1624 |
|
|
| 1625 |
|
assert( url( "http://www.example.com" ).set_port( "8080" ).authority().buffer() == "www.example.com:8080" );
|
1625 |
|
assert( url( "http://www.example.com" ).set_port( "8080" ).authority().buffer() == "www.example.com:8080" );
|
| 1626 |
|
|
1626 |
|
|
| 1627 |
|
|
1627 |
|
|
| 1628 |
|
|
1628 |
|
|
| 1629 |
|
|
1629 |
|
|
| 1630 |
|
this->has_port() == true && this->port_number() == n && this->port() == std::to_string(n)
|
1630 |
|
this->has_port() == true && this->port_number() == n && this->port() == std::to_string(n)
|
| 1631 |
|
|
1631 |
|
|
| 1632 |
|
|
1632 |
|
|
| 1633 |
|
|
1633 |
|
|
| 1634 |
|
|
1634 |
|
|
| 1635 |
|
Calls to allocate may throw.
|
1635 |
|
Calls to allocate may throw.
|
| 1636 |
|
Exceptions thrown on invalid input.
|
1636 |
|
Exceptions thrown on invalid input.
|
| 1637 |
|
|
1637 |
|
|
| 1638 |
|
|
1638 |
|
|
| 1639 |
|
`s` does not contain a valid port.
|
1639 |
|
`s` does not contain a valid port.
|
| 1640 |
|
|
1640 |
|
|
| 1641 |
|
@param s The port string to set.
|
1641 |
|
@param s The port string to set.
|
| 1642 |
|
|
1642 |
|
|
| 1643 |
|
|
1643 |
|
|
| 1644 |
|
|
1644 |
|
|
| 1645 |
|
|
1645 |
|
|
| 1646 |
|
|
1646 |
|
|
| 1647 |
|
|
1647 |
|
|
| 1648 |
|
|
1648 |
|
|
| 1649 |
|
|
1649 |
|
|
| 1650 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3">
|
1650 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3">
|
| 1651 |
|
3.2.3. Port (rfc3986)</a>
|
1651 |
|
3.2.3. Port (rfc3986)</a>
|
| 1652 |
|
|
1652 |
|
|
| 1653 |
|
|
1653 |
|
|
| 1654 |
|
|
1654 |
|
|
| 1655 |
|
|
1655 |
|
|
| 1656 |
|
|
1656 |
|
|
| 1657 |
|
|
1657 |
|
|
| 1658 |
|
set_port(core::string_view s);
|
1658 |
|
set_port(core::string_view s);
|
| 1659 |
|
|
1659 |
|
|
| 1660 |
|
|
1660 |
|
|
| 1661 |
|
|
1661 |
|
|
| 1662 |
|
If a port exists, it is removed. The rest
|
1662 |
|
If a port exists, it is removed. The rest
|
| 1663 |
|
of the authority is unchanged.
|
1663 |
|
of the authority is unchanged.
|
| 1664 |
|
|
1664 |
|
|
| 1665 |
|
|
1665 |
|
|
| 1666 |
|
|
1666 |
|
|
| 1667 |
|
|
1667 |
|
|
| 1668 |
|
|
1668 |
|
|
| 1669 |
|
assert( url( "http://www.example.com:80" ).remove_port().authority().buffer() == "www.example.com" );
|
1669 |
|
assert( url( "http://www.example.com:80" ).remove_port().authority().buffer() == "www.example.com" );
|
| 1670 |
|
|
1670 |
|
|
| 1671 |
|
|
1671 |
|
|
| 1672 |
|
|
1672 |
|
|
| 1673 |
|
|
1673 |
|
|
| 1674 |
|
this->has_port() == false && this->port_number() == 0 && this->port() == ""
|
1674 |
|
this->has_port() == false && this->port_number() == 0 && this->port() == ""
|
| 1675 |
|
|
1675 |
|
|
| 1676 |
|
|
1676 |
|
|
| 1677 |
|
|
1677 |
|
|
| 1678 |
|
Linear in `this->size()`.
|
1678 |
|
Linear in `this->size()`.
|
| 1679 |
|
|
1679 |
|
|
| 1680 |
|
|
1680 |
|
|
| 1681 |
|
|
1681 |
|
|
| 1682 |
|
|
1682 |
|
|
| 1683 |
|
|
1683 |
|
|
| 1684 |
|
|
1684 |
|
|
| 1685 |
|
authority = [ userinfo "@" ] host [ ":" port ]
|
1685 |
|
authority = [ userinfo "@" ] host [ ":" port ]
|
| 1686 |
|
|
1686 |
|
|
| 1687 |
|
|
1687 |
|
|
| 1688 |
|
|
1688 |
|
|
| 1689 |
|
|
1689 |
|
|
| 1690 |
|
|
1690 |
|
|
| 1691 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3">
|
1691 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3">
|
| 1692 |
|
3.2.3. Port (rfc3986)</a>
|
1692 |
|
3.2.3. Port (rfc3986)</a>
|
| 1693 |
|
|
1693 |
|
|
| 1694 |
|
|
1694 |
|
|
| 1695 |
|
|
1695 |
|
|
| 1696 |
|
|
1696 |
|
|
| 1697 |
|
|
1697 |
|
|
| 1698 |
|
|
1698 |
|
|
| 1699 |
|
|
1699 |
|
|
| 1700 |
|
//--------------------------------------------
|
1700 |
|
//--------------------------------------------
|
| 1701 |
|
|
1701 |
|
|
| 1702 |
|
|
1702 |
|
|
| 1703 |
|
|
1703 |
|
|
| 1704 |
|
//--------------------------------------------
|
1704 |
|
//--------------------------------------------
|
| 1705 |
|
|
1705 |
|
|
| 1706 |
|
/** Set if the path is absolute
|
1706 |
|
/** Set if the path is absolute
|
| 1707 |
|
|
1707 |
|
|
| 1708 |
|
This function adjusts the path to make
|
1708 |
|
This function adjusts the path to make
|
| 1709 |
|
it absolute or not, depending on the
|
1709 |
|
it absolute or not, depending on the
|
| 1710 |
|
|
1710 |
|
|
| 1711 |
|
|
1711 |
|
|
| 1712 |
|
|
1712 |
|
|
| 1713 |
|
If an authority is present, the path
|
1713 |
|
If an authority is present, the path
|
| 1714 |
|
is always absolute. In this case, the
|
1714 |
|
is always absolute. In this case, the
|
| 1715 |
|
|
1715 |
|
|
| 1716 |
|
|
1716 |
|
|
| 1717 |
|
|
1717 |
|
|
| 1718 |
|
|
1718 |
|
|
| 1719 |
|
url u( "path/to/file.txt" );
|
1719 |
|
url u( "path/to/file.txt" );
|
| 1720 |
|
assert( u.set_path_absolute( true ) );
|
1720 |
|
assert( u.set_path_absolute( true ) );
|
| 1721 |
|
assert( u.buffer() == "/path/to/file.txt" );
|
1721 |
|
assert( u.buffer() == "/path/to/file.txt" );
|
| 1722 |
|
|
1722 |
|
|
| 1723 |
|
|
1723 |
|
|
| 1724 |
|
|
1724 |
|
|
| 1725 |
|
|
1725 |
|
|
| 1726 |
|
this->is_path_absolute() == true && this->encoded_path().front() == '/'
|
1726 |
|
this->is_path_absolute() == true && this->encoded_path().front() == '/'
|
| 1727 |
|
|
1727 |
|
|
| 1728 |
|
|
1728 |
|
|
| 1729 |
|
@param absolute If `true`, the path is made absolute.
|
1729 |
|
@param absolute If `true`, the path is made absolute.
|
| 1730 |
|
|
1730 |
|
|
| 1731 |
|
|
1731 |
|
|
| 1732 |
|
|
1732 |
|
|
| 1733 |
|
|
1733 |
|
|
| 1734 |
|
Linear in `this->size()`.
|
1734 |
|
Linear in `this->size()`.
|
| 1735 |
|
|
1735 |
|
|
| 1736 |
|
|
1736 |
|
|
| 1737 |
|
|
1737 |
|
|
| 1738 |
|
path = path-abempty ; begins with "/" or is empty
|
1738 |
|
path = path-abempty ; begins with "/" or is empty
|
| 1739 |
|
/ path-absolute ; begins with "/" but not "//"
|
1739 |
|
/ path-absolute ; begins with "/" but not "//"
|
| 1740 |
|
/ path-noscheme ; begins with a non-colon segment
|
1740 |
|
/ path-noscheme ; begins with a non-colon segment
|
| 1741 |
|
/ path-rootless ; begins with a segment
|
1741 |
|
/ path-rootless ; begins with a segment
|
| 1742 |
|
/ path-empty ; zero characters
|
1742 |
|
/ path-empty ; zero characters
|
| 1743 |
|
|
1743 |
|
|
| 1744 |
|
path-abempty = *( "/" segment )
|
1744 |
|
path-abempty = *( "/" segment )
|
| 1745 |
|
path-absolute = "/" [ segment-nz *( "/" segment ) ]
|
1745 |
|
path-absolute = "/" [ segment-nz *( "/" segment ) ]
|
| 1746 |
|
path-noscheme = segment-nz-nc *( "/" segment )
|
1746 |
|
path-noscheme = segment-nz-nc *( "/" segment )
|
| 1747 |
|
path-rootless = segment-nz *( "/" segment )
|
1747 |
|
path-rootless = segment-nz *( "/" segment )
|
| 1748 |
|
|
1748 |
|
|
| 1749 |
|
|
1749 |
|
|
| 1750 |
|
|
1750 |
|
|
| 1751 |
|
|
1751 |
|
|
| 1752 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.3"
|
1752 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.3"
|
| 1753 |
|
|
1753 |
|
|
| 1754 |
|
|
1754 |
|
|
| 1755 |
|
|
1755 |
|
|
| 1756 |
|
|
1756 |
|
|
| 1757 |
|
|
1757 |
|
|
| 1758 |
|
|
1758 |
|
|
| 1759 |
|
|
1759 |
|
|
| 1760 |
|
|
1760 |
|
|
| 1761 |
|
|
1761 |
|
|
| 1762 |
|
set_path_absolute(bool absolute);
|
1762 |
|
set_path_absolute(bool absolute);
|
| 1763 |
|
|
1763 |
|
|
| 1764 |
|
|
1764 |
|
|
| 1765 |
|
|
1765 |
|
|
| 1766 |
|
This function sets the path to the
|
1766 |
|
This function sets the path to the
|
| 1767 |
|
string, which may be empty.
|
1767 |
|
string, which may be empty.
|
| 1768 |
|
Reserved characters in the string are
|
1768 |
|
Reserved characters in the string are
|
| 1769 |
|
percent-escaped in the result.
|
1769 |
|
percent-escaped in the result.
|
| 1770 |
|
|
1770 |
|
|
| 1771 |
|
|
1771 |
|
|
| 1772 |
|
The library may adjust the final result
|
1772 |
|
The library may adjust the final result
|
| 1773 |
|
to ensure that no other parts of the URL
|
1773 |
|
to ensure that no other parts of the URL
|
| 1774 |
|
are semantically affected.
|
1774 |
|
are semantically affected.
|
| 1775 |
|
|
1775 |
|
|
| 1776 |
|
|
1776 |
|
|
| 1777 |
|
This function does not encode '/' chars, which
|
1777 |
|
This function does not encode '/' chars, which
|
| 1778 |
|
are unreserved for paths but reserved for
|
1778 |
|
are unreserved for paths but reserved for
|
| 1779 |
|
path segments. If a path segment should include
|
1779 |
|
path segments. If a path segment should include
|
| 1780 |
|
encoded '/'s to differentiate it from path separators,
|
1780 |
|
encoded '/'s to differentiate it from path separators,
|
| 1781 |
|
the functions @ref set_encoded_path or @ref segments
|
1781 |
|
the functions @ref set_encoded_path or @ref segments
|
| 1782 |
|
|
1782 |
|
|
| 1783 |
|
|
1783 |
|
|
| 1784 |
|
|
1784 |
|
|
| 1785 |
|
|
1785 |
|
|
| 1786 |
|
url u( "http://www.example.com" );
|
1786 |
|
url u( "http://www.example.com" );
|
| 1787 |
|
|
1787 |
|
|
| 1788 |
|
u.set_path( "path/to/file.txt" );
|
1788 |
|
u.set_path( "path/to/file.txt" );
|
| 1789 |
|
|
1789 |
|
|
| 1790 |
|
assert( u.path() == "/path/to/file.txt" );
|
1790 |
|
assert( u.path() == "/path/to/file.txt" );
|
| 1791 |
|
|
1791 |
|
|
| 1792 |
|
|
1792 |
|
|
| 1793 |
|
|
1793 |
|
|
| 1794 |
|
Linear in `this->size() + s.size()`.
|
1794 |
|
Linear in `this->size() + s.size()`.
|
| 1795 |
|
|
1795 |
|
|
| 1796 |
|
|
1796 |
|
|
| 1797 |
|
|
1797 |
|
|
| 1798 |
|
Calls to allocate may throw.
|
1798 |
|
Calls to allocate may throw.
|
| 1799 |
|
|
1799 |
|
|
| 1800 |
|
@param s The string to set.
|
1800 |
|
@param s The string to set.
|
| 1801 |
|
|
1801 |
|
|
| 1802 |
|
|
1802 |
|
|
| 1803 |
|
|
1803 |
|
|
| 1804 |
|
|
1804 |
|
|
| 1805 |
|
path = path-abempty ; begins with "/" or is empty
|
1805 |
|
path = path-abempty ; begins with "/" or is empty
|
| 1806 |
|
/ path-absolute ; begins with "/" but not "//"
|
1806 |
|
/ path-absolute ; begins with "/" but not "//"
|
| 1807 |
|
/ path-noscheme ; begins with a non-colon segment
|
1807 |
|
/ path-noscheme ; begins with a non-colon segment
|
| 1808 |
|
/ path-rootless ; begins with a segment
|
1808 |
|
/ path-rootless ; begins with a segment
|
| 1809 |
|
/ path-empty ; zero characters
|
1809 |
|
/ path-empty ; zero characters
|
| 1810 |
|
|
1810 |
|
|
| 1811 |
|
path-abempty = *( "/" segment )
|
1811 |
|
path-abempty = *( "/" segment )
|
| 1812 |
|
path-absolute = "/" [ segment-nz *( "/" segment ) ]
|
1812 |
|
path-absolute = "/" [ segment-nz *( "/" segment ) ]
|
| 1813 |
|
path-noscheme = segment-nz-nc *( "/" segment )
|
1813 |
|
path-noscheme = segment-nz-nc *( "/" segment )
|
| 1814 |
|
path-rootless = segment-nz *( "/" segment )
|
1814 |
|
path-rootless = segment-nz *( "/" segment )
|
| 1815 |
|
|
1815 |
|
|
| 1816 |
|
|
1816 |
|
|
| 1817 |
|
|
1817 |
|
|
| 1818 |
|
|
1818 |
|
|
| 1819 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.3"
|
1819 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.3"
|
| 1820 |
|
|
1820 |
|
|
| 1821 |
|
|
1821 |
|
|
| 1822 |
|
|
1822 |
|
|
| 1823 |
|
|
1823 |
|
|
| 1824 |
|
|
1824 |
|
|
| 1825 |
|
|
1825 |
|
|
| 1826 |
|
|
1826 |
|
|
| 1827 |
|
|
1827 |
|
|
| 1828 |
|
|
1828 |
|
|
| 1829 |
|
|
1829 |
|
|
| 1830 |
|
|
1830 |
|
|
| 1831 |
|
|
1831 |
|
|
| 1832 |
|
|
1832 |
|
|
| 1833 |
|
|
1833 |
|
|
| 1834 |
|
This function sets the path to the
|
1834 |
|
This function sets the path to the
|
| 1835 |
|
string, which may contain percent-escapes
|
1835 |
|
string, which may contain percent-escapes
|
| 1836 |
|
|
1836 |
|
|
| 1837 |
|
Escapes in the string are preserved,
|
1837 |
|
Escapes in the string are preserved,
|
| 1838 |
|
and reserved characters in the string
|
1838 |
|
and reserved characters in the string
|
| 1839 |
|
are percent-escaped in the result.
|
1839 |
|
are percent-escaped in the result.
|
| 1840 |
|
|
1840 |
|
|
| 1841 |
|
|
1841 |
|
|
| 1842 |
|
The library may adjust the final result
|
1842 |
|
The library may adjust the final result
|
| 1843 |
|
to ensure that no other parts of the url
|
1843 |
|
to ensure that no other parts of the url
|
| 1844 |
|
is semantically affected.
|
1844 |
|
is semantically affected.
|
| 1845 |
|
|
1845 |
|
|
| 1846 |
|
|
1846 |
|
|
| 1847 |
|
|
1847 |
|
|
| 1848 |
|
url u( "http://www.example.com" );
|
1848 |
|
url u( "http://www.example.com" );
|
| 1849 |
|
|
1849 |
|
|
| 1850 |
|
u.set_encoded_path( "path/to/file.txt" );
|
1850 |
|
u.set_encoded_path( "path/to/file.txt" );
|
| 1851 |
|
|
1851 |
|
|
| 1852 |
|
assert( u.encoded_path() == "/path/to/file.txt" );
|
1852 |
|
assert( u.encoded_path() == "/path/to/file.txt" );
|
| 1853 |
|
|
1853 |
|
|
| 1854 |
|
|
1854 |
|
|
| 1855 |
|
|
1855 |
|
|
| 1856 |
|
Linear in `this->size() + s.size()`.
|
1856 |
|
Linear in `this->size() + s.size()`.
|
| 1857 |
|
|
1857 |
|
|
| 1858 |
|
|
1858 |
|
|
| 1859 |
|
|
1859 |
|
|
| 1860 |
|
Calls to allocate may throw.
|
1860 |
|
Calls to allocate may throw.
|
| 1861 |
|
Exceptions thrown on invalid input.
|
1861 |
|
Exceptions thrown on invalid input.
|
| 1862 |
|
|
1862 |
|
|
| 1863 |
|
|
1863 |
|
|
| 1864 |
|
`s` contains an invalid percent-encoding.
|
1864 |
|
`s` contains an invalid percent-encoding.
|
| 1865 |
|
|
1865 |
|
|
| 1866 |
|
@param s The string to set.
|
1866 |
|
@param s The string to set.
|
| 1867 |
|
|
1867 |
|
|
| 1868 |
|
|
1868 |
|
|
| 1869 |
|
|
1869 |
|
|
| 1870 |
|
|
1870 |
|
|
| 1871 |
|
|
1871 |
|
|
| 1872 |
|
path = path-abempty ; begins with "/" or is empty
|
1872 |
|
path = path-abempty ; begins with "/" or is empty
|
| 1873 |
|
/ path-absolute ; begins with "/" but not "//"
|
1873 |
|
/ path-absolute ; begins with "/" but not "//"
|
| 1874 |
|
/ path-noscheme ; begins with a non-colon segment
|
1874 |
|
/ path-noscheme ; begins with a non-colon segment
|
| 1875 |
|
/ path-rootless ; begins with a segment
|
1875 |
|
/ path-rootless ; begins with a segment
|
| 1876 |
|
/ path-empty ; zero characters
|
1876 |
|
/ path-empty ; zero characters
|
| 1877 |
|
|
1877 |
|
|
| 1878 |
|
path-abempty = *( "/" segment )
|
1878 |
|
path-abempty = *( "/" segment )
|
| 1879 |
|
path-absolute = "/" [ segment-nz *( "/" segment ) ]
|
1879 |
|
path-absolute = "/" [ segment-nz *( "/" segment ) ]
|
| 1880 |
|
path-noscheme = segment-nz-nc *( "/" segment )
|
1880 |
|
path-noscheme = segment-nz-nc *( "/" segment )
|
| 1881 |
|
path-rootless = segment-nz *( "/" segment )
|
1881 |
|
path-rootless = segment-nz *( "/" segment )
|
| 1882 |
|
|
1882 |
|
|
| 1883 |
|
|
1883 |
|
|
| 1884 |
|
|
1884 |
|
|
| 1885 |
|
|
1885 |
|
|
| 1886 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.3"
|
1886 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.3"
|
| 1887 |
|
|
1887 |
|
|
| 1888 |
|
|
1888 |
|
|
| 1889 |
|
|
1889 |
|
|
| 1890 |
|
|
1890 |
|
|
| 1891 |
|
|
1891 |
|
|
| 1892 |
|
|
1892 |
|
|
| 1893 |
|
|
1893 |
|
|
| 1894 |
|
|
1894 |
|
|
| 1895 |
|
|
1895 |
|
|
| 1896 |
|
|
1896 |
|
|
| 1897 |
|
|
1897 |
|
|
| 1898 |
|
|
1898 |
|
|
| 1899 |
|
/** Return the path as a container of segments
|
1899 |
|
/** Return the path as a container of segments
|
| 1900 |
|
|
1900 |
|
|
| 1901 |
|
This function returns a bidirectional
|
1901 |
|
This function returns a bidirectional
|
| 1902 |
|
view of segments over the path.
|
1902 |
|
view of segments over the path.
|
| 1903 |
|
The returned view references the same
|
1903 |
|
The returned view references the same
|
| 1904 |
|
underlying character buffer; ownership
|
1904 |
|
underlying character buffer; ownership
|
| 1905 |
|
|
1905 |
|
|
| 1906 |
|
Any percent-escapes in strings returned
|
1906 |
|
Any percent-escapes in strings returned
|
| 1907 |
|
when iterating the view are decoded first.
|
1907 |
|
when iterating the view are decoded first.
|
| 1908 |
|
The container is modifiable; changes
|
1908 |
|
The container is modifiable; changes
|
| 1909 |
|
to the container are reflected in the
|
1909 |
|
to the container are reflected in the
|
| 1910 |
|
|
1910 |
|
|
| 1911 |
|
|
1911 |
|
|
| 1912 |
|
|
1912 |
|
|
| 1913 |
|
|
1913 |
|
|
| 1914 |
|
|
1914 |
|
|
| 1915 |
|
|
1915 |
|
|
| 1916 |
|
url u( "http://example.com/path/to/file.txt" );
|
1916 |
|
url u( "http://example.com/path/to/file.txt" );
|
| 1917 |
|
|
1917 |
|
|
| 1918 |
|
segments sv = u.segments();
|
1918 |
|
segments sv = u.segments();
|
| 1919 |
|
|
1919 |
|
|
| 1920 |
|
|
1920 |
|
|
| 1921 |
|
|
1921 |
|
|
| 1922 |
|
|
1922 |
|
|
| 1923 |
|
|
1923 |
|
|
| 1924 |
|
|
1924 |
|
|
| 1925 |
|
|
1925 |
|
|
| 1926 |
|
|
1926 |
|
|
| 1927 |
|
|
1927 |
|
|
| 1928 |
|
|
1928 |
|
|
| 1929 |
|
path = path-abempty ; begins with "/" or is empty
|
1929 |
|
path = path-abempty ; begins with "/" or is empty
|
| 1930 |
|
/ path-absolute ; begins with "/" but not "//"
|
1930 |
|
/ path-absolute ; begins with "/" but not "//"
|
| 1931 |
|
/ path-noscheme ; begins with a non-colon segment
|
1931 |
|
/ path-noscheme ; begins with a non-colon segment
|
| 1932 |
|
/ path-rootless ; begins with a segment
|
1932 |
|
/ path-rootless ; begins with a segment
|
| 1933 |
|
/ path-empty ; zero characters
|
1933 |
|
/ path-empty ; zero characters
|
| 1934 |
|
|
1934 |
|
|
| 1935 |
|
path-abempty = *( "/" segment )
|
1935 |
|
path-abempty = *( "/" segment )
|
| 1936 |
|
path-absolute = "/" [ segment-nz *( "/" segment ) ]
|
1936 |
|
path-absolute = "/" [ segment-nz *( "/" segment ) ]
|
| 1937 |
|
path-noscheme = segment-nz-nc *( "/" segment )
|
1937 |
|
path-noscheme = segment-nz-nc *( "/" segment )
|
| 1938 |
|
path-rootless = segment-nz *( "/" segment )
|
1938 |
|
path-rootless = segment-nz *( "/" segment )
|
| 1939 |
|
|
1939 |
|
|
| 1940 |
|
|
1940 |
|
|
| 1941 |
|
|
1941 |
|
|
| 1942 |
|
|
1942 |
|
|
| 1943 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.3"
|
1943 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.3"
|
| 1944 |
|
|
1944 |
|
|
| 1945 |
|
|
1945 |
|
|
| 1946 |
|
|
1946 |
|
|
| 1947 |
|
|
1947 |
|
|
| 1948 |
|
|
1948 |
|
|
| 1949 |
|
|
1949 |
|
|
| 1950 |
|
|
1950 |
|
|
| 1951 |
|
|
1951 |
|
|
| 1952 |
|
|
1952 |
|
|
| 1953 |
|
|
1953 |
|
|
| 1954 |
|
|
1954 |
|
|
| 1955 |
|
/// @copydoc url_view_base::segments
|
1955 |
|
/// @copydoc url_view_base::segments
|
| 1956 |
|
|
1956 |
|
|
| 1957 |
|
segments() const noexcept
|
1957 |
|
segments() const noexcept
|
| 1958 |
|
|
1958 |
|
|
| 1959 |
|
return url_view_base::segments();
|
1959 |
|
return url_view_base::segments();
|
| 1960 |
|
|
1960 |
|
|
| 1961 |
|
|
1961 |
|
|
| 1962 |
|
/** Return the path as a container of segments
|
1962 |
|
/** Return the path as a container of segments
|
| 1963 |
|
|
1963 |
|
|
| 1964 |
|
This function returns a bidirectional
|
1964 |
|
This function returns a bidirectional
|
| 1965 |
|
view of segments over the path.
|
1965 |
|
view of segments over the path.
|
| 1966 |
|
The returned view references the same
|
1966 |
|
The returned view references the same
|
| 1967 |
|
underlying character buffer; ownership
|
1967 |
|
underlying character buffer; ownership
|
| 1968 |
|
|
1968 |
|
|
| 1969 |
|
Strings returned when iterating the
|
1969 |
|
Strings returned when iterating the
|
| 1970 |
|
range may contain percent escapes.
|
1970 |
|
range may contain percent escapes.
|
| 1971 |
|
The container is modifiable; changes
|
1971 |
|
The container is modifiable; changes
|
| 1972 |
|
to the container are reflected in the
|
1972 |
|
to the container are reflected in the
|
| 1973 |
|
|
1973 |
|
|
| 1974 |
|
|
1974 |
|
|
| 1975 |
|
|
1975 |
|
|
| 1976 |
|
|
1976 |
|
|
| 1977 |
|
|
1977 |
|
|
| 1978 |
|
|
1978 |
|
|
| 1979 |
|
url u( "http://example.com/path/to/file.txt" );
|
1979 |
|
url u( "http://example.com/path/to/file.txt" );
|
| 1980 |
|
|
1980 |
|
|
| 1981 |
|
segments_encoded_ref sv = u.encoded_segments();
|
1981 |
|
segments_encoded_ref sv = u.encoded_segments();
|
| 1982 |
|
|
1982 |
|
|
| 1983 |
|
|
1983 |
|
|
| 1984 |
|
|
1984 |
|
|
| 1985 |
|
|
1985 |
|
|
| 1986 |
|
|
1986 |
|
|
| 1987 |
|
|
1987 |
|
|
| 1988 |
|
|
1988 |
|
|
| 1989 |
|
|
1989 |
|
|
| 1990 |
|
|
1990 |
|
|
| 1991 |
|
|
1991 |
|
|
| 1992 |
|
path = path-abempty ; begins with "/" or is empty
|
1992 |
|
path = path-abempty ; begins with "/" or is empty
|
| 1993 |
|
/ path-absolute ; begins with "/" but not "//"
|
1993 |
|
/ path-absolute ; begins with "/" but not "//"
|
| 1994 |
|
/ path-noscheme ; begins with a non-colon segment
|
1994 |
|
/ path-noscheme ; begins with a non-colon segment
|
| 1995 |
|
/ path-rootless ; begins with a segment
|
1995 |
|
/ path-rootless ; begins with a segment
|
| 1996 |
|
/ path-empty ; zero characters
|
1996 |
|
/ path-empty ; zero characters
|
| 1997 |
|
|
1997 |
|
|
| 1998 |
|
path-abempty = *( "/" segment )
|
1998 |
|
path-abempty = *( "/" segment )
|
| 1999 |
|
path-absolute = "/" [ segment-nz *( "/" segment ) ]
|
1999 |
|
path-absolute = "/" [ segment-nz *( "/" segment ) ]
|
| 2000 |
|
path-noscheme = segment-nz-nc *( "/" segment )
|
2000 |
|
path-noscheme = segment-nz-nc *( "/" segment )
|
| 2001 |
|
path-rootless = segment-nz *( "/" segment )
|
2001 |
|
path-rootless = segment-nz *( "/" segment )
|
| 2002 |
|
|
2002 |
|
|
| 2003 |
|
|
2003 |
|
|
| 2004 |
|
|
2004 |
|
|
| 2005 |
|
|
2005 |
|
|
| 2006 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.3"
|
2006 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.3"
|
| 2007 |
|
|
2007 |
|
|
| 2008 |
|
|
2008 |
|
|
| 2009 |
|
|
2009 |
|
|
| 2010 |
|
|
2010 |
|
|
| 2011 |
|
|
2011 |
|
|
| 2012 |
|
|
2012 |
|
|
| 2013 |
|
|
2013 |
|
|
| 2014 |
|
|
2014 |
|
|
| 2015 |
|
|
2015 |
|
|
| 2016 |
|
encoded_segments() noexcept;
|
2016 |
|
encoded_segments() noexcept;
|
| 2017 |
|
|
2017 |
|
|
| 2018 |
|
/// @copydoc url_view_base::encoded_segments
|
2018 |
|
/// @copydoc url_view_base::encoded_segments
|
| 2019 |
|
|
2019 |
|
|
| 2020 |
|
encoded_segments() const noexcept
|
2020 |
|
encoded_segments() const noexcept
|
| 2021 |
|
|
2021 |
|
|
| 2022 |
|
return url_view_base::encoded_segments();
|
2022 |
|
return url_view_base::encoded_segments();
|
| 2023 |
|
|
2023 |
|
|
| 2024 |
|
|
2024 |
|
|
| 2025 |
|
//--------------------------------------------
|
2025 |
|
//--------------------------------------------
|
| 2026 |
|
|
2026 |
|
|
| 2027 |
|
|
2027 |
|
|
| 2028 |
|
|
2028 |
|
|
| 2029 |
|
//--------------------------------------------
|
2029 |
|
//--------------------------------------------
|
| 2030 |
|
|
2030 |
|
|
| 2031 |
|
|
2031 |
|
|
| 2032 |
|
|
2032 |
|
|
| 2033 |
|
This sets the query to the string, which
|
2033 |
|
This sets the query to the string, which
|
| 2034 |
|
|
2034 |
|
|
| 2035 |
|
An empty query is distinct from having
|
2035 |
|
An empty query is distinct from having
|
| 2036 |
|
|
2036 |
|
|
| 2037 |
|
Reserved characters in the string are
|
2037 |
|
Reserved characters in the string are
|
| 2038 |
|
percent-escaped in the result.
|
2038 |
|
percent-escaped in the result.
|
| 2039 |
|
|
2039 |
|
|
| 2040 |
|
|
2040 |
|
|
| 2041 |
|
|
2041 |
|
|
| 2042 |
|
assert( url( "http://example.com" ).set_query( "id=42" ).query() == "id=42" );
|
2042 |
|
assert( url( "http://example.com" ).set_query( "id=42" ).query() == "id=42" );
|
| 2043 |
|
|
2043 |
|
|
| 2044 |
|
|
2044 |
|
|
| 2045 |
|
|
2045 |
|
|
| 2046 |
|
|
2046 |
|
|
| 2047 |
|
this->has_query() == true && this->query() == s
|
2047 |
|
this->has_query() == true && this->query() == s
|
| 2048 |
|
|
2048 |
|
|
| 2049 |
|
|
2049 |
|
|
| 2050 |
|
|
2050 |
|
|
| 2051 |
|
|
2051 |
|
|
| 2052 |
|
Calls to allocate may throw.
|
2052 |
|
Calls to allocate may throw.
|
| 2053 |
|
|
2053 |
|
|
| 2054 |
|
@param s The string to set.
|
2054 |
|
@param s The string to set.
|
| 2055 |
|
|
2055 |
|
|
| 2056 |
|
|
2056 |
|
|
| 2057 |
|
|
2057 |
|
|
| 2058 |
|
|
2058 |
|
|
| 2059 |
|
query = *( pchar / "/" / "?" )
|
2059 |
|
query = *( pchar / "/" / "?" )
|
| 2060 |
|
|
2060 |
|
|
| 2061 |
|
query-param = key [ "=" value ]
|
2061 |
|
query-param = key [ "=" value ]
|
| 2062 |
|
query-params = [ query-param ] *( "&" query-param )
|
2062 |
|
query-params = [ query-param ] *( "&" query-param )
|
| 2063 |
|
|
2063 |
|
|
| 2064 |
|
|
2064 |
|
|
| 2065 |
|
|
2065 |
|
|
| 2066 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.4"
|
2066 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.4"
|
| 2067 |
|
>3.4. Query (rfc3986)</a>
|
2067 |
|
>3.4. Query (rfc3986)</a>
|
| 2068 |
|
@li <a href="https://en.wikipedia.org/wiki/Query_string"
|
2068 |
|
@li <a href="https://en.wikipedia.org/wiki/Query_string"
|
| 2069 |
|
>Query string (Wikipedia)</a>
|
2069 |
|
>Query string (Wikipedia)</a>
|
| 2070 |
|
|
2070 |
|
|
| 2071 |
|
|
2071 |
|
|
| 2072 |
|
|
2072 |
|
|
| 2073 |
|
|
2073 |
|
|
| 2074 |
|
|
2074 |
|
|
| 2075 |
|
|
2075 |
|
|
| 2076 |
|
|
2076 |
|
|
| 2077 |
|
|
2077 |
|
|
| 2078 |
|
|
2078 |
|
|
| 2079 |
|
|
2079 |
|
|
| 2080 |
|
|
2080 |
|
|
| 2081 |
|
|
2081 |
|
|
| 2082 |
|
|
2082 |
|
|
| 2083 |
|
This sets the query to the string, which
|
2083 |
|
This sets the query to the string, which
|
| 2084 |
|
may contain percent-escapes and can be
|
2084 |
|
may contain percent-escapes and can be
|
| 2085 |
|
|
2085 |
|
|
| 2086 |
|
An empty query is distinct from having
|
2086 |
|
An empty query is distinct from having
|
| 2087 |
|
|
2087 |
|
|
| 2088 |
|
Escapes in the string are preserved,
|
2088 |
|
Escapes in the string are preserved,
|
| 2089 |
|
and reserved characters in the string
|
2089 |
|
and reserved characters in the string
|
| 2090 |
|
are percent-escaped in the result.
|
2090 |
|
are percent-escaped in the result.
|
| 2091 |
|
|
2091 |
|
|
| 2092 |
|
|
2092 |
|
|
| 2093 |
|
|
2093 |
|
|
| 2094 |
|
assert( url( "http://example.com" ).set_encoded_query( "id=42" ).encoded_query() == "id=42" );
|
2094 |
|
assert( url( "http://example.com" ).set_encoded_query( "id=42" ).encoded_query() == "id=42" );
|
| 2095 |
|
|
2095 |
|
|
| 2096 |
|
|
2096 |
|
|
| 2097 |
|
|
2097 |
|
|
| 2098 |
|
|
2098 |
|
|
| 2099 |
|
this->has_query() == true && this->query() == decode_view( s );
|
2099 |
|
this->has_query() == true && this->query() == decode_view( s );
|
| 2100 |
|
|
2100 |
|
|
| 2101 |
|
|
2101 |
|
|
| 2102 |
|
|
2102 |
|
|
| 2103 |
|
|
2103 |
|
|
| 2104 |
|
Calls to allocate may throw.
|
2104 |
|
Calls to allocate may throw.
|
| 2105 |
|
Exceptions thrown on invalid input.
|
2105 |
|
Exceptions thrown on invalid input.
|
| 2106 |
|
|
2106 |
|
|
| 2107 |
|
@param s The string to set.
|
2107 |
|
@param s The string to set.
|
| 2108 |
|
|
2108 |
|
|
| 2109 |
|
|
2109 |
|
|
| 2110 |
|
|
2110 |
|
|
| 2111 |
|
`s` contains an invalid percent-encoding.
|
2111 |
|
`s` contains an invalid percent-encoding.
|
| 2112 |
|
|
2112 |
|
|
| 2113 |
|
|
2113 |
|
|
| 2114 |
|
|
2114 |
|
|
| 2115 |
|
query = *( pchar / "/" / "?" )
|
2115 |
|
query = *( pchar / "/" / "?" )
|
| 2116 |
|
|
2116 |
|
|
| 2117 |
|
query-param = key [ "=" value ]
|
2117 |
|
query-param = key [ "=" value ]
|
| 2118 |
|
query-params = [ query-param ] *( "&" query-param )
|
2118 |
|
query-params = [ query-param ] *( "&" query-param )
|
| 2119 |
|
|
2119 |
|
|
| 2120 |
|
|
2120 |
|
|
| 2121 |
|
|
2121 |
|
|
| 2122 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.4"
|
2122 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.4"
|
| 2123 |
|
>3.4. Query (rfc3986)</a>
|
2123 |
|
>3.4. Query (rfc3986)</a>
|
| 2124 |
|
@li <a href="https://en.wikipedia.org/wiki/Query_string"
|
2124 |
|
@li <a href="https://en.wikipedia.org/wiki/Query_string"
|
| 2125 |
|
>Query string (Wikipedia)</a>
|
2125 |
|
>Query string (Wikipedia)</a>
|
| 2126 |
|
|
2126 |
|
|
| 2127 |
|
|
2127 |
|
|
| 2128 |
|
|
2128 |
|
|
| 2129 |
|
|
2129 |
|
|
| 2130 |
|
|
2130 |
|
|
| 2131 |
|
|
2131 |
|
|
| 2132 |
|
|
2132 |
|
|
| 2133 |
|
|
2133 |
|
|
| 2134 |
|
|
2134 |
|
|
| 2135 |
|
|
2135 |
|
|
| 2136 |
|
|
2136 |
|
|
| 2137 |
|
/** Return the query as a container of parameters
|
2137 |
|
/** Return the query as a container of parameters
|
| 2138 |
|
|
2138 |
|
|
| 2139 |
|
This function returns a bidirectional
|
2139 |
|
This function returns a bidirectional
|
| 2140 |
|
view of key/value pairs over the query.
|
2140 |
|
view of key/value pairs over the query.
|
| 2141 |
|
The returned view references the same
|
2141 |
|
The returned view references the same
|
| 2142 |
|
underlying character buffer; ownership
|
2142 |
|
underlying character buffer; ownership
|
| 2143 |
|
|
2143 |
|
|
| 2144 |
|
Any percent-escapes in strings returned
|
2144 |
|
Any percent-escapes in strings returned
|
| 2145 |
|
when iterating the view are decoded first.
|
2145 |
|
when iterating the view are decoded first.
|
| 2146 |
|
The container is modifiable; changes
|
2146 |
|
The container is modifiable; changes
|
| 2147 |
|
to the container are reflected in the
|
2147 |
|
to the container are reflected in the
|
| 2148 |
|
|
2148 |
|
|
| 2149 |
|
|
2149 |
|
|
| 2150 |
|
|
2150 |
|
|
| 2151 |
|
|
2151 |
|
|
| 2152 |
|
|
2152 |
|
|
| 2153 |
|
|
2153 |
|
|
| 2154 |
|
params_ref pv = url( "/sql?id=42&name=jane%2Ddoe&page+size=20" ).params();
|
2154 |
|
params_ref pv = url( "/sql?id=42&name=jane%2Ddoe&page+size=20" ).params();
|
| 2155 |
|
|
2155 |
|
|
| 2156 |
|
|
2156 |
|
|
| 2157 |
|
|
2157 |
|
|
| 2158 |
|
|
2158 |
|
|
| 2159 |
|
|
2159 |
|
|
| 2160 |
|
|
2160 |
|
|
| 2161 |
|
|
2161 |
|
|
| 2162 |
|
|
2162 |
|
|
| 2163 |
|
|
2163 |
|
|
| 2164 |
|
|
2164 |
|
|
| 2165 |
|
query = *( pchar / "/" / "?" )
|
2165 |
|
query = *( pchar / "/" / "?" )
|
| 2166 |
|
|
2166 |
|
|
| 2167 |
|
query-param = key [ "=" value ]
|
2167 |
|
query-param = key [ "=" value ]
|
| 2168 |
|
query-params = [ query-param ] *( "&" query-param )
|
2168 |
|
query-params = [ query-param ] *( "&" query-param )
|
| 2169 |
|
|
2169 |
|
|
| 2170 |
|
|
2170 |
|
|
| 2171 |
|
|
2171 |
|
|
| 2172 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.4"
|
2172 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.4"
|
| 2173 |
|
>3.4. Query (rfc3986)</a>
|
2173 |
|
>3.4. Query (rfc3986)</a>
|
| 2174 |
|
@li <a href="https://en.wikipedia.org/wiki/Query_string"
|
2174 |
|
@li <a href="https://en.wikipedia.org/wiki/Query_string"
|
| 2175 |
|
>Query string (Wikipedia)</a>
|
2175 |
|
>Query string (Wikipedia)</a>
|
| 2176 |
|
|
2176 |
|
|
| 2177 |
|
|
2177 |
|
|
| 2178 |
|
|
2178 |
|
|
| 2179 |
|
|
2179 |
|
|
| 2180 |
|
|
2180 |
|
|
| 2181 |
|
|
2181 |
|
|
| 2182 |
|
|
2182 |
|
|
| 2183 |
|
|
2183 |
|
|
| 2184 |
|
|
2184 |
|
|
| 2185 |
|
|
2185 |
|
|
| 2186 |
|
/// @copydoc url_view_base::params
|
2186 |
|
/// @copydoc url_view_base::params
|
| 2187 |
|
|
2187 |
|
|
| 2188 |
|
|
2188 |
|
|
| 2189 |
|
|
2189 |
|
|
| 2190 |
|
return url_view_base::params();
|
2190 |
|
return url_view_base::params();
|
| 2191 |
|
|
2191 |
|
|
| 2192 |
|
|
2192 |
|
|
| 2193 |
|
/** Return the query as a container of parameters
|
2193 |
|
/** Return the query as a container of parameters
|
| 2194 |
|
|
2194 |
|
|
| 2195 |
|
This function returns a bidirectional
|
2195 |
|
This function returns a bidirectional
|
| 2196 |
|
view of key/value pairs over the query.
|
2196 |
|
view of key/value pairs over the query.
|
| 2197 |
|
The returned view references the same
|
2197 |
|
The returned view references the same
|
| 2198 |
|
underlying character buffer; ownership
|
2198 |
|
underlying character buffer; ownership
|
| 2199 |
|
|
2199 |
|
|
| 2200 |
|
Any percent-escapes in strings returned
|
2200 |
|
Any percent-escapes in strings returned
|
| 2201 |
|
when iterating the view are decoded first.
|
2201 |
|
when iterating the view are decoded first.
|
| 2202 |
|
The container is modifiable; changes
|
2202 |
|
The container is modifiable; changes
|
| 2203 |
|
to the container are reflected in the
|
2203 |
|
to the container are reflected in the
|
| 2204 |
|
|
2204 |
|
|
| 2205 |
|
|
2205 |
|
|
| 2206 |
|
|
2206 |
|
|
| 2207 |
|
|
2207 |
|
|
| 2208 |
|
|
2208 |
|
|
| 2209 |
|
opt.space_as_plus = true;
|
2209 |
|
opt.space_as_plus = true;
|
| 2210 |
|
params_ref pv = url( "/sql?id=42&name=jane+doe&page+size=20" ).params(opt);
|
2210 |
|
params_ref pv = url( "/sql?id=42&name=jane+doe&page+size=20" ).params(opt);
|
| 2211 |
|
|
2211 |
|
|
| 2212 |
|
|
2212 |
|
|
| 2213 |
|
|
2213 |
|
|
| 2214 |
|
|
2214 |
|
|
| 2215 |
|
|
2215 |
|
|
| 2216 |
|
|
2216 |
|
|
| 2217 |
|
|
2217 |
|
|
| 2218 |
|
|
2218 |
|
|
| 2219 |
|
@param opt The options for decoding. If
|
2219 |
|
@param opt The options for decoding. If
|
| 2220 |
|
this parameter is omitted, the `space_as_plus`
|
2220 |
|
this parameter is omitted, the `space_as_plus`
|
| 2221 |
|
|
2221 |
|
|
| 2222 |
|
|
2222 |
|
|
| 2223 |
|
@return A range of references to the parameters.
|
2223 |
|
@return A range of references to the parameters.
|
| 2224 |
|
|
2224 |
|
|
| 2225 |
|
|
2225 |
|
|
| 2226 |
|
|
2226 |
|
|
| 2227 |
|
query = *( pchar / "/" / "?" )
|
2227 |
|
query = *( pchar / "/" / "?" )
|
| 2228 |
|
|
2228 |
|
|
| 2229 |
|
query-param = key [ "=" value ]
|
2229 |
|
query-param = key [ "=" value ]
|
| 2230 |
|
query-params = [ query-param ] *( "&" query-param )
|
2230 |
|
query-params = [ query-param ] *( "&" query-param )
|
| 2231 |
|
|
2231 |
|
|
| 2232 |
|
|
2232 |
|
|
| 2233 |
|
|
2233 |
|
|
| 2234 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.4"
|
2234 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.4"
|
| 2235 |
|
>3.4. Query (rfc3986)</a>
|
2235 |
|
>3.4. Query (rfc3986)</a>
|
| 2236 |
|
@li <a href="https://en.wikipedia.org/wiki/Query_string"
|
2236 |
|
@li <a href="https://en.wikipedia.org/wiki/Query_string"
|
| 2237 |
|
>Query string (Wikipedia)</a>
|
2237 |
|
>Query string (Wikipedia)</a>
|
| 2238 |
|
|
2238 |
|
|
| 2239 |
|
|
2239 |
|
|
| 2240 |
|
|
2240 |
|
|
| 2241 |
|
|
2241 |
|
|
| 2242 |
|
|
2242 |
|
|
| 2243 |
|
|
2243 |
|
|
| 2244 |
|
|
2244 |
|
|
| 2245 |
|
|
2245 |
|
|
| 2246 |
|
params(encoding_opts opt) noexcept;
|
2246 |
|
params(encoding_opts opt) noexcept;
|
| 2247 |
|
|
2247 |
|
|
| 2248 |
|
/// @copydoc url_view_base::encoded_params
|
2248 |
|
/// @copydoc url_view_base::encoded_params
|
| 2249 |
|
|
2249 |
|
|
| 2250 |
|
encoded_params() const noexcept
|
2250 |
|
encoded_params() const noexcept
|
| 2251 |
|
|
2251 |
|
|
| 2252 |
|
return url_view_base::encoded_params();
|
2252 |
|
return url_view_base::encoded_params();
|
| 2253 |
|
|
2253 |
|
|
| 2254 |
|
|
2254 |
|
|
| 2255 |
|
/** Return the query as a container of parameters
|
2255 |
|
/** Return the query as a container of parameters
|
| 2256 |
|
|
2256 |
|
|
| 2257 |
|
This function returns a bidirectional
|
2257 |
|
This function returns a bidirectional
|
| 2258 |
|
view of key/value pairs over the query.
|
2258 |
|
view of key/value pairs over the query.
|
| 2259 |
|
The returned view references the same
|
2259 |
|
The returned view references the same
|
| 2260 |
|
underlying character buffer; ownership
|
2260 |
|
underlying character buffer; ownership
|
| 2261 |
|
|
2261 |
|
|
| 2262 |
|
Strings returned when iterating the
|
2262 |
|
Strings returned when iterating the
|
| 2263 |
|
range may contain percent escapes.
|
2263 |
|
range may contain percent escapes.
|
| 2264 |
|
The container is modifiable; changes
|
2264 |
|
The container is modifiable; changes
|
| 2265 |
|
to the container are reflected in the
|
2265 |
|
to the container are reflected in the
|
| 2266 |
|
|
2266 |
|
|
| 2267 |
|
|
2267 |
|
|
| 2268 |
|
|
2268 |
|
|
| 2269 |
|
|
2269 |
|
|
| 2270 |
|
|
2270 |
|
|
| 2271 |
|
|
2271 |
|
|
| 2272 |
|
params_encoded_ref pv = url( "/sql?id=42&name=jane%2Ddoe&page+size=20" ).encoded_params();
|
2272 |
|
params_encoded_ref pv = url( "/sql?id=42&name=jane%2Ddoe&page+size=20" ).encoded_params();
|
| 2273 |
|
|
2273 |
|
|
| 2274 |
|
|
2274 |
|
|
| 2275 |
|
|
2275 |
|
|
| 2276 |
|
|
2276 |
|
|
| 2277 |
|
|
2277 |
|
|
| 2278 |
|
|
2278 |
|
|
| 2279 |
|
|
2279 |
|
|
| 2280 |
|
|
2280 |
|
|
| 2281 |
|
|
2281 |
|
|
| 2282 |
|
|
2282 |
|
|
| 2283 |
|
query = *( pchar / "/" / "?" )
|
2283 |
|
query = *( pchar / "/" / "?" )
|
| 2284 |
|
|
2284 |
|
|
| 2285 |
|
query-param = key [ "=" value ]
|
2285 |
|
query-param = key [ "=" value ]
|
| 2286 |
|
query-params = [ query-param ] *( "&" query-param )
|
2286 |
|
query-params = [ query-param ] *( "&" query-param )
|
| 2287 |
|
|
2287 |
|
|
| 2288 |
|
|
2288 |
|
|
| 2289 |
|
|
2289 |
|
|
| 2290 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.4"
|
2290 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.4"
|
| 2291 |
|
>3.4. Query (rfc3986)</a>
|
2291 |
|
>3.4. Query (rfc3986)</a>
|
| 2292 |
|
@li <a href="https://en.wikipedia.org/wiki/Query_string"
|
2292 |
|
@li <a href="https://en.wikipedia.org/wiki/Query_string"
|
| 2293 |
|
>Query string (Wikipedia)</a>
|
2293 |
|
>Query string (Wikipedia)</a>
|
| 2294 |
|
|
2294 |
|
|
| 2295 |
|
|
2295 |
|
|
| 2296 |
|
|
2296 |
|
|
| 2297 |
|
|
2297 |
|
|
| 2298 |
|
|
2298 |
|
|
| 2299 |
|
|
2299 |
|
|
| 2300 |
|
|
2300 |
|
|
| 2301 |
|
|
2301 |
|
|
| 2302 |
|
encoded_params() noexcept;
|
2302 |
|
encoded_params() noexcept;
|
| 2303 |
|
|
2303 |
|
|
| 2304 |
|
|
2304 |
|
|
| 2305 |
|
|
2305 |
|
|
| 2306 |
|
This sets the query params to the list
|
2306 |
|
This sets the query params to the list
|
| 2307 |
|
of param_view, which can be empty.
|
2307 |
|
of param_view, which can be empty.
|
| 2308 |
|
|
2308 |
|
|
| 2309 |
|
An empty list of params is distinct from
|
2309 |
|
An empty list of params is distinct from
|
| 2310 |
|
|
2310 |
|
|
| 2311 |
|
|
2311 |
|
|
| 2312 |
|
Reserved characters in the string are
|
2312 |
|
Reserved characters in the string are
|
| 2313 |
|
percent-escaped in the result.
|
2313 |
|
percent-escaped in the result.
|
| 2314 |
|
|
2314 |
|
|
| 2315 |
|
|
2315 |
|
|
| 2316 |
|
|
2316 |
|
|
| 2317 |
|
assert( url( "http://example.com" ).set_params( {"id", "42"} ).query() == "id=42" );
|
2317 |
|
assert( url( "http://example.com" ).set_params( {"id", "42"} ).query() == "id=42" );
|
| 2318 |
|
|
2318 |
|
|
| 2319 |
|
|
2319 |
|
|
| 2320 |
|
|
2320 |
|
|
| 2321 |
|
|
2321 |
|
|
| 2322 |
|
this->has_query() == true
|
2322 |
|
this->has_query() == true
|
| 2323 |
|
|
2323 |
|
|
| 2324 |
|
|
2324 |
|
|
| 2325 |
|
|
2325 |
|
|
| 2326 |
|
|
2326 |
|
|
| 2327 |
|
Calls to allocate may throw.
|
2327 |
|
Calls to allocate may throw.
|
| 2328 |
|
|
2328 |
|
|
| 2329 |
|
|
2329 |
|
|
| 2330 |
|
|
2330 |
|
|
| 2331 |
|
|
2331 |
|
|
| 2332 |
|
@param ps The params to set.
|
2332 |
|
@param ps The params to set.
|
| 2333 |
|
@param opts The options for encoding.
|
2333 |
|
@param opts The options for encoding.
|
| 2334 |
|
|
2334 |
|
|
| 2335 |
|
|
2335 |
|
|
| 2336 |
|
|
2336 |
|
|
| 2337 |
|
|
2337 |
|
|
| 2338 |
|
query = *( pchar / "/" / "?" )
|
2338 |
|
query = *( pchar / "/" / "?" )
|
| 2339 |
|
|
2339 |
|
|
| 2340 |
|
query-param = key [ "=" value ]
|
2340 |
|
query-param = key [ "=" value ]
|
| 2341 |
|
query-params = [ query-param ] *( "&" query-param )
|
2341 |
|
query-params = [ query-param ] *( "&" query-param )
|
| 2342 |
|
|
2342 |
|
|
| 2343 |
|
|
2343 |
|
|
| 2344 |
|
|
2344 |
|
|
| 2345 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.4
|
2345 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.4
|
| 2346 |
|
>3.4. Query (rfc3986)</a>
|
2346 |
|
>3.4. Query (rfc3986)</a>
|
| 2347 |
|
@li <a href="https://en.wikipedia.org/wiki/Query_string"
|
2347 |
|
@li <a href="https://en.wikipedia.org/wiki/Query_string"
|
| 2348 |
|
>Query string (Wikipedia)</a>
|
2348 |
|
>Query string (Wikipedia)</a>
|
| 2349 |
|
|
2349 |
|
|
| 2350 |
|
|
2350 |
|
|
| 2351 |
|
|
2351 |
|
|
| 2352 |
|
|
2352 |
|
|
| 2353 |
|
|
2353 |
|
|
| 2354 |
|
|
2354 |
|
|
| 2355 |
|
|
2355 |
|
|
| 2356 |
|
|
2356 |
|
|
| 2357 |
|
|
2357 |
|
|
| 2358 |
|
std::initializer_list<param_view> ps,
|
2358 |
|
std::initializer_list<param_view> ps,
|
| 2359 |
|
encoding_opts opts = {}) noexcept;
|
2359 |
|
encoding_opts opts = {}) noexcept;
|
| 2360 |
|
|
2360 |
|
|
| 2361 |
|
|
2361 |
|
|
| 2362 |
|
|
2362 |
|
|
| 2363 |
|
This sets the query params to the elements
|
2363 |
|
This sets the query params to the elements
|
| 2364 |
|
in the list, which may contain
|
2364 |
|
in the list, which may contain
|
| 2365 |
|
percent-escapes and can be empty.
|
2365 |
|
percent-escapes and can be empty.
|
| 2366 |
|
|
2366 |
|
|
| 2367 |
|
An empty list of params is distinct from
|
2367 |
|
An empty list of params is distinct from
|
| 2368 |
|
|
2368 |
|
|
| 2369 |
|
|
2369 |
|
|
| 2370 |
|
Escapes in the string are preserved,
|
2370 |
|
Escapes in the string are preserved,
|
| 2371 |
|
and reserved characters in the string
|
2371 |
|
and reserved characters in the string
|
| 2372 |
|
are percent-escaped in the result.
|
2372 |
|
are percent-escaped in the result.
|
| 2373 |
|
|
2373 |
|
|
| 2374 |
|
|
2374 |
|
|
| 2375 |
|
|
2375 |
|
|
| 2376 |
|
assert( url( "http://example.com" ).set_encoded_params( {"id", "42"} ).encoded_query() == "id=42" );
|
2376 |
|
assert( url( "http://example.com" ).set_encoded_params( {"id", "42"} ).encoded_query() == "id=42" );
|
| 2377 |
|
|
2377 |
|
|
| 2378 |
|
|
2378 |
|
|
| 2379 |
|
|
2379 |
|
|
| 2380 |
|
|
2380 |
|
|
| 2381 |
|
this->has_query() == true
|
2381 |
|
this->has_query() == true
|
| 2382 |
|
|
2382 |
|
|
| 2383 |
|
|
2383 |
|
|
| 2384 |
|
|
2384 |
|
|
| 2385 |
|
|
2385 |
|
|
| 2386 |
|
|
2386 |
|
|
| 2387 |
|
|
2387 |
|
|
| 2388 |
|
|
2388 |
|
|
| 2389 |
|
Calls to allocate may throw.
|
2389 |
|
Calls to allocate may throw.
|
| 2390 |
|
Exceptions thrown on invalid input.
|
2390 |
|
Exceptions thrown on invalid input.
|
| 2391 |
|
|
2391 |
|
|
| 2392 |
|
@param ps The params to set.
|
2392 |
|
@param ps The params to set.
|
| 2393 |
|
|
2393 |
|
|
| 2394 |
|
|
2394 |
|
|
| 2395 |
|
|
2395 |
|
|
| 2396 |
|
|
2396 |
|
|
| 2397 |
|
some element in `ps` contains an invalid percent-encoding.
|
2397 |
|
some element in `ps` contains an invalid percent-encoding.
|
| 2398 |
|
|
2398 |
|
|
| 2399 |
|
|
2399 |
|
|
| 2400 |
|
|
2400 |
|
|
| 2401 |
|
query = *( pchar / "/" / "?" )
|
2401 |
|
query = *( pchar / "/" / "?" )
|
| 2402 |
|
|
2402 |
|
|
| 2403 |
|
query-param = key [ "=" value ]
|
2403 |
|
query-param = key [ "=" value ]
|
| 2404 |
|
query-params = [ query-param ] *( "&" query-param )
|
2404 |
|
query-params = [ query-param ] *( "&" query-param )
|
| 2405 |
|
|
2405 |
|
|
| 2406 |
|
|
2406 |
|
|
| 2407 |
|
|
2407 |
|
|
| 2408 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.4"
|
2408 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.4"
|
| 2409 |
|
>3.4. Query (rfc3986)</a>
|
2409 |
|
>3.4. Query (rfc3986)</a>
|
| 2410 |
|
@li <a href="https://en.wikipedia.org/wiki/Query_string"
|
2410 |
|
@li <a href="https://en.wikipedia.org/wiki/Query_string"
|
| 2411 |
|
>Query string (Wikipedia)</a>
|
2411 |
|
>Query string (Wikipedia)</a>
|
| 2412 |
|
|
2412 |
|
|
| 2413 |
|
|
2413 |
|
|
| 2414 |
|
|
2414 |
|
|
| 2415 |
|
|
2415 |
|
|
| 2416 |
|
|
2416 |
|
|
| 2417 |
|
|
2417 |
|
|
| 2418 |
|
|
2418 |
|
|
| 2419 |
|
|
2419 |
|
|
| 2420 |
|
|
2420 |
|
|
| 2421 |
|
set_encoded_params( std::initializer_list< param_pct_view > ps ) noexcept;
|
2421 |
|
set_encoded_params( std::initializer_list< param_pct_view > ps ) noexcept;
|
| 2422 |
|
|
2422 |
|
|
| 2423 |
|
|
2423 |
|
|
| 2424 |
|
|
2424 |
|
|
| 2425 |
|
If a query is present, it is removed.
|
2425 |
|
If a query is present, it is removed.
|
| 2426 |
|
An empty query is distinct from having
|
2426 |
|
An empty query is distinct from having
|
| 2427 |
|
|
2427 |
|
|
| 2428 |
|
|
2428 |
|
|
| 2429 |
|
|
2429 |
|
|
| 2430 |
|
|
2430 |
|
|
| 2431 |
|
|
2431 |
|
|
| 2432 |
|
|
2432 |
|
|
| 2433 |
|
assert( url( "http://www.example.com?id=42" ).remove_query().buffer() == "http://www.example.com" );
|
2433 |
|
assert( url( "http://www.example.com?id=42" ).remove_query().buffer() == "http://www.example.com" );
|
| 2434 |
|
|
2434 |
|
|
| 2435 |
|
|
2435 |
|
|
| 2436 |
|
|
2436 |
|
|
| 2437 |
|
|
2437 |
|
|
| 2438 |
|
this->has_query() == false && this->params().empty()
|
2438 |
|
this->has_query() == false && this->params().empty()
|
| 2439 |
|
|
2439 |
|
|
| 2440 |
|
|
2440 |
|
|
| 2441 |
|
|
2441 |
|
|
| 2442 |
|
|
2442 |
|
|
| 2443 |
|
|
2443 |
|
|
| 2444 |
|
|
2444 |
|
|
| 2445 |
|
|
2445 |
|
|
| 2446 |
|
query = *( pchar / "/" / "?" )
|
2446 |
|
query = *( pchar / "/" / "?" )
|
| 2447 |
|
|
2447 |
|
|
| 2448 |
|
query-param = key [ "=" value ]
|
2448 |
|
query-param = key [ "=" value ]
|
| 2449 |
|
query-params = [ query-param ] *( "&" query-param )
|
2449 |
|
query-params = [ query-param ] *( "&" query-param )
|
| 2450 |
|
|
2450 |
|
|
| 2451 |
|
|
2451 |
|
|
| 2452 |
|
|
2452 |
|
|
| 2453 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.4"
|
2453 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.4"
|
| 2454 |
|
>3.4. Query (rfc3986)</a>
|
2454 |
|
>3.4. Query (rfc3986)</a>
|
| 2455 |
|
@li <a href="https://en.wikipedia.org/wiki/Query_string"
|
2455 |
|
@li <a href="https://en.wikipedia.org/wiki/Query_string"
|
| 2456 |
|
>Query string (Wikipedia)</a>
|
2456 |
|
>Query string (Wikipedia)</a>
|
| 2457 |
|
|
2457 |
|
|
| 2458 |
|
|
2458 |
|
|
| 2459 |
|
|
2459 |
|
|
| 2460 |
|
|
2460 |
|
|
| 2461 |
|
|
2461 |
|
|
| 2462 |
|
|
2462 |
|
|
| 2463 |
|
|
2463 |
|
|
| 2464 |
|
|
2464 |
|
|
| 2465 |
|
|
2465 |
|
|
| 2466 |
|
|
2466 |
|
|
| 2467 |
|
//--------------------------------------------
|
2467 |
|
//--------------------------------------------
|
| 2468 |
|
|
2468 |
|
|
| 2469 |
|
|
2469 |
|
|
| 2470 |
|
|
2470 |
|
|
| 2471 |
|
//--------------------------------------------
|
2471 |
|
//--------------------------------------------
|
| 2472 |
|
|
2472 |
|
|
| 2473 |
|
|
2473 |
|
|
| 2474 |
|
|
2474 |
|
|
| 2475 |
|
This function removes the fragment.
|
2475 |
|
This function removes the fragment.
|
| 2476 |
|
An empty fragment is distinct from
|
2476 |
|
An empty fragment is distinct from
|
| 2477 |
|
|
2477 |
|
|
| 2478 |
|
|
2478 |
|
|
| 2479 |
|
|
2479 |
|
|
| 2480 |
|
|
2480 |
|
|
| 2481 |
|
|
2481 |
|
|
| 2482 |
|
|
2482 |
|
|
| 2483 |
|
assert( url( "?first=john&last=doe#anchor" ).remove_fragment().buffer() == "?first=john&last=doe" );
|
2483 |
|
assert( url( "?first=john&last=doe#anchor" ).remove_fragment().buffer() == "?first=john&last=doe" );
|
| 2484 |
|
|
2484 |
|
|
| 2485 |
|
|
2485 |
|
|
| 2486 |
|
|
2486 |
|
|
| 2487 |
|
|
2487 |
|
|
| 2488 |
|
this->has_fragment() == false && this->encoded_fragment() == ""
|
2488 |
|
this->has_fragment() == false && this->encoded_fragment() == ""
|
| 2489 |
|
|
2489 |
|
|
| 2490 |
|
|
2490 |
|
|
| 2491 |
|
|
2491 |
|
|
| 2492 |
|
|
2492 |
|
|
| 2493 |
|
|
2493 |
|
|
| 2494 |
|
|
2494 |
|
|
| 2495 |
|
|
2495 |
|
|
| 2496 |
|
|
2496 |
|
|
| 2497 |
|
|
2497 |
|
|
| 2498 |
|
|
2498 |
|
|
| 2499 |
|
fragment = *( pchar / "/" / "?" )
|
2499 |
|
fragment = *( pchar / "/" / "?" )
|
| 2500 |
|
|
2500 |
|
|
| 2501 |
|
|
2501 |
|
|
| 2502 |
|
|
2502 |
|
|
| 2503 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.5"
|
2503 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.5"
|
| 2504 |
|
|
2504 |
|
|
| 2505 |
|
|
2505 |
|
|
| 2506 |
|
|
2506 |
|
|
| 2507 |
|
|
2507 |
|
|
| 2508 |
|
@ref set_encoded_fragment,
|
2508 |
|
@ref set_encoded_fragment,
|
| 2509 |
|
|
2509 |
|
|
| 2510 |
|
|
2510 |
|
|
| 2511 |
|
|
2511 |
|
|
| 2512 |
|
remove_fragment() noexcept;
|
2512 |
|
remove_fragment() noexcept;
|
| 2513 |
|
|
2513 |
|
|
| 2514 |
|
|
2514 |
|
|
| 2515 |
|
|
2515 |
|
|
| 2516 |
|
This function sets the fragment to the
|
2516 |
|
This function sets the fragment to the
|
| 2517 |
|
specified string, which may be empty.
|
2517 |
|
specified string, which may be empty.
|
| 2518 |
|
An empty fragment is distinct from
|
2518 |
|
An empty fragment is distinct from
|
| 2519 |
|
|
2519 |
|
|
| 2520 |
|
Reserved characters in the string are
|
2520 |
|
Reserved characters in the string are
|
| 2521 |
|
percent-escaped in the result.
|
2521 |
|
percent-escaped in the result.
|
| 2522 |
|
|
2522 |
|
|
| 2523 |
|
|
2523 |
|
|
| 2524 |
|
|
2524 |
|
|
| 2525 |
|
assert( url("?first=john&last=doe" ).set_encoded_fragment( "john doe" ).encoded_fragment() == "john%20doe" );
|
2525 |
|
assert( url("?first=john&last=doe" ).set_encoded_fragment( "john doe" ).encoded_fragment() == "john%20doe" );
|
| 2526 |
|
|
2526 |
|
|
| 2527 |
|
|
2527 |
|
|
| 2528 |
|
|
2528 |
|
|
| 2529 |
|
|
2529 |
|
|
| 2530 |
|
this->has_fragment() == true && this->fragment() == s
|
2530 |
|
this->has_fragment() == true && this->fragment() == s
|
| 2531 |
|
|
2531 |
|
|
| 2532 |
|
|
2532 |
|
|
| 2533 |
|
|
2533 |
|
|
| 2534 |
|
Linear in `this->size() + s.size()`.
|
2534 |
|
Linear in `this->size() + s.size()`.
|
| 2535 |
|
|
2535 |
|
|
| 2536 |
|
|
2536 |
|
|
| 2537 |
|
|
2537 |
|
|
| 2538 |
|
Calls to allocate may throw.
|
2538 |
|
Calls to allocate may throw.
|
| 2539 |
|
|
2539 |
|
|
| 2540 |
|
@param s The string to set.
|
2540 |
|
@param s The string to set.
|
| 2541 |
|
|
2541 |
|
|
| 2542 |
|
|
2542 |
|
|
| 2543 |
|
|
2543 |
|
|
| 2544 |
|
|
2544 |
|
|
| 2545 |
|
|
2545 |
|
|
| 2546 |
|
fragment = *( pchar / "/" / "?" )
|
2546 |
|
fragment = *( pchar / "/" / "?" )
|
| 2547 |
|
|
2547 |
|
|
| 2548 |
|
|
2548 |
|
|
| 2549 |
|
|
2549 |
|
|
| 2550 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.5"
|
2550 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.5"
|
| 2551 |
|
|
2551 |
|
|
| 2552 |
|
|
2552 |
|
|
| 2553 |
|
|
2553 |
|
|
| 2554 |
|
|
2554 |
|
|
| 2555 |
|
@ref set_encoded_fragment.
|
2555 |
|
@ref set_encoded_fragment.
|
| 2556 |
|
|
2556 |
|
|
| 2557 |
|
|
2557 |
|
|
| 2558 |
|
|
2558 |
|
|
| 2559 |
|
|
2559 |
|
|
| 2560 |
|
|
2560 |
|
|
| 2561 |
|
|
2561 |
|
|
| 2562 |
|
|
2562 |
|
|
| 2563 |
|
This function sets the fragment to the
|
2563 |
|
This function sets the fragment to the
|
| 2564 |
|
specified string, which may contain
|
2564 |
|
specified string, which may contain
|
| 2565 |
|
percent-escapes and which may be empty.
|
2565 |
|
percent-escapes and which may be empty.
|
| 2566 |
|
An empty fragment is distinct from
|
2566 |
|
An empty fragment is distinct from
|
| 2567 |
|
|
2567 |
|
|
| 2568 |
|
Escapes in the string are preserved,
|
2568 |
|
Escapes in the string are preserved,
|
| 2569 |
|
and reserved characters in the string
|
2569 |
|
and reserved characters in the string
|
| 2570 |
|
are percent-escaped in the result.
|
2570 |
|
are percent-escaped in the result.
|
| 2571 |
|
|
2571 |
|
|
| 2572 |
|
|
2572 |
|
|
| 2573 |
|
|
2573 |
|
|
| 2574 |
|
|
2574 |
|
|
| 2575 |
|
|
2575 |
|
|
| 2576 |
|
assert( url("?first=john&last=doe" ).set_encoded_fragment( "john%2Ddoe" ).fragment() == "john-doe" );
|
2576 |
|
assert( url("?first=john&last=doe" ).set_encoded_fragment( "john%2Ddoe" ).fragment() == "john-doe" );
|
| 2577 |
|
|
2577 |
|
|
| 2578 |
|
|
2578 |
|
|
| 2579 |
|
|
2579 |
|
|
| 2580 |
|
|
2580 |
|
|
| 2581 |
|
this->has_fragment() == true && this->fragment() == decode_view( s )
|
2581 |
|
this->has_fragment() == true && this->fragment() == decode_view( s )
|
| 2582 |
|
|
2582 |
|
|
| 2583 |
|
|
2583 |
|
|
| 2584 |
|
|
2584 |
|
|
| 2585 |
|
Linear in `this->size() + s.size()`.
|
2585 |
|
Linear in `this->size() + s.size()`.
|
| 2586 |
|
|
2586 |
|
|
| 2587 |
|
|
2587 |
|
|
| 2588 |
|
|
2588 |
|
|
| 2589 |
|
Calls to allocate may throw.
|
2589 |
|
Calls to allocate may throw.
|
| 2590 |
|
Exceptions thrown on invalid input.
|
2590 |
|
Exceptions thrown on invalid input.
|
| 2591 |
|
|
2591 |
|
|
| 2592 |
|
|
2592 |
|
|
| 2593 |
|
`s` contains an invalid percent-encoding.
|
2593 |
|
`s` contains an invalid percent-encoding.
|
| 2594 |
|
|
2594 |
|
|
| 2595 |
|
@param s The string to set.
|
2595 |
|
@param s The string to set.
|
| 2596 |
|
|
2596 |
|
|
| 2597 |
|
|
2597 |
|
|
| 2598 |
|
|
2598 |
|
|
| 2599 |
|
|
2599 |
|
|
| 2600 |
|
|
2600 |
|
|
| 2601 |
|
fragment = *( pchar / "/" / "?" )
|
2601 |
|
fragment = *( pchar / "/" / "?" )
|
| 2602 |
|
|
2602 |
|
|
| 2603 |
|
|
2603 |
|
|
| 2604 |
|
|
2604 |
|
|
| 2605 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.5"
|
2605 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-3.5"
|
| 2606 |
|
|
2606 |
|
|
| 2607 |
|
|
2607 |
|
|
| 2608 |
|
|
2608 |
|
|
| 2609 |
|
|
2609 |
|
|
| 2610 |
|
|
2610 |
|
|
| 2611 |
|
|
2611 |
|
|
| 2612 |
|
|
2612 |
|
|
| 2613 |
|
|
2613 |
|
|
| 2614 |
|
|
2614 |
|
|
| 2615 |
|
|
2615 |
|
|
| 2616 |
|
//--------------------------------------------
|
2616 |
|
//--------------------------------------------
|
| 2617 |
|
|
2617 |
|
|
| 2618 |
|
|
2618 |
|
|
| 2619 |
|
|
2619 |
|
|
| 2620 |
|
//--------------------------------------------
|
2620 |
|
//--------------------------------------------
|
| 2621 |
|
|
2621 |
|
|
| 2622 |
|
/** Remove the origin component
|
2622 |
|
/** Remove the origin component
|
| 2623 |
|
|
2623 |
|
|
| 2624 |
|
This function removes the origin, which
|
2624 |
|
This function removes the origin, which
|
| 2625 |
|
consists of the scheme and authority.
|
2625 |
|
consists of the scheme and authority.
|
| 2626 |
|
|
2626 |
|
|
| 2627 |
|
|
2627 |
|
|
| 2628 |
|
|
2628 |
|
|
| 2629 |
|
|
2629 |
|
|
| 2630 |
|
|
2630 |
|
|
| 2631 |
|
assert( url( "http://www.example.com/index.htm" ).remove_origin().buffer() == "/index.htm" );
|
2631 |
|
assert( url( "http://www.example.com/index.htm" ).remove_origin().buffer() == "/index.htm" );
|
| 2632 |
|
|
2632 |
|
|
| 2633 |
|
|
2633 |
|
|
| 2634 |
|
|
2634 |
|
|
| 2635 |
|
|
2635 |
|
|
| 2636 |
|
this->scheme_id() == scheme::none && this->has_authority() == false
|
2636 |
|
this->scheme_id() == scheme::none && this->has_authority() == false
|
| 2637 |
|
|
2637 |
|
|
| 2638 |
|
|
2638 |
|
|
| 2639 |
|
|
2639 |
|
|
| 2640 |
|
Linear in `this->size()`.
|
2640 |
|
Linear in `this->size()`.
|
| 2641 |
|
|
2641 |
|
|
| 2642 |
|
|
2642 |
|
|
| 2643 |
|
|
2643 |
|
|
| 2644 |
|
|
2644 |
|
|
| 2645 |
|
|
2645 |
|
|
| 2646 |
|
|
2646 |
|
|
| 2647 |
|
|
2647 |
|
|
| 2648 |
|
//--------------------------------------------
|
2648 |
|
//--------------------------------------------
|
| 2649 |
|
|
2649 |
|
|
| 2650 |
|
|
2650 |
|
|
| 2651 |
|
|
2651 |
|
|
| 2652 |
|
//--------------------------------------------
|
2652 |
|
//--------------------------------------------
|
| 2653 |
|
|
2653 |
|
|
| 2654 |
|
/** Normalize the URL components
|
2654 |
|
/** Normalize the URL components
|
| 2655 |
|
|
2655 |
|
|
| 2656 |
|
Applies Syntax-based normalization to
|
2656 |
|
Applies Syntax-based normalization to
|
| 2657 |
|
all components of the URL.
|
2657 |
|
all components of the URL.
|
| 2658 |
|
|
2658 |
|
|
| 2659 |
|
The scheme is normalized to lowercase.
|
2659 |
|
The scheme is normalized to lowercase.
|
| 2660 |
|
|
2660 |
|
|
| 2661 |
|
|
2661 |
|
|
| 2662 |
|
assert( url( "HTTP://www.example.com" ).normalize().buffer() == "http://www.example.com" );
|
2662 |
|
assert( url( "HTTP://www.example.com" ).normalize().buffer() == "http://www.example.com" );
|
| 2663 |
|
|
2663 |
|
|
| 2664 |
|
|
2664 |
|
|
| 2665 |
|
The host is normalized to lowercase.
|
2665 |
|
The host is normalized to lowercase.
|
| 2666 |
|
Percent-encoding triplets are normalized
|
2666 |
|
Percent-encoding triplets are normalized
|
| 2667 |
|
to uppercase letters. Percent-encoded
|
2667 |
|
to uppercase letters. Percent-encoded
|
| 2668 |
|
octets that correspond to unreserved
|
2668 |
|
octets that correspond to unreserved
|
| 2669 |
|
|
2669 |
|
|
| 2670 |
|
|
2670 |
|
|
| 2671 |
|
|
2671 |
|
|
| 2672 |
|
assert( url( "http://www.Example.com" ).normalize().buffer() == "http://www.example.com" );
|
2672 |
|
assert( url( "http://www.Example.com" ).normalize().buffer() == "http://www.example.com" );
|
| 2673 |
|
assert( url( "http://www.%65xample.com" ).normalize().buffer() == "http://www.example.com" );
|
2673 |
|
assert( url( "http://www.%65xample.com" ).normalize().buffer() == "http://www.example.com" );
|
| 2674 |
|
|
2674 |
|
|
| 2675 |
|
|
2675 |
|
|
| 2676 |
|
Percent-encoding triplets in the path
|
2676 |
|
Percent-encoding triplets in the path
|
| 2677 |
|
are normalized to uppercase letters.
|
2677 |
|
are normalized to uppercase letters.
|
| 2678 |
|
Percent-encoded octets that correspond
|
2678 |
|
Percent-encoded octets that correspond
|
| 2679 |
|
to unreserved characters are decoded.
|
2679 |
|
to unreserved characters are decoded.
|
| 2680 |
|
Redundant path-segments "." and ".."
|
2680 |
|
Redundant path-segments "." and ".."
|
| 2681 |
|
|
2681 |
|
|
| 2682 |
|
|
2682 |
|
|
| 2683 |
|
|
2683 |
|
|
| 2684 |
|
assert( url( "http://www.example.com/a/b/../c" ).normalize().buffer() == "http://www.example.com/a/c" );
|
2684 |
|
assert( url( "http://www.example.com/a/b/../c" ).normalize().buffer() == "http://www.example.com/a/c" );
|
| 2685 |
|
assert( url( "http://www.example.com/a/./b" ).normalize().buffer() == "http://www.example.com/a/b" );
|
2685 |
|
assert( url( "http://www.example.com/a/./b" ).normalize().buffer() == "http://www.example.com/a/b" );
|
| 2686 |
|
assert( url( "http://www.example.com/%63ss" ).normalize().buffer() == "http://www.example.com/css" );
|
2686 |
|
assert( url( "http://www.example.com/%63ss" ).normalize().buffer() == "http://www.example.com/css" );
|
| 2687 |
|
|
2687 |
|
|
| 2688 |
|
|
2688 |
|
|
| 2689 |
|
Percent-encoding triplets in the query
|
2689 |
|
Percent-encoding triplets in the query
|
| 2690 |
|
are normalized to uppercase letters.
|
2690 |
|
are normalized to uppercase letters.
|
| 2691 |
|
Percent-encoded octets that correspond
|
2691 |
|
Percent-encoded octets that correspond
|
| 2692 |
|
to unreserved characters are decoded.
|
2692 |
|
to unreserved characters are decoded.
|
| 2693 |
|
|
2693 |
|
|
| 2694 |
|
|
2694 |
|
|
| 2695 |
|
assert( url( "http://www.example.com?a=%62" ).normalize().buffer() == "http://www.example.com?a=b" );
|
2695 |
|
assert( url( "http://www.example.com?a=%62" ).normalize().buffer() == "http://www.example.com?a=b" );
|
| 2696 |
|
|
2696 |
|
|
| 2697 |
|
|
2697 |
|
|
| 2698 |
|
Percent-encoding triplets in the fragment
|
2698 |
|
Percent-encoding triplets in the fragment
|
| 2699 |
|
are normalized to uppercase letters.
|
2699 |
|
are normalized to uppercase letters.
|
| 2700 |
|
Percent-encoded octets that correspond
|
2700 |
|
Percent-encoded octets that correspond
|
| 2701 |
|
to unreserved characters are decoded.
|
2701 |
|
to unreserved characters are decoded.
|
| 2702 |
|
|
2702 |
|
|
| 2703 |
|
|
2703 |
|
|
| 2704 |
|
assert( url( "http://www.example.com#%61bc" ).normalize().buffer() == "http://www.example.com#abc" );
|
2704 |
|
assert( url( "http://www.example.com#%61bc" ).normalize().buffer() == "http://www.example.com#abc" );
|
| 2705 |
|
|
2705 |
|
|
| 2706 |
|
|
2706 |
|
|
| 2707 |
|
Applying normalization to a URL with all
|
2707 |
|
Applying normalization to a URL with all
|
| 2708 |
|
components percent-encoded:
|
2708 |
|
components percent-encoded:
|
| 2709 |
|
|
2709 |
|
|
| 2710 |
|
|
2710 |
|
|
| 2711 |
|
assert( url( "HTTP://www.Example.com/%70ath?%71uery#%66rag" ).normalize().buffer() == "http://www.example.com/path?query#frag" );
|
2711 |
|
assert( url( "HTTP://www.Example.com/%70ath?%71uery#%66rag" ).normalize().buffer() == "http://www.example.com/path?query#frag" );
|
| 2712 |
|
|
2712 |
|
|
| 2713 |
|
|
2713 |
|
|
| 2714 |
|
|
2714 |
|
|
| 2715 |
|
|
2715 |
|
|
| 2716 |
|
|
2716 |
|
|
| 2717 |
|
|
2717 |
|
|
| 2718 |
|
Calls to allocate may throw.
|
2718 |
|
Calls to allocate may throw.
|
| 2719 |
|
|
2719 |
|
|
| 2720 |
|
|
2720 |
|
|
| 2721 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2"
|
2721 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2"
|
| 2722 |
|
>6.2.2 Syntax-Based Normalization (rfc3986)</a>
|
2722 |
|
>6.2.2 Syntax-Based Normalization (rfc3986)</a>
|
| 2723 |
|
|
2723 |
|
|
| 2724 |
|
|
2724 |
|
|
| 2725 |
|
|
2725 |
|
|
| 2726 |
|
@ref normalize_authority,
|
2726 |
|
@ref normalize_authority,
|
| 2727 |
|
|
2727 |
|
|
| 2728 |
|
|
2728 |
|
|
| 2729 |
|
|
2729 |
|
|
| 2730 |
|
|
2730 |
|
|
| 2731 |
|
|
2731 |
|
|
| 2732 |
|
|
2732 |
|
|
| 2733 |
|
|
2733 |
|
|
| 2734 |
|
|
2734 |
|
|
| 2735 |
|
/** Normalize the URL scheme
|
2735 |
|
/** Normalize the URL scheme
|
| 2736 |
|
|
2736 |
|
|
| 2737 |
|
Applies Syntax-based normalization to the
|
2737 |
|
Applies Syntax-based normalization to the
|
| 2738 |
|
|
2738 |
|
|
| 2739 |
|
|
2739 |
|
|
| 2740 |
|
The scheme is normalized to lowercase.
|
2740 |
|
The scheme is normalized to lowercase.
|
| 2741 |
|
|
2741 |
|
|
| 2742 |
|
|
2742 |
|
|
| 2743 |
|
assert( url( "HTTP://www.example.com" ).normalize_scheme().buffer() == "http://www.example.com" );
|
2743 |
|
assert( url( "HTTP://www.example.com" ).normalize_scheme().buffer() == "http://www.example.com" );
|
| 2744 |
|
|
2744 |
|
|
| 2745 |
|
|
2745 |
|
|
| 2746 |
|
|
2746 |
|
|
| 2747 |
|
|
2747 |
|
|
| 2748 |
|
|
2748 |
|
|
| 2749 |
|
|
2749 |
|
|
| 2750 |
|
Calls to allocate may throw.
|
2750 |
|
Calls to allocate may throw.
|
| 2751 |
|
|
2751 |
|
|
| 2752 |
|
|
2752 |
|
|
| 2753 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2"
|
2753 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2"
|
| 2754 |
|
>6.2.2 Syntax-Based Normalization (rfc3986)</a>
|
2754 |
|
>6.2.2 Syntax-Based Normalization (rfc3986)</a>
|
| 2755 |
|
|
2755 |
|
|
| 2756 |
|
|
2756 |
|
|
| 2757 |
|
|
2757 |
|
|
| 2758 |
|
|
2758 |
|
|
| 2759 |
|
|
2759 |
|
|
| 2760 |
|
/** Normalize the URL authority
|
2760 |
|
/** Normalize the URL authority
|
| 2761 |
|
|
2761 |
|
|
| 2762 |
|
Applies Syntax-based normalization to the
|
2762 |
|
Applies Syntax-based normalization to the
|
| 2763 |
|
|
2763 |
|
|
| 2764 |
|
|
2764 |
|
|
| 2765 |
|
The host is normalized to lowercase.
|
2765 |
|
The host is normalized to lowercase.
|
| 2766 |
|
Percent-encoding triplets are normalized
|
2766 |
|
Percent-encoding triplets are normalized
|
| 2767 |
|
to uppercase letters. Percent-encoded
|
2767 |
|
to uppercase letters. Percent-encoded
|
| 2768 |
|
octets that correspond to unreserved
|
2768 |
|
octets that correspond to unreserved
|
| 2769 |
|
|
2769 |
|
|
| 2770 |
|
|
2770 |
|
|
| 2771 |
|
|
2771 |
|
|
| 2772 |
|
assert( url( "http://www.Example.com" ).normalize_authority().buffer() == "http://www.example.com" );
|
2772 |
|
assert( url( "http://www.Example.com" ).normalize_authority().buffer() == "http://www.example.com" );
|
| 2773 |
|
assert( url( "http://www.%65xample.com" ).normalize_authority().buffer() == "http://www.example.com" );
|
2773 |
|
assert( url( "http://www.%65xample.com" ).normalize_authority().buffer() == "http://www.example.com" );
|
| 2774 |
|
|
2774 |
|
|
| 2775 |
|
|
2775 |
|
|
| 2776 |
|
|
2776 |
|
|
| 2777 |
|
|
2777 |
|
|
| 2778 |
|
|
2778 |
|
|
| 2779 |
|
|
2779 |
|
|
| 2780 |
|
Calls to allocate may throw.
|
2780 |
|
Calls to allocate may throw.
|
| 2781 |
|
|
2781 |
|
|
| 2782 |
|
|
2782 |
|
|
| 2783 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2"
|
2783 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2"
|
| 2784 |
|
>6.2.2 Syntax-Based Normalization (rfc3986)</a>
|
2784 |
|
>6.2.2 Syntax-Based Normalization (rfc3986)</a>
|
| 2785 |
|
|
2785 |
|
|
| 2786 |
|
|
2786 |
|
|
| 2787 |
|
|
2787 |
|
|
| 2788 |
|
|
2788 |
|
|
| 2789 |
|
|
2789 |
|
|
| 2790 |
|
/** Normalize the URL path
|
2790 |
|
/** Normalize the URL path
|
| 2791 |
|
|
2791 |
|
|
| 2792 |
|
Applies Syntax-based normalization to the
|
2792 |
|
Applies Syntax-based normalization to the
|
| 2793 |
|
|
2793 |
|
|
| 2794 |
|
|
2794 |
|
|
| 2795 |
|
Percent-encoding triplets are normalized
|
2795 |
|
Percent-encoding triplets are normalized
|
| 2796 |
|
to uppercase letters. Percent-encoded
|
2796 |
|
to uppercase letters. Percent-encoded
|
| 2797 |
|
octets that correspond to unreserved
|
2797 |
|
octets that correspond to unreserved
|
| 2798 |
|
characters are decoded. Redundant
|
2798 |
|
characters are decoded. Redundant
|
| 2799 |
|
path-segments "." and ".." are removed.
|
2799 |
|
path-segments "." and ".." are removed.
|
| 2800 |
|
|
2800 |
|
|
| 2801 |
|
|
2801 |
|
|
| 2802 |
|
assert( url( "http://www.example.com/a/b/../c" ).normalize_path().buffer() == "http://www.example.com/a/c" );
|
2802 |
|
assert( url( "http://www.example.com/a/b/../c" ).normalize_path().buffer() == "http://www.example.com/a/c" );
|
| 2803 |
|
assert( url( "http://www.example.com/a/./b" ).normalize_path().buffer() == "http://www.example.com/a/b" );
|
2803 |
|
assert( url( "http://www.example.com/a/./b" ).normalize_path().buffer() == "http://www.example.com/a/b" );
|
| 2804 |
|
assert( url( "http://www.example.com/%63ss" ).normalize_path().buffer() == "http://www.example.com/css" );
|
2804 |
|
assert( url( "http://www.example.com/%63ss" ).normalize_path().buffer() == "http://www.example.com/css" );
|
| 2805 |
|
|
2805 |
|
|
| 2806 |
|
|
2806 |
|
|
| 2807 |
|
|
2807 |
|
|
| 2808 |
|
|
2808 |
|
|
| 2809 |
|
|
2809 |
|
|
| 2810 |
|
|
2810 |
|
|
| 2811 |
|
Calls to allocate may throw.
|
2811 |
|
Calls to allocate may throw.
|
| 2812 |
|
|
2812 |
|
|
| 2813 |
|
|
2813 |
|
|
| 2814 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2"
|
2814 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2"
|
| 2815 |
|
>6.2.2 Syntax-Based Normalization (rfc3986)</a>
|
2815 |
|
>6.2.2 Syntax-Based Normalization (rfc3986)</a>
|
| 2816 |
|
|
2816 |
|
|
| 2817 |
|
|
2817 |
|
|
| 2818 |
|
|
2818 |
|
|
| 2819 |
|
|
2819 |
|
|
| 2820 |
|
|
2820 |
|
|
| 2821 |
|
/** Normalize the URL query
|
2821 |
|
/** Normalize the URL query
|
| 2822 |
|
|
2822 |
|
|
| 2823 |
|
Applies Syntax-based normalization to the
|
2823 |
|
Applies Syntax-based normalization to the
|
| 2824 |
|
|
2824 |
|
|
| 2825 |
|
|
2825 |
|
|
| 2826 |
|
Percent-encoding triplets are normalized
|
2826 |
|
Percent-encoding triplets are normalized
|
| 2827 |
|
to uppercase letters. Percent-encoded
|
2827 |
|
to uppercase letters. Percent-encoded
|
| 2828 |
|
octets that correspond to unreserved
|
2828 |
|
octets that correspond to unreserved
|
| 2829 |
|
|
2829 |
|
|
| 2830 |
|
|
2830 |
|
|
| 2831 |
|
|
2831 |
|
|
| 2832 |
|
assert( url( "http://www.example.com?a=%62" ).normalize_query().buffer() == "http://www.example.com?a=b" );
|
2832 |
|
assert( url( "http://www.example.com?a=%62" ).normalize_query().buffer() == "http://www.example.com?a=b" );
|
| 2833 |
|
|
2833 |
|
|
| 2834 |
|
|
2834 |
|
|
| 2835 |
|
|
2835 |
|
|
| 2836 |
|
|
2836 |
|
|
| 2837 |
|
|
2837 |
|
|
| 2838 |
|
|
2838 |
|
|
| 2839 |
|
Calls to allocate may throw.
|
2839 |
|
Calls to allocate may throw.
|
| 2840 |
|
|
2840 |
|
|
| 2841 |
|
|
2841 |
|
|
| 2842 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2"
|
2842 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2"
|
| 2843 |
|
>6.2.2 Syntax-Based Normalization (rfc3986)</a>
|
2843 |
|
>6.2.2 Syntax-Based Normalization (rfc3986)</a>
|
| 2844 |
|
|
2844 |
|
|
| 2845 |
|
|
2845 |
|
|
| 2846 |
|
|
2846 |
|
|
| 2847 |
|
|
2847 |
|
|
| 2848 |
|
|
2848 |
|
|
| 2849 |
|
/** Normalize the URL fragment
|
2849 |
|
/** Normalize the URL fragment
|
| 2850 |
|
|
2850 |
|
|
| 2851 |
|
Applies Syntax-based normalization to the
|
2851 |
|
Applies Syntax-based normalization to the
|
| 2852 |
|
|
2852 |
|
|
| 2853 |
|
|
2853 |
|
|
| 2854 |
|
Percent-encoding triplets are normalized
|
2854 |
|
Percent-encoding triplets are normalized
|
| 2855 |
|
to uppercase letters. Percent-encoded
|
2855 |
|
to uppercase letters. Percent-encoded
|
| 2856 |
|
octets that correspond to unreserved
|
2856 |
|
octets that correspond to unreserved
|
| 2857 |
|
|
2857 |
|
|
| 2858 |
|
|
2858 |
|
|
| 2859 |
|
|
2859 |
|
|
| 2860 |
|
assert( url( "http://www.example.com#%61bc" ).normalize_fragment().buffer() == "http://www.example.com#abc" );
|
2860 |
|
assert( url( "http://www.example.com#%61bc" ).normalize_fragment().buffer() == "http://www.example.com#abc" );
|
| 2861 |
|
|
2861 |
|
|
| 2862 |
|
|
2862 |
|
|
| 2863 |
|
|
2863 |
|
|
| 2864 |
|
|
2864 |
|
|
| 2865 |
|
|
2865 |
|
|
| 2866 |
|
|
2866 |
|
|
| 2867 |
|
Calls to allocate may throw.
|
2867 |
|
Calls to allocate may throw.
|
| 2868 |
|
|
2868 |
|
|
| 2869 |
|
|
2869 |
|
|
| 2870 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2"
|
2870 |
|
@li <a href="https://datatracker.ietf.org/doc/html/rfc3986#section-6.2.2"
|
| 2871 |
|
>6.2.2 Syntax-Based Normalization (rfc3986)</a>
|
2871 |
|
>6.2.2 Syntax-Based Normalization (rfc3986)</a>
|
| 2872 |
|
|
2872 |
|
|
| 2873 |
|
|
2873 |
|
|
| 2874 |
|
|
2874 |
|
|
| 2875 |
|
|
2875 |
|
|
| 2876 |
|
|
2876 |
|
|
| 2877 |
|
|
2877 |
|
|
| 2878 |
|
|
2878 |
|
|
| 2879 |
|
|
2879 |
|
|
| 2880 |
|
//--------------------------------------------
|
2880 |
|
//--------------------------------------------
|
| 2881 |
|
|
2881 |
|
|
| 2882 |
|
//--------------------------------------------
|
2882 |
|
//--------------------------------------------
|
| 2883 |
|
|
2883 |
|
|
| 2884 |
|
|
2884 |
|
|
| 2885 |
|
|
2885 |
|
|
| 2886 |
|
//--------------------------------------------
|
2886 |
|
//--------------------------------------------
|
| 2887 |
|
|
2887 |
|
|
| 2888 |
|
/** Resolve a URL reference against this base URL
|
2888 |
|
/** Resolve a URL reference against this base URL
|
| 2889 |
|
|
2889 |
|
|
| 2890 |
|
This function attempts to resolve a URL
|
2890 |
|
This function attempts to resolve a URL
|
| 2891 |
|
reference `ref` against this base URL
|
2891 |
|
reference `ref` against this base URL
|
| 2892 |
|
in a manner similar to that of a web browser
|
2892 |
|
in a manner similar to that of a web browser
|
| 2893 |
|
|
2893 |
|
|
| 2894 |
|
|
2894 |
|
|
| 2895 |
|
This URL must satisfy the <em>URI</em>
|
2895 |
|
This URL must satisfy the <em>URI</em>
|
| 2896 |
|
grammar. In other words, it must contain
|
2896 |
|
grammar. In other words, it must contain
|
| 2897 |
|
|
2897 |
|
|
| 2898 |
|
|
2898 |
|
|
| 2899 |
|
Relative references are only usable when
|
2899 |
|
Relative references are only usable when
|
| 2900 |
|
in the context of a base absolute URI.
|
2900 |
|
in the context of a base absolute URI.
|
| 2901 |
|
This process of resolving a relative
|
2901 |
|
This process of resolving a relative
|
| 2902 |
|
<em>reference</em> within the context of
|
2902 |
|
<em>reference</em> within the context of
|
| 2903 |
|
a <em>base</em> URI is defined in detail
|
2903 |
|
a <em>base</em> URI is defined in detail
|
| 2904 |
|
|
2904 |
|
|
| 2905 |
|
|
2905 |
|
|
| 2906 |
|
The resolution process works as if the
|
2906 |
|
The resolution process works as if the
|
| 2907 |
|
relative reference is appended to the base
|
2907 |
|
relative reference is appended to the base
|
| 2908 |
|
URI and the result is normalized.
|
2908 |
|
URI and the result is normalized.
|
| 2909 |
|
|
2909 |
|
|
| 2910 |
|
Given the input base URL, this function
|
2910 |
|
Given the input base URL, this function
|
| 2911 |
|
resolves the relative reference
|
2911 |
|
resolves the relative reference
|
| 2912 |
|
as if performing the following steps:
|
2912 |
|
as if performing the following steps:
|
| 2913 |
|
|
2913 |
|
|
| 2914 |
|
@li Ensure the base URI has at least a scheme
|
2914 |
|
@li Ensure the base URI has at least a scheme
|
| 2915 |
|
@li Normalizing the reference path
|
2915 |
|
@li Normalizing the reference path
|
| 2916 |
|
@li Merge base and reference paths
|
2916 |
|
@li Merge base and reference paths
|
| 2917 |
|
@li Normalize the merged path
|
2917 |
|
@li Normalize the merged path
|
| 2918 |
|
|
2918 |
|
|
| 2919 |
|
This function places the result of the
|
2919 |
|
This function places the result of the
|
| 2920 |
|
resolution into this URL in place.
|
2920 |
|
resolution into this URL in place.
|
| 2921 |
|
|
2921 |
|
|
| 2922 |
|
If an error occurs, the contents of
|
2922 |
|
If an error occurs, the contents of
|
| 2923 |
|
this URL are unspecified and a `boost::system::result`
|
2923 |
|
this URL are unspecified and a `boost::system::result`
|
| 2924 |
|
with an `system::error_code` is returned.
|
2924 |
|
with an `system::error_code` is returned.
|
| 2925 |
|
|
2925 |
|
|
| 2926 |
|
@note Abnormal hrefs where the number of ".."
|
2926 |
|
@note Abnormal hrefs where the number of ".."
|
| 2927 |
|
segments exceeds the number of segments in
|
2927 |
|
segments exceeds the number of segments in
|
| 2928 |
|
the base path are handled by including the
|
2928 |
|
the base path are handled by including the
|
| 2929 |
|
unmatched ".." segments in the result, as described
|
2929 |
|
unmatched ".." segments in the result, as described
|
| 2930 |
|
in <a href="https://www.rfc-editor.org/errata/eid4547"
|
2930 |
|
in <a href="https://www.rfc-editor.org/errata/eid4547"
|
| 2931 |
|
|
2931 |
|
|
| 2932 |
|
|
2932 |
|
|
| 2933 |
|
|
2933 |
|
|
| 2934 |
|
|
2934 |
|
|
| 2935 |
|
url base1( "/one/two/three" );
|
2935 |
|
url base1( "/one/two/three" );
|
| 2936 |
|
|
2936 |
|
|
| 2937 |
|
assert( base1.buffer() == "/one/two/four" );
|
2937 |
|
assert( base1.buffer() == "/one/two/four" );
|
| 2938 |
|
|
2938 |
|
|
| 2939 |
|
url base2( "http://example.com/" )
|
2939 |
|
url base2( "http://example.com/" )
|
| 2940 |
|
|
2940 |
|
|
| 2941 |
|
assert( base2.buffer() == "http://example.com/one" );
|
2941 |
|
assert( base2.buffer() == "http://example.com/one" );
|
| 2942 |
|
|
2942 |
|
|
| 2943 |
|
url base3( "http://example.com/one" );
|
2943 |
|
url base3( "http://example.com/one" );
|
| 2944 |
|
|
2944 |
|
|
| 2945 |
|
assert( base3.buffer() == "http://example.com/two" );
|
2945 |
|
assert( base3.buffer() == "http://example.com/two" );
|
| 2946 |
|
|
2946 |
|
|
| 2947 |
|
url base4( "http://a/b/c/d;p?q" );
|
2947 |
|
url base4( "http://a/b/c/d;p?q" );
|
| 2948 |
|
|
2948 |
|
|
| 2949 |
|
assert( base4.buffer() == "http://a/b/c/g#s" );
|
2949 |
|
assert( base4.buffer() == "http://a/b/c/g#s" );
|
| 2950 |
|
|
2950 |
|
|
| 2951 |
|
|
2951 |
|
|
| 2952 |
|
|
2952 |
|
|
| 2953 |
|
|
2953 |
|
|
| 2954 |
|
absolute-URI = scheme ":" hier-part [ "?" query ]
|
2954 |
|
absolute-URI = scheme ":" hier-part [ "?" query ]
|
| 2955 |
|
|
2955 |
|
|
| 2956 |
|
|
2956 |
|
|
| 2957 |
|
|
2957 |
|
|
| 2958 |
|
|
2958 |
|
|
| 2959 |
|
Calls to allocate may throw.
|
2959 |
|
Calls to allocate may throw.
|
| 2960 |
|
|
2960 |
|
|
| 2961 |
|
@return An empty `boost::system::result` upon success,
|
2961 |
|
@return An empty `boost::system::result` upon success,
|
| 2962 |
|
otherwise an error code if `!base.has_scheme()`.
|
2962 |
|
otherwise an error code if `!base.has_scheme()`.
|
| 2963 |
|
|
2963 |
|
|
| 2964 |
|
@param ref The URL reference to resolve.
|
2964 |
|
@param ref The URL reference to resolve.
|
| 2965 |
|
|
2965 |
|
|
| 2966 |
|
|
2966 |
|
|
| 2967 |
|
<a href="https://datatracker.ietf.org/doc/html/rfc3986#section-5"
|
2967 |
|
<a href="https://datatracker.ietf.org/doc/html/rfc3986#section-5"
|
| 2968 |
|
>5. Reference Resolution (rfc3986)</a>
|
2968 |
|
>5. Reference Resolution (rfc3986)</a>
|
| 2969 |
|
|
2969 |
|
|
| 2970 |
|
|
2970 |
|
|
| 2971 |
|
|
2971 |
|
|
| 2972 |
|
|
2972 |
|
|
| 2973 |
|
|
2973 |
|
|
| 2974 |
|
|
2974 |
|
|
| 2975 |
|
|
2975 |
|
|
| 2976 |
|
url_view_base const& ref);
|
2976 |
|
url_view_base const& ref);
|
| 2977 |
|
|
2977 |
|
|
| 2978 |
|
|
2978 |
|
|
| 2979 |
|
|
2979 |
|
|
| 2980 |
|
|
2980 |
|
|
| 2981 |
|
url_view_base const& base,
|
2981 |
|
url_view_base const& base,
|
| 2982 |
|
url_view_base const& ref,
|
2982 |
|
url_view_base const& ref,
|
| 2983 |
|
|
2983 |
|
|
| 2984 |
|
|
2984 |
|
|
| 2985 |
|
|
2985 |
|
|
| 2986 |
|
//--------------------------------------------
|
2986 |
|
//--------------------------------------------
|
| 2987 |
|
|
2987 |
|
|
| 2988 |
|
|
2988 |
|
|
| 2989 |
|
|
2989 |
|
|
| 2990 |
|
//--------------------------------------------
|
2990 |
|
//--------------------------------------------
|
| 2991 |
|
|
2991 |
|
|
| 2992 |
|
void check_invariants() const noexcept;
|
2992 |
|
void check_invariants() const noexcept;
|
| 2993 |
|
|
2993 |
|
|
| 2994 |
|
char* resize_impl(int, std::size_t, op_t&);
|
2994 |
|
char* resize_impl(int, std::size_t, op_t&);
|
| 2995 |
|
char* resize_impl(int, int, std::size_t, op_t&);
|
2995 |
|
char* resize_impl(int, int, std::size_t, op_t&);
|
| 2996 |
|
char* shrink_impl(int, std::size_t, op_t&);
|
2996 |
|
char* shrink_impl(int, std::size_t, op_t&);
|
| 2997 |
|
char* shrink_impl(int, int, std::size_t, op_t&);
|
2997 |
|
char* shrink_impl(int, int, std::size_t, op_t&);
|
| 2998 |
|
|
2998 |
|
|
| 2999 |
|
void set_scheme_impl(core::string_view, urls::scheme);
|
2999 |
|
void set_scheme_impl(core::string_view, urls::scheme);
|
| 3000 |
|
char* set_user_impl(std::size_t n, op_t& op);
|
3000 |
|
char* set_user_impl(std::size_t n, op_t& op);
|
| 3001 |
|
char* set_password_impl(std::size_t n, op_t& op);
|
3001 |
|
char* set_password_impl(std::size_t n, op_t& op);
|
| 3002 |
|
char* set_userinfo_impl(std::size_t n, op_t& op);
|
3002 |
|
char* set_userinfo_impl(std::size_t n, op_t& op);
|
| 3003 |
|
char* set_host_impl(std::size_t n, op_t& op);
|
3003 |
|
char* set_host_impl(std::size_t n, op_t& op);
|
| 3004 |
|
char* set_port_impl(std::size_t n, op_t& op);
|
3004 |
|
char* set_port_impl(std::size_t n, op_t& op);
|
| 3005 |
|
char* set_path_impl(std::size_t n, op_t& op);
|
3005 |
|
char* set_path_impl(std::size_t n, op_t& op);
|
| 3006 |
|
|
3006 |
|
|
| 3007 |
|
|
3007 |
|
|
| 3008 |
|
set_host_ipv6_and_zone_id(
|
3008 |
|
set_host_ipv6_and_zone_id(
|
| 3009 |
|
ipv6_address const& addr,
|
3009 |
|
ipv6_address const& addr,
|
| 3010 |
|
core::string_view zone_id);
|
3010 |
|
core::string_view zone_id);
|
| 3011 |
|
|
3011 |
|
|
| 3012 |
|
|
3012 |
|
|
| 3013 |
|
set_host_ipv6_and_encoded_zone_id(
|
3013 |
|
set_host_ipv6_and_encoded_zone_id(
|
| 3014 |
|
ipv6_address const& addr,
|
3014 |
|
ipv6_address const& addr,
|
| 3015 |
|
pct_string_view zone_id);
|
3015 |
|
pct_string_view zone_id);
|
| 3016 |
|
|
3016 |
|
|
| 3017 |
|
|
3017 |
|
|
| 3018 |
|
first_segment() const noexcept;
|
3018 |
|
first_segment() const noexcept;
|
| 3019 |
|
|
3019 |
|
|
| 3020 |
|
detail::segments_iter_impl
|
3020 |
|
detail::segments_iter_impl
|
| 3021 |
|
|
3021 |
|
|
| 3022 |
|
detail::segments_iter_impl const&,
|
3022 |
|
detail::segments_iter_impl const&,
|
| 3023 |
|
detail::segments_iter_impl const&,
|
3023 |
|
detail::segments_iter_impl const&,
|
| 3024 |
|
detail::any_segments_iter&& it0,
|
3024 |
|
detail::any_segments_iter&& it0,
|
| 3025 |
|
|
3025 |
|
|
| 3026 |
|
|
3026 |
|
|
| 3027 |
|
|
3027 |
|
|
| 3028 |
|
|
3028 |
|
|
| 3029 |
|
detail::params_iter_impl const&,
|
3029 |
|
detail::params_iter_impl const&,
|
| 3030 |
|
detail::params_iter_impl const&,
|
3030 |
|
detail::params_iter_impl const&,
|
| 3031 |
|
detail::any_params_iter&&) ->
|
3031 |
|
detail::any_params_iter&&) ->
|
| 3032 |
|
detail::params_iter_impl;
|
3032 |
|
detail::params_iter_impl;
|
| 3033 |
|
|
3033 |
|
|
| 3034 |
|
// Decode any unnecessary percent-escapes
|
3034 |
|
// Decode any unnecessary percent-escapes
|
| 3035 |
|
// and ensures hexadecimals are uppercase.
|
3035 |
|
// and ensures hexadecimals are uppercase.
|
| 3036 |
|
// The encoding of ignored characters is
|
3036 |
|
// The encoding of ignored characters is
|
| 3037 |
|
|
3037 |
|
|
| 3038 |
|
|
3038 |
|
|
| 3039 |
|
|
3039 |
|
|
| 3040 |
|
|
3040 |
|
|
| 3041 |
|
|
3041 |
|
|
| 3042 |
|
|
3042 |
|
|
| 3043 |
|
|
3043 |
|
|
| 3044 |
|
AllowedCharSet const& allowed,
|
3044 |
|
AllowedCharSet const& allowed,
|
| 3045 |
|
IgnoredCharSet const& ignored,
|
3045 |
|
IgnoredCharSet const& ignored,
|
| 3046 |
|
|
3046 |
|
|
| 3047 |
|
|
3047 |
|
|
| 3048 |
|
|
3048 |
|
|
| 3049 |
|
|
3049 |
|
|
| 3050 |
|
|
3050 |
|
|
| 3051 |
|
|
3051 |
|
|
| 3052 |
|
|
3052 |
|
|
| 3053 |
|
|
3053 |
|
|
| 3054 |
|
|
3054 |
|
|
| 3055 |
|
void decoded_to_lower_impl(int id) noexcept;
|
3055 |
|
void decoded_to_lower_impl(int id) noexcept;
|
| 3056 |
|
void to_lower_impl(int id) noexcept;
|
3056 |
|
void to_lower_impl(int id) noexcept;
|
| 3057 |
|
|
3057 |
|
|
| 3058 |
|
|
3058 |
|
|
| 3059 |
|
//------------------------------------------------
|
3059 |
|
//------------------------------------------------
|
| 3060 |
|
|
3060 |
|
|
| 3061 |
|
/** Resolve a URL reference against a base URL
|
3061 |
|
/** Resolve a URL reference against a base URL
|
| 3062 |
|
|
3062 |
|
|
| 3063 |
|
This function attempts to resolve a URL
|
3063 |
|
This function attempts to resolve a URL
|
| 3064 |
|
reference `ref` against the base URL `base`
|
3064 |
|
reference `ref` against the base URL `base`
|
| 3065 |
|
in a manner similar to that of a web browser
|
3065 |
|
in a manner similar to that of a web browser
|
| 3066 |
|
|
3066 |
|
|
| 3067 |
|
|
3067 |
|
|
| 3068 |
|
The base URL must satisfy the <em>URI</em>
|
3068 |
|
The base URL must satisfy the <em>URI</em>
|
| 3069 |
|
grammar. In other words, it must contain
|
3069 |
|
grammar. In other words, it must contain
|
| 3070 |
|
|
3070 |
|
|
| 3071 |
|
|
3071 |
|
|
| 3072 |
|
Relative references are only usable when
|
3072 |
|
Relative references are only usable when
|
| 3073 |
|
in the context of a base absolute URI.
|
3073 |
|
in the context of a base absolute URI.
|
| 3074 |
|
This process of resolving a relative
|
3074 |
|
This process of resolving a relative
|
| 3075 |
|
<em>reference</em> within the context of
|
3075 |
|
<em>reference</em> within the context of
|
| 3076 |
|
a <em>base</em> URI is defined in detail
|
3076 |
|
a <em>base</em> URI is defined in detail
|
| 3077 |
|
|
3077 |
|
|
| 3078 |
|
|
3078 |
|
|
| 3079 |
|
The resolution process works as if the
|
3079 |
|
The resolution process works as if the
|
| 3080 |
|
relative reference is appended to the base
|
3080 |
|
relative reference is appended to the base
|
| 3081 |
|
URI and the result is normalized.
|
3081 |
|
URI and the result is normalized.
|
| 3082 |
|
|
3082 |
|
|
| 3083 |
|
Given the input base URL, this function
|
3083 |
|
Given the input base URL, this function
|
| 3084 |
|
resolves the relative reference
|
3084 |
|
resolves the relative reference
|
| 3085 |
|
as if performing the following steps:
|
3085 |
|
as if performing the following steps:
|
| 3086 |
|
|
3086 |
|
|
| 3087 |
|
@li Ensure the base URI has at least a scheme
|
3087 |
|
@li Ensure the base URI has at least a scheme
|
| 3088 |
|
@li Normalizing the reference path
|
3088 |
|
@li Normalizing the reference path
|
| 3089 |
|
@li Merge base and reference paths
|
3089 |
|
@li Merge base and reference paths
|
| 3090 |
|
@li Normalize the merged path
|
3090 |
|
@li Normalize the merged path
|
| 3091 |
|
|
3091 |
|
|
| 3092 |
|
This function places the result of the
|
3092 |
|
This function places the result of the
|
| 3093 |
|
resolution into `dest`, which can be
|
3093 |
|
resolution into `dest`, which can be
|
| 3094 |
|
any of the url containers that inherit
|
3094 |
|
any of the url containers that inherit
|
| 3095 |
|
|
3095 |
|
|
| 3096 |
|
|
3096 |
|
|
| 3097 |
|
If an error occurs, the contents of
|
3097 |
|
If an error occurs, the contents of
|
| 3098 |
|
`dest` is unspecified and `ec` is set.
|
3098 |
|
`dest` is unspecified and `ec` is set.
|
| 3099 |
|
|
3099 |
|
|
| 3100 |
|
@note Abnormal hrefs where the number of ".."
|
3100 |
|
@note Abnormal hrefs where the number of ".."
|
| 3101 |
|
segments exceeds the number of segments in
|
3101 |
|
segments exceeds the number of segments in
|
| 3102 |
|
the base path are handled by including the
|
3102 |
|
the base path are handled by including the
|
| 3103 |
|
unmatched ".." segments in the result, as described
|
3103 |
|
unmatched ".." segments in the result, as described
|
| 3104 |
|
in <a href="https://www.rfc-editor.org/errata/eid4547"
|
3104 |
|
in <a href="https://www.rfc-editor.org/errata/eid4547"
|
| 3105 |
|
|
3105 |
|
|
| 3106 |
|
|
3106 |
|
|
| 3107 |
|
|
3107 |
|
|
| 3108 |
|
|
3108 |
|
|
| 3109 |
|
|
3109 |
|
|
| 3110 |
|
|
3110 |
|
|
| 3111 |
|
|
3111 |
|
|
| 3112 |
|
resolve("/one/two/three", "four", dest, ec);
|
3112 |
|
resolve("/one/two/three", "four", dest, ec);
|
| 3113 |
|
assert( dest.str() == "/one/two/four" );
|
3113 |
|
assert( dest.str() == "/one/two/four" );
|
| 3114 |
|
|
3114 |
|
|
| 3115 |
|
resolve("http://example.com/", "/one", dest, ec);
|
3115 |
|
resolve("http://example.com/", "/one", dest, ec);
|
| 3116 |
|
assert( dest.str() == "http://example.com/one" );
|
3116 |
|
assert( dest.str() == "http://example.com/one" );
|
| 3117 |
|
|
3117 |
|
|
| 3118 |
|
resolve("http://example.com/one", "/two", dest, ec);
|
3118 |
|
resolve("http://example.com/one", "/two", dest, ec);
|
| 3119 |
|
assert( dest.str() == "http://example.com/two" );
|
3119 |
|
assert( dest.str() == "http://example.com/two" );
|
| 3120 |
|
|
3120 |
|
|
| 3121 |
|
resolve("http://a/b/c/d;p?q", "g#s", dest, ec);
|
3121 |
|
resolve("http://a/b/c/d;p?q", "g#s", dest, ec);
|
| 3122 |
|
assert( dest.str() == "http://a/b/c/g#s" );
|
3122 |
|
assert( dest.str() == "http://a/b/c/g#s" );
|
| 3123 |
|
|
3123 |
|
|
| 3124 |
|
|
3124 |
|
|
| 3125 |
|
|
3125 |
|
|
| 3126 |
|
|
3126 |
|
|
| 3127 |
|
absolute-URI = scheme ":" hier-part [ "?" query ]
|
3127 |
|
absolute-URI = scheme ":" hier-part [ "?" query ]
|
| 3128 |
|
|
3128 |
|
|
| 3129 |
|
|
3129 |
|
|
| 3130 |
|
|
3130 |
|
|
| 3131 |
|
|
3131 |
|
|
| 3132 |
|
Calls to allocate may throw.
|
3132 |
|
Calls to allocate may throw.
|
| 3133 |
|
|
3133 |
|
|
| 3134 |
|
@return An empty `boost::system::result` upon success,
|
3134 |
|
@return An empty `boost::system::result` upon success,
|
| 3135 |
|
otherwise an error code if `!base.has_scheme()`.
|
3135 |
|
otherwise an error code if `!base.has_scheme()`.
|
| 3136 |
|
|
3136 |
|
|
| 3137 |
|
@param base The base URL to resolve against.
|
3137 |
|
@param base The base URL to resolve against.
|
| 3138 |
|
|
3138 |
|
|
| 3139 |
|
@param ref The URL reference to resolve.
|
3139 |
|
@param ref The URL reference to resolve.
|
| 3140 |
|
|
3140 |
|
|
| 3141 |
|
@param dest The container where the result
|
3141 |
|
@param dest The container where the result
|
| 3142 |
|
is written, upon success.
|
3142 |
|
is written, upon success.
|
| 3143 |
|
|
3143 |
|
|
| 3144 |
|
|
3144 |
|
|
| 3145 |
|
<a href="https://datatracker.ietf.org/doc/html/rfc3986#section-5"
|
3145 |
|
<a href="https://datatracker.ietf.org/doc/html/rfc3986#section-5"
|
| 3146 |
|
>5. Reference Resolution (rfc3986)</a>
|
3146 |
|
>5. Reference Resolution (rfc3986)</a>
|
| 3147 |
|
|
3147 |
|
|
| 3148 |
|
|
3148 |
|
|
| 3149 |
|
|
3149 |
|
|
| 3150 |
|
|
3150 |
|
|
| 3151 |
|
|
3151 |
|
|
| 3152 |
|
|
3152 |
|
|
| 3153 |
|
|
3153 |
|
|
| 3154 |
|
|
3154 |
|
|
| 3155 |
|
url_view_base const& base,
|
3155 |
|
url_view_base const& base,
|
| 3156 |
|
url_view_base const& ref,
|
3156 |
|
url_view_base const& ref,
|
| 3157 |
|
|
3157 |
|
|
| 3158 |
|
|
3158 |
|
|
| 3159 |
|
|
3159 |
|
|
| 3160 |
|
|
3160 |
|
|
| 3161 |
|
return dest.resolve(ref);
|
3161 |
|
return dest.resolve(ref);
|
| 3162 |
|
|
3162 |
|
|
| 3163 |
|
|
3163 |
|
|
| 3164 |
|
|
3164 |
|
|
| 3165 |
|
|
3165 |
|
|
| 3166 |
|
|
3166 |
|
|
| 3167 |
|
// These are here because of circular references
|
3167 |
|
// These are here because of circular references
|
| 3168 |
|
#include <boost/url/impl/params_ref.hpp>
|
3168 |
|
#include <boost/url/impl/params_ref.hpp>
|
| 3169 |
|
#include <boost/url/impl/params_encoded_ref.hpp>
|
3169 |
|
#include <boost/url/impl/params_encoded_ref.hpp>
|
| 3170 |
|
#include <boost/url/impl/segments_ref.hpp>
|
3170 |
|
#include <boost/url/impl/segments_ref.hpp>
|
| 3171 |
|
#include <boost/url/impl/segments_encoded_ref.hpp>
|
3171 |
|
#include <boost/url/impl/segments_encoded_ref.hpp>
|
| 3172 |
|
|
3172 |
|
|
| 3173 |
|
|
3173 |
|
|