Mercurial > projects > dstep
annotate dstep/foundation/NSProcessInfo.d @ 15:7ff919f595d5
Added the Foundation framework, again
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Mon, 03 Aug 2009 15:31:48 +0200 |
parents | 89f3c3ef1fd2 |
children | 19885b43130e |
rev | line source |
---|---|
14 | 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 { | |
15
7ff919f595d5
Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
33 return invokeObjcSelfClass!(NSProcessInfo, "processInfo"); |
7ff919f595d5
Added the Foundation framework, again
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
34 } |
14 | 35 |
36 NSDictionary environment () | |
37 { | |
38 return invokeObjcSelf!(NSDictionary, "environment"); | |
39 } | |
40 | |
41 NSArray arguments () | |
42 { | |
43 return invokeObjcSelf!(NSArray, "arguments"); | |
44 } | |
45 | |
46 NSString hostName () | |
47 { | |
48 return invokeObjcSelf!(NSString, "hostName"); | |
49 } | |
50 | |
51 NSString processName () | |
52 { | |
53 return invokeObjcSelf!(NSString, "processName"); | |
54 } | |
55 | |
56 int processIdentifier () | |
57 { | |
58 return invokeObjcSelf!(int, "processIdentifier"); | |
59 } | |
60 | |
61 void setProcessName (NSString newName) | |
62 { | |
63 return invokeObjcSelf!(void, "setProcessName:", NSString)(newName); | |
64 } | |
65 | |
66 NSString globallyUniqueString () | |
67 { | |
68 return invokeObjcSelf!(NSString, "globallyUniqueString"); | |
69 } | |
70 | |
71 NSUInteger operatingSystem () | |
72 { | |
73 return invokeObjcSelf!(NSUInteger, "operatingSystem"); | |
74 } | |
75 | |
76 NSString operatingSystemName () | |
77 { | |
78 return invokeObjcSelf!(NSString, "operatingSystemName"); | |
79 } | |
80 | |
81 NSString operatingSystemVersionString () | |
82 { | |
83 return invokeObjcSelf!(NSString, "operatingSystemVersionString"); | |
84 } | |
85 | |
86 NSUInteger processorCount () | |
87 { | |
88 return invokeObjcSelf!(NSUInteger, "processorCount"); | |
89 } | |
90 | |
91 NSUInteger activeProcessorCount () | |
92 { | |
93 return invokeObjcSelf!(NSUInteger, "activeProcessorCount"); | |
94 } | |
95 | |
96 ulong physicalMemory () | |
97 { | |
98 return invokeObjcSelf!(ulong, "physicalMemory"); | |
99 } | |
100 } | |
101 |