This repository has been archived by the owner on Jul 31, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
PackageInfo.pas
68 lines (58 loc) · 1.92 KB
/
PackageInfo.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
{**
DelphiPI (Delphi Package Installer)
Author : ibrahim dursun (ibrahimdursun gmail)
License : GNU General Public License 2.0
**}
unit PackageInfo;
interface
uses Classes, StrUtils, TreeModel;
type
TPackageStatus = (psNone, psCompiling, psInstalling, psSuccess, psError);
TPackageInfo = class
private
fRequiredPackageList: TStringList;
fContainedFileList : TStringList;
FDescription : String;
FSuffix : String;
FRunOnly : Boolean;
FPackageName : String;
fFileName: String;
fStatus: TPackageStatus;
public
constructor Create;overload;
constructor Create(const packageName:string);overload;
destructor Destroy; override;
function DependsOn(const package: TPackageInfo): Boolean; overload;
property Description: string read FDescription write FDescription;
property PackageName: string read FPackageName write FPackageName;
property RunOnly: Boolean read FRunOnly write FRunOnly;
property Suffix: string read FSuffix write FSuffix;
property RequiredPackageList: TStringList read fRequiredPackageList;
property ContainedFileList: TStringList read fContainedFileList;
property FileName: string read fFileName write fFileName;
property Status: TPackageStatus read fStatus write fStatus;
end;
implementation
uses SysUtils, contnrs, JclStrings;
constructor TPackageInfo.Create;
begin
fRequiredPackageList := TStringList.Create;
fContainedFileList := TStringList.Create;
end;
destructor TPackageInfo.Destroy;
begin
FreeAndNil(fRequiredPackageList);
FreeAndNil(fContainedFileList);
inherited;
end;
constructor TPackageInfo.Create(const packageName: string);
begin
Create;
FPackageName := packageName;
end;
function TPackageInfo.DependsOn(const package: TPackageInfo): Boolean;
begin
assert(package <> nil);
Result := RequiredPackageList.IndexOf(package.packageName) > -1;
end;
end.