|
|
|
| TextTemplateConverter component.
|
| procedure ConvertStream(Stream: TStream);
|
| The ConvertStream method is the same as Convert, but translates the text in the streams or their descendants (MemoryStream's, FileStream's etc).
|
|
|
| It checks the template string specified in Value parameter, found in that string all the %keywords% specified in Name property of Params collection, replaces the %keywords% with the text specified in Value property of Params.
|
|
|
| After calling the ConvertStream method, the Stream will contain translated text, where all keywords replaced with their actual values.
|
| procedure TForm1.Button1Click(Sender: TObject);
|
| var
|
| fs: TFileStream;
|
| begin
|
| fs := TFileStream.Create('c:\file.txt', fmOpenReadWrite);
|
| try
|
| TextTemplateConverter1.ConvertStream(fs);
|
| finally
|
| fs.Free;
|
| end;
|
| end;
|
| Params property;
|
| Convert and ConvertStrings methods.
|