ObjFW  Check-in [aecadefe62]

Overview
Comment:Add -[stringByAppendingFormat:arguments:].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: aecadefe620bba19ce8ca1dc1e8077fb02dc35e830045f9abcd8689a5dcf5d24
User & Date: js on 2012-12-16 14:57:25
Other Links: manifest | tags
Context
2012-12-16
15:04
Fix a missing exception argument. check-in: f835847243 user: js tags: trunk
14:57
Add -[stringByAppendingFormat:arguments:]. check-in: aecadefe62 user: js tags: trunk
13:39
OFRunLoop: Use OFMutex instead of @synchronized. check-in: 35ad639b7c user: js tags: trunk
Changes

Modified src/OFConstantString.m from [2b5371b50c] to [b86bf57c57].

389
390
391
392
393
394
395









396
397
398
399
400
401
402

- (OFString*)stringByAppendingString: (OFString*)string
{
	[self finishInitialization];

	return [self stringByAppendingString: string];
}










- (OFString*)stringByAppendingPathComponent: (OFString*)component
{
	[self finishInitialization];

	return [self stringByAppendingPathComponent: component];
}







>
>
>
>
>
>
>
>
>







389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411

- (OFString*)stringByAppendingString: (OFString*)string
{
	[self finishInitialization];

	return [self stringByAppendingString: string];
}

- (OFString*)stringByAppendingFormat: (OFConstantString*)format
			   arguments: (va_list)arguments
{
	[self finishInitialization];

	return [self stringByAppendingFormat: format
				   arguments: arguments];
}

- (OFString*)stringByAppendingPathComponent: (OFString*)component
{
	[self finishInitialization];

	return [self stringByAppendingPathComponent: component];
}

Modified src/OFString.h from [2600a4af67] to [4d4538878f].

685
686
687
688
689
690
691










692
693
694
695
696
697
698
 * @brief Creates a new string by appending the specified format.
 *
 * @param format A format string which generates the string to append
 * @return A new, autoreleased OFString with the specified format appended
 */
- (OFString*)stringByAppendingFormat: (OFConstantString*)format, ...;











/*!
 * @brief Creates a new string by appending a path component.
 *
 * @param component The path component to append
 * @return A new, autoreleased OFString with the path component appended
 */
- (OFString*)stringByAppendingPathComponent: (OFString*)component;







>
>
>
>
>
>
>
>
>
>







685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
 * @brief Creates a new string by appending the specified format.
 *
 * @param format A format string which generates the string to append
 * @return A new, autoreleased OFString with the specified format appended
 */
- (OFString*)stringByAppendingFormat: (OFConstantString*)format, ...;

/*!
 * @brief Creates a new string by appending the specified format.
 *
 * @param format A format string which generates the string to append
 * @param arguments The arguments used in the format string
 * @return A new, autoreleased OFString with the specified format appended
 */
- (OFString*)stringByAppendingFormat: (OFConstantString*)format
			   arguments: (va_list)arguments;

/*!
 * @brief Creates a new string by appending a path component.
 *
 * @param component The path component to append
 * @return A new, autoreleased OFString with the path component appended
 */
- (OFString*)stringByAppendingPathComponent: (OFString*)component;

Modified src/OFString.m from [29ef9c669e] to [221b9ffe16].

1345
1346
1347
1348
1349
1350
1351
1352
1353
1354




1355

1356
1357






1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
	[new makeImmutable];

	return new;
}

- (OFString*)stringByAppendingFormat: (OFConstantString*)format, ...
{
	OFMutableString *new;
	va_list arguments;





	new = [OFMutableString stringWithString: self];


	va_start(arguments, format);






	[new appendFormat: format
		arguments: arguments];
	va_end(arguments);

	[new makeImmutable];

	return new;
}

- (OFString*)stringByAppendingPathComponent: (OFString*)component







|


>
>
>
>
|
>
|
|
>
>
>
>
>
>


<







1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370

1371
1372
1373
1374
1375
1376
1377
	[new makeImmutable];

	return new;
}

- (OFString*)stringByAppendingFormat: (OFConstantString*)format, ...
{
	OFString *ret;
	va_list arguments;

	va_start(arguments, format);
	ret = [self stringByAppendingFormat: format
				  arguments: arguments];
	va_end(arguments);

	return ret;
}

- (OFString*)stringByAppendingFormat: (OFConstantString*)format
			   arguments: (va_list)arguments
{
	OFMutableString *new;

	new = [OFMutableString stringWithString: self];
	[new appendFormat: format
		arguments: arguments];


	[new makeImmutable];

	return new;
}

- (OFString*)stringByAppendingPathComponent: (OFString*)component