Mercurial > projects > dstep
comparison dstep/foundation/NSPathUtilities.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 |
comparison
equal
deleted
inserted
replaced
15:7ff919f595d5 | 16:19885b43130e |
---|---|
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) | 5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) |
6 */ | 6 */ |
7 module dstep.foundation.NSPathUtilities; | 7 module dstep.foundation.NSPathUtilities; |
8 | 8 |
9 import dstep.foundation.NSArray; | 9 import dstep.foundation.NSArray; |
10 import dstep.foundation.NSObjCRuntime; | |
10 import dstep.foundation.NSString; | 11 import dstep.foundation.NSString; |
11 import dstep.objc.bridge.Bridge; | 12 import dstep.objc.bridge.Bridge; |
12 import dstep.objc.objc : id; | 13 import dstep.objc.objc; |
14 | |
15 import bindings = dstep.foundation.NSPathUtilities_bindings; | |
13 | 16 |
14 alias NSUInteger NSSearchPathDirectory; | 17 alias NSUInteger NSSearchPathDirectory; |
15 alias NSUInteger NSSearchPathDomainMask; | 18 alias NSUInteger NSSearchPathDomainMask; |
16 | 19 |
17 enum | 20 enum |
41 NSNetworkDomainMask = 4, | 44 NSNetworkDomainMask = 4, |
42 NSSystemDomainMask = 8, | 45 NSSystemDomainMask = 8, |
43 NSAllDomainsMask = 0x0ffff | 46 NSAllDomainsMask = 0x0ffff |
44 } | 47 } |
45 | 48 |
46 template TNSStringPathExtensions () | 49 const TNSStringPathExtensions = ` |
47 { | 50 |
48 static NSString pathWithComponents (NSArray components) | 51 static NSString pathWithComponents (NSArray components) |
49 { | 52 { |
50 return invokeObjcSelfClass!(NSString, "pathWithComponents:", NSArray)(components); | 53 return invokeObjcSuperClass!(NSString, "pathWithComponents:", NSArray)(components); |
51 } | 54 } |
52 | 55 |
53 NSArray pathComponents () | 56 NSArray pathComponents () |
54 { | 57 { |
55 return invokeObjcSelf!(NSArray, "pathComponents"); | 58 return invokeObjcSelf!(NSArray, "pathComponents"); |
127 | 130 |
128 bool getFileSystemRepresentation (char* cname, NSUInteger max) | 131 bool getFileSystemRepresentation (char* cname, NSUInteger max) |
129 { | 132 { |
130 return invokeObjcSelf!(bool, "getFileSystemRepresentation:maxLength:", char*, NSUInteger)(cname, max); | 133 return invokeObjcSelf!(bool, "getFileSystemRepresentation:maxLength:", char*, NSUInteger)(cname, max); |
131 } | 134 } |
132 } | 135 `; |
133 | 136 |
134 template TNSArrayPathExtensions () | 137 const TNSArrayPathExtensions = ` |
135 { | 138 |
136 NSArray pathsMatchingExtensions (NSArray filterTypes) | 139 NSArray pathsMatchingExtensions (NSArray filterTypes) |
137 { | 140 { |
138 return invokeObjcSelf!(NSArray, "pathsMatchingExtensions:", NSArray)(filterTypes); | 141 return invokeObjcSelf!(NSArray, "pathsMatchingExtensions:", NSArray)(filterTypes); |
139 } | 142 } |
140 } | 143 `; |
141 | 144 |
142 NSString NSUserName () | 145 NSString NSUserName () |
143 { | 146 { |
144 return Bridge.invokeObjcFunction!(NSString, bindings.NSUserName); | 147 return Bridge.invokeObjcFunction!(NSString, bindings.NSUserName); |
145 } | 148 } |