Oberon ||
Library ||
Module Index ||
Search Engine ||
Definition ||
Module
Ulm's Oberon Library:
Texts
NAME
Texts - in-memory streams
SYNOPSIS
CONST posBeyondCurrentLength = 0;
CONST invalidTruncPos = 1;
CONST errors = 2;
TYPE ErrorEvent = POINTER TO ErrorEventRec;
TYPE ErrorEventRec =
RECORD
(Events.EventRec)
errorcode: SHORTINT;
END;
VAR errormsg: ARRAY errors OF Events.Message;
VAR error: Events.EventType;
TYPE Text = POINTER TO TextRec;
TYPE TextRec = RECORD (Streams.StreamRec) END;
PROCEDURE Open(VAR text: Streams.Stream);
DESCRIPTION
Texts
realizes in-memory streams which can be utilized as dynamic strings.
Texts
supports all operations of Streams but
does not permit holes.
Open
opens a buffered in-memory stream for reading and writing.
The returned stream is of type Texts.Text.
DIAGNOSTICS
By default, error events for text streams are
being queued.
Write operations fail never and
read operations return FALSE only at the end
of the current text buffer.
Seek and trunc positions may fail due to invalid positions:
- posBeyondCurrentLength
-
Negative seek positions and positions beyond the
current length are invalid
because Texts does not support holes.
- invalidTruncPos
-
The trunc position must be non-negative and
the current position must not be subject to a trunc operation.
SEE ALSO
- RelatedEvents
-
error handling
- Streams
-
stream operations
- Strings
-
string to stream conversions
Edited by: borchert, last change: 2003/07/10, revision: 1.4, converted to HTML: 2003/07/10
Oberon ||
Library ||
Module Index ||
Search Engine ||
Definition ||
Module