forked from Memnarch/Delphinus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDN.PackageProvider.State.pas
70 lines (57 loc) · 1.66 KB
/
DN.PackageProvider.State.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
69
70
unit DN.PackageProvider.State;
interface
uses
DN.PackageProvider.State.Intf;
type
TDNPackageProviderState = class(TInterfacedObject, IDNPackageProviderState)
private
FLastError: string;
FState: TProviderState;
protected
function GetLastError: string; virtual;
function GetState: TProviderState; virtual;
function GetStatisticCount: Integer; virtual;
function GetStatisticName(const AIndex: Integer): string; virtual;
function GetStatisticValue(const AIndex: Integer): string; virtual;
public
procedure Reset; virtual;
procedure SetError(const AError: string);
property StatisticCount: Integer read GetStatisticCount;
property StatisticName[const AIndex: Integer]: string read GetStatisticName;
property StatisticValue[const AIndex: Integer]: string read GetStatisticValue;
property LastError: string read GetLastError;
property State: TProviderState read GetState;
end;
implementation
{ TPackageProviderState }
function TDNPackageProviderState.GetLastError: string;
begin
Result := FLastError;
end;
function TDNPackageProviderState.GetState: TProviderState;
begin
Result := FState;
end;
function TDNPackageProviderState.GetStatisticCount: Integer;
begin
Result := 0;
end;
function TDNPackageProviderState.GetStatisticName(const AIndex: Integer): string;
begin
Result := '';
end;
function TDNPackageProviderState.GetStatisticValue(const AIndex: Integer): string;
begin
Result := '';
end;
procedure TDNPackageProviderState.Reset;
begin
FState := psOk;
FLastError := '';
end;
procedure TDNPackageProviderState.SetError(const AError: string);
begin
FLastError := AError;
FState := psError;
end;
end.