ObjFW  Diff

Differences From Artifact [77a2a36083]:

To Artifact [d363f4b1e5]:


369
370
371
372
373
374
375
376

377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392

393
394
395
396
397

398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414

415
416
417
418
419

420
421
422
423
424
425
426

427
428
429
430
431

432
433
434
435
436
437
438

439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457

458
459
460
461
462

463
464
465
466
467
468
469

470
471
472
473
474

475
476
477
478
479
480
481

482
483
484
485
486

487
488
489
490
491
492
493
494
495
369
370
371
372
373
374
375

376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391

392
393
394
395
396

397


398
399
400
401
402
403
404
405
406
407
408
409
410
411

412
413
414
415
416

417


418
419
420
421

422
423
424
425
426

427


428
429
430
431

432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450

451
452
453
454
455

456


457
458
459
460

461
462
463
464
465

466


467
468
469
470

471
472
473
474
475

476


477
478
479
480
481
482
483







-
+















-
+




-
+
-
-














-
+




-
+
-
-




-
+




-
+
-
-




-
+


















-
+




-
+
-
-




-
+




-
+
-
-




-
+




-
+
-
-







	new->fragment = [fragment copy];

	return new;
}

- (OFString*)scheme
{
	return [[scheme copy] autorelease];
	OF_GETTER(scheme, YES)
}

- (void)setScheme: (OFString*)scheme_
{
	if (![scheme_ isEqual: @"http"] && ![scheme_ isEqual: @"https"])
		@throw [OFInvalidArgumentException newWithClass: isa
						       selector: _cmd];

	OFString *old = scheme;
	scheme = [scheme_ copy];
	[old release];
}

- (OFString*)host
{
	return [[host copy] autorelease];
	OF_GETTER(host, YES)
}

- (void)setHost: (OFString*)host_
{
	OFString *old = host;
	OF_SETTER(host, host_, YES, YES)
	host = [host_ copy];
	[old release];
}

- (uint16_t)port
{
	return port;
}

- (void)setPort: (uint16_t)port_
{
	port = port_;
}

- (OFString*)user
{
	return [[user copy] autorelease];
	OF_GETTER(user, YES)
}

- (void)setUser: (OFString*)user_
{
	OFString *old = user;
	OF_SETTER(user, user_, YES, YES)
	user = [user_ copy];
	[old release];
}

- (OFString*)password
{
	return [[password copy] autorelease];
	OF_GETTER(password, YES)
}

- (void)setPassword: (OFString*)password_
{
	OFString *old = password;
	OF_SETTER(password, password_, YES, YES)
	password = [password_ copy];
	[old release];
}

- (OFString*)path
{
	return [[path copy] autorelease];
	OF_GETTER(path, YES)
}

- (void)setPath: (OFString*)path_
{
	OFString *old;

	if (([scheme isEqual: @"http"] || [scheme isEqual: @"https"]) &&
	    ![path_ hasPrefix: @"/"])
		@throw [OFInvalidArgumentException newWithClass: isa
						       selector: _cmd];

	old = path;
	path = [path_ copy];
	[old release];
}

- (OFString*)parameters
{
	return [[parameters copy] autorelease];
	OF_GETTER(parameters, YES)
}

- (void)setParameters: (OFString*)parameters_
{
	OFString *old = parameters;
	OF_SETTER(parameters, parameters_, YES, YES)
	parameters = [parameters_ copy];
	[old release];
}

- (OFString*)query
{
	return [[query copy] autorelease];
	OF_GETTER(query, YES)
}

- (void)setQuery: (OFString*)query_
{
	OFString *old = query;
	OF_SETTER(query, query_, YES, YES)
	query = [query_ copy];
	[old release];
}

- (OFString*)fragment
{
	return [[fragment copy] autorelease];
	OF_GETTER(fragment, YES)
}

- (void)setFragment: (OFString*)fragment_
{
	OFString *old = fragment;
	OF_SETTER(fragment, fragment_, YES, YES)
	fragment = [fragment_ copy];
	[old release];
}

- (OFString*)description
{
	OFMutableString *desc = [OFMutableString stringWithFormat: @"%@://",
								   scheme];
	BOOL needPort = YES;