-
Notifications
You must be signed in to change notification settings - Fork 0
/
uPSComponent_Default.pas
81 lines (64 loc) · 1.81 KB
/
uPSComponent_Default.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
71
72
73
74
75
76
77
78
79
80
81
unit uPSComponent_Default;
{$I PascalScript.inc}
interface
uses
SysUtils, Classes, uPSComponent, uPSCompiler, uPSRuntime;
type
TPSImport_DateUtils = class(TPSPlugin)
public
procedure CompOnUses(CompExec: TPSScript); override;
procedure ExecOnUses(CompExec: TPSScript); override;
end;
TPSImport_Classes = class(TPSPlugin)
private
FEnableStreams: Boolean;
FEnableClasses: Boolean;
public
procedure CompileImport1(CompExec: TPSScript); override;
procedure ExecImport1(CompExec: TPSScript; const ri: TPSRuntimeClassImporter); override;
public
constructor Create(AOwner: TComponent); override;
published
property EnableStreams: Boolean read FEnableStreams write FEnableStreams;
property EnableClasses: Boolean read FEnableClasses write FEnableClasses;
end;
TIFPS3CE_Std = class(TPSImport_Classes);
TIFPS3CE_DateUtils = class(TPSImport_DateUtils);
implementation
uses
uPSC_std,
uPSR_std,
uPSC_classes,
uPSR_classes,
uPSC_dateutils,
uPSR_dateutils;
{ TPSImport_Classes }
procedure TPSImport_Classes.CompileImport1(CompExec: TPSScript);
begin
SIRegister_Std(CompExec.Comp);
if FEnableClasses then
SIRegister_Classes(CompExec.Comp, FEnableStreams);
end;
procedure TPSImport_Classes.ExecImport1(CompExec: TPSScript;
const ri: TPSRuntimeClassImporter);
begin
RIRegister_Std(Ri);
if FEnableClasses then
RIRegister_Classes(ri, FEnableStreams);
end;
constructor TPSImport_Classes.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FEnableStreams := True;
FEnableClasses := True;
end;
{ TPSImport_DateUtils }
procedure TPSImport_DateUtils.CompOnUses(CompExec: TPSScript);
begin
RegisterDateTimeLibrary_C(CompExec.Comp);
end;
procedure TPSImport_DateUtils.ExecOnUses(CompExec: TPSScript);
begin
RegisterDateTimeLibrary_R(CompExec.Exec);
end;
end.