#import <CharacterLineFilter.h>
Inherited by ANSICharLineFilter, DefaultLineFilter, EscapeLineFilter, XTermAltCharLineFilter, and XTermEscapeLineFilter.
Inheritance diagram for CharacterLineFilter:


CharacterLineFilter is an abstract base class for filters that turn character sequences into terminal commands. The controller that receives data from the host (MyDocument in Crescat) passes the incoming data to the current filter object (a CharacterLineFilter subclass) which passes it to the terminal model (TextStorageTerminal) either as characters to be rendered, or as commands.
CharacterLineFilters stack; there is a default filter that represents the responses to characters the terminal makes when in its initial state, but a command from the host (an escape character is the common example) may throw the terminal into a state in which characters have a different interpretation. For each such state, stack up a corresponding subclass of CharacterLineFilter, with the current filter as the fallback. Handling the transient state causes the filter to be popped off and released (releaseToFallback). Some inputs pop all filters off down to the default filter (releaseToDefault).
Definition at line 23 of file CharacterLineFilter.h.
Public Member Functions | |
| (id) | - initWithFallback: |
| Initialize and stack over the given CharacterLineFilter. | |
| (id) | - initWithFallback:terminal: |
| Designated initializer: Stack over the given CharacterLineFilter, using the given terminal. | |
| (id) | - processCharacter: |
| Process one character of input. | |
| (id) | - processData: |
| Process many characters of input. | |
| (id) | - releaseToFallback |
| Release the receiver and return the next filter on the stack. | |
| (id) | - resetToDefault |
| Release all filters down to the default; return default. | |
| (id) | - terminalDevice |
| Getter for the target terminal device. | |
| (void) | - dealloc [implementation] |
| (BOOL) | - isRootFilter [implementation] |
| Whether this is the default filter (no fallback below it). | |
Protected Attributes | |
| CharacterLineFilter * | fallback |
| id | terminalDevice |
|
|
Definition at line 33 of file CharacterLineFilter.m. References fallback. |
|
|
Initialize and stack over the given CharacterLineFilter. This is a convenience initializer, which uses the same terminal object as the fallback filter.
Definition at line 28 of file CharacterLineFilter.m. References initWithFallback:terminal:. Here is the call graph for this function: ![]() |
|
||||||||||||
|
Designated initializer: Stack over the given CharacterLineFilter, using the given terminal. Keep the result of this initializer as the top of the line-filter stack, and feed data from the host to it (processCharacter: / processData:). Data will be translated into events, and corresponding messages will be sent to the terminal. It is thought to be an error to enqueue the same filter twice in a row. If the receiver is of the same class as the inFallback filter, the receiver will be released and inFallback will be returned (thus ensuring that the returned value is always the proper top-of-stack). This stack-folding is noted in the console log.
Reimplemented in EscapeLineFilter, and XTermEscapeLineFilter. Definition at line 14 of file CharacterLineFilter.m. References fallback, and terminalDevice. Referenced by initWithFallback:, and DefaultLineFilter::initWithTerminal:. Here is the call graph for this function: ![]() |
|
|
Whether this is the default filter (no fallback below it).
Definition at line 40 of file CharacterLineFilter.m. References fallback. Referenced by resetToDefault. |
|
|
Process one character of input. Given one character from the host, respond by passing it to the terminal, changing the terminal state, or changing line filters. If the result involves a new line filter, this method allocates it and stacks it on top of the receiver. The filter for the next character is returned, so always update the filter-stack variable with the result of this method.
Reimplemented in ANSICharLineFilter, DefaultLineFilter, EscapeLineFilter, XTermAltCharLineFilter, and XTermEscapeLineFilter. Definition at line 67 of file CharacterLineFilter.m. |
|
|
Process many characters of input. This method iterates through the bytes of the given NSData, sending the first in a processCharacter: message to the receiver, and the succeeding ones to whatever line filter is top. The filter for the next character is returned, so always update the filter-stack variable with the result of this method.
Reimplemented in DefaultLineFilter. Definition at line 72 of file CharacterLineFilter.m. Referenced by MyDocument::dataArrivedFromPty:. |
|
|
Release the receiver and return the next filter on the stack. This method is sent by the filter itself when it reaches end-of-state. End-of-state means that the filter is spent, and must be released; and the previous top-of-stack filter becomes top-of-stack again.
Definition at line 47 of file CharacterLineFilter.m. References fallback. Referenced by resetToDefault. |
|
|
Release all filters down to the default; return default. Sends releaseToFallback to self, and to the results, until the result is the root filter (isRootFilter). A command, like a general reset, may terminate all character modes. This message takes all the character modes but the default off the handler stack and returns the default. Definition at line 58 of file CharacterLineFilter.m. References isRootFilter, and releaseToFallback. Here is the call graph for this function: ![]() |
|
|
Getter for the target terminal device.
Referenced by initWithFallback:terminal:. |
|
|
Definition at line 25 of file CharacterLineFilter.h. Referenced by dealloc, initWithFallback:terminal:, isRootFilter, and releaseToFallback. |
|
|
Definition at line 26 of file CharacterLineFilter.h. Referenced by DefaultLineFilter::processCharacter:, and DefaultLineFilter::processData:. |
1.4.4