-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStats.SystemInfo.pas
52 lines (42 loc) · 971 Bytes
/
Stats.SystemInfo.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
unit Stats.SystemInfo;
interface
uses
System.Classes, System.SysUtils, System.JSON.Serializers,
Stats.CPU, Stats.OS, Stats.Disk, Stats.Memory;
type
TSystemInfo = class
private
[JsonName('OS')]
FOS: TOSInfo;
[JsonName('Memory')]
FMemory: TMemoryInfo;
[JSONName('CPU')]
FCPU: TCPUInfo;
[JSONName('Disk')]
FDisk: TDiskInfo;
public
property OS : TOSInfo read FOS;
property Memory : TMemoryInfo read FMemory;
property CPU : TCPUInfo read FCPU;
property Disk: TDiskInfo read FDisk;
constructor Create;
destructor Destroy; override;
end;
implementation
{ TSystemInfo }
constructor TSystemInfo.Create;
begin
FMemory := TMemoryInfo.Create(stMB);
FOS := TOSInfo.Create;
FCPU := TCPUInfo.Create;
FDisk := TDiskInfo.Create;
end;
destructor TSystemInfo.Destroy;
begin
FMemory.Free;
FOS.Free;
FCPU.Free;
FDisk.Free;
inherited;
end;
end.