annotate dstep/foundation/NSString.d @ 16:19885b43130e

Huge update, the bridge actually works now
author Jacob Carlborg <doob@me.com>
date Sun, 03 Jan 2010 22:06:11 +0100
parents 89f3c3ef1fd2
children b9de51448c6b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
1 /**
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
2 * Copyright: Copyright (c) 2009 Jacob Carlborg.
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
3 * Authors: Jacob Carlborg
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
4 * Version: Initial created: Aug 3, 2009
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
6 */
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
7 module dstep.foundation.NSString;
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
8
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
9 import dstep.foundation.NSArray;
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
10 import dstep.foundation.NSCharacterSet;
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
11 import dstep.foundation.NSCoder;
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
12 import dstep.foundation.NSData;
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
13 import dstep.foundation.NSDictionary;
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
14 import dstep.foundation.NSError;
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
15 import dstep.foundation.NSLocale;
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
16 import dstep.foundation.NSObjCRuntime;
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
17 import dstep.foundation.NSObject;
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
18 import dstep.foundation.NSPathUtilities;
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
19 import dstep.foundation.NSRange;
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
20 import dstep.foundation.NSURL;
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
21 import dstep.foundation.NSZone;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
22 import dstep.internal.String;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
23 import dstep.internal.Version;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
24 import dstep.objc.bridge.Wrapper;
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
25 import dstep.objc.bridge.Bridge;
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
26 import dstep.objc.objc;
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
27
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
28 import bindings = dstep.foundation.NSString_bindings;
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
29
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
30 alias wchar unichar;
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
31 alias NSUInteger NSStringCompareOptions;
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
32 alias NSUInteger NSStringEncoding;
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
33 alias NSUInteger NSStringEncodingConversionOptions;
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
34
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
35 private
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
36 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
37 NSString NSParseErrorException_;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
38 NSString NSCharacterConversionException_;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
39 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
40
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
41 NSString NSParseErrorException ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
42 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
43 if (NSParseErrorException_)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
44 return NSParseErrorException_;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
45
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
46 return NSParseErrorException_ = new NSString(bindings.NSParseErrorException);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
47 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
48
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
49 NSString NSCharacterConversionException ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
50 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
51 if (NSCharacterConversionException_)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
52 return NSCharacterConversionException_;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
53
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
54 return NSCharacterConversionException_ = new NSString(bindings.NSCharacterConversionException);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
55 }
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
56
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
57 enum
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
58 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
59 NSCaseInsensitiveSearch = 1,
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
60 NSLiteralSearch = 2,
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
61 NSBackwardsSearch = 4,
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
62 NSAnchoredSearch = 8,
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
63 NSNumericSearch = 64,
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
64 NSDiacriticInsensitiveSearch = 128,
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
65 NSWidthInsensitiveSearch = 256,
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
66 NSForcedOrderingSearch = 512
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
67 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
68
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
69 enum
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
70 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
71 NSASCIIStringEncoding = 1,
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
72 NSNEXTSTEPStringEncoding = 2,
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
73 NSJapaneseEUCStringEncoding = 3,
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
74 NSUTF8StringEncoding = 4,
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
75 NSISOLatin1StringEncoding = 5,
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
76 NSSymbolStringEncoding = 6,
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
77 NSNonLossyASCIIStringEncoding = 7,
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
78 NSShiftJISStringEncoding = 8,
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
79 NSISOLatin2StringEncoding = 9,
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
80 NSUnicodeStringEncoding = 10,
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
81 NSWindowsCP1251StringEncoding = 11,
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
82 NSWindowsCP1252StringEncoding = 12,
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
83 NSWindowsCP1253StringEncoding = 13,
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
84 NSWindowsCP1254StringEncoding = 14,
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
85 NSWindowsCP1250StringEncoding = 15,
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
86 NSISO2022JPStringEncoding = 21,
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
87 NSMacOSRomanStringEncoding = 30,
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
88 NSUTF16StringEncoding = NSUnicodeStringEncoding,
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
89 NSUTF16BigEndianStringEncoding = 0x90000100,
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
90 NSUTF16LittleEndianStringEncoding = 0x94000100,
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
91 NSUTF32StringEncoding = 0x8c000100,
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
92 NSUTF32BigEndianStringEncoding = 0x98000100,
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
93 NSUTF32LittleEndianStringEncoding = 0x9c000100
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
94 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
95
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
96 enum
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
97 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
98 NSStringEncodingConversionAllowLossy = 1,
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
99 NSStringEncodingConversionExternalRepresentation = 2
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
100 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
101
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
102 const TNSExtendedStringPropertyListParsing = `
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
103
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
104 Object propertyList ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
105 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
106 return invokeObjcSelf!(Object, "propertyList");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
107 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
108
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
109 NSDictionary propertyListFromStringsFileFormat ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
110 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
111 return invokeObjcSelf!(NSDictionary, "propertyListFromStringsFileFormat");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
112 }
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
113 `;
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
114
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
115 const TNSMutableStringExtensionMethods = `
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
116
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
117 void insertString (NSString aString, NSUInteger loc)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
118 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
119 return invokeObjcSelf!(void, "insertString:atIndex:", NSString, NSUInteger)(aString, loc);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
120 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
121
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
122 void deleteCharactersInRange (NSRange range)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
123 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
124 return invokeObjcSelf!(void, "deleteCharactersInRange:", NSRange)(range);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
125 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
126
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
127 void appendString (NSString aString)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
128 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
129 return invokeObjcSelf!(void, "appendString:", NSString)(aString);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
130 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
131
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
132 void appendFormat (NSString appendFormat, ...)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
133 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
134 return invokeObjcSelf!(void, "appendFormat:", NSString)(appendFormat);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
135 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
136
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
137 void setString (NSString aString)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
138 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
139 return invokeObjcSelf!(void, "setString:", NSString)(aString);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
140 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
141
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
142 NSString initWithCapacity (NSUInteger capacity)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
143 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
144 return invokeObjcSelf!(Object, "initWithCapacity:", NSUInteger)(capacity);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
145 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
146
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
147 /*this (NSUInteger capacity)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
148 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
149 typeof(this).alloc.initWithCapacity(capacity);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
150 }*/
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
151
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
152 static Object stringWithCapacity (NSUInteger capacity)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
153 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
154 return invokeObjcSuperClass!(Object, "stringWithCapacity:", NSUInteger)(capacity);
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
155 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
156
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
157 NSUInteger replaceOccurrencesOfString (NSString target, NSString replacement, uint options, NSRange searchRange)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
158 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
159 return invokeObjcSelf!(NSUInteger, "replaceOccurrencesOfString:withString:options:range:", NSString, NSString, uint, NSRange)(target, replacement, options, searchRange);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
160 }
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
161 `;
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
162
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
163 const TNSStringExtensionMethods = `
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
164
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
165 void getCharacters (unichar* buffer)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
166 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
167 return invokeObjcSelf!(void, "getCharacters:", unichar*)(buffer);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
168 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
169
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
170 void getCharacters (unichar* buffer, NSRange aRange)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
171 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
172 return invokeObjcSelf!(void, "getCharacters:range:", unichar*, NSRange)(buffer, aRange);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
173 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
174
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
175 NSString substringFromIndex (NSUInteger from)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
176 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
177 return invokeObjcSelf!(NSString, "substringFromIndex:", NSUInteger)(from);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
178 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
179
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
180 NSString substringToIndex (NSUInteger to)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
181 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
182 return invokeObjcSelf!(NSString, "substringToIndex:", NSUInteger)(to);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
183 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
184
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
185 NSString substringWithRange (NSRange range)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
186 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
187 return invokeObjcSelf!(NSString, "substringWithRange:", NSRange)(range);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
188 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
189
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
190 int compare (NSString string)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
191 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
192 return invokeObjcSelf!(int, "compare:", NSString)(string);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
193 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
194
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
195 int compare (NSString string, uint mask)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
196 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
197 return invokeObjcSelf!(int, "compare:options:", NSString, uint)(string, mask);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
198 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
199
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
200 int compare (NSString string, uint mask, NSRange compareRange)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
201 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
202 return invokeObjcSelf!(int, "compare:options:range:", NSString, uint, NSRange)(string, mask, compareRange);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
203 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
204
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
205 int compare (NSString string, uint mask, NSRange compareRange, Object locale)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
206 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
207 return invokeObjcSelf!(int, "compare:options:range:locale:", NSString, uint, NSRange, Object)(string, mask, compareRange, locale);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
208 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
209
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
210 int caseInsensitiveCompare (NSString string)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
211 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
212 return invokeObjcSelf!(int, "caseInsensitiveCompare:", NSString)(string);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
213 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
214
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
215 int localizedCompare (NSString string)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
216 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
217 return invokeObjcSelf!(int, "localizedCompare:", NSString)(string);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
218 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
219
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
220 int localizedCaseInsensitiveCompare (NSString string)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
221 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
222 return invokeObjcSelf!(int, "localizedCaseInsensitiveCompare:", NSString)(string);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
223 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
224
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
225 bool isEqualToString (NSString aString)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
226 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
227 return invokeObjcSelf!(bool, "isEqualToString:", NSString)(aString);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
228 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
229
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
230 bool hasPrefix (NSString aString)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
231 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
232 return invokeObjcSelf!(bool, "hasPrefix:", NSString)(aString);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
233 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
234
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
235 bool hasSuffix (NSString aString)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
236 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
237 return invokeObjcSelf!(bool, "hasSuffix:", NSString)(aString);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
238 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
239
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
240 NSRange rangeOfString (NSString aString)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
241 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
242 return invokeObjcSelf!(NSRange, "rangeOfString:", NSString)(aString);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
243 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
244
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
245 NSRange rangeOfString (NSString aString, uint mask)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
246 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
247 return invokeObjcSelf!(NSRange, "rangeOfString:options:", NSString, uint)(aString, mask);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
248 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
249
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
250 NSRange rangeOfString (NSString aString, uint mask, NSRange searchRange)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
251 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
252 return invokeObjcSelf!(NSRange, "rangeOfString:options:range:", NSString, uint, NSRange)(aString, mask, searchRange);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
253 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
254
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
255 NSRange rangeOfString (NSString aString, uint mask, NSRange searchRange, NSLocale locale)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
256 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
257 return invokeObjcSelf!(NSRange, "rangeOfString:options:range:locale:", NSString, uint, NSRange, NSLocale)(aString, mask, searchRange, locale);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
258 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
259
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
260 NSRange rangeOfCharacterFromSet (NSCharacterSet aSet)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
261 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
262 return invokeObjcSelf!(NSRange, "rangeOfCharacterFromSet:", NSCharacterSet)(aSet);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
263 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
264
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
265 NSRange rangeOfCharacterFromSet (NSCharacterSet aSet, uint mask)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
266 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
267 return invokeObjcSelf!(NSRange, "rangeOfCharacterFromSet:options:", NSCharacterSet, uint)(aSet, mask);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
268 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
269
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
270 NSRange rangeOfCharacterFromSet (NSCharacterSet aSet, uint mask, NSRange searchRange)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
271 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
272 return invokeObjcSelf!(NSRange, "rangeOfCharacterFromSet:options:range:", NSCharacterSet, uint, NSRange)(aSet, mask, searchRange);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
273 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
274
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
275 NSRange rangeOfComposedCharacterSequenceAtIndex (NSUInteger index)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
276 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
277 return invokeObjcSelf!(NSRange, "rangeOfComposedCharacterSequenceAtIndex:", NSUInteger)(index);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
278 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
279
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
280 NSRange rangeOfComposedCharacterSequencesForRange (NSRange range)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
281 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
282 return invokeObjcSelf!(NSRange, "rangeOfComposedCharacterSequencesForRange:", NSRange)(range);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
283 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
284
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
285 NSString stringByAppendingString (NSString aString)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
286 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
287 return invokeObjcSelf!(NSString, "stringByAppendingString:", NSString)(aString);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
288 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
289
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
290 NSString stringByAppendingFormat (NSString stringByAppendingFormat, ...)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
291 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
292 return invokeObjcSelf!(NSString, "stringByAppendingFormat:", NSString)(stringByAppendingFormat);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
293 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
294
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
295 double doubleValue ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
296 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
297 return invokeObjcSelf!(double, "doubleValue");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
298 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
299
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
300 float floatValue ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
301 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
302 return invokeObjcSelf!(float, "floatValue");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
303 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
304
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
305 int intValue ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
306 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
307 return invokeObjcSelf!(int, "intValue");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
308 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
309
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
310 NSInteger integerValue ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
311 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
312 return invokeObjcSelf!(NSInteger, "integerValue");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
313 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
314
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
315 long longLongValue ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
316 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
317 return invokeObjcSelf!(long, "longLongValue");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
318 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
319
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
320 bool boolValue ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
321 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
322 return invokeObjcSelf!(bool, "boolValue");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
323 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
324
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
325 NSArray componentsSeparatedByString (NSString separator)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
326 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
327 return invokeObjcSelf!(NSArray, "componentsSeparatedByString:", NSString)(separator);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
328 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
329
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
330 NSArray componentsSeparatedByCharactersInSet (NSCharacterSet separator)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
331 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
332 return invokeObjcSelf!(NSArray, "componentsSeparatedByCharactersInSet:", NSCharacterSet)(separator);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
333 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
334
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
335 NSString commonPrefixWithString (NSString aString, uint mask)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
336 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
337 return invokeObjcSelf!(NSString, "commonPrefixWithString:options:", NSString, uint)(aString, mask);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
338 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
339
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
340 NSString uppercaseString ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
341 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
342 return invokeObjcSelf!(NSString, "uppercaseString");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
343 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
344
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
345 NSString lowercaseString ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
346 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
347 return invokeObjcSelf!(NSString, "lowercaseString");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
348 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
349
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
350 NSString capitalizedString ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
351 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
352 return invokeObjcSelf!(NSString, "capitalizedString");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
353 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
354
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
355 NSString stringByTrimmingCharactersInSet (NSCharacterSet set)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
356 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
357 return invokeObjcSelf!(NSString, "stringByTrimmingCharactersInSet:", NSCharacterSet)(set);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
358 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
359
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
360 NSString stringByPaddingToLength (NSUInteger newLength, NSString padString, NSUInteger padIndex)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
361 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
362 return invokeObjcSelf!(NSString, "stringByPaddingToLength:withString:startingAtIndex:", NSUInteger, NSString, NSUInteger)(newLength, padString, padIndex);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
363 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
364
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
365 void getLineStart (NSUInteger* startPtr, NSUInteger* lineEndPtr, NSUInteger* contentsEndPtr, NSRange range)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
366 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
367 return invokeObjcSelf!(void, "getLineStart:end:contentsEnd:forRange:", NSUInteger*, NSUInteger*, NSUInteger*, NSRange)(startPtr, lineEndPtr, contentsEndPtr, range);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
368 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
369
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
370 NSRange lineRangeForRange (NSRange range)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
371 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
372 return invokeObjcSelf!(NSRange, "lineRangeForRange:", NSRange)(range);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
373 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
374
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
375 void getParagraphStart (NSUInteger* startPtr, NSUInteger* parEndPtr, NSUInteger* contentsEndPtr, NSRange range)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
376 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
377 return invokeObjcSelf!(void, "getParagraphStart:end:contentsEnd:forRange:", NSUInteger*, NSUInteger*, NSUInteger*, NSRange)(startPtr, parEndPtr, contentsEndPtr, range);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
378 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
379
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
380 NSRange paragraphRangeForRange (NSRange range)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
381 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
382 return invokeObjcSelf!(NSRange, "paragraphRangeForRange:", NSRange)(range);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
383 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
384
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
385 NSString description ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
386 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
387 return invokeObjcSelf!(NSString, "description");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
388 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
389
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
390 NSUInteger hash ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
391 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
392 return invokeObjcSelf!(NSUInteger, "hash");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
393 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
394
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
395 uint fastestEncoding ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
396 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
397 return invokeObjcSelf!(uint, "fastestEncoding");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
398 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
399
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
400 uint smallestEncoding ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
401 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
402 return invokeObjcSelf!(uint, "smallestEncoding");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
403 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
404
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
405 NSData dataUsingEncoding (uint encoding, bool lossy)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
406 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
407 return invokeObjcSelf!(NSData, "dataUsingEncoding:allowLossyConversion:", uint, bool)(encoding, lossy);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
408 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
409
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
410 NSData dataUsingEncoding (uint encoding)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
411 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
412 return invokeObjcSelf!(NSData, "dataUsingEncoding:", uint)(encoding);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
413 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
414
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
415 bool canBeConvertedToEncoding (uint encoding)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
416 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
417 return invokeObjcSelf!(bool, "canBeConvertedToEncoding:", uint)(encoding);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
418 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
419
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
420 char* cStringUsingEncoding (uint encoding)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
421 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
422 return invokeObjcSelf!(char*, "cStringUsingEncoding:", uint)(encoding);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
423 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
424
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
425 bool getCString (char* buffer, NSUInteger maxBufferCount, uint encoding)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
426 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
427 return invokeObjcSelf!(bool, "getCString:maxLength:encoding:", char*, NSUInteger, uint)(buffer, maxBufferCount, encoding);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
428 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
429
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
430 bool getBytes (void* buffer, NSUInteger maxBufferCount, NSUInteger* usedBufferCount, uint encoding, uint options, NSRange range, NSRangePointer leftover)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
431 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
432 return invokeObjcSelf!(bool, "getBytes:maxLength:usedLength:encoding:options:range:remainingRange:", void*, NSUInteger, NSUInteger*, uint, uint, NSRange, NSRangePointer)(buffer, maxBufferCount, usedBufferCount, encoding, options, range, leftover);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
433 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
434
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
435 NSUInteger maximumLengthOfBytesUsingEncoding (uint enc)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
436 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
437 return invokeObjcSelf!(NSUInteger, "maximumLengthOfBytesUsingEncoding:", uint)(enc);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
438 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
439
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
440 NSUInteger lengthOfBytesUsingEncoding (uint enc)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
441 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
442 return invokeObjcSelf!(NSUInteger, "lengthOfBytesUsingEncoding:", uint)(enc);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
443 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
444
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
445 NSString decomposedStringWithCanonicalMapping ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
446 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
447 return invokeObjcSelf!(NSString, "decomposedStringWithCanonicalMapping");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
448 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
449
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
450 NSString precomposedStringWithCanonicalMapping ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
451 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
452 return invokeObjcSelf!(NSString, "precomposedStringWithCanonicalMapping");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
453 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
454
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
455 NSString decomposedStringWithCompatibilityMapping ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
456 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
457 return invokeObjcSelf!(NSString, "decomposedStringWithCompatibilityMapping");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
458 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
459
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
460 NSString precomposedStringWithCompatibilityMapping ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
461 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
462 return invokeObjcSelf!(NSString, "precomposedStringWithCompatibilityMapping");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
463 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
464
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
465 NSString stringByFoldingWithOptions (uint options, NSLocale locale)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
466 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
467 return invokeObjcSelf!(NSString, "stringByFoldingWithOptions:locale:", uint, NSLocale)(options, locale);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
468 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
469
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
470 NSString stringByReplacingOccurrencesOfString (NSString target, NSString replacement, uint options, NSRange searchRange)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
471 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
472 return invokeObjcSelf!(NSString, "stringByReplacingOccurrencesOfString:withString:options:range:", NSString, NSString, uint, NSRange)(target, replacement, options, searchRange);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
473 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
474
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
475 NSString stringByReplacingOccurrencesOfString (NSString target, NSString replacement)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
476 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
477 return invokeObjcSelf!(NSString, "stringByReplacingOccurrencesOfString:withString:", NSString, NSString)(target, replacement);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
478 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
479
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
480 NSString stringByReplacingCharactersInRange (NSRange range, NSString replacement)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
481 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
482 return invokeObjcSelf!(NSString, "stringByReplacingCharactersInRange:withString:", NSRange, NSString)(range, replacement);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
483 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
484
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
485 char* UTF8String ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
486 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
487 return invokeObjcSelf!(char*, "UTF8String");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
488 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
489
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
490 static uint defaultCStringEncoding ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
491 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
492 return invokeObjcSuperClass!(uint, "defaultCStringEncoding");
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
493 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
494
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
495 static NSStringEncoding* availableStringEncodings ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
496 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
497 return invokeObjcSuperClass!(NSStringEncoding*, "availableStringEncodings");
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
498 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
499
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
500 static NSString localizedNameOfStringEncoding (uint encoding)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
501 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
502 return invokeObjcSuperClass!(NSString, "localizedNameOfStringEncoding:", uint)(encoding);
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
503 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
504
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
505 NSString initWithCharactersNoCopy (unichar* characters, NSUInteger length, bool freeBuffer)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
506 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
507 return invokeObjcSelf!(Object, "initWithCharactersNoCopy:length:freeWhenDone:", unichar*, NSUInteger, bool)(characters, length, freeBuffer);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
508 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
509
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
510 /*this (unichar* characters, NSUInteger length, bool freeBuffer)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
511 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
512 typeof(this).alloc.initWithCharactersNoCopy(characters, length, freeBuffer);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
513 }*/
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
514
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
515 NSString initWithCharacters (unichar* characters, NSUInteger length)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
516 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
517 return invokeObjcSelf!(Object, "initWithCharacters:length:", unichar*, NSUInteger)(characters, length);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
518 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
519
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
520 /*this (unichar* characters, NSUInteger length)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
521 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
522 typeof(this).alloc.initWithCharacters(characters, length);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
523 }*/
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
524
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
525 NSString initWithUTF8String (char* nullTerminatedCString)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
526 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
527 return invokeObjcSelf!(Object, "initWithUTF8String:", char*)(nullTerminatedCString);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
528 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
529
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
530 /*this (char* nullTerminatedCString)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
531 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
532 typeof(this).alloc.initWithUTF8String(nullTerminatedCString);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
533 }*/
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
534
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
535 NSString initWithString (NSString aString)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
536 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
537 return invokeObjcSelf!(Object, "initWithString:", NSString)(aString);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
538 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
539
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
540 /*this (NSString aString)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
541 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
542 typeof(this).alloc.initWithString(aString);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
543 }*/
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
544
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
545 NSString initWithFormat (NSString initWithFormat, ...)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
546 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
547 return invokeObjcSelf!(Object, "initWithFormat:", NSString)(initWithFormat);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
548 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
549
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
550 /*this (NSString initWithFormat, ...)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
551 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
552 typeof(this).alloc.initWithFormat(initWithFormat);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
553 }*/
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
554
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
555 NSString initWithFormat (NSString format, char* argList)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
556 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
557 return invokeObjcSelf!(Object, "initWithFormat:arguments:", NSString, char*)(format, argList);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
558 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
559
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
560 /*this (NSString format, char* argList)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
561 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
562 typeof(this).alloc.initWithFormat(format, argList);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
563 }*/
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
564
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
565 NSString initWithFormat (NSString format, Object locale, ...)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
566 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
567 return invokeObjcSelf!(Object, "initWithFormat:locale:", NSString, Object)(format, locale);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
568 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
569
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
570 /*this (NSString format, Object locale, ...)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
571 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
572 typeof(this).alloc.initWithFormat(format, locale);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
573 }*/
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
574
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
575 NSString initWithFormat (NSString format, Object locale, char* argList)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
576 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
577 return invokeObjcSelf!(Object, "initWithFormat:locale:arguments:", NSString, Object, char*)(format, locale, argList);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
578 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
579
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
580 /*this (NSString format, Object locale, char* argList)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
581 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
582 typeof(this).alloc.initWithFormat(format, locale, argList);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
583 }*/
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
584
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
585 NSString initWithData (NSData data, uint encoding)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
586 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
587 return invokeObjcSelf!(Object, "initWithData:encoding:", NSData, uint)(data, encoding);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
588 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
589
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
590 /*this (NSData data, uint encoding)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
591 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
592 typeof(this).alloc.initWithData(data, encoding);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
593 }*/
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
594
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
595 NSString initWithBytes (void* bytes, NSUInteger len, uint encoding)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
596 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
597 return invokeObjcSelf!(Object, "initWithBytes:length:encoding:", void*, NSUInteger, uint)(bytes, len, encoding);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
598 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
599
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
600 /*this (void* bytes, NSUInteger len, uint encoding)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
601 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
602 typeof(this).alloc.initWithBytes(bytes, len, encoding);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
603 }*/
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
604
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
605 NSString initWithBytesNoCopy (void* bytes, NSUInteger len, NSStringEncoding encoding, bool freeBuffer)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
606 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
607 return invokeObjcSelf!(Object, "initWithBytesNoCopy:length:encoding:freeWhenDone:", void*, NSUInteger, NSStringEncoding, bool)(bytes, len, encoding, freeBuffer);
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
608 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
609
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
610 /*this (void* bytes, NSUInteger len, uint encoding, bool freeBuffer)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
611 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
612 typeof(this).alloc.initWithBytesNoCopy(bytes, len, encoding, freeBuffer);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
613 }*/
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
614
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
615 static Object string ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
616 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
617 return invokeObjcSuperClass!(Object, "string");
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
618 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
619
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
620 static Object stringWithString (NSString string)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
621 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
622 return invokeObjcSuperClass!(Object, "stringWithString:", NSString)(string);
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
623 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
624
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
625 static Object stringWithCharacters (unichar* characters, NSUInteger length)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
626 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
627 return invokeObjcSuperClass!(Object, "stringWithCharacters:length:", unichar*, NSUInteger)(characters, length);
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
628 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
629
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
630 static NSString stringWithUTF8String (char* nullTerminatedCString)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
631 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
632 return invokeObjcSuperClass!(NSString, "stringWithUTF8String:", char*)(nullTerminatedCString);
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
633 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
634
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
635 static Object stringWithFormat (NSString stringWithFormat, ...)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
636 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
637 return invokeObjcSuperClass!(Object, "stringWithFormat:", NSString)(stringWithFormat);
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
638 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
639
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
640 static Object localizedStringWithFormat (NSString localizedStringWithFormat, ...)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
641 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
642 return invokeObjcSuperClass!(Object, "localizedStringWithFormat:", NSString)(localizedStringWithFormat);
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
643 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
644
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
645 static Object stringWithCString (char* cString, uint enc)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
646 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
647 return invokeObjcSuperClass!(Object, "stringWithCString:encoding:", char*, uint)(cString, enc);
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
648 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
649
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
650 NSString initWithContentsOfURL (NSURL url, NSStringEncoding enc, ref NSError error)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
651 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
652 id err;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
653
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
654 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
655 err = new objc_object;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
656
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
657 Object result = invokeObjcSelf!(Object, "initWithContentsOfURL:encoding:error:", NSURL, NSStringEncoding, id*)(url, enc, &err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
658
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
659 if (err)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
660 error = new NSError(err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
661
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
662 return result;
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
663 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
664
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
665 /*this (NSURL url, NSStringEncoding enc, ref NSError error)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
666 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
667 typeof(this).alloc.initWithContentsOfURL(url, enc, error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
668 }*/
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
669
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
670 NSString initWithContentsOfFile (NSString path, NSStringEncoding enc, ref NSError error)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
671 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
672 id err;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
673
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
674 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
675 err = new objc_object;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
676
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
677 Object result = invokeObjcSelf!(Object, "initWithContentsOfFile:encoding:error:", NSString, NSStringEncoding, id*)(path, enc, &err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
678
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
679 if (err)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
680 error = new NSError(err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
681
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
682 return result;
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
683 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
684
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
685 /*this (NSString path, NSStringEncoding enc, ref NSError error)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
686 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
687 typeof(this).alloc.initWithContentsOfFile(path, enc, error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
688 }*/
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
689
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
690 static Object stringWithContentsOfURL (NSURL url, NSStringEncoding enc, ref NSError error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
691 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
692 id err;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
693
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
694 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
695 err = new objc_object;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
696
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
697 Object result = invokeObjcSuperClass!(Object, "stringWithContentsOfURL:encoding:error:", NSURL, NSStringEncoding, id*)(url, enc, &err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
698
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
699 if (err)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
700 error = new NSError(err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
701
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
702 return result;
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
703 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
704
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
705 static Object stringWithContentsOfFile (NSString path, NSStringEncoding enc, ref NSError error)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
706 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
707 id err;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
708
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
709 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
710 err = new objc_object;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
711
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
712 Object result = invokeObjcSuperClass!(Object, "stringWithContentsOfFile:encoding:error:", NSString, NSStringEncoding, id*)(path, enc, &err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
713
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
714 if (err)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
715 error = new NSError(err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
716
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
717 return result;
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
718 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
719
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
720 NSString initWithContentsOfURL (NSURL url, NSStringEncoding* enc, ref NSError error)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
721 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
722 id err;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
723
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
724 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
725 err = new objc_object;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
726
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
727 Object result = invokeObjcSelf!(Object, "initWithContentsOfURL:usedEncoding:error:", NSURL, NSStringEncoding*, id*)(url, enc, &err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
728
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
729 if (err)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
730 error = new NSError(err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
731
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
732 return result;
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
733 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
734
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
735 /*this (NSURL url, NSStringEncoding* enc, ref NSError error)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
736 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
737 typeof(this).alloc.initWithContentsOfURL(url, enc, error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
738 }*/
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
739
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
740 NSString initWithContentsOfFile (NSString path, NSStringEncoding* enc, ref NSError error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
741 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
742 id err;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
743
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
744 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
745 err = new objc_object;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
746
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
747 Object result = invokeObjcSelf!(Object, "initWithContentsOfFile:usedEncoding:error:", NSString, NSStringEncoding*, id*)(path, enc, &err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
748
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
749 if (err)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
750 error = new NSError(err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
751
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
752 return result;
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
753 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
754
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
755 /*this (NSString path, NSStringEncoding* enc, ref NSError error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
756 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
757 typeof(this).alloc.initWithContentsOfFile(path, enc, error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
758 }*/
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
759
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
760 static Object stringWithContentsOfURL (NSURL url, NSStringEncoding* enc, ref NSError error)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
761 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
762 id err;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
763
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
764 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
765 err = new objc_object;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
766
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
767 Object result = invokeObjcSuperClass!(Object, "stringWithContentsOfURL:usedEncoding:error:", NSURL, NSStringEncoding*, id*)(url, enc, &err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
768
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
769 if (err)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
770 error = new NSError(err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
771
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
772 return result;
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
773 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
774
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
775 static Object stringWithContentsOfFile (NSString path, NSStringEncoding* enc, ref NSError error)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
776 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
777 id err;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
778
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
779 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
780 err = new objc_object;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
781
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
782 Object result = invokeObjcSuperClass!(Object, "stringWithContentsOfFile:usedEncoding:error:", NSString, NSStringEncoding*, id*)(path, enc, &err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
783
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
784 if (err)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
785 error = new NSError(err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
786
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
787 return result;
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
788 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
789
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
790 bool writeToURL (NSURL url, bool useAuxiliaryFile, uint enc, ref NSError error)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
791 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
792 id err;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
793
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
794 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
795 err = new objc_object;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
796
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
797 bool result = invokeObjcSelf!(bool, "writeToURL:atomically:encoding:error:", NSURL, bool, uint, id*)(url, useAuxiliaryFile, enc, &err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
798
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
799 if (err)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
800 error = new NSError(err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
801
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
802 return result;
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
803 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
804
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
805 bool writeToFile (NSString path, bool useAuxiliaryFile, uint enc, ref NSError error)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
806 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
807 id err;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
808
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
809 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
810 err = new objc_object;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
811
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
812 bool result = invokeObjcSelf!(bool, "writeToFile:atomically:encoding:error:", NSString, bool, uint, id*)(path, useAuxiliaryFile, enc, &err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
813
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
814 if (err)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
815 error = new NSError(err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
816
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
817 return result;
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
818 }
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
819 `;
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
820
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
821 const TNSStringDeprecated = `
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
822
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
823 char* cString ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
824 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
825 return invokeObjcSelf!(char*, "cString");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
826 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
827
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
828 char* lossyCString ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
829 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
830 return invokeObjcSelf!(char*, "lossyCString");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
831 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
832
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
833 NSUInteger cStringLength ()
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
834 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
835 return invokeObjcSelf!(NSUInteger, "cStringLength");
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
836 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
837
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
838 void getCString (char* bytes)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
839 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
840 return invokeObjcSelf!(void, "getCString:", char*)(bytes);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
841 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
842
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
843 void getCString (char* bytes, NSUInteger maxLength)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
844 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
845 return invokeObjcSelf!(void, "getCString:maxLength:", char*, NSUInteger)(bytes, maxLength);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
846 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
847
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
848 void getCString (char* bytes, NSUInteger maxLength, NSRange aRange, NSRangePointer leftoverRange)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
849 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
850 return invokeObjcSelf!(void, "getCString:maxLength:range:remainingRange:", char*, NSUInteger, NSRange, NSRangePointer)(bytes, maxLength, aRange, leftoverRange);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
851 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
852
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
853 bool writeToFile (NSString path, bool useAuxiliaryFile)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
854 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
855 return invokeObjcSelf!(bool, "writeToFile:atomically:", NSString, bool)(path, useAuxiliaryFile);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
856 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
857
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
858 bool writeToURL (NSURL url, bool atomically)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
859 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
860 return invokeObjcSelf!(bool, "writeToURL:atomically:", NSURL, bool)(url, atomically);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
861 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
862
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
863 /*NSString initWithContentsOfFile (NSString path)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
864 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
865 return invokeObjcSelf!(Object, "initWithContentsOfFile:", NSString)(path);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
866 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
867
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
868 this (NSString path)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
869 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
870 typeof(this).alloc.initWithContentsOfFile(path);
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
871 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
872
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
873 NSString initWithContentsOfURL (NSURL url)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
874 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
875 return invokeObjcSelf!(Object, "initWithContentsOfURL:", NSURL)(url);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
876 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
877
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
878 this (NSURL url)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
879 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
880 typeof(this).alloc.initWithContentsOfURL(url);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
881 }*/
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
882
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
883 static Object stringWithContentsOfFile (NSString path)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
884 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
885 return invokeObjcSuperClass!(Object, "stringWithContentsOfFile:", NSString)(path);
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
886 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
887
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
888 static Object stringWithContentsOfURL (NSURL url)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
889 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
890 return invokeObjcSuperClass!(Object, "stringWithContentsOfURL:", NSURL)(url);
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
891 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
892
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
893 NSString initWithCStringNoCopy (char* bytes, NSUInteger length, bool freeBuffer)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
894 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
895 return invokeObjcSelf!(Object, "initWithCStringNoCopy:length:freeWhenDone:", char*, NSUInteger, bool)(bytes, length, freeBuffer);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
896 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
897
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
898 this (char* bytes, NSUInteger length, bool freeBuffer)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
899 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
900 typeof(this).alloc.initWithCStringNoCopy(bytes, length, freeBuffer);
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
901 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
902
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
903 NSString initWithCString (char* bytes, NSUInteger length)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
904 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
905 return invokeObjcSelf!(Object, "initWithCString:length:", char*, NSUInteger)(bytes, length);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
906 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
907
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
908 this (char* bytes, NSUInteger length)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
909 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
910 typeof(this).alloc.initWithCString(bytes, length);
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
911 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
912
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
913 NSString initWithCString (char* bytes)
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
914 {
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
915 return invokeObjcSelf!(Object, "initWithCString:", char*)(bytes);
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
916 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
917
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
918 this (char* bytes)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
919 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
920 typeof(this).alloc.initWithCString(bytes);
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
921 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
922
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
923 static Object stringWithCString (char* bytes, NSUInteger length)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
924 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
925 return invokeObjcSuperClass!(Object, "stringWithCString:length:", char*, NSUInteger)(bytes, length);
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
926 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
927
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
928 static Object stringWithCString (char* bytes)
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
929 {
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
930 return invokeObjcSuperClass!(Object, "stringWithCString:", char*)(bytes);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
931 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
932 `;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
933
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
934 class NSMutableString : NSString
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
935 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
936 mixin (ObjcClusterWrap);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
937
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
938 this ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
939 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
940 super(typeof(this).alloc.init.objcObject);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
941 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
942
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
943 typeof(this) init ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
944 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
945 return invokeObjcSelf!(typeof(this), "init");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
946 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
947
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
948 void replaceCharactersInRange (NSRange range, NSString aString)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
949 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
950 return invokeObjcSelf!(void, "replaceCharactersInRange:withString:", NSRange, NSString)(range, aString);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
951 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
952
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
953 // TNSMutableStringExtensionMethods
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
954 void insertString (NSString aString, NSUInteger loc)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
955 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
956 return invokeObjcSelf!(void, "insertString:atIndex:", NSString, NSUInteger)(aString, loc);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
957 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
958
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
959 void deleteCharactersInRange (NSRange range)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
960 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
961 return invokeObjcSelf!(void, "deleteCharactersInRange:", NSRange)(range);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
962 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
963
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
964 void appendString (NSString aString)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
965 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
966 return invokeObjcSelf!(void, "appendString:", NSString)(aString);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
967 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
968
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
969 void appendFormat (NSString appendFormat, ...)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
970 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
971 return invokeObjcSelf!(void, "appendFormat:", NSString)(appendFormat);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
972 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
973
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
974 void setString (NSString aString)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
975 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
976 return invokeObjcSelf!(void, "setString:", NSString)(aString);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
977 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
978
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
979 NSMutableString initWithCapacity (NSUInteger capacity)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
980 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
981 return invokeObjcSelf!(NSMutableString, "initWithCapacity:", NSUInteger)(capacity);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
982 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
983
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
984 /*this (NSUInteger capacity)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
985 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
986 typeof(this).alloc.initWithCapacity(capacity);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
987 }*/
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
988
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
989 static NSMutableString stringWithCapacity (NSUInteger capacity)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
990 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
991 return invokeObjcSuperClass!(NSMutableString, "stringWithCapacity:", NSUInteger)(capacity);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
992 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
993
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
994 NSUInteger replaceOccurrencesOfString (NSString target, NSString replacement, uint options, NSRange searchRange)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
995 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
996 return invokeObjcSelf!(NSUInteger, "replaceOccurrencesOfString:withString:options:range:", NSString, NSString, uint, NSRange)(target, replacement, options, searchRange);
14
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
997 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
998 }
89f3c3ef1fd2 Added the Foundation framework
Jacob Carlborg <doob@me.com>
parents:
diff changeset
999
16
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1000 class NSString : NSObject, INSCopying, INSMutableCopying, INSCoding
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1001 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1002 mixin (ObjcClusterWrap);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1003
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1004 this ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1005 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1006 super(typeof(this).alloc.init.objcObject);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1007 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1008
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1009 typeof(this) init ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1010 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1011 return invokeObjcSelf!(typeof(this), "init");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1012 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1013
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1014 NSUInteger length ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1015 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1016 return invokeObjcSelf!(NSUInteger, "length");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1017 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1018
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1019 unichar characterAtIndex (NSUInteger index)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1020 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1021 return invokeObjcSelf!(unichar, "characterAtIndex:", NSUInteger)(index);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1022 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1023
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1024 NSString copyWithZone (NSZone* zone)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1025 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1026 return invokeObjcSelf!(NSString, "copyWithZone:", NSZone*)(zone);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1027 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1028
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1029 NSString mutableCopyWithZone (NSZone* zone)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1030 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1031 return invokeObjcSelf!(NSString, "mutableCopyWithZone:", NSZone*)(zone);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1032 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1033
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1034 void encodeWithCoder (NSCoder aCoder)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1035 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1036 return invokeObjcSelf!(void, "encodeWithCoder:", NSCoder)(aCoder);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1037 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1038
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1039 NSString initWithCoder (NSCoder aDecoder)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1040 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1041 return invokeObjcSelf!(NSString, "initWithCoder:", NSCoder)(aDecoder);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1042 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1043
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1044 this (NSCoder aDecoder)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1045 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1046 typeof(this).alloc.initWithCoder(aDecoder);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1047 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1048
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1049 // TNSExtendedStringPropertyListParsing
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1050 Object propertyList ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1051 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1052 return invokeObjcSelf!(Object, "propertyList");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1053 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1054
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1055 NSDictionary propertyListFromStringsFileFormat ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1056 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1057 return invokeObjcSelf!(NSDictionary, "propertyListFromStringsFileFormat");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1058 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1059
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1060 // TNSStringExtensionMethods
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1061 void getCharacters (unichar* buffer)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1062 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1063 return invokeObjcSelf!(void, "getCharacters:", unichar*)(buffer);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1064 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1065
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1066 void getCharacters (unichar* buffer, NSRange aRange)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1067 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1068 return invokeObjcSelf!(void, "getCharacters:range:", unichar*, NSRange)(buffer, aRange);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1069 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1070
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1071 NSString substringFromIndex (NSUInteger from)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1072 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1073 return invokeObjcSelf!(NSString, "substringFromIndex:", NSUInteger)(from);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1074 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1075
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1076 NSString substringToIndex (NSUInteger to)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1077 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1078 return invokeObjcSelf!(NSString, "substringToIndex:", NSUInteger)(to);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1079 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1080
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1081 NSString substringWithRange (NSRange range)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1082 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1083 return invokeObjcSelf!(NSString, "substringWithRange:", NSRange)(range);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1084 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1085
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1086 int compare (NSString string)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1087 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1088 return invokeObjcSelf!(int, "compare:", NSString)(string);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1089 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1090
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1091 int compare (NSString string, uint mask)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1092 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1093 return invokeObjcSelf!(int, "compare:options:", NSString, uint)(string, mask);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1094 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1095
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1096 int compare (NSString string, uint mask, NSRange compareRange)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1097 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1098 return invokeObjcSelf!(int, "compare:options:range:", NSString, uint, NSRange)(string, mask, compareRange);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1099 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1100
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1101 int compare (NSString string, uint mask, NSRange compareRange, Object locale)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1102 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1103 return invokeObjcSelf!(int, "compare:options:range:locale:", NSString, uint, NSRange, Object)(string, mask, compareRange, locale);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1104 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1105
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1106 int caseInsensitiveCompare (NSString string)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1107 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1108 return invokeObjcSelf!(int, "caseInsensitiveCompare:", NSString)(string);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1109 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1110
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1111 int localizedCompare (NSString string)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1112 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1113 return invokeObjcSelf!(int, "localizedCompare:", NSString)(string);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1114 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1115
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1116 int localizedCaseInsensitiveCompare (NSString string)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1117 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1118 return invokeObjcSelf!(int, "localizedCaseInsensitiveCompare:", NSString)(string);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1119 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1120
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1121 bool isEqualToString (NSString aString)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1122 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1123 return invokeObjcSelf!(bool, "isEqualToString:", NSString)(aString);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1124 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1125
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1126 bool hasPrefix (NSString aString)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1127 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1128 return invokeObjcSelf!(bool, "hasPrefix:", NSString)(aString);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1129 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1130
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1131 bool hasSuffix (NSString aString)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1132 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1133 return invokeObjcSelf!(bool, "hasSuffix:", NSString)(aString);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1134 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1135
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1136 NSRange rangeOfString (NSString aString)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1137 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1138 return invokeObjcSelf!(NSRange, "rangeOfString:", NSString)(aString);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1139 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1140
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1141 NSRange rangeOfString (NSString aString, uint mask)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1142 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1143 return invokeObjcSelf!(NSRange, "rangeOfString:options:", NSString, uint)(aString, mask);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1144 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1145
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1146 NSRange rangeOfString (NSString aString, uint mask, NSRange searchRange)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1147 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1148 return invokeObjcSelf!(NSRange, "rangeOfString:options:range:", NSString, uint, NSRange)(aString, mask, searchRange);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1149 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1150
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1151 NSRange rangeOfString (NSString aString, uint mask, NSRange searchRange, NSLocale locale)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1152 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1153 return invokeObjcSelf!(NSRange, "rangeOfString:options:range:locale:", NSString, uint, NSRange, NSLocale)(aString, mask, searchRange, locale);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1154 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1155
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1156 NSRange rangeOfCharacterFromSet (NSCharacterSet aSet)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1157 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1158 return invokeObjcSelf!(NSRange, "rangeOfCharacterFromSet:", NSCharacterSet)(aSet);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1159 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1160
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1161 NSRange rangeOfCharacterFromSet (NSCharacterSet aSet, uint mask)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1162 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1163 return invokeObjcSelf!(NSRange, "rangeOfCharacterFromSet:options:", NSCharacterSet, uint)(aSet, mask);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1164 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1165
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1166 NSRange rangeOfCharacterFromSet (NSCharacterSet aSet, uint mask, NSRange searchRange)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1167 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1168 return invokeObjcSelf!(NSRange, "rangeOfCharacterFromSet:options:range:", NSCharacterSet, uint, NSRange)(aSet, mask, searchRange);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1169 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1170
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1171 NSRange rangeOfComposedCharacterSequenceAtIndex (NSUInteger index)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1172 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1173 return invokeObjcSelf!(NSRange, "rangeOfComposedCharacterSequenceAtIndex:", NSUInteger)(index);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1174 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1175
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1176 NSRange rangeOfComposedCharacterSequencesForRange (NSRange range)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1177 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1178 return invokeObjcSelf!(NSRange, "rangeOfComposedCharacterSequencesForRange:", NSRange)(range);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1179 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1180
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1181 NSString stringByAppendingString (NSString aString)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1182 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1183 return invokeObjcSelf!(NSString, "stringByAppendingString:", NSString)(aString);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1184 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1185
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1186 NSString stringByAppendingFormat (NSString stringByAppendingFormat, ...)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1187 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1188 return invokeObjcSelf!(NSString, "stringByAppendingFormat:", NSString)(stringByAppendingFormat);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1189 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1190
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1191 double doubleValue ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1192 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1193 return invokeObjcSelf!(double, "doubleValue");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1194 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1195
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1196 float floatValue ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1197 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1198 return invokeObjcSelf!(float, "floatValue");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1199 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1200
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1201 int intValue ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1202 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1203 return invokeObjcSelf!(int, "intValue");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1204 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1205
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1206 NSInteger integerValue ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1207 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1208 return invokeObjcSelf!(NSInteger, "integerValue");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1209 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1210
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1211 long longLongValue ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1212 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1213 return invokeObjcSelf!(long, "longLongValue");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1214 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1215
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1216 bool boolValue ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1217 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1218 return invokeObjcSelf!(bool, "boolValue");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1219 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1220
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1221 NSArray componentsSeparatedByString (NSString separator)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1222 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1223 return invokeObjcSelf!(NSArray, "componentsSeparatedByString:", NSString)(separator);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1224 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1225
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1226 NSArray componentsSeparatedByCharactersInSet (NSCharacterSet separator)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1227 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1228 return invokeObjcSelf!(NSArray, "componentsSeparatedByCharactersInSet:", NSCharacterSet)(separator);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1229 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1230
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1231 NSString commonPrefixWithString (NSString aString, uint mask)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1232 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1233 return invokeObjcSelf!(NSString, "commonPrefixWithString:options:", NSString, uint)(aString, mask);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1234 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1235
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1236 NSString uppercaseString ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1237 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1238 return invokeObjcSelf!(NSString, "uppercaseString");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1239 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1240
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1241 NSString lowercaseString ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1242 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1243 return invokeObjcSelf!(NSString, "lowercaseString");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1244 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1245
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1246 NSString capitalizedString ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1247 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1248 return invokeObjcSelf!(NSString, "capitalizedString");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1249 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1250
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1251 NSString stringByTrimmingCharactersInSet (NSCharacterSet set)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1252 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1253 return invokeObjcSelf!(NSString, "stringByTrimmingCharactersInSet:", NSCharacterSet)(set);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1254 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1255
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1256 NSString stringByPaddingToLength (NSUInteger newLength, NSString padString, NSUInteger padIndex)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1257 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1258 return invokeObjcSelf!(NSString, "stringByPaddingToLength:withString:startingAtIndex:", NSUInteger, NSString, NSUInteger)(newLength, padString, padIndex);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1259 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1260
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1261 void getLineStart (NSUInteger* startPtr, NSUInteger* lineEndPtr, NSUInteger* contentsEndPtr, NSRange range)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1262 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1263 return invokeObjcSelf!(void, "getLineStart:end:contentsEnd:forRange:", NSUInteger*, NSUInteger*, NSUInteger*, NSRange)(startPtr, lineEndPtr, contentsEndPtr, range);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1264 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1265
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1266 NSRange lineRangeForRange (NSRange range)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1267 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1268 return invokeObjcSelf!(NSRange, "lineRangeForRange:", NSRange)(range);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1269 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1270
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1271 void getParagraphStart (NSUInteger* startPtr, NSUInteger* parEndPtr, NSUInteger* contentsEndPtr, NSRange range)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1272 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1273 return invokeObjcSelf!(void, "getParagraphStart:end:contentsEnd:forRange:", NSUInteger*, NSUInteger*, NSUInteger*, NSRange)(startPtr, parEndPtr, contentsEndPtr, range);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1274 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1275
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1276 NSRange paragraphRangeForRange (NSRange range)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1277 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1278 return invokeObjcSelf!(NSRange, "paragraphRangeForRange:", NSRange)(range);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1279 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1280
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1281 NSString description ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1282 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1283 return invokeObjcSelf!(NSString, "description");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1284 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1285
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1286 NSUInteger hash ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1287 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1288 return invokeObjcSelf!(NSUInteger, "hash");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1289 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1290
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1291 uint fastestEncoding ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1292 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1293 return invokeObjcSelf!(uint, "fastestEncoding");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1294 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1295
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1296 uint smallestEncoding ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1297 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1298 return invokeObjcSelf!(uint, "smallestEncoding");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1299 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1300
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1301 NSData dataUsingEncoding (uint encoding, bool lossy)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1302 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1303 return invokeObjcSelf!(NSData, "dataUsingEncoding:allowLossyConversion:", uint, bool)(encoding, lossy);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1304 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1305
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1306 NSData dataUsingEncoding (uint encoding)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1307 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1308 return invokeObjcSelf!(NSData, "dataUsingEncoding:", uint)(encoding);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1309 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1310
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1311 bool canBeConvertedToEncoding (uint encoding)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1312 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1313 return invokeObjcSelf!(bool, "canBeConvertedToEncoding:", uint)(encoding);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1314 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1315
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1316 char* cStringUsingEncoding (uint encoding)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1317 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1318 return invokeObjcSelf!(char*, "cStringUsingEncoding:", uint)(encoding);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1319 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1320
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1321 bool getCString (char* buffer, NSUInteger maxBufferCount, uint encoding)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1322 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1323 return invokeObjcSelf!(bool, "getCString:maxLength:encoding:", char*, NSUInteger, uint)(buffer, maxBufferCount, encoding);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1324 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1325
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1326 bool getBytes (void* buffer, NSUInteger maxBufferCount, NSUInteger* usedBufferCount, uint encoding, uint options, NSRange range, NSRangePointer leftover)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1327 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1328 return invokeObjcSelf!(bool, "getBytes:maxLength:usedLength:encoding:options:range:remainingRange:", void*, NSUInteger, NSUInteger*, uint, uint, NSRange, NSRangePointer)(buffer, maxBufferCount, usedBufferCount, encoding, options, range, leftover);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1329 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1330
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1331 NSUInteger maximumLengthOfBytesUsingEncoding (uint enc)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1332 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1333 return invokeObjcSelf!(NSUInteger, "maximumLengthOfBytesUsingEncoding:", uint)(enc);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1334 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1335
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1336 NSUInteger lengthOfBytesUsingEncoding (uint enc)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1337 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1338 return invokeObjcSelf!(NSUInteger, "lengthOfBytesUsingEncoding:", uint)(enc);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1339 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1340
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1341 NSString decomposedStringWithCanonicalMapping ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1342 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1343 return invokeObjcSelf!(NSString, "decomposedStringWithCanonicalMapping");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1344 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1345
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1346 NSString precomposedStringWithCanonicalMapping ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1347 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1348 return invokeObjcSelf!(NSString, "precomposedStringWithCanonicalMapping");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1349 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1350
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1351 NSString decomposedStringWithCompatibilityMapping ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1352 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1353 return invokeObjcSelf!(NSString, "decomposedStringWithCompatibilityMapping");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1354 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1355
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1356 NSString precomposedStringWithCompatibilityMapping ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1357 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1358 return invokeObjcSelf!(NSString, "precomposedStringWithCompatibilityMapping");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1359 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1360
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1361 NSString stringByFoldingWithOptions (uint options, NSLocale locale)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1362 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1363 return invokeObjcSelf!(NSString, "stringByFoldingWithOptions:locale:", uint, NSLocale)(options, locale);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1364 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1365
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1366 NSString stringByReplacingOccurrencesOfString (NSString target, NSString replacement, uint options, NSRange searchRange)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1367 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1368 return invokeObjcSelf!(NSString, "stringByReplacingOccurrencesOfString:withString:options:range:", NSString, NSString, uint, NSRange)(target, replacement, options, searchRange);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1369 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1370
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1371 NSString stringByReplacingOccurrencesOfString (NSString target, NSString replacement)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1372 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1373 return invokeObjcSelf!(NSString, "stringByReplacingOccurrencesOfString:withString:", NSString, NSString)(target, replacement);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1374 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1375
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1376 NSString stringByReplacingCharactersInRange (NSRange range, NSString replacement)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1377 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1378 return invokeObjcSelf!(NSString, "stringByReplacingCharactersInRange:withString:", NSRange, NSString)(range, replacement);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1379 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1380
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1381 char* UTF8String ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1382 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1383 return invokeObjcSelf!(char*, "UTF8String");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1384 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1385
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1386 static uint defaultCStringEncoding ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1387 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1388 return invokeObjcSuperClass!(uint, "defaultCStringEncoding");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1389 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1390
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1391 static NSStringEncoding* availableStringEncodings ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1392 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1393 return invokeObjcSuperClass!(NSStringEncoding*, "availableStringEncodings");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1394 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1395
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1396 static NSString localizedNameOfStringEncoding (uint encoding)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1397 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1398 return invokeObjcSuperClass!(NSString, "localizedNameOfStringEncoding:", uint)(encoding);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1399 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1400
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1401 NSString initWithCharactersNoCopy (unichar* characters, NSUInteger length, bool freeBuffer)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1402 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1403 return invokeObjcSelf!(NSString, "initWithCharactersNoCopy:length:freeWhenDone:", unichar*, NSUInteger, bool)(characters, length, freeBuffer);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1404 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1405
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1406 /*this (unichar* characters, NSUInteger length, bool freeBuffer)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1407 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1408 typeof(this).alloc.initWithCharactersNoCopy(characters, length, freeBuffer);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1409 }*/
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1410
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1411 NSString initWithCharacters (unichar* characters, NSUInteger length)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1412 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1413 return invokeObjcSelf!(NSString, "initWithCharacters:length:", unichar*, NSUInteger)(characters, length);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1414 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1415
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1416 /*this (unichar* characters, NSUInteger length)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1417 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1418 typeof(this).alloc.initWithCharacters(characters, length);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1419 }*/
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1420
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1421 NSString initWithUTF8String (char* nullTerminatedCString)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1422 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1423 return invokeObjcSelf!(NSString, "initWithUTF8String:", char*)(nullTerminatedCString);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1424 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1425
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1426 /*this (char* nullTerminatedCString)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1427 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1428 typeof(this).alloc.initWithUTF8String(nullTerminatedCString);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1429 }*/
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1430
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1431 NSString initWithString (NSString aString)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1432 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1433 return invokeObjcSelf!(NSString, "initWithString:", NSString)(aString);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1434 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1435
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1436 /*this (NSString aString)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1437 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1438 typeof(this).alloc.initWithString(aString);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1439 }*/
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1440
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1441 NSString initWithFormat (NSString initWithFormat, ...)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1442 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1443 return invokeObjcSelf!(NSString, "initWithFormat:", NSString)(initWithFormat);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1444 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1445
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1446 /*this (NSString initWithFormat, ...)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1447 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1448 typeof(this).alloc.initWithFormat(initWithFormat);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1449 }*/
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1450
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1451 NSString initWithFormat (NSString format, char* argList)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1452 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1453 return invokeObjcSelf!(NSString, "initWithFormat:arguments:", NSString, char*)(format, argList);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1454 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1455
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1456 /*this (NSString format, char* argList)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1457 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1458 typeof(this).alloc.initWithFormat(format, argList);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1459 }*/
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1460
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1461 NSString initWithFormat (NSString format, Object locale, ...)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1462 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1463 return invokeObjcSelf!(NSString, "initWithFormat:locale:", NSString, Object)(format, locale);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1464 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1465
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1466 /*this (NSString format, Object locale, ...)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1467 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1468 typeof(this).alloc.initWithFormat(format, locale);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1469 }*/
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1470
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1471 NSString initWithFormat (NSString format, Object locale, char* argList)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1472 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1473 return invokeObjcSelf!(NSString, "initWithFormat:locale:arguments:", NSString, Object, char*)(format, locale, argList);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1474 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1475
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1476 /*this (NSString format, Object locale, char* argList)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1477 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1478 typeof(this).alloc.initWithFormat(format, locale, argList);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1479 }*/
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1480
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1481 NSString initWithData (NSData data, uint encoding)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1482 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1483 return invokeObjcSelf!(NSString, "initWithData:encoding:", NSData, uint)(data, encoding);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1484 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1485
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1486 /*this (NSData data, uint encoding)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1487 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1488 typeof(this).alloc.initWithData(data, encoding);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1489 }*/
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1490
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1491 NSString initWithBytes (void* bytes, NSUInteger len, uint encoding)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1492 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1493 return invokeObjcSelf!(NSString, "initWithBytes:length:encoding:", void*, NSUInteger, uint)(bytes, len, encoding);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1494 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1495
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1496 /*this (void* bytes, NSUInteger len, uint encoding)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1497 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1498 typeof(this).alloc.initWithBytes(bytes, len, encoding);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1499 }*/
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1500
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1501 NSString initWithBytesNoCopy (void* bytes, NSUInteger len, NSStringEncoding encoding, bool freeBuffer)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1502 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1503 return invokeObjcSelf!(NSString, "initWithBytesNoCopy:length:encoding:freeWhenDone:", void*, NSUInteger, NSStringEncoding, bool)(bytes, len, encoding, freeBuffer);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1504 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1505
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1506 /*this (void* bytes, NSUInteger len, uint encoding, bool freeBuffer)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1507 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1508 typeof(this).alloc.initWithBytesNoCopy(bytes, len, encoding, freeBuffer);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1509 }*/
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1510
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1511 static NSString string ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1512 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1513 return invokeObjcSuperClass!(NSString, "string");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1514 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1515
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1516 static NSString stringWithString (NSString string)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1517 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1518 return invokeObjcSuperClass!(NSString, "stringWithString:", NSString)(string);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1519 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1520
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1521 static NSString stringWithCharacters (unichar* characters, NSUInteger length)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1522 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1523 return invokeObjcSuperClass!(NSString, "stringWithCharacters:length:", unichar*, NSUInteger)(characters, length);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1524 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1525
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1526 static NSString stringWithUTF8String (char* nullTerminatedCString)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1527 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1528 return invokeObjcSuperClass!(NSString, "stringWithUTF8String:", char*)(nullTerminatedCString);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1529 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1530
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1531 static NSString stringWithFormat (NSString stringWithFormat, ...)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1532 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1533 return invokeObjcSuperClass!(NSString, "stringWithFormat:", NSString)(stringWithFormat);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1534 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1535
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1536 static NSString localizedStringWithFormat (NSString localizedStringWithFormat, ...)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1537 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1538 return invokeObjcSuperClass!(NSString, "localizedStringWithFormat:", NSString)(localizedStringWithFormat);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1539 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1540
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1541 static NSString stringWithCString (char* cString, uint enc)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1542 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1543 return invokeObjcSuperClass!(NSString, "stringWithCString:encoding:", char*, uint)(cString, enc);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1544 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1545
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1546 NSString initWithContentsOfURL (NSURL url, NSStringEncoding enc, ref NSError error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1547 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1548 id err;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1549
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1550 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1551 err = new objc_object;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1552
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1553 NSString result = invokeObjcSelf!(NSString, "initWithContentsOfURL:encoding:error:", NSURL, NSStringEncoding, id*)(url, enc, &err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1554
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1555 if (err)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1556 error = new NSError(err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1557
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1558 return result;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1559 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1560
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1561 /*this (NSURL url, NSStringEncoding enc, ref NSError error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1562 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1563 typeof(this).alloc.initWithContentsOfURL(url, enc, error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1564 }*/
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1565
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1566 NSString initWithContentsOfFile (NSString path, NSStringEncoding enc, ref NSError error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1567 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1568 id err;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1569
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1570 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1571 err = new objc_object;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1572
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1573 NSString result = invokeObjcSelf!(NSString, "initWithContentsOfFile:encoding:error:", NSString, NSStringEncoding, id*)(path, enc, &err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1574
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1575 if (err)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1576 error = new NSError(err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1577
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1578 return result;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1579 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1580
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1581 /*this (NSString path, NSStringEncoding enc, ref NSError error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1582 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1583 typeof(this).alloc.initWithContentsOfFile(path, enc, error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1584 }*/
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1585
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1586 static NSString stringWithContentsOfURL (NSURL url, NSStringEncoding enc, ref NSError error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1587 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1588 id err;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1589
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1590 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1591 err = new objc_object;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1592
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1593 NSString result = invokeObjcSuperClass!(NSString, "stringWithContentsOfURL:encoding:error:", NSURL, NSStringEncoding, id*)(url, enc, &err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1594
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1595 if (err)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1596 error = new NSError(err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1597
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1598 return result;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1599 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1600
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1601 static NSString stringWithContentsOfFile (NSString path, NSStringEncoding enc, ref NSError error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1602 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1603 id err;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1604
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1605 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1606 err = new objc_object;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1607
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1608 NSString result = invokeObjcSuperClass!(NSString, "stringWithContentsOfFile:encoding:error:", NSString, NSStringEncoding, id*)(path, enc, &err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1609
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1610 if (err)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1611 error = new NSError(err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1612
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1613 return result;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1614 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1615
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1616 NSString initWithContentsOfURL (NSURL url, NSStringEncoding* enc, ref NSError error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1617 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1618 id err;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1619
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1620 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1621 err = new objc_object;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1622
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1623 NSString result = invokeObjcSelf!(NSString, "initWithContentsOfURL:usedEncoding:error:", NSURL, NSStringEncoding*, id*)(url, enc, &err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1624
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1625 if (err)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1626 error = new NSError(err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1627
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1628 return result;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1629 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1630
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1631 /*this (NSURL url, NSStringEncoding* enc, ref NSError error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1632 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1633 typeof(this).alloc.initWithContentsOfURL(url, enc, error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1634 }*/
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1635
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1636 NSString initWithContentsOfFile (NSString path, NSStringEncoding* enc, ref NSError error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1637 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1638 id err;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1639
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1640 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1641 err = new objc_object;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1642
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1643 NSString result = invokeObjcSelf!(NSString, "initWithContentsOfFile:usedEncoding:error:", NSString, NSStringEncoding*, id*)(path, enc, &err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1644
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1645 if (err)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1646 error = new NSError(err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1647
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1648 return result;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1649 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1650
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1651 /*this (NSString path, NSStringEncoding* enc, ref NSError error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1652 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1653 typeof(this).alloc.initWithContentsOfFile(path, enc, error);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1654 }*/
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1655
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1656 static NSString stringWithContentsOfURL (NSURL url, NSStringEncoding* enc, ref NSError error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1657 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1658 id err;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1659
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1660 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1661 err = new objc_object;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1662
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1663 NSString result = invokeObjcSuperClass!(NSString, "stringWithContentsOfURL:usedEncoding:error:", NSURL, NSStringEncoding*, id*)(url, enc, &err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1664
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1665 if (err)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1666 error = new NSError(err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1667
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1668 return result;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1669 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1670
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1671 static NSString stringWithContentsOfFile (NSString path, NSStringEncoding* enc, ref NSError error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1672 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1673 id err;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1674
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1675 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1676 err = new objc_object;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1677
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1678 NSString result = invokeObjcSuperClass!(NSString, "stringWithContentsOfFile:usedEncoding:error:", NSString, NSStringEncoding*, id*)(path, enc, &err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1679
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1680 if (err)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1681 error = new NSError(err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1682
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1683 return result;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1684 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1685
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1686 bool writeToURL (NSURL url, bool useAuxiliaryFile, uint enc, ref NSError error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1687 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1688 id err;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1689
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1690 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1691 err = new objc_object;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1692
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1693 bool result = invokeObjcSelf!(bool, "writeToURL:atomically:encoding:error:", NSURL, bool, uint, id*)(url, useAuxiliaryFile, enc, &err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1694
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1695 if (err)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1696 error = new NSError(err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1697
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1698 return result;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1699 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1700
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1701 bool writeToFile (NSString path, bool useAuxiliaryFile, uint enc, ref NSError error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1702 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1703 id err;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1704
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1705 if (error)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1706 err = new objc_object;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1707
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1708 bool result = invokeObjcSelf!(bool, "writeToFile:atomically:encoding:error:", NSString, bool, uint, id*)(path, useAuxiliaryFile, enc, &err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1709
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1710 if (err)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1711 error = new NSError(err);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1712
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1713 return result;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1714 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1715
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1716 // TNSStringPathExtensions
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1717 static NSString pathWithComponents (NSArray components)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1718 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1719 return invokeObjcSuperClass!(NSString, "pathWithComponents:", NSArray)(components);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1720 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1721
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1722 NSArray pathComponents ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1723 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1724 return invokeObjcSelf!(NSArray, "pathComponents");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1725 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1726
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1727 bool isAbsolutePath ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1728 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1729 return invokeObjcSelf!(bool, "isAbsolutePath");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1730 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1731
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1732 NSString lastPathComponent ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1733 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1734 return invokeObjcSelf!(NSString, "lastPathComponent");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1735 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1736
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1737 NSString stringByDeletingLastPathComponent ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1738 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1739 return invokeObjcSelf!(NSString, "stringByDeletingLastPathComponent");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1740 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1741
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1742 NSString stringByAppendingPathComponent (NSString str)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1743 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1744 return invokeObjcSelf!(NSString, "stringByAppendingPathComponent:", NSString)(str);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1745 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1746
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1747 NSString pathExtension ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1748 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1749 return invokeObjcSelf!(NSString, "pathExtension");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1750 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1751
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1752 NSString stringByDeletingPathExtension ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1753 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1754 return invokeObjcSelf!(NSString, "stringByDeletingPathExtension");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1755 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1756
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1757 NSString stringByAppendingPathExtension (NSString str)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1758 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1759 return invokeObjcSelf!(NSString, "stringByAppendingPathExtension:", NSString)(str);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1760 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1761
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1762 NSString stringByAbbreviatingWithTildeInPath ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1763 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1764 return invokeObjcSelf!(NSString, "stringByAbbreviatingWithTildeInPath");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1765 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1766
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1767 NSString stringByExpandingTildeInPath ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1768 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1769 return invokeObjcSelf!(NSString, "stringByExpandingTildeInPath");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1770 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1771
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1772 NSString stringByStandardizingPath ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1773 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1774 return invokeObjcSelf!(NSString, "stringByStandardizingPath");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1775 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1776
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1777 NSString stringByResolvingSymlinksInPath ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1778 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1779 return invokeObjcSelf!(NSString, "stringByResolvingSymlinksInPath");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1780 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1781
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1782 NSArray stringsByAppendingPaths (NSArray paths)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1783 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1784 return invokeObjcSelf!(NSArray, "stringsByAppendingPaths:", NSArray)(paths);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1785 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1786
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1787 NSUInteger completePathIntoString (NSString** outputName, bool flag, NSArray** outputArray, NSArray filterTypes)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1788 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1789 return invokeObjcSelf!(NSUInteger, "completePathIntoString:caseSensitive:matchesIntoArray:filterTypes:", NSString**, bool, NSArray**, NSArray)(outputName, flag, outputArray, filterTypes);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1790 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1791
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1792 char* fileSystemRepresentation ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1793 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1794 return invokeObjcSelf!(char*, "fileSystemRepresentation");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1795 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1796
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1797 bool getFileSystemRepresentation (char* cname, NSUInteger max)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1798 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1799 return invokeObjcSelf!(bool, "getFileSystemRepresentation:maxLength:", char*, NSUInteger)(cname, max);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1800 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1801
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1802 // TNSURLUtilities
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1803 NSString stringByAddingPercentEscapesUsingEncoding (uint enc)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1804 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1805 return invokeObjcSelf!(NSString, "stringByAddingPercentEscapesUsingEncoding:", uint)(enc);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1806 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1807
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1808 NSString stringByReplacingPercentEscapesUsingEncoding (uint enc)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1809 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1810 return invokeObjcSelf!(NSString, "stringByReplacingPercentEscapesUsingEncoding:", uint)(enc);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1811 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1812
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1813 // TNSStringDeprecated
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1814 char* cString ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1815 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1816 return invokeObjcSelf!(char*, "cString");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1817 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1818
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1819 char* lossyCString ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1820 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1821 return invokeObjcSelf!(char*, "lossyCString");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1822 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1823
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1824 NSUInteger cStringLength ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1825 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1826 return invokeObjcSelf!(NSUInteger, "cStringLength");
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1827 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1828
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1829 void getCString (char* bytes)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1830 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1831 return invokeObjcSelf!(void, "getCString:", char*)(bytes);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1832 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1833
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1834 void getCString (char* bytes, NSUInteger maxLength)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1835 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1836 return invokeObjcSelf!(void, "getCString:maxLength:", char*, NSUInteger)(bytes, maxLength);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1837 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1838
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1839 void getCString (char* bytes, NSUInteger maxLength, NSRange aRange, NSRangePointer leftoverRange)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1840 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1841 return invokeObjcSelf!(void, "getCString:maxLength:range:remainingRange:", char*, NSUInteger, NSRange, NSRangePointer)(bytes, maxLength, aRange, leftoverRange);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1842 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1843
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1844 bool writeToFile (NSString path, bool useAuxiliaryFile)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1845 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1846 return invokeObjcSelf!(bool, "writeToFile:atomically:", NSString, bool)(path, useAuxiliaryFile);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1847 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1848
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1849 bool writeToURL (NSURL url, bool atomically)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1850 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1851 return invokeObjcSelf!(bool, "writeToURL:atomically:", NSURL, bool)(url, atomically);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1852 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1853
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1854 NSString initWithContentsOfFile (NSString path)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1855 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1856 return invokeObjcSelf!(NSString, "initWithContentsOfFile:", NSString)(path);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1857 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1858
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1859 NSString initWithContentsOfURL (NSURL url)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1860 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1861 return invokeObjcSelf!(NSString, "initWithContentsOfURL:", NSURL)(url);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1862 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1863
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1864 static NSString stringWithContentsOfFile (NSString path)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1865 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1866 return invokeObjcSuperClass!(NSString, "stringWithContentsOfFile:", NSString)(path);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1867 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1868
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1869 static NSString stringWithContentsOfURL (NSURL url)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1870 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1871 return invokeObjcSuperClass!(NSString, "stringWithContentsOfURL:", NSURL)(url);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1872 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1873
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1874 NSString initWithCStringNoCopy (char* bytes, NSUInteger length, bool freeBuffer)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1875 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1876 return invokeObjcSelf!(NSString, "initWithCStringNoCopy:length:freeWhenDone:", char*, NSUInteger, bool)(bytes, length, freeBuffer);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1877 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1878
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1879 /*this (char* bytes, NSUInteger length, bool freeBuffer)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1880 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1881 typeof(this).alloc.initWithCStringNoCopy(bytes, length, freeBuffer);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1882 }*/
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1883
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1884 NSString initWithCString (char* bytes, NSUInteger length)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1885 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1886 return invokeObjcSelf!(NSString, "initWithCString:length:", char*, NSUInteger)(bytes, length);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1887 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1888
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1889 /*this (char* bytes, NSUInteger length)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1890 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1891 typeof(this).alloc.initWithCString(bytes, length);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1892 }*/
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1893
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1894 NSString initWithCString (char* bytes)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1895 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1896 return invokeObjcSelf!(NSString, "initWithCString:", char*)(bytes);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1897 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1898
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1899 /*this (char* bytes)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1900 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1901 typeof(this).alloc.initWithCString(bytes);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1902 }*/
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1903
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1904 static NSString stringWithCString_length (char* bytes, NSUInteger length)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1905 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1906 return invokeObjcSuperClass!(NSString, "stringWithCString:length:", char*, NSUInteger)(bytes, length);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1907 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1908
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1909 static NSString stringWithCString (char* bytes)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1910 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1911 return invokeObjcSuperClass!(NSString, "stringWithCString:", char*)(bytes);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1912 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1913
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1914 // D extensions
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1915 static NSString opCall (.string str)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1916 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1917 return stringWithUTF8String((str ~ '\0').ptr);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1918 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1919
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1920 equals_t opEquals (Object object)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1921 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1922 if (auto str = cast(NSString) object)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1923 return isEqual(object);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1924
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1925 return false;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1926 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1927
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1928 final equals_t opEquals (.string str)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1929 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1930 return str == cStringUsingEncoding(NSUTF8StringEncoding)[0 .. lengthOfBytesUsingEncoding(NSUTF8StringEncoding)];
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1931 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1932
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1933 NSString opCatAssign (NSString str)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1934 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1935 objcObject = stringByAppendingString(str).objcObject;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1936 return this;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1937 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1938
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1939 NSString opCatAssign (.string str)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1940 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1941 objcObject = stringByAppendingString(NSString(str)).objcObject;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1942 return this;
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1943 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1944
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1945 NSString opCat (NSString str)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1946 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1947 return stringByAppendingString(str);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1948 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1949
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1950 NSString opCat (.string str)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1951 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1952 return stringByAppendingString(NSString(str));
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1953 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1954
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1955 .string toString ()
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1956 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1957 return cStringUsingEncoding(NSUTF8StringEncoding)[0 .. lengthOfBytesUsingEncoding(NSUTF8StringEncoding)];
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1958 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1959
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1960 wchar opIndex (size_t index)
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1961 {
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1962 return characterAtIndex(index);
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1963 }
19885b43130e Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents: 14
diff changeset
1964 }