RopeFile.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Russ Atkinson, February 5, 1985 2:15:26 pm PST
DIRECTORY
FS USING [OpenFile],
IO USING [STREAM],
Rope USING [ROPE];
RopeFile: CEDAR DEFINITIONS = BEGIN OPEN IO, Rope;
Create: PROC [name: ROPE, start: INT ← 0, len: INTLAST[INT], bufSize: INT ← 512, buffers: NAT ← 4, raw: BOOLTRUE] RETURNS [rope: ROPE];
Create makes a new ROPE from the specified subrope of the named file. It will open the named file, and hold a read lock on that file until the rope becomes inaccessible! If raw, then Tioga formatting will be part of the created rope. Create can raise FS.Error when attempting to open the given file.
FromStream: PROC [stream: STREAM, start: INT ← 0, len: INTLAST[INT], bufSize: INT ← 512, buffers: NAT ← 4] RETURNS [rope: ROPE];
Just like Create, except that it takes an open stream as the file rather than opening a file.
SubstrCreate: PROC [name: ROPE, start: INT ← 0, len: INTLAST[INT]] RETURNS [rope: ROPE];
Equivalent to Create[name, start, len].
SimpleCreate: PROC [name: ROPE] RETURNS [rope: ROPE];
Equivalent to Create[name].
FileFromRope: PROC [rope: ROPE] RETURNS [FS.OpenFile];
Returns the file (if any) used by the given rope. NIL if the given rope does not directly depend on a RopeFile ROPE.
END.
Russ Atkinson (RRA) January 29, 1985 6:31:15 pm PST
Removed AppendChars (use Rope.AppendChars instead)