Object
Module with library wide abstract interface types.
Const
SeekSet* = Const.SeekSet;
SeekCur* = Const.SeekCur;
SeekEnd* = Const.SeekEnd;
StreamOK* = Const.StreamOK;
StreamNotImplementedError* = Const.StreamNotImplementedError;
StreamNotOpenError* = Const.StreamNotOpenError;
StreamReadError* = Const.StreamReadError;
StreamWriteError* = Const.StreamWriteError;
Types
Stream* = POINTER TO StreamDesc;
StreamDesc* = RECORD
error* : LONGINT;
END;
Procedures
Stream.HasError
PROCEDURE (s : Stream) HasError*(): BOOLEAN;
Stream.LastError
Return last error code or StreamOK if no error is set.
PROCEDURE (s : Stream) LastError*(): LONGINT;
Stream.ClearError
Clear error status to StreamOK.
PROCEDURE (s : Stream) ClearError*();
Stream.ReadBytes
Read bytes into buffer with optional start and length.
PROCEDURE (s : Stream) ReadBytes*(VAR buffer : ARRAY OF SYSTEM.BYTE; start := 0 : LONGINT; length := - 1 : LONGINT): LONGINT;
Stream.ReadByte
Read BYTE value. Return TRUE if success.
PROCEDURE (s : Stream) ReadByte*(VAR value : SYSTEM.BYTE): BOOLEAN;
Stream.ReadChar
Read CHAR value. Return TRUE if success.
PROCEDURE (s : Stream) ReadChar*(VAR value : CHAR): BOOLEAN;
Stream.ReadInteger
Read INTEGER value. Return TRUE if success.
PROCEDURE (s : Stream) ReadInteger*(VAR value : INTEGER): BOOLEAN;
Stream.ReadLongInt
Read LONGINT value. Return TRUE if success.
PROCEDURE (s : Stream) ReadLongInt*(VAR value : LONGINT): BOOLEAN;
Stream.ReadReal
Read REAL value. Return TRUE if success.
PROCEDURE (s : Stream) ReadReal*(VAR value : REAL): BOOLEAN;
Stream.ReadLongReal
Read LONGREAL value. Return TRUE if success.
PROCEDURE (s : Stream) ReadLongReal*(VAR value : LONGREAL): BOOLEAN;
Stream.ReadLine
Read line to EOL mark or EOF mark. STRING possible reallocated to contain whole line if needed. Return TRUE if success.
PROCEDURE (s : Stream) ReadLine*(VAR value : Type.STRING): BOOLEAN;
Stream.WriteBytes
Write bytes from buffer with optional start and length.
PROCEDURE (s : Stream) WriteBytes*(buffer- : ARRAY OF SYSTEM.BYTE; start := 0 : LONGINT; length := - 1 : LONGINT): LONGINT;
Stream.WriteByte
Write BYTE value. Sets error to StreamWriteError on failure.
PROCEDURE (s : Stream) WriteByte*(value : SYSTEM.BYTE);
Stream.WriteChar
Write CHAR value. Sets error to StreamWriteError on failure.
PROCEDURE (s : Stream) WriteChar*(value : CHAR);
Stream.WriteInteger
Write INTEGER value. Sets error to StreamWriteError on failure.
PROCEDURE (s : Stream) WriteInteger*(value : INTEGER);
Stream.WriteLongInt
Write LONGINT value. Sets error to StreamWriteError on failure.
PROCEDURE (s : Stream) WriteLongInt*(value : LONGINT);
Stream.WriteReal
Write REAL value. Sets error to StreamWriteError on failure.
PROCEDURE (s : Stream) WriteReal*(value : REAL);
Stream.WriteLongReal
Write LONGREAL value. Sets error to StreamWriteError on failure.
PROCEDURE (s : Stream) WriteLongReal*(value : LONGREAL);
Stream.WriteString
Write ARRAY OF CHAR value to NULL byte or length of array. Sets error to StreamWriteError on failure.
PROCEDURE (s : Stream) WriteString*(value- : ARRAY OF CHAR);
Stream.WriteNL
Write platforms newline value to stream. Sets error to StreamWriteError on failure.
PROCEDURE (s : Stream) WriteNL*();
Stream.WriteStream
Write Stream src to stream. Sets error to StreamWriteError on failure.
PROCEDURE (s : Stream) WriteStream*(src : Stream);
Stream.Format
Writes formatted string according to fmt definition and arguments. Reference Format module for further details. Sets error to StreamWriteError on failure.
PROCEDURE (s : Stream) Format*(fmt- : ARRAY OF CHAR; SEQ seq: SYSTEM.BYTE);
Stream.FormatInteger
Writes formatted string from LONGLONGINT value. This is a separate procedure for handling 64bit values due to a limitation in the XDS compiler. Reference Format module for further details. Sets error to StreamWriteError on failure.
PROCEDURE (s : Stream) FormatInteger*(value : LONGLONGINT; width := 0 : LONGINT; flags := {} : SET);
Stream.FormatCardinal
Writes formatted string from CARD64 value. This is a separate procedure for handling 64bit values due to a limitation in the XDS compiler. Reference Format module for further details. Sets error to StreamWriteError on failure.
PROCEDURE (s : Stream) FormatCardinal*(value : SYSTEM.CARD64; base := 10 : INTEGER; width := 0 : LONGINT; flags := {} : SET);
Stream.Seek
Offsets or set the current location depending on the mode argument:
SeekSet : sets position relative to start of stream.
SeekCur : sets position relative to current position of stream.
SeekEnd : sets position relative to end position of stream (only negative offset values makes sense).
Return new position or -1 in case of failure.
PROCEDURE (s : Stream) Seek*(offset : LONGINT; mode := SeekSet : INTEGER): LONGINT;
Stream.Tell
Return current position or -1 on failure.
PROCEDURE (s : Stream) Tell*(): LONGINT;
Stream.Truncate
Truncates or extends stream to new size. Return new size or -1 in case of failure.
PROCEDURE (s : Stream) Truncate*(size : LONGINT): LONGINT;
Stream.Flush
Flush buffers
PROCEDURE (s : Stream) Flush*();
Stream.Close
Close Stream
PROCEDURE (s : Stream) Close*();
Stream.Closed
Return TRUE if Stream is closed
PROCEDURE (s : Stream) Closed*(): BOOLEAN;
Stream.IsTTY
Return TRUE if Stream is a TTY
PROCEDURE (s : Stream) IsTTY*(): BOOLEAN;
Stream.Readable
Return TRUE if Stream is readable
PROCEDURE (s : Stream) Readable*(): BOOLEAN;
Stream.Writeable
Return TRUE if Stream is writeable
PROCEDURE (s : Stream) Writeable*(): BOOLEAN;
Stream.Seekable
Return TRUE if Stream is seekable
PROCEDURE (s : Stream) Seekable*(): BOOLEAN;