]> git.saurik.com Git - apple/security.git/blob - SecurityTool/sharedTool/NSFileHandle+Formatting.m
Security-59306.11.20.tar.gz
[apple/security.git] / SecurityTool / sharedTool / NSFileHandle+Formatting.m
1 //
2 // NSFileHandle+Formatting.m
3 // sec
4 //
5 //
6
7 #include <stdarg.h>
8
9 #import <Foundation/Foundation.h>
10 #import "NSFileHandle+Formatting.h"
11
12
13 @implementation NSFileHandle (Formatting)
14
15 - (void) writeString: (NSString*) string {
16 [self writeData:[string dataUsingEncoding:NSUTF8StringEncoding]];
17 }
18
19 - (void) writeFormat: (NSString*) format, ... {
20 va_list args;
21 va_start(args, format);
22
23 NSString* formatted = [[NSString alloc] initWithFormat:format arguments:args];
24
25 va_end(args);
26
27 [self writeString: formatted];
28 // Remove with <rdar://problem/28925164> Enable ARC wherever possible in Security.framework
29 #if !__has_feature(objc_arc)
30 [formatted release];
31 #endif
32 }
33
34 @end