|
LLDB mainline
|
#include <Terminal.h>
Classes | |
| struct | Data |
Public Types | |
| enum class | Parity { No , Even , Odd , Space , Mark } |
| enum class | ParityCheck { No , ReplaceWithNUL , Ignore , Mark } |
Public Member Functions | |
| Terminal (int fd=-1) | |
| ~Terminal ()=default | |
| bool | IsATerminal () const |
| int | GetFileDescriptor () const |
| void | SetFileDescriptor (int fd) |
| bool | FileDescriptorIsValid () const |
| void | Clear () |
| llvm::Error | SetEcho (bool enabled) |
| llvm::Error | SetCanonical (bool enabled) |
| llvm::Error | SetRaw () |
| llvm::Error | SetBaudRate (unsigned int baud_rate) |
| llvm::Error | SetStopBits (unsigned int stop_bits) |
| llvm::Error | SetParity (Parity parity) |
| llvm::Error | SetParityCheck (ParityCheck parity_check) |
| llvm::Error | SetHardwareFlowControl (bool enabled) |
Static Public Member Functions | |
| static bool | SupportsUnicode () |
| Returns whether or not the current terminal supports Unicode rendering. | |
Protected Member Functions | |
| llvm::Expected< Data > | GetData () |
| llvm::Error | SetData (const Data &data) |
Protected Attributes | |
| int | m_fd |
Friends | |
| class | TerminalState |
Definition at line 19 of file Terminal.h.
|
strong |
| Enumerator | |
|---|---|
| No | |
| Even | |
| Odd | |
| Space | |
| Mark | |
Definition at line 21 of file Terminal.h.
|
strong |
| Enumerator | |
|---|---|
| No | |
| ReplaceWithNUL | |
| Ignore | |
| Mark | |
Definition at line 29 of file Terminal.h.
|
inline |
Definition at line 41 of file Terminal.h.
References m_fd.
|
default |
|
inline |
Definition at line 53 of file Terminal.h.
References m_fd.
|
inline |
|
protected |
Definition at line 44 of file Terminal.cpp.
References FileDescriptorIsValid(), IsATerminal(), m_fd, and termiosMissingError().
Referenced by SetBaudRate(), SetCanonical(), SetEcho(), SetHardwareFlowControl(), SetParity(), SetParityCheck(), SetRaw(), and SetStopBits().
|
inline |
Definition at line 47 of file Terminal.h.
References m_fd.
| bool Terminal::IsATerminal | ( | ) | const |
Definition at line 35 of file Terminal.cpp.
References m_fd.
Referenced by GetData(), lldb_private::IOHandlerPythonInterpreter::Run(), and SetData().
| llvm::Error Terminal::SetBaudRate | ( | unsigned int | baud_rate | ) |
Definition at line 277 of file Terminal.cpp.
References GetData(), SetData(), and termiosMissingError().
Referenced by lldb_private::SerialPort::Create().
| llvm::Error Terminal::SetCanonical | ( | bool | enabled | ) |
Definition at line 96 of file Terminal.cpp.
References GetData(), SetData(), and termiosMissingError().
Referenced by IOHandlerProcessSTDIO::Run(), and lldb_private::IOHandlerPythonInterpreter::Run().
|
protected |
Definition at line 65 of file Terminal.cpp.
References FileDescriptorIsValid(), IsATerminal(), m_fd, and termiosMissingError().
Referenced by SetBaudRate(), SetCanonical(), SetEcho(), SetHardwareFlowControl(), SetParity(), SetParityCheck(), SetRaw(), and SetStopBits().
| llvm::Error Terminal::SetEcho | ( | bool | enabled | ) |
Definition at line 80 of file Terminal.cpp.
References GetData(), SetData(), and termiosMissingError().
Referenced by IOHandlerProcessSTDIO::Run(), and lldb_private::IOHandlerPythonInterpreter::Run().
|
inline |
Definition at line 49 of file Terminal.h.
References m_fd.
| llvm::Error Terminal::SetHardwareFlowControl | ( | bool | enabled | ) |
Definition at line 383 of file Terminal.cpp.
References GetData(), SetData(), and termiosMissingError().
| llvm::Error Terminal::SetParity | ( | Terminal::Parity | parity | ) |
Definition at line 328 of file Terminal.cpp.
References GetData(), Mark, No, Odd, SetData(), Space, and termiosMissingError().
Referenced by lldb_private::SerialPort::Create().
| llvm::Error Terminal::SetParityCheck | ( | Terminal::ParityCheck | parity_check | ) |
Definition at line 361 of file Terminal.cpp.
References GetData(), Ignore, Mark, No, SetData(), and termiosMissingError().
Referenced by lldb_private::SerialPort::Create().
| llvm::Error Terminal::SetRaw | ( | ) |
Definition at line 112 of file Terminal.cpp.
References GetData(), SetData(), and termiosMissingError().
Referenced by lldb_private::SerialPort::Create().
| llvm::Error Terminal::SetStopBits | ( | unsigned int | stop_bits | ) |
Definition at line 303 of file Terminal.cpp.
References GetData(), SetData(), and termiosMissingError().
Referenced by lldb_private::SerialPort::Create().
|
static |
Returns whether or not the current terminal supports Unicode rendering.
The value is cached after the first computation.
On POSIX systems, we check if the LANG environment variable contains the substring "UTF-8", case insensitive.
On Windows, we always return true since we use the WriteConsoleW API internally. Note that the default Windows codepage (437) does not support all Unicode characters. This function does not check the codepage.
Definition at line 407 of file Terminal.cpp.
Referenced by lldb_private::StackFrameList::GetFrameMarker(), and lldb_private::RenderDiagnosticDetails().
|
friend |
|
protected |
Definition at line 86 of file Terminal.h.
Referenced by Clear(), FileDescriptorIsValid(), GetData(), GetFileDescriptor(), IsATerminal(), SetData(), SetFileDescriptor(), and Terminal().