mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-11 21:29:42 +02:00
* Added ParseFiles
git-svn-id: trunk@21977 -
This commit is contained in:
parent
a7311f1348
commit
7976add94b
@ -78,6 +78,7 @@ Type
|
|||||||
Function ParseString(Src : String) : String;
|
Function ParseString(Src : String) : String;
|
||||||
Function ParseStream(Src : TStream; Dest : TStream) : Integer; // Wrapper, Returns number of bytes written.
|
Function ParseStream(Src : TStream; Dest : TStream) : Integer; // Wrapper, Returns number of bytes written.
|
||||||
Procedure ParseStrings(Src : TStrings; Dest : TStrings) ; // Wrapper
|
Procedure ParseStrings(Src : TStrings; Dest : TStrings) ; // Wrapper
|
||||||
|
Procedure ParseFiles(Const Src,Dest : String);
|
||||||
Property OnGetParam : TGetParamEvent Read FOnGetParam Write FOnGetParam; // Called if not found in values //used only when AllowTagParams = false
|
Property OnGetParam : TGetParamEvent Read FOnGetParam Write FOnGetParam; // Called if not found in values //used only when AllowTagParams = false
|
||||||
Property OnReplaceTag : TReplaceTagEvent Read FOnReplaceTag Write FOnReplaceTag; // Called if a tag found //used only when AllowTagParams = true
|
Property OnReplaceTag : TReplaceTagEvent Read FOnReplaceTag Write FOnReplaceTag; // Called if a tag found //used only when AllowTagParams = true
|
||||||
Property StartDelimiter : TParseDelimiter Index 1 Read GetDelimiter Write SetDelimiter;// Start char/string, default '}'
|
Property StartDelimiter : TParseDelimiter Index 1 Read GetDelimiter Write SetDelimiter;// Start char/string, default '}'
|
||||||
@ -592,6 +593,25 @@ begin
|
|||||||
Dest.Add(ParseString(Src[i]));
|
Dest.Add(ParseString(Src[i]));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TTemplateParser.ParseFiles(const Src, Dest: String);
|
||||||
|
|
||||||
|
Var
|
||||||
|
Fin,Fout : TFileStream;
|
||||||
|
|
||||||
|
begin
|
||||||
|
Fin:=TFileStream.Create(Src,fmOpenRead or fmShareDenyWrite);
|
||||||
|
try
|
||||||
|
Fout:=TFileStream.Create(Dest,fmCreate);
|
||||||
|
try
|
||||||
|
ParseStream(Fin,Fout);
|
||||||
|
finally
|
||||||
|
Fout.Free;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
Fin.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TFPCustomTemplate }
|
{ TFPCustomTemplate }
|
||||||
|
|
||||||
procedure TFPCustomTemplate.GetParam(Sender: TObject; const ParamName: String; out AValue: String);
|
procedure TFPCustomTemplate.GetParam(Sender: TObject; const ParamName: String; out AValue: String);
|
||||||
|
Loading…
Reference in New Issue
Block a user