Qore Programming Language Reference Manual 1.19.2
|
This class allows Qore scripts to get or set terminal settings on UNIX platforms. More...
#include <QC_TermIOS.dox.h>
Public Member Methods | |
constructor () | |
Creates the TermIOS object with random contents. More... | |
copy () | |
Returns a copy of the object. More... | |
int | getCC (softint cc) |
Returns the integer value for the given control character from the given control character code. More... | |
int | getCFlag () |
Returns the control mode flag for the object. More... | |
int | getIFlag () |
Returns the input mode flag for the object. More... | |
int | getLFlag () |
Returns the local mode flag for the object. More... | |
int | getOFlag () |
Returns the output mode flag for the object. More... | |
bool | isEqual (Termios termios) |
Returns True if the TermIOS object passed as an argument is equal to the current object; False if not. More... | |
nothing | setCC (softint offset, softint value) |
Sets the value of the given control character. More... | |
nothing | setCFlag (softint flag) |
Sets the control mode flag for the object from a mask of Terminal Attribute Control Mode Constants. More... | |
nothing | setIFlag (softint flag) |
Sets the input mode flag for the object from a mask of Terminal Attributes Input Mode Constants. More... | |
nothing | setLFlag (softint flag) |
Sets the local mode flag for the object from a mask of Terminal Attribute Local Mode Constants. More... | |
nothing | setOFlag (softint flag) |
Sets the output mode flag for the object from a mask of Terminal Attributes Output Mode Constants. More... | |
Static Public Member Methods | |
static hash | getWindowSize () |
Returns a hash giving the current terminal window size in hash keys "rows" and "columns" . More... | |
This class allows Qore scripts to get or set terminal settings on UNIX platforms.
On platforms without TermIOS support (such as Windows), none of the methods in this class are available; to write a portable program, check the Qore::Option::HAVE_TERMIOS constant at runtime before using this functionality.
This class contains the data structure used to read and set terminal attributes on terminal I/O constants (stdin, stdout, stderr).
This class is used with File::getTerminalAttributes(), File::setTerminalAttributes(), and the terminal I/O constants to manipulate terminal attributes.
For example, here is some code to set terminal attributes, read in a character from standard input with a timeout, and reset the terminal attributes:
For more information on terminal attributes, see your system's manual pages for "termios".
Qore::TermIOS::constructor | ( | ) |
Creates the TermIOS object with random contents.
Use File::getTerminalAttributes() with a terminal I/O constant to initialize the object with terminal settings
Qore::TermIOS::copy | ( | ) |
Returns a copy of the object.
int Qore::TermIOS::getCC | ( | softint | cc | ) |
Returns the integer value for the given control character from the given control character code.
cc | the control character code for the character to retrieve |
TERMIOS-CC-ERROR | the control character is invalid |
int Qore::TermIOS::getCFlag | ( | ) |
Returns the control mode flag for the object.
int Qore::TermIOS::getIFlag | ( | ) |
Returns the input mode flag for the object.
int Qore::TermIOS::getLFlag | ( | ) |
Returns the local mode flag for the object.
int Qore::TermIOS::getOFlag | ( | ) |
Returns the output mode flag for the object.
|
static |
Returns a hash giving the current terminal window size in hash keys "rows"
and "columns"
.
"rows"
and "columns"
bool Qore::TermIOS::isEqual | ( | Termios | termios | ) |
Returns True if the TermIOS object passed as an argument is equal to the current object; False if not.
nothing Qore::TermIOS::setCC | ( | softint | offset, |
softint | value | ||
) |
Sets the value of the given control character.
offset | the control character to set |
value | the value to set for the control character |
TERMIOS-CC-ERROR | the control character is invalid |
nothing Qore::TermIOS::setCFlag | ( | softint | flag | ) |
Sets the control mode flag for the object from a mask of Terminal Attribute Control Mode Constants.
flag | the control mode (see Terminal Attribute Control Mode Constants for masks for this value) |
nothing Qore::TermIOS::setIFlag | ( | softint | flag | ) |
Sets the input mode flag for the object from a mask of Terminal Attributes Input Mode Constants.
flag | the input mode flag for the object from a mask of Terminal Attributes Input Mode Constants |
nothing Qore::TermIOS::setLFlag | ( | softint | flag | ) |
Sets the local mode flag for the object from a mask of Terminal Attribute Local Mode Constants.
flag | the local mode (see Terminal Attribute Local Mode Constants for masks for this value) |
nothing Qore::TermIOS::setOFlag | ( | softint | flag | ) |
Sets the output mode flag for the object from a mask of Terminal Attributes Output Mode Constants.
flag | the output mode (see Terminal Attributes Output Mode Constants for masks for this value) |