tos - Text output stream

Module Description

The tos module implements a text output stream. It extends the str module, so all words from the str module, can be used on the tos data structure. The data written to the stream is always appended. Alignment is normally done for the last written data. By using the start alignment pointers words the start of the alignment can be changed. The end of the alignment is always the end of the stream.

Module Words

Output stream structure

tos% ( - n )
Get the required space for the tos data structure

Output stream creation, initialisation and destruction

tos-init ( w:tos - )
Initialise the empty output stream

tos-create ( C: "name" - R: - w:tos )
Create a named output stream in the dictionary

tos-new ( - w:tos )
Create a new output stream on the heap

tos-free ( w:tos - )
Free the output stream from the heap

Stream words

tos-rewrite ( w:tos - )
Rewrite the output stream

Alignment start pointer words

tos-pntr@ ( w:tos - u )
Get the current alignment start pointer

tos-pntr! ( n w:tis - f )
Set the alignment pointer from start [n>=0] or from end [n<0]

tos-pntr+! ( n w:tis - f )
Add an offset to the alignment pointer

Write data words

tos-write-char ( c w:tos - )
Write character to the stream

tos-write-chars ( c u w:tos - )
Write u characters to the stream

tos-write-string ( c-addr u w:tos - )
Write string to the stream

tos-write-line ( w:tos - )
Write end-of-line from config to the stream, not alignable

tos-write-number ( n w:tos - )
Write a number in the current base to the stream

tos-write-double ( d w:tos - )
Write a double in the current base to the stream

Alignment words

tos-align ( c:pad u:trailing u:leading w:tos - )
Align the previous written data

tos-align-left ( c:pad u:width w:tos - )
Align left the previous written data

tos-align-right ( c:pad u:width w:tos - )
Align right the previous written data

tos-center ( c:pad u:width w:tos - )
Center the previous written data

Inspection

tos-dump ( w:tos - )
Dump the text output stream


generated 09-Jan-2007 by ofcfrth-0.2.0