This is a new site that's currently running on alpha code. There are going to be bugs. If you discover any, please report them on the site's issues page (GitHub account required). Thanks.
Warning: Many URLs are going to change. Refer to the README file to discover which library project's documentation has been completed.
Project: I/O Utility Classes
Unit: PJPipeFilters
Classes: TPJPipeFilter, TPJUnicodeBMPPipeFilter, TPJAnsiSBCSPipeFilter
Applies to: ~>1.0
constructor Create(const APipe: TPJPipe; const AOwnsPipe: Boolean = False);
This constructor creates an instance of the filter object to operate on a specified pipe.
Parameters:
APipe - Pipe on which the filters are to act. The pipe will be exposed via the read only Pipe property.
AOwnsPipe - Flag that indicates whether the filter object owns the pipe. If true then the pipe object will be freed when the filter object is destroyed.
The filter object will read the pipe whenever the filter’s ReadPipe method is called.
Setting AOwnsPipe to true means that pipes can be created on the fly in the filter’s constructor and they will be freed automatically at the appropriate time. For example the two following code fragments are functionally the same:
var
Filter: TPJUnicodeBMPPipeFilter;
Pipe: TPJPipe;
begin
Pipe := TPJPipe.Create;
try
Filter := TPJUnicodeBMPPipeFilter.Create(Pipe, False);
try
// do something with Filter and Pipe
finally
Filter.Free;
end;
finally
Pipe.Free;
end;
end;
var
Filter: TPJUnicodeBMPPipeFilter;
begin
Filter := TPJUnicodeBMPPipeFilter.Create(TPJPipe.Create, True);
try
// do something with Filter and Filter.Pipe
finally
Filter.Free;
end;
end;
In the second listing, if we need to access the pipe object we must use the filter’s Pipe property.