comparison dstep/foundation/NSHost.d @ 14:89f3c3ef1fd2

Added the Foundation framework
author Jacob Carlborg <doob@me.com>
date Mon, 03 Aug 2009 15:23:15 +0200
parents
children 7ff919f595d5
comparison
equal deleted inserted replaced
13:4f583f7e242e 14:89f3c3ef1fd2
1 /**
2 * Copyright: Copyright (c) 2009 Jacob Carlborg.
3 * Authors: Jacob Carlborg
4 * Version: Initial created: Aug 3, 2009
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
6 */
7 module dstep.foundation.NSHost;
8
9 import dstep.foundation.NSArray;
10 import dstep.foundation.NSMutableArray;
11 import dstep.foundation.NSObject;
12 import dstep.foundation.NSString;
13 import dstep.objc.bridge.Bridge;
14 import dstep.objc.objc : id;
15
16 class NSHost : NSObject
17 {
18 mixin ObjcWrap;
19
20 static NSHost currentHost ()
21 {
22 return invokeObjcSelfClass!(NSHost, "currentHost"return result is this.objcObject ? this : (result !is null ? new NSHost(result) : null); }
23
24 static NSHost hostWithName (NSString name)
25 {
26 return invokeObjcSelfClass!(NSHost, "hostWithName:", NSString)(namereturn result is this.objcObject ? this : (result !is null ? new NSHost(result) : null); }
27
28 static NSHost hostWithAddress (NSString address)
29 {
30 return invokeObjcSelfClass!(NSHost, "hostWithAddress:", NSString)(addressreturn result is this.objcObject ? this : (result !is null ? new NSHost(result) : null); }
31
32 static void setHostCacheEnabled (bool flag)
33 {
34 return invokeObjcSelfClass!(void, "setHostCacheEnabled:", bool)(flag);
35 }
36
37 static bool isHostCacheEnabled ()
38 {
39 return invokeObjcSelfClass!(bool, "isHostCacheEnabled");
40 }
41
42 static void flushHostCache ()
43 {
44 return invokeObjcSelfClass!(void, "flushHostCache");
45 }
46
47 bool isEqualToHost (NSHost aHost)
48 {
49 return invokeObjcSelf!(bool, "isEqualToHost:", NSHost)(aHost);
50 }
51
52 NSString name ()
53 {
54 return invokeObjcSelf!(NSString, "name");
55 }
56
57 NSArray names ()
58 {
59 return invokeObjcSelf!(NSArray, "names");
60 }
61
62 NSString address ()
63 {
64 return invokeObjcSelf!(NSString, "address");
65 }
66
67 NSArray addresses ()
68 {
69 return invokeObjcSelf!(NSArray, "addresses");
70 }
71 }
72