Repository navigation
Expand file tree
/
Copy pathuGetItTypes.pas
More file actions
122 lines (109 loc) · 2.73 KB
/
Copy pathuGetItTypes.pas
File metadata and controls
122 lines (109 loc) · 2.73 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
unit uGetItTypes;
interface
type
TGetItIncompatibilityReason = (irBuild, irPersonality);
TGetItIncompatibilityReasons = set of TGetItIncompatibilityReason;
TGetItNamedId = record
Id: string;
Name: string;
end;
TGetItPersonality = (gpDelphi, gpCppBuilder);
TGetItPersonalities = set of TGetItPersonality;
TInstalledGetItPackageInfo = class
public
Id: string;
PackageId: string;
Version: string;
Name: string;
Vendor: string;
Url: string;
LibSize: string;
LibMD5: string;
Modified: string;
VersionTimestamp: string;
State: Integer;
AllUsers: Integer;
Subscription: Integer;
constructor Create;
end;
TGetItPackageInfo = class
private
function GetIncompatible: Boolean;
public
Id: string;
PackageId: string;
Version: string;
Name: string;
Vendor: string;
Description: string;
Tags: string;
TypeDescription: string;
State: string;
Subscription: string;
CategoryIds: string;
CategoryNames: string;
Platforms: TArray<TGetItNamedId>;
OSes: TArray<TGetItNamedId>;
LibCode: string;
LibCodeName: string;
LibSize: string;
LibUrl: string;
LibMD5: string;
VendorUrl: string;
VersionTimestamp: string;
Modified: string;
// Preserve all server fields, including unknown future fields and nested actions.
CatalogDetailsJson: string;
ImageUrl: string;
IconUrl: string;
LicenseUrl: string;
LicenseName: string;
ProjectUrl: string;
InstalledVersion: string;
InstalledUrl: string;
InstalledModified: string;
InstalledVersionTimestamp: string;
InstalledLibSize: string;
InstalledLibMD5: string;
InstalledState: Integer;
InstalledAllUsers: Integer;
InstalledSubscription: Integer;
LatestVersion: string;
VersionStatus: string;
CatalogUnavailable: Boolean;
IncompatibilityReasons: TGetItIncompatibilityReasons;
property Incompatible: Boolean read GetIncompatible;
constructor Create;
procedure ClearInstalledMetadata;
end;
TListSource = (lsUnknown, lsGetItCmd, lsRest);
implementation
constructor TInstalledGetItPackageInfo.Create;
begin
inherited Create;
State := -1;
AllUsers := -1;
Subscription := -1;
end;
function TGetItPackageInfo.GetIncompatible: Boolean;
begin
Result := IncompatibilityReasons <> [];
end;
constructor TGetItPackageInfo.Create;
begin
inherited Create;
ClearInstalledMetadata;
end;
procedure TGetItPackageInfo.ClearInstalledMetadata;
begin
InstalledVersion := '';
InstalledUrl := '';
InstalledModified := '';
InstalledVersionTimestamp := '';
InstalledLibSize := '';
InstalledLibMD5 := '';
InstalledState := -1;
InstalledAllUsers := -1;
InstalledSubscription := -1;
end;
end.