@@ -137,7 +137,7 @@ class url {
137
137
// / \returns The underlying URL string
138
138
string_type href () const ;
139
139
140
- // /
140
+ // / @{
141
141
// / \tparam Source The input string type
142
142
// / \param input The input string
143
143
// / \returns An error on failure to parse the new URL
@@ -155,6 +155,9 @@ class url {
155
155
return set_href (std::move (bytes.value ()));
156
156
}
157
157
158
+ expected<void , std::error_code> set_href (string_type &&href);
159
+ // / @}
160
+
158
161
// / The URL string
159
162
// /
160
163
// / Equivalent to `skyr::serialize(url_).value()`
@@ -168,6 +171,7 @@ class url {
168
171
// / \returns The [URL protocol](https://url.spec.whatwg.org/#dom-url-protocol)
169
172
string_type protocol () const ;
170
173
174
+ // / @{
171
175
// / Sets the [URL protocol](https://url.spec.whatwg.org/#dom-url-protocol)
172
176
// /
173
177
// / \param protocol The new URL protocol
@@ -186,9 +190,13 @@ class url {
186
190
return set_protocol (std::move (bytes.value ()));
187
191
}
188
192
193
+ expected<void , std::error_code> set_protocol (string_type &&protocol);
194
+ // / @}
195
+
189
196
// / \returns The [URL username](https://url.spec.whatwg.org/#dom-url-username)
190
197
string_type username () const ;
191
198
199
+ // / @{
192
200
// / Sets the [URL username](https://url.spec.whatwg.org/#dom-url-username)
193
201
// /
194
202
// / \param username The new username
@@ -207,13 +215,17 @@ class url {
207
215
return set_username (std::move (bytes.value ()));
208
216
}
209
217
218
+ expected<void , std::error_code> set_username (string_type &&username);
219
+ // / @}
220
+
210
221
// / The [URL password](https://url.spec.whatwg.org/#dom-url-password)
211
222
// /
212
223
// / Equivalent to: `url_.password? url_.password.value() : string_type()`
213
224
// /
214
225
// / \returns The URL password
215
226
string_type password () const ;
216
227
228
+ // / @{
217
229
// / Sets the [URL password](https://url.spec.whatwg.org/#dom-url-password)
218
230
// /
219
231
// / \param password The new password
@@ -231,10 +243,14 @@ class url {
231
243
}
232
244
return set_password (std::move (bytes.value ()));
233
245
}
246
+
247
+ expected<void , std::error_code> set_password (string_type &&password);
248
+ // / @}
234
249
235
250
// / \returns The [URL host](https://url.spec.whatwg.org/#dom-url-host)
236
251
string_type host () const ;
237
252
253
+ // / @{
238
254
// / Sets the [URL host](https://url.spec.whatwg.org/#dom-url-host)
239
255
// /
240
256
// / \param host The new URL host
@@ -253,9 +269,13 @@ class url {
253
269
return set_host (std::move (bytes.value ()));
254
270
}
255
271
272
+ expected<void , std::error_code> set_host (string_type &&host);
273
+ // / @}
274
+
256
275
// / \returns The [URL hostname](https://url.spec.whatwg.org/#dom-url-hostname)
257
276
string_type hostname () const ;
258
277
278
+ // / @{
259
279
// / Sets the [URL hostname](https://url.spec.whatwg.org/#dom-url-hostname)
260
280
// /
261
281
// / \param hostname The new URL host name
@@ -274,6 +294,9 @@ class url {
274
294
return set_hostname (std::move (bytes.value ()));
275
295
}
276
296
297
+ expected<void , std::error_code> set_hostname (string_type &&hostname);
298
+ // / @}
299
+
277
300
// / \returns The [URL port](https://url.spec.whatwg.org/#dom-url-port)
278
301
string_type port () const ;
279
302
@@ -287,6 +310,7 @@ class url {
287
310
std::strtoul (port_first, &port_last, 10 ));
288
311
}
289
312
313
+ // / @{
290
314
// / Sets the [URL port](https://url.spec.whatwg.org/#dom-url-port)
291
315
// /
292
316
// / \param port The new port
@@ -296,11 +320,15 @@ class url {
296
320
return set_port_impl (port);
297
321
}
298
322
323
+ expected<void , std::error_code> set_port (string_type &&port);
324
+ // / @}
325
+
299
326
// / Returns the [URL pathname](https://url.spec.whatwg.org/#dom-url-pathname)
300
327
// /
301
328
// / \returns The URL pathname
302
329
string_type pathname () const ;
303
330
331
+ // / @{
304
332
// / Sets the [URL pathname](https://url.spec.whatwg.org/#dom-url-pathname)
305
333
// /
306
334
// / \param pathname The new pathname
@@ -319,11 +347,15 @@ class url {
319
347
return set_pathname (std::move (bytes.value ()));
320
348
}
321
349
350
+ expected<void , std::error_code> set_pathname (string_type &&pathname);
351
+ // / @}
352
+
322
353
// / Returns the [URL search string](https://url.spec.whatwg.org/#dom-url-search)
323
354
// /
324
355
// / \returns The URL search string
325
356
string_type search () const ;
326
357
358
+ // / @{
327
359
// / Sets the [URL search string](https://url.spec.whatwg.org/#dom-url-search)
328
360
// /
329
361
// / \param search The new search string
@@ -342,6 +374,9 @@ class url {
342
374
return set_search (std::move (bytes.value ()));
343
375
}
344
376
377
+ expected<void , std::error_code> set_search (string_type &&search);
378
+ // / @}
379
+
345
380
// / \returns A reference to the search parameters
346
381
url_search_parameters &search_parameters ();
347
382
@@ -350,6 +385,7 @@ class url {
350
385
// / \returns The URL hash string
351
386
string_type hash () const ;
352
387
388
+ // / @{
353
389
// / Sets the [URL hash string](https://url.spec.whatwg.org/#dom-url-hash)
354
390
// /
355
391
// / \param hash The new hash string
@@ -368,6 +404,9 @@ class url {
368
404
return set_hash (std::move (bytes.value ()));
369
405
}
370
406
407
+ expected<void , std::error_code> set_hash (string_type &&hash);
408
+ // / @}
409
+
371
410
// / \returns A copy to the underlying `url_record` implementation.
372
411
url_record record () const ;
373
412
@@ -441,16 +480,6 @@ class url {
441
480
string_type &&input,
442
481
optional<url_record> base = nullopt);
443
482
void update_record (url_record &&record);
444
- expected<void , std::error_code> set_href (string_type &&href);
445
- expected<void , std::error_code> set_protocol (string_type &&protocol);
446
- expected<void , std::error_code> set_username (string_type &&username);
447
- expected<void , std::error_code> set_password (string_type &&password);
448
- expected<void , std::error_code> set_host (string_type &&host);
449
- expected<void , std::error_code> set_hostname (string_type &&hostname);
450
- expected<void , std::error_code> set_port (string_type &&port);
451
- expected<void , std::error_code> set_pathname (string_type &&pathname);
452
- expected<void , std::error_code> set_search (string_type &&search);
453
- expected<void , std::error_code> set_hash (string_type &&hash);
454
483
455
484
template <class Source >
456
485
expected<void , std::error_code> set_port_impl (
0 commit comments