Class AStandardOutputStream

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type AStandardOutputStream = class(AStream)

Description

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

Note that if you want to print text using this stream, you must create an instance of ATextOutputStream 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: TStreamIOSize; 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.

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

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

Write count bytes from source to the stream. See AStream.write for more information on this method.

Returns

The total number of bytes written to the stream.

Public function position: TStreamOffset; override;

Retrieve the current position within the stream. This value is simply the number of bytes that have been written to the stream since it was created; for AStandardOutputStream, therefore, it is always the same value as AStandardOutputStream.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 AStandardOutputStream.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 written to the stream since it was created.


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