KPty
#include <kptydevice.h>
Signals | |
void | readEof () |
Public Member Functions | |
KPtyDevice (QObject *parent=0) | |
virtual | ~KPtyDevice () |
bool | atEnd () const |
qint64 | bytesAvailable () const |
qint64 | bytesToWrite () const |
bool | canReadLine () const |
virtual void | close () |
virtual bool | isSequential () const |
bool | isSuspended () const |
virtual bool | open (OpenMode mode=ReadWrite|Unbuffered) |
bool | open (int fd, OpenMode mode=ReadWrite|Unbuffered) |
void | setSuspended (bool suspended) |
bool | waitForBytesWritten (int msecs=-1) |
bool | waitForReadyRead (int msecs=-1) |
Public Member Functions inherited from KPty | |
KPty () | |
~KPty () | |
void | close () |
void | closeSlave () |
void | login (const char *user=0, const char *remotehost=0) |
void | logout () |
int | masterFd () const |
bool | open () |
bool | open (int fd) |
bool | openSlave () |
void | setCTty () |
bool | setEcho (bool echo) |
bool | setWinSize (int lines, int columns) |
int | slaveFd () const |
bool | tcGetAttr (struct::termios *ttmode) const |
bool | tcSetAttr (struct::termios *ttmode) |
const char * | ttyName () const |
Protected Member Functions | |
virtual qint64 | readData (char *data, qint64 maxSize) |
virtual qint64 | readLineData (char *data, qint64 maxSize) |
virtual qint64 | writeData (const char *data, qint64 maxSize) |
Protected Member Functions inherited from KPty | |
KPty (KPtyPrivate *d) | |
Additional Inherited Members | |
Protected Attributes inherited from KPty | |
KPtyPrivate *const | d_ptr |
Detailed Description
Encapsulates KPty into a QIODevice, so it can be used with Q*Stream, etc.
Definition at line 38 of file kptydevice.h.
Constructor & Destructor Documentation
KPtyDevice::KPtyDevice | ( | QObject * | parent = 0 | ) |
Constructor.
Definition at line 478 of file kptydevice.cpp.
|
virtual |
Destructor:
If the pty is still open, it will be closed. Note, however, that an utmp registration is not undone.
Definition at line 484 of file kptydevice.cpp.
Member Function Documentation
bool KPtyDevice::atEnd | ( | ) | const |
- Reimplemented from superclass.
Definition at line 546 of file kptydevice.cpp.
qint64 KPtyDevice::bytesAvailable | ( | ) | const |
- Reimplemented from superclass.
Definition at line 552 of file kptydevice.cpp.
qint64 KPtyDevice::bytesToWrite | ( | ) | const |
- Reimplemented from superclass.
Definition at line 558 of file kptydevice.cpp.
bool KPtyDevice::canReadLine | ( | ) | const |
- Reimplemented from superclass.
Definition at line 540 of file kptydevice.cpp.
|
virtual |
Close the pty master/slave pair.
Definition at line 520 of file kptydevice.cpp.
|
virtual |
- Returns
- always true
Definition at line 535 of file kptydevice.cpp.
bool KPtyDevice::isSuspended | ( | ) | const |
Returns true if the KPtyDevice is not monitoring the pty for incoming data.
Do not use on closed ptys.
See setSuspended()
Definition at line 582 of file kptydevice.cpp.
|
virtual |
Create a pty master/slave pair.
- Returns
- true if a pty pair was successfully opened
Definition at line 489 of file kptydevice.cpp.
bool KPtyDevice::open | ( | int | fd, |
OpenMode | mode = ReadWrite | Unbuffered |
||
) |
Open using an existing pty master.
The ownership of the fd remains with the caller, i.e., close() will not close the fd.
This is useful if you wish to attach a secondary "controller" to an existing pty device such as a terminal widget. Note that you will need to use setSuspended() on both devices to control which one gets the incoming data from the pty.
- Parameters
-
fd an open pty master file descriptor. mode the device mode to open the pty with.
- Returns
- true if a pty pair was successfully opened
Definition at line 506 of file kptydevice.cpp.
Definition at line 589 of file kptydevice.cpp.
|
signal |
Emitted when EOF is read from the PTY.
Data may still remain in the buffers.
Definition at line 596 of file kptydevice.cpp.
void KPtyDevice::setSuspended | ( | bool | suspended | ) |
Sets whether the KPtyDevice monitors the pty for incoming data.
When the KPtyDevice is suspended, it will no longer attempt to buffer data that becomes available from the pty and it will not emit any signals.
Do not use on closed ptys. After a call to open(), the pty is not suspended. If you need to ensure that no data is read, call this function before the main loop is entered again (i.e., immediately after opening the pty).
Definition at line 576 of file kptydevice.cpp.
bool KPtyDevice::waitForBytesWritten | ( | int | msecs = -1 | ) |
Definition at line 570 of file kptydevice.cpp.
bool KPtyDevice::waitForReadyRead | ( | int | msecs = -1 | ) |
Definition at line 564 of file kptydevice.cpp.
Definition at line 603 of file kptydevice.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:56 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.