OutputStream class | output.t[197]

Output Stream. This class provides a stream-oriented interface to displaying text on the console. "Stream-oriented" means that we write text as a sequential string of characters.

Output streams are always transient, since they track the system user interface in the interpreter. The interpreter does not save its UI state with a saved position, so objects such as output streams that track the UI state should not be saved either.

`class OutputStream : PreinitObject`

Superclass Tree (in declaration order)

`OutputStream`
`PreinitObject`
`ModuleExecObject`
`object`

Subclass Tree

`OutputStream`
`BannerOutputStream`
`LogConsole`
`WebWinOutputStream`

Global Objects

`mainOutputStream menuOutputStream statusLeftOutputStream statusRightOutputStream statusTagOutputStream`

Summary of Properties

`filterList_ justDidPara justDidParaSuppressor myInputManager prefix`

Inherited from `PreinitObject` :
`execBeforeMe reverseGlobalSymbols`

Inherited from `ModuleExecObject` :
`execAfterMe hasInitialized_ isDoingExec_ isExecuted_`

Summary of Methods

`addOutputFilter addOutputFilterBelow applyFilters applyTextFilters captureOutput captureOutputIgnoreExit construct execute inputLineEnd removeOutputFilter setPrefix watchForOutput writeFromStream writeToStream`

``

Inherited from `ModuleExecObject` :
`_execute classExec`

Properties

`filterList_` | `output.t[426]`

The list of active filters on this stream, in the order in which they are to be called. This should normally be initialized to a Vector in each instance.

`justDidPara` | `output.t[546]`

Internal state: we just wrote a paragraph break, and there has not yet been any intervening text. By default, we set this to true initially, so that we suppress any paragraph breaks at the very start of the text.

`justDidParaSuppressor` | `output.t[554]`

Internal state: we just wrote a character that suppresses paragraph breaks that immediately follow. In this state, we'll suppress any paragraph marker that immediately follows, but we won't suppress any other characters.

`myInputManager` | `output.t[385]`

my associated input manager, if I have one

`prefix` | `output.t[557]`

Text to be output before anything else

Methods

`addOutputFilter (filter)` | `output.t[436]`

Add an output filter. The argument is an object of class OutputFilter, or any object implementing the filterText() method.

Filters are always arranged in a "stack": the last output filter added is the first one called during output. This method thus adds the new filter at the "top" of the stack.

`addOutputFilterBelow (newFilter, existingFilter)` | `output.t[451]`

Add an output filter at a given point in the filter stack: add the filter so that it is "below" the given existing filter in the stack. This means that the new filter will be called just after the existing filter during output.

If 'existingFilter' isn't in the stack of existing filters, we'll add the new filter at the "top" of the stack.

`applyFilters (val)` | `output.t[491]`

call the filters

`applyTextFilters (val)` | `output.t[511]`

Apply the current set of text transformation filters to a string. This applies only the non-capturing filters; we skip any capture filters.

`captureOutput (func, [args])` | `output.t[310]`

Call the given function, capturing all text output to this stream in the course of the function call. Return a string containing the captured text.

`captureOutputIgnoreExit (func, [args])` | `output.t[339]`

A Version of captureOutput that ignores an Exit Exception. This can be used to attempt to retrieve the string value of an output filter that threw an exit exeption.

`construct ( )` | `output.t[388]`

dynamic construction

`execute ( )`OVERRIDDEN | `output.t[398]`

execute pre-initialization

`inputLineEnd ( )` | `output.t[534]`

Receive notification from the input manager that we have just ended reading a line of input from the keyboard.

`removeOutputFilter (filter)` | `output.t[477]`

Remove an output filter. Since filters are arranged in a stack, only the LAST output filter added may be removed. It's an error to remove a filter other than the last one.

`setPrefix (txt)` | `output.t[560]`

Set the prefix to txt

`watchForOutput (func)` | `output.t[261]`

Watch the stream for output. It's sometimes useful to be able to call out to some code and determine whether or not the code generated any text output. This routine invokes the given callback function, monitoring the stream for output; if any occurs, we'll return true, otherwise we'll return nil.

`writeFromStream (txt)` | `output.t[419]`

Write text out from this stream; this writes to the lower-level stream underlying this stream. This routine is intended to be called only from within this class.

Each output stream is conceptually "stacked" on top of another, lower-level stream. At the bottom of the stack is usually some kind of physical device, such as the display, or a file on disk.

This method must be defined in each subclass to write to the appropriate underlying stream. Most subclasses are specifically designed to sit atop a system-level stream, such as the display output stream, so most implementations of this method will call directly to a system-level output function.

`writeToStream (val)` | `output.t[204]`

Write a value to the stream. If the value is a string, we'll display the text of the string; if it's nil, we'll ignore it; if it's anything else, we'll try to convert it to a string (with the toString() function) and display the resulting text.

Adv3Lite Library Reference Manual
Generated on 13/06/2025 from adv3Lite version 2.2.1