Class TTextReader

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TTextReader = class(TObject)

Description

Read given Stream line by line. Lines may be terminated in the Stream with #13, #10, #13+#10 or #10+#13. This way I can treat any TStream quite like standard Pascal text files: I have simple Readln method.

After calling Readln or Eof you should stop directly using underlying Stream (but you can use Stream right after creating TTextReader.Create(Stream) and before any Readln or Eof operations on this TTextReader).

Hierarchy

  • TObject
  • TTextReader

Overview

Methods

Public constructor CreateFromFileStream(const FileName: string);
Public constructor Create(AStream: TStream; AOwnsStream: boolean);
Public destructor Destroy; override;
Public function Readln: string;
Public function Eof: boolean;

Description

Methods

Public constructor CreateFromFileStream(const FileName: string);

Open a file in read-only mode.

Public constructor Create(AStream: TStream; AOwnsStream: boolean);

Open a stream. If AOwnsStream then in destructor we will free given Stream object.

Public destructor Destroy; override;
 
Public function Readln: string;

Read next line from Stream. Returned string does not contain any end-of-line characters.

Public function Eof: boolean;
 

Generated by PasDoc 0.12.1 on 2013-02-04 20:26:49