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
Class: TPJUnicodeBMPPipeFilter
Applies to: ~>1.0
property OnLineEnd: TPJUnicodeTextReadEvent;
This event is triggered whenever the end of a line is encountered in the Unicode text read from the associated pipe. Line ends are determined by the value of the EOLMarker property.
The event can also be triggered when the Flush method is called or when the object is destroyed. This occurs if there is some text remaining that has not been terminated by an end of line marker.
The event handler is passed the following parameters:
Sender - Set to the TPJUnicodeBMPPipeFilter object that triggered the event.
Text - An UnicodeString containing the line of text, stripped of the end of line marker.
Note that the UnicodeString type must be defined to use this event. This is a native type on Delphi 2009 or later. For Delphi 2007 and earlier the PJPipeFilters unit defines UnicodeString as WideString.
In this example all text strings are Unicode.
Suppose we have a TPJUnicodeBMPPipeFilter object created on a pipe that contains the following Unicode text:
Lorem ipsum<EOL>intellegam<EOL>dissentias<EOL>te sea
The EOLMarker property is set to <EOL>
. We perform three pipe reads and a flush operation before destroying the object. Here’s what happens:
Lorem ip
from the pipe.
<EOL>
).sum<EOL>intellegam<EOL>dis
from the pipe.
Lorem ipsum<EOL>intellegam<EOL>dis
, which is then processed.Lorem ipsum
. The following <EOL>
is discarded.intellegam
. The following <EOL>
is again discarded.dis
is left over and recorded in the carry forward buffer.sentias<EOL>te sea
from the pipe.
dissentias<EOL>te sea
, which is processed.dissentias
and the following <EOL>
is discarded.te sea
is recorded in the carry forward buffer.te sea
as its parameter.Of course ReadPipe actually reads binary data from the pipe and converts that data into a Unicode text string.