37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
#import "OFDictionary.h"
#ifdef OF_HAVE_FILES
# import "OFFile.h"
# import "OFFileManager.h"
#endif
#import "OFLocale.h"
#import "OFStream.h"
#import "OFURL.h"
#import "OFURLHandler.h"
#import "OFUTF8String.h"
#import "OFUTF8String+Private.h"
#import "OFXMLElement.h"
#import "OFInitializationFailedException.h"
|
>
|
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
#import "OFDictionary.h"
#ifdef OF_HAVE_FILES
# import "OFFile.h"
# import "OFFileManager.h"
#endif
#import "OFLocale.h"
#import "OFStream.h"
#import "OFSystemInfo.h"
#import "OFURL.h"
#import "OFURLHandler.h"
#import "OFUTF8String.h"
#import "OFUTF8String+Private.h"
#import "OFXMLElement.h"
#import "OFInitializationFailedException.h"
|
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
|
else if ([string isEqual: @"macintosh"] || [string isEqual: @"mac"])
encoding = OF_STRING_ENCODING_MAC_ROMAN;
else if ([string isEqual: @"koi8-r"])
encoding = OF_STRING_ENCODING_KOI8_R;
else if ([string isEqual: @"koi8-u"])
encoding = OF_STRING_ENCODING_KOI8_U;
else
@throw [OFInvalidEncodingException exception];
objc_autoreleasePoolPop(pool);
return encoding;
}
OFString *
|
|
|
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
|
else if ([string isEqual: @"macintosh"] || [string isEqual: @"mac"])
encoding = OF_STRING_ENCODING_MAC_ROMAN;
else if ([string isEqual: @"koi8-r"])
encoding = OF_STRING_ENCODING_KOI8_R;
else if ([string isEqual: @"koi8-u"])
encoding = OF_STRING_ENCODING_KOI8_U;
else
@throw [OFInvalidArgumentException exception];
objc_autoreleasePoolPop(pool);
return encoding;
}
OFString *
|
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
|
OF_UNICODE_DECOMPOSITION_TABLE_SIZE);
}
- (OFString *)decomposedStringWithCompatibilityMapping
{
return decomposedString(self, of_unicode_decomposition_compat_table,
OF_UNICODE_DECOMPOSITION_COMPAT_TABLE_SIZE);
}
#endif
#ifdef OF_HAVE_FILES
- (void)writeToFile: (OFString *)path
{
[self writeToFile: path
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
|
OF_UNICODE_DECOMPOSITION_TABLE_SIZE);
}
- (OFString *)decomposedStringWithCompatibilityMapping
{
return decomposedString(self, of_unicode_decomposition_compat_table,
OF_UNICODE_DECOMPOSITION_COMPAT_TABLE_SIZE);
}
#endif
#ifdef OF_WINDOWS
- (OFString *)stringByExpandingWindowsEnvironmentStrings
{
if ([OFSystemInfo isWindowsNT]) {
wchar_t buffer[512];
size_t length;
if ((length = ExpandEnvironmentStringsW(self.UTF16String,
buffer, sizeof(buffer))) == 0)
return self;
return [OFString stringWithUTF16String: buffer
length: length - 1];
} else {
of_string_encoding_t encoding = [OFLocale encoding];
char buffer[512];
size_t length;
if ((length = ExpandEnvironmentStringsA(
[self cStringWithEncoding: encoding], buffer,
sizeof(buffer))) == 0)
return self;
return [OFString stringWithCString: buffer
encoding: encoding
length: length - 1];
}
}
#endif
#ifdef OF_HAVE_FILES
- (void)writeToFile: (OFString *)path
{
[self writeToFile: path
|