349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
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
|
{
char *UTF8String;
int UTF8StringLength;
if (format == nil)
@throw [OFInvalidArgumentException exception];
if ((UTF8StringLength = OFVASPrintF(&UTF8String, format.UTF8String,
arguments)) == -1)
@throw [OFInvalidFormatException exception];
@try {
[self appendUTF8String: UTF8String length: UTF8StringLength];
} @finally {
free(UTF8String);
}
}
#ifdef OF_HAVE_UNICODE_TABLES
- (void)uppercase
{
[self of_convertWithWordStartTable: OFUnicodeUppercaseTable
wordMiddleTable: OFUnicodeUppercaseTable
wordStartTableSize: OFUnicodeUppercaseTableSize
wordMiddleTableSize: OFUnicodeUppercaseTableSize];
}
- (void)lowercase
{
[self of_convertWithWordStartTable: OFUnicodeLowercaseTable
wordMiddleTable: OFUnicodeLowercaseTable
wordStartTableSize: OFUnicodeLowercaseTableSize
wordMiddleTableSize: OFUnicodeLowercaseTableSize];
}
- (void)capitalize
{
[self of_convertWithWordStartTable: OFUnicodeTitlecaseTable
wordMiddleTable: OFUnicodeLowercaseTable
wordStartTableSize: OFUnicodeTitlecaseTableSize
wordMiddleTableSize: OFUnicodeLowercaseTableSize];
}
#else
- (void)uppercase
{
convert(self, OFASCIIToUpper, OFASCIIToUpper);
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
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
|
{
char *UTF8String;
int UTF8StringLength;
if (format == nil)
@throw [OFInvalidArgumentException exception];
if ((UTF8StringLength = _OFVASPrintF(&UTF8String, format.UTF8String,
arguments)) == -1)
@throw [OFInvalidFormatException exception];
@try {
[self appendUTF8String: UTF8String length: UTF8StringLength];
} @finally {
free(UTF8String);
}
}
#ifdef OF_HAVE_UNICODE_TABLES
- (void)uppercase
{
[self of_convertWithWordStartTable: _OFUnicodeUppercaseTable
wordMiddleTable: _OFUnicodeUppercaseTable
wordStartTableSize: _OFUnicodeUppercaseTableSize
wordMiddleTableSize: _OFUnicodeUppercaseTableSize];
}
- (void)lowercase
{
[self of_convertWithWordStartTable: _OFUnicodeLowercaseTable
wordMiddleTable: _OFUnicodeLowercaseTable
wordStartTableSize: _OFUnicodeLowercaseTableSize
wordMiddleTableSize: _OFUnicodeLowercaseTableSize];
}
- (void)capitalize
{
[self of_convertWithWordStartTable: _OFUnicodeTitlecaseTable
wordMiddleTable: _OFUnicodeLowercaseTable
wordStartTableSize: _OFUnicodeTitlecaseTableSize
wordMiddleTableSize: _OFUnicodeLowercaseTableSize];
}
#else
- (void)uppercase
{
convert(self, OFASCIIToUpper, OFASCIIToUpper);
}
|