Skip to content

TTextReader

Text reader class.

Declaration

Source position: streamex.pp line 95

type

  TTextReader = class(TObject)
  public
    constructor Create;
    procedure Reset;
    procedure Close;
    procedure ReadLine(out AString: AnsiString); overload;
    function ReadLine : AnsiString; overload;
    property Eof: Boolean; {r}
    property EndOfStream: Boolean; {r}
  end;

Description

TTextReader is an abstract class that provides a line-oriented reading API. It allows to read data from streams or memory blocks as if one was using regular pascal Read or ReadLn operations: the ReadLine procedure. Several descendents of this class exist which implement the reader interface for several sources of text data: TStreamReader, TFileReader, TStringReader.

Properties

Member Visibility Description
EndOfStream read only public
Eof read only public Check whether the end of the text data is returned.
See all Properties

Methods

Member Visibility Description
Close public Close the text data stream.
Create public Instantiate a new instance.
ReadLine public Read a line of text.
Reset public Reset the reader to the start position.
See all Methods

See also

Name Description
TStreamReader Implement TTextReader for streams.
TFileReader Implement TTextReader for files.
TStringReader Implement TTextReader for a single string.
ReadLine Read a line of text.