39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
+
|
#import "OFDictionary.h"
#import "OFLocalization.h"
#ifdef OF_HAVE_FILES
# import "OFFile.h"
# import "OFFileManager.h"
#endif
#import "OFURL.h"
#import "OFURLHandler.h"
#import "OFXMLElement.h"
#import "OFInitializationFailedException.h"
#import "OFInvalidArgumentException.h"
#import "OFInvalidEncodingException.h"
#import "OFInvalidFormatException.h"
#import "OFNotImplementedException.h"
|
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
|
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
mode: @"w"];
[file writeString: self
encoding: encoding];
objc_autoreleasePoolPop(pool);
}
#endif
- (void)writeToURL: (OFURL *)URL
{
[self writeToURL: URL
encoding: OF_STRING_ENCODING_UTF_8];
}
- (void)writeToURL: (OFURL *)URL
encoding: (of_string_encoding_t)encoding
{
void *pool = objc_autoreleasePoolPush();
OFURLHandler *URLHandler;
OFStream *stream;
if ((URLHandler = [OFURLHandler handlerForURL: URL]) == nil)
@throw [OFUnsupportedProtocolException exceptionWithURL: URL];
stream = [URLHandler openItemAtURL: URL
mode: @"w"];
[stream writeString: self
encoding: encoding];
objc_autoreleasePoolPop(pool);
}
#ifdef OF_HAVE_BLOCKS
- (void)enumerateLinesUsingBlock: (of_string_line_enumeration_block_t)block
{
void *pool = objc_autoreleasePoolPush();
const of_unichar_t *characters = [self characters];
size_t i, last = 0, length = [self length];
|