Mercurial > projects > dstep
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dstep/foundation/NSHost.d Mon Aug 03 15:23:15 2009 +0200 @@ -0,0 +1,72 @@ +/** + * Copyright: Copyright (c) 2009 Jacob Carlborg. + * Authors: Jacob Carlborg + * Version: Initial created: Aug 3, 2009 + * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) + */ +module dstep.foundation.NSHost; + +import dstep.foundation.NSArray; +import dstep.foundation.NSMutableArray; +import dstep.foundation.NSObject; +import dstep.foundation.NSString; +import dstep.objc.bridge.Bridge; +import dstep.objc.objc : id; + +class NSHost : NSObject +{ + mixin ObjcWrap; + + static NSHost currentHost () + { + return invokeObjcSelfClass!(NSHost, "currentHost"return result is this.objcObject ? this : (result !is null ? new NSHost(result) : null); } + + static NSHost hostWithName (NSString name) + { + return invokeObjcSelfClass!(NSHost, "hostWithName:", NSString)(namereturn result is this.objcObject ? this : (result !is null ? new NSHost(result) : null); } + + static NSHost hostWithAddress (NSString address) + { + return invokeObjcSelfClass!(NSHost, "hostWithAddress:", NSString)(addressreturn result is this.objcObject ? this : (result !is null ? new NSHost(result) : null); } + + static void setHostCacheEnabled (bool flag) + { + return invokeObjcSelfClass!(void, "setHostCacheEnabled:", bool)(flag); + } + + static bool isHostCacheEnabled () + { + return invokeObjcSelfClass!(bool, "isHostCacheEnabled"); + } + + static void flushHostCache () + { + return invokeObjcSelfClass!(void, "flushHostCache"); + } + + bool isEqualToHost (NSHost aHost) + { + return invokeObjcSelf!(bool, "isEqualToHost:", NSHost)(aHost); + } + + NSString name () + { + return invokeObjcSelf!(NSString, "name"); + } + + NSArray names () + { + return invokeObjcSelf!(NSArray, "names"); + } + + NSString address () + { + return invokeObjcSelf!(NSString, "address"); + } + + NSArray addresses () + { + return invokeObjcSelf!(NSArray, "addresses"); + } +} +