ObjFW  Check-in [9e8c825616]

Overview
Comment:OFMutableString: Implement more methods.

The only method that needs to be implemented by a subclass now is
-[replaceCharactersInRange:withString:].

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 9e8c8256161a0da6bdd3a5932935b7e36834c658b831b149818a094dde15cd5c
User & Date: js on 2012-12-29 14:31:10
Other Links: manifest | tags
Context
2012-12-29
14:43
Prettify some code. check-in: 374956b098 user: js tags: trunk
14:31
OFMutableString: Implement more methods. check-in: 9e8c825616 user: js tags: trunk
14:29
OFXMLParser: OFMutableString -> OFString. check-in: 036c487137 user: js tags: trunk
Changes

Modified src/OFMutableString.m from [e77a1233fc] to [b484829d75].

297
298
299
300
301
302
303


304


305




306
307
308
309
310
311
312

	objc_autoreleasePoolPop(pool);
}

- (void)setCharacter: (of_unichar_t)character
	     atIndex: (size_t)index
{


	[self doesNotRecognizeSelector: _cmd];


	abort();




}

- (void)appendUTF8String: (const char*)UTF8String
{
	void *pool = objc_autoreleasePoolPush();

	[self appendString: [OFString stringWithUTF8String: UTF8String]];







>
>
|
>
>
|
>
>
>
>







297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320

	objc_autoreleasePoolPop(pool);
}

- (void)setCharacter: (of_unichar_t)character
	     atIndex: (size_t)index
{
	void *pool = objc_autoreleasePoolPush();
	OFString *string;

	string = [OFString stringWithUnicodeString: &character
					    length: 1];

	[self replaceCharactersInRange: of_range(index, 1)
			    withString: string];

	objc_autoreleasePoolPop(pool);
}

- (void)appendUTF8String: (const char*)UTF8String
{
	void *pool = objc_autoreleasePoolPush();

	[self appendString: [OFString stringWithUTF8String: UTF8String]];
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
			wordStartTableSize: OF_UNICODE_TITLECASE_TABLE_SIZE
		       wordMiddleTableSize: OF_UNICODE_LOWERCASE_TABLE_SIZE];
}

- (void)insertString: (OFString*)string
	     atIndex: (size_t)index
{
	[self doesNotRecognizeSelector: _cmd];
	abort();
}

- (void)deleteCharactersInRange: (of_range_t)range
{
	[self doesNotRecognizeSelector: _cmd];
	abort();
}

- (void)replaceCharactersInRange: (of_range_t)range
		      withString: (OFString*)replacement
{
	[self deleteCharactersInRange: range];
	[self insertString: replacement
		   atIndex: range.location];
}

- (void)replaceOccurrencesOfString: (OFString*)string
			withString: (OFString*)replacement
{
	[self replaceOccurrencesOfString: string
			      withString: replacement







|
|




|
|





|
|
<







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
			wordStartTableSize: OF_UNICODE_TITLECASE_TABLE_SIZE
		       wordMiddleTableSize: OF_UNICODE_LOWERCASE_TABLE_SIZE];
}

- (void)insertString: (OFString*)string
	     atIndex: (size_t)index
{
	[self replaceCharactersInRange: of_range(index, 0)
			    withString: string];
}

- (void)deleteCharactersInRange: (of_range_t)range
{
	[self replaceCharactersInRange: range
			    withString: @""];
}

- (void)replaceCharactersInRange: (of_range_t)range
		      withString: (OFString*)replacement
{
	[self doesNotRecognizeSelector: _cmd];
	abort();

}

- (void)replaceOccurrencesOfString: (OFString*)string
			withString: (OFString*)replacement
{
	[self replaceOccurrencesOfString: string
			      withString: replacement