Class AStandardInputStream

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type AStandardInputStream = class(AStream)

Description

This class allows access to stdin as though it was a file stream. The class does not support writing or seeking and will fail silently if these operations are attempted. The primary reason for this class to exist is to allow console input to be used by any class that supports reading from an arbitrary stream.

Note that if you want to read text from this stream, you must create an instance of ATextInputStream that wraps around it.

Hierarchy

Overview

Fields

Protected myPosition: TStreamOffset;

Methods

Public function init: boolean; override;
Public function read(const count: TStreamIOSize; var dest): TStreamIOSize; override;
Public function write(const count: longword; const source): TStreamIOSize; override;
Public function position: TStreamOffset; override;
Public function setPosition(newPosition: TStreamOffset): TStreamOffset; override;
Public function length: TStreamLength; override;

Description

Fields

Protected myPosition: TStreamOffset;

Stores the current position within the stream

Methods

Public function init: boolean; override;

Initializer

Public function read(const count: TStreamIOSize; var dest): TStreamIOSize; override;

Read count bytes from the stream and store them in dest. See AStream.read for more information on this method.

Returns

The total number of bytes read from the stream.

Public function write(const count: longword; const source): TStreamIOSize; override;

Write count bytes from source to the stream.

This method fails silently for this class and will always return zero (0).

Public function position: TStreamOffset; override;

Retrieve the current position within the stream. This value is simply the number of bytes that have been read from the stream since it was created; for AStandardInputStream, therefore, it is always the same value as AStandardInputStream.length.

Public function setPosition(newPosition: TStreamOffset): TStreamOffset; override;

Set the current position within the stream.

This method fails silently for this class and will simply return the same value as AStandardInputStream.position.

Public function length: TStreamLength; override;

Retrieve the size of the stream, in bytes. This value is simply the number of bytes that have been read from the stream since it was created.


Generated by PasDoc 0.13.0 on 2015-01-10 17:13:18