ObjFW  Check-in [925754a097]

Overview
Comment:Add -[string] to OFURL.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 925754a09743d3fe462072474d2d4d1c1c227bab9a447b25c54a608c19641637
User & Date: js on 2011-05-08 22:17:37
Other Links: manifest | tags
Context
2011-05-08
22:36
Change serialization format. check-in: 17d18368bb user: js tags: trunk
22:17
Add -[string] to OFURL. check-in: 925754a097 user: js tags: trunk
20:44
Add support for serialization to OFList. check-in: 046abd074d user: js tags: trunk
Changes

Modified src/OFURL.h from [8d20bb8741] to [75baa54cee].

181
182
183
184
185
186
187







188

/**
 * Set the fragment part of the URL.
 *
 * \param fragment The fragment part of the URL to set
 */
- (void)setFragment: (OFString*)fragment;







@end







>
>
>
>
>
>
>

181
182
183
184
185
186
187
188
189
190
191
192
193
194
195

/**
 * Set the fragment part of the URL.
 *
 * \param fragment The fragment part of the URL to set
 */
- (void)setFragment: (OFString*)fragment;

/**
 * \brief Returns the URL as a string.
 *
 * \return The URL as a string
 */
- (OFString*)string;
@end

Modified src/OFURL.m from [e94e617a72] to [01254b0236].

476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
}

- (void)setFragment: (OFString*)fragment_
{
	OF_SETTER(fragment, fragment_, YES, YES)
}

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

	if ([scheme isEqual: @"file"]) {
		[ret appendString: path];







|







476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
}

- (void)setFragment: (OFString*)fragment_
{
	OF_SETTER(fragment, fragment_, YES, YES)
}

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

	if ([scheme isEqual: @"file"]) {
		[ret appendString: path];
520
521
522
523
524
525
526





527
	 * Class swizzle the string to be immutable. We declared the return type
	 * to be OFString*, so it can't be modified anyway. But not swizzling it
	 * would create a real copy each time -[copy] is called.
	 */
	ret->isa = [OFString class];
	return ret;
}





@end







>
>
>
>
>

520
521
522
523
524
525
526
527
528
529
530
531
532
	 * Class swizzle the string to be immutable. We declared the return type
	 * to be OFString*, so it can't be modified anyway. But not swizzling it
	 * would create a real copy each time -[copy] is called.
	 */
	ret->isa = [OFString class];
	return ret;
}

- (OFString*)description
{
	return [self string];
}
@end