251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
|
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
|
-
-
-
-
+
+
+
+
|
{
if (self == [OFMutableString class])
return (id)&placeholder;
return [super alloc];
}
- (void)_convertWithWordStartTable: (const of_unichar_t *const[])startTable
wordMiddleTable: (const of_unichar_t *const[])middleTable
wordStartTableSize: (size_t)startTableSize
wordMiddleTableSize: (size_t)middleTableSize
- (void)OF_convertWithWordStartTable: (const of_unichar_t *const[])startTable
wordMiddleTable: (const of_unichar_t *const[])middleTable
wordStartTableSize: (size_t)startTableSize
wordMiddleTableSize: (size_t)middleTableSize
{
void *pool = objc_autoreleasePoolPush();
const of_unichar_t *string = [self unicodeString];
size_t i, length = [self length];
BOOL isStart = YES;
for (i = 0; i < length; i++) {
|
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
|
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
|
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
|
[self setCharacter: tmp
atIndex: i];
}
}
- (void)uppercase
{
[self _convertWithWordStartTable: of_unicode_uppercase_table
wordMiddleTable: of_unicode_uppercase_table
wordStartTableSize: OF_UNICODE_UPPERCASE_TABLE_SIZE
wordMiddleTableSize: OF_UNICODE_UPPERCASE_TABLE_SIZE];
[self OF_convertWithWordStartTable: of_unicode_uppercase_table
wordMiddleTable: of_unicode_uppercase_table
wordStartTableSize: OF_UNICODE_UPPERCASE_TABLE_SIZE
wordMiddleTableSize: OF_UNICODE_UPPERCASE_TABLE_SIZE];
}
- (void)lowercase
{
[self _convertWithWordStartTable: of_unicode_lowercase_table
wordMiddleTable: of_unicode_lowercase_table
wordStartTableSize: OF_UNICODE_LOWERCASE_TABLE_SIZE
wordMiddleTableSize: OF_UNICODE_LOWERCASE_TABLE_SIZE];
[self OF_convertWithWordStartTable: of_unicode_lowercase_table
wordMiddleTable: of_unicode_lowercase_table
wordStartTableSize: OF_UNICODE_LOWERCASE_TABLE_SIZE
wordMiddleTableSize: OF_UNICODE_LOWERCASE_TABLE_SIZE];
}
- (void)capitalize
{
[self _convertWithWordStartTable: of_unicode_titlecase_table
wordMiddleTable: of_unicode_lowercase_table
wordStartTableSize: OF_UNICODE_TITLECASE_TABLE_SIZE
wordMiddleTableSize: OF_UNICODE_LOWERCASE_TABLE_SIZE];
[self OF_convertWithWordStartTable: of_unicode_titlecase_table
wordMiddleTable: of_unicode_lowercase_table
wordStartTableSize: OF_UNICODE_TITLECASE_TABLE_SIZE
wordMiddleTableSize: OF_UNICODE_LOWERCASE_TABLE_SIZE];
}
- (void)insertString: (OFString*)string
atIndex: (size_t)index
{
@throw [OFNotImplementedException exceptionWithClass: [self class]
selector: _cmd];
|