Unit ConsoleUnit

Description

Provides utilities for managing a separate-thread console input/output interface.

This unit implements the TConsoleReaderThread class, which runs a separate thread to handle console input (stdin) and provides methods for writing to the console (stdout). It is designed to allow visual applications (like TForms) to interact with a background console.

Overview

Classes, Interfaces, Objects and Records

Name Description
Interface IConsoleInputHandler Interface to handle console input received by the worker thread.
Class TConsoleReaderThread A thread class dedicated to creating and managing a separate Windows console for input/output.

Types

TLevelLog = (...);
TLevelLogArray = array[TLevelLog] of String;
TConsolePosMode = (...);

Constants

LevelLogArray: TLevelLogArray = ('Notice', 'Warning', 'Error', 'Info', 'Debug', 'Log');

Description

Types

TLevelLog = (...);

Specifies the log level for console messages.

Values
  • csNoticeLog
  • csWarningLog
  • csErrorLog
  • csInfoLog
  • csDebugLog
  • csLog
TLevelLogArray = array[TLevelLog] of String;

Array type for mapping TLevelLog to strings.

TConsolePosMode = (...);
 
Values
  • cpmDefault
  • cpmFollowMain
  • cpmSpecificMonitor

Constants

LevelLogArray: TLevelLogArray = ('Notice', 'Warning', 'Error', 'Info', 'Debug', 'Log');

String representations for TLevelLog values. Used primarily in the log entry formatting by TConsoleReaderThread.CSWriteLogEntryUTC.