ToFile:
PROC [fileName:
ROPE, node: Ref, start: Offset ← 0, textOnly:
BOOL ←
FALSE]
RETURNS [dataLen, count: Offset];
ToFileC:
PROC [file: File.Capability, node: Ref, start: Offset ← 0, textOnly:
BOOL ←
FALSE]
RETURNS [dataLen, count: Offset];
write the node on the specified file
starts writing at given address in file
returns dataLen = number of data bytes at start of file,
and count = the total number of bytes written
FromFile:
PROC [fileName:
ROPE, start: Offset ← 0, len: Offset ← MaxLen]
RETURNS [Ref];
FromFileC:
PROC [file: File.Capability, start: Offset ← 0, len: Offset ← MaxLen]
RETURNS [Ref];
create node from the contents of a file
starts reading at given start address in file
pretends that start+len is the end of the file
if file was not created by ToFile (i.e., password not correct)
then returns a simple document containing the ASCII contents of the file
WriteMesaFilePlain:
PROC [fileName:
ROPE, root: RefBranchNode];
This is like WriteFilePlain, but adds initial dashes to comments if necessary.
WriteFilePlain:
PROC [fileName:
ROPE, root: RefBranchNode];
WriteFileCPlain:
PROC [file: File.Capability, root: RefBranchNode];
gives text of file with CR after each node and TABs before according to nesting
ToRope:
PROC [node: Ref, textOnly:
BOOLEAN ←
FALSE]
RETURNS [dataLen, count: Offset, output: ROPE];
resulting rope contains same representation of node as would be put on file
FromRope:
PROC [rope:
ROPE, start: Offset ← 0, len: Offset ← MaxLen]
RETURNS [Ref];
reads rope to construct node
WriteRopePlain: PROC [node: RefBranchNode] RETURNS [output: ROPE];
IO Operations
ToStream:
PROC [stream:
IO.Handle, node: Ref, textOnly:
BOOL ←
FALSE]
RETURNS [dataLen, count: Offset];
does a series of IO.PutBlock's
returns number of bytes written
FromStream:
PROC [stream:
IO.Handle, len: Offset ← MaxLen]
RETURNS [Ref];
reads up to len chars from stream (via GetBlock's) to construct a node