Mercurial > projects > dstep
comparison dstep/foundation/NSProcessInfo.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.NSProcessInfo; | |
8 | |
9 import dstep.foundation.NSArray; | |
10 import dstep.foundation.NSDictionary; | |
11 import dstep.foundation.NSObject; | |
12 import dstep.foundation.NSString; | |
13 import dstep.objc.bridge.Bridge; | |
14 import dstep.objc.objc : id; | |
15 | |
16 enum | |
17 { | |
18 NSWindowsNTOperatingSystem = 1, | |
19 NSWindows95OperatingSystem, | |
20 NSSolarisOperatingSystem, | |
21 NSHPUXOperatingSystem, | |
22 NSMACHOperatingSystem, | |
23 NSSunOSOperatingSystem, | |
24 NSOSF1OperatingSystem | |
25 } | |
26 | |
27 class NSProcessInfo : NSObject | |
28 { | |
29 mixin ObjcWrap; | |
30 | |
31 static NSProcessInfo processInfo () | |
32 { | |
33 return invokeObjcSelfClass!(NSProcessInfo, "processInfo"return result is this.objcObject ? this : (result !is null ? new NSProcessInfo(result) : null); } | |
34 | |
35 NSDictionary environment () | |
36 { | |
37 return invokeObjcSelf!(NSDictionary, "environment"); | |
38 } | |
39 | |
40 NSArray arguments () | |
41 { | |
42 return invokeObjcSelf!(NSArray, "arguments"); | |
43 } | |
44 | |
45 NSString hostName () | |
46 { | |
47 return invokeObjcSelf!(NSString, "hostName"); | |
48 } | |
49 | |
50 NSString processName () | |
51 { | |
52 return invokeObjcSelf!(NSString, "processName"); | |
53 } | |
54 | |
55 int processIdentifier () | |
56 { | |
57 return invokeObjcSelf!(int, "processIdentifier"); | |
58 } | |
59 | |
60 void setProcessName (NSString newName) | |
61 { | |
62 return invokeObjcSelf!(void, "setProcessName:", NSString)(newName); | |
63 } | |
64 | |
65 NSString globallyUniqueString () | |
66 { | |
67 return invokeObjcSelf!(NSString, "globallyUniqueString"); | |
68 } | |
69 | |
70 NSUInteger operatingSystem () | |
71 { | |
72 return invokeObjcSelf!(NSUInteger, "operatingSystem"); | |
73 } | |
74 | |
75 NSString operatingSystemName () | |
76 { | |
77 return invokeObjcSelf!(NSString, "operatingSystemName"); | |
78 } | |
79 | |
80 NSString operatingSystemVersionString () | |
81 { | |
82 return invokeObjcSelf!(NSString, "operatingSystemVersionString"); | |
83 } | |
84 | |
85 NSUInteger processorCount () | |
86 { | |
87 return invokeObjcSelf!(NSUInteger, "processorCount"); | |
88 } | |
89 | |
90 NSUInteger activeProcessorCount () | |
91 { | |
92 return invokeObjcSelf!(NSUInteger, "activeProcessorCount"); | |
93 } | |
94 | |
95 ulong physicalMemory () | |
96 { | |
97 return invokeObjcSelf!(ulong, "physicalMemory"); | |
98 } | |
99 } | |
100 |