Oberon || Library || Module Index || Search Engine || Definition || Module
CONST noSeek = 0; noLength = 1; errors = 2; TYPE ErrorEvent = POINTER TO ErrorEventRec; TYPE ErrorCode = SHORTINT; TYPE ErrorEventRec = RECORD (Events.EventRec) errorcode: ErrorCode; END; VAR error: Events.EventType; VAR errormsg: ARRAY errors OF Events.Message;
TYPE OpenProc = PROCEDURE (VAR s: Streams.Stream; base: Streams.Stream; from, length: Streams.Count; errors: RelatedEvents.Object) : BOOLEAN;
PROCEDURE Register(type: Services.Type; open: OpenProc);
PROCEDURE Open(VAR s: Streams.Stream; base: Streams.Stream; from, length: Streams.Count; errors: RelatedEvents.Object) : BOOLEAN;
PROCEDURE Supported(s: Streams.Stream) : BOOLEAN; PROCEDURE DirectlySupported(s: Streams.Stream) : BOOLEAN;
PROCEDURE Join(VAR s: Streams.Stream; s1, s2: Streams.Stream; errors: RelatedEvents.Object) : BOOLEAN;
Open creates a stream which represents the subrange [from..from+length) of base which will be mapped to [0..length) on s. Note that s works in general as filter object of base, i.e. all other operations may be forwarded as well (if supported by Forwarders).
Supported allows to check whether a stream may be passed as base stream to Open. DirectlySupported returns TRUE if substreams are directly supported by the implementation of s, i.e. SubStreams needs not to create a stream on base of Maps for s as base stream.
Join returns a stream which accesses s1 and s2 in a concatenated way. If s1 and s2 are neighbouring substreams of the the same base stream, Join will create a new substream directly from the common base stream -- otherwise s1 and s2 will be tied together by Maps.
Register registers a specific implementation for the given type (which must be an extension of Streams.Stream) and all extensions thereof if not overridden by more specific calls). Note that the opening procedure needs not to call Forwarders.Forward -- this will be done by SubStreams.
Register checks its parameter for validity in form of assertions.
Oberon || Library || Module Index || Search Engine || Definition || Module