Class TBrookStreamReader

Unit

Declaration

type TBrookStreamReader = class(TBrookTextReader)

Description

Line reader which uses stream as source of lines.

Hierarchy

Overview

Methods

Public constructor Create(AEncoding: TEncoding; AStream: TStream; ABufferSize: Cardinal; AOwnsStream: Boolean); reintroduce; overload; virtual;
Public constructor Create(AEncoding: TEncoding; AStream: TStream); reintroduce; overload; virtual;
Public constructor Create(AStream: TStream); reintroduce; overload; virtual;
Public destructor Destroy; override;
Public procedure Reset; override;
Public procedure Close; override;
Public function IsEOF: Boolean; override;
Public procedure ReadBytes(out ALine: TBytes); overload; override;
Public function ReadBytes: TBytes; overload; override;
Public procedure Read(out ALine: string); overload; override;
Public function Read: string; overload; override;

Properties

Public property Stream: TStream read GetStream;
Public property OwnsStream: Boolean read GetOwnsStream write SetOwnsStream;

Description

Methods

Public constructor Create(AEncoding: TEncoding; AStream: TStream; ABufferSize: Cardinal; AOwnsStream: Boolean); reintroduce; overload; virtual;

Creates an instance of TBrookStreamReader

Parameters
AEncoding[in]
Character encoding determined during reading.
AStream[in]
Stream to be read line by line.
ABufferSize[in]
Buffer size for the line reading.
AOwnsStream[in]
If True the stream is freed on Destroy.
Public constructor Create(AEncoding: TEncoding; AStream: TStream); reintroduce; overload; virtual;

Creates an instance of TBrookStreamReader

Parameters
AEncoding[in]
Character encoding determined during reading.
AStream[in]
Stream to be read line by line.
Public constructor Create(AStream: TStream); reintroduce; overload; virtual;

Creates an instance of TBrookStreamReader

Parameters
AStream[in]
Stream to be read line by line.
Public destructor Destroy; override;

Destroys an instance of TBrookStreamReader.

Public procedure Reset; override;

Resets the cursor to the beginning of the stream.

Public procedure Close; override;

Frees the stream if property OwnsStream is True.

Public function IsEOF: Boolean; override;

Checks if the reader has reached the End-Of-File.

Returns

True if the stream has reached the End-Of-File.

Public procedure ReadBytes(out ALine: TBytes); overload; override;

Reads a line as bytes.

Parameters
ALine[out]
Line read as bytes.
Public function ReadBytes: TBytes; overload; override;

Reads a line returning it as bytes.

Returns

Line read as bytes.

Public procedure Read(out ALine: string); overload; override;

Reads a line as static string.

Parameters
ALine[out]
read as static string.
Public function Read: string; overload; override;

Read a line returning it as a static string.

Returns

Line read as static string.

Properties

Public property Stream: TStream read GetStream;

Source stream containing the lines to be read.

Public property OwnsStream: Boolean read GetOwnsStream write SetOwnsStream;

If True the stream is freed on Destroy.


Generated by PasDoc 0.16.0.