Create:
PROC [
name: ROPE, start: INT ← 0, len: INT ← LAST[INT],
bufSize: INT ← 512, buffers: NAT ← 4, raw: BOOL ← TRUE]
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: INT ← LAST[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:
INT ←
LAST[
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.
AppendChars:
PROC
[buffer: REF TEXT, rope: ROPE, start: INT ← 0, len: INT ← LAST[INT]]
RETURNS [charsMoved: NAT];
Appends characters from the given rope (which need not be a RopeFile rope) onto the specified buffer. The move will stop at the end of the specified subrope OR end of the rope OR the end of the buffer. It is the user's responsibility to determine if enough characters have been moved. A BoundsFault will occur if start NOT IN [0..rope.Length[]].