2006-05-30 16:23:25 +02:00
|
|
|
unit uPSComponent_Default;
|
2006-08-18 12:13:43 +02:00
|
|
|
{$I PascalScript.inc}
|
2006-05-30 16:23:25 +02:00
|
|
|
interface
|
|
|
|
uses
|
|
|
|
SysUtils, Classes, uPSComponent, uPSCompiler, uPSRuntime;
|
|
|
|
|
|
|
|
type
|
2006-08-18 12:13:43 +02:00
|
|
|
|
2006-05-30 16:23:25 +02:00
|
|
|
TPSImport_DateUtils = class(TPSPlugin)
|
|
|
|
protected
|
|
|
|
procedure CompOnUses(CompExec: TPSScript); override;
|
|
|
|
procedure ExecOnUses(CompExec: TPSScript); override;
|
|
|
|
end;
|
2006-08-18 12:13:43 +02:00
|
|
|
|
2006-05-30 16:23:25 +02:00
|
|
|
TPSImport_Classes = class(TPSPlugin)
|
|
|
|
private
|
|
|
|
FEnableStreams: Boolean;
|
|
|
|
FEnableClasses: Boolean;
|
|
|
|
protected
|
|
|
|
procedure CompileImport1(CompExec: TPSScript); override;
|
|
|
|
procedure ExecImport1(CompExec: TPSScript; const ri: TPSRuntimeClassImporter); override;
|
|
|
|
public
|
2006-08-18 12:13:43 +02:00
|
|
|
|
2006-05-30 16:23:25 +02:00
|
|
|
constructor Create(AOwner: TComponent); override;
|
|
|
|
published
|
2006-08-18 12:13:43 +02:00
|
|
|
|
2006-05-30 16:23:25 +02:00
|
|
|
property EnableStreams: Boolean read FEnableStreams write FEnableStreams;
|
2006-08-18 12:13:43 +02:00
|
|
|
|
2006-05-30 16:23:25 +02:00
|
|
|
property EnableClasses: Boolean read FEnableClasses write FEnableClasses;
|
|
|
|
end;
|
2006-08-18 12:13:43 +02:00
|
|
|
|
2006-05-30 16:23:25 +02:00
|
|
|
TIFPS3CE_Std = class(TPSImport_Classes);
|
2006-08-18 12:13:43 +02:00
|
|
|
|
2006-05-30 16:23:25 +02:00
|
|
|
TIFPS3CE_DateUtils = class(TPSImport_DateUtils);
|
|
|
|
|
|
|
|
implementation
|
|
|
|
uses
|
|
|
|
uPSC_std,
|
|
|
|
uPSR_std,
|
|
|
|
uPSC_classes,
|
|
|
|
uPSR_classes,
|
|
|
|
uPSC_dateutils,
|
|
|
|
uPSR_dateutils;
|
|
|
|
|
|
|
|
{ TPSImport_Classes }
|
2006-08-18 12:13:43 +02:00
|
|
|
|
2006-05-30 16:23:25 +02:00
|
|
|
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.
|