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 QIODevice | |
QIODevice () | |
QIODevice (QObject *parent) | |
virtual | ~QIODevice () |
void | aboutToClose () |
Offset | at () const |
bool | at (Offset offset) |
void | bytesWritten (qint64 bytes) |
QString | errorString () const |
int | flags () const |
int | getch () |
bool | getChar (char *c) |
bool | isAsynchronous () const |
bool | isBuffered () const |
bool | isCombinedAccess () const |
bool | isDirectAccess () const |
bool | isInactive () const |
bool | isOpen () const |
bool | isRaw () const |
bool | isReadable () const |
bool | isSequentialAccess () const |
bool | isSynchronous () const |
bool | isTextModeEnabled () const |
bool | isTranslated () const |
bool | isWritable () const |
int | mode () const |
virtual bool | open (QFlags< QIODevice::OpenModeFlag > mode) |
OpenMode | openMode () const |
qint64 | peek (char *data, qint64 maxSize) |
QByteArray | peek (qint64 maxSize) |
virtual qint64 | pos () const |
int | putch (int ch) |
bool | putChar (char c) |
qint64 | read (char *data, qint64 maxSize) |
QByteArray | read (qint64 maxSize) |
QByteArray | readAll () |
qint64 | readBlock (char *data, quint64 size) |
void | readChannelFinished () |
QByteArray | readLine (qint64 maxSize) |
qint64 | readLine (char *data, qint64 maxSize) |
void | readyRead () |
virtual bool | reset () |
void | resetStatus () |
virtual bool | seek (qint64 pos) |
void | setTextModeEnabled (bool enabled) |
virtual qint64 | size () const |
int | state () const |
Status | status () const |
int | ungetch (int ch) |
void | ungetChar (char c) |
qint64 | write (const char *data) |
qint64 | write (const char *data, qint64 maxSize) |
qint64 | write (const QByteArray &byteArray) |
qint64 | writeBlock (const QByteArray &data) |
qint64 | writeBlock (const char *data, quint64 size) |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
QObject (QObject *parent, const char *name) | |
virtual | ~QObject () |
bool | blockSignals (bool block) |
QObject * | child (const char *objName, const char *inheritsClass, bool recursiveSearch) const |
const QObjectList & | children () const |
const char * | className () const |
bool | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const QObject *receiver, const char *method) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QByteArray > | dynamicPropertyNames () const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name) const |
QList< T > | findChildren (const QRegExp ®Exp) const |
QList< T > | findChildren (const QString &name) const |
bool | inherits (const char *className) const |
void | insertChild (QObject *object) |
void | installEventFilter (QObject *filterObj) |
bool | isA (const char *className) const |
bool | isWidgetType () const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
const char * | name () const |
const char * | name (const char *defaultName) const |
QString | objectName () const |
QObject * | parent () const |
QVariant | property (const char *name) const |
void | removeChild (QObject *object) |
void | removeEventFilter (QObject *obj) |
void | setName (const char *name) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (int interval) |
QThread * | thread () const |
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 QIODevice | |
virtual qint64 | readData (char *data, qint64 maxSize)=0 |
void | setErrorString (const QString &str) |
void | setOpenMode (QFlags< QIODevice::OpenModeFlag > openMode) |
virtual qint64 | writeData (const char *data, qint64 maxSize)=0 |
Protected Member Functions inherited from QObject | |
bool | checkConnectArgs (const char *signal, const QObject *object, const char *method) |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const char *signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const char *signal) |
int | receivers (const char *signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
Protected Member Functions inherited from KPty | |
KPty (KPtyPrivate *d) | |
Additional Inherited Members | |
Static Public Member Functions inherited from QObject | |
bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
Public Attributes inherited from QIODevice | |
typedef | Offset |
typedef | OpenMode |
typedef | Status |
Static Protected Member Functions inherited from QObject | |
QByteArray | normalizeSignalSlot (const char *signalSlot) |
Protected Attributes inherited from KPty | |
KPtyPrivate *const | d_ptr |
Properties inherited from QObject | |
objectName | |
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
|
virtual |
- Reimplemented from superclass.
Reimplemented from QIODevice.
Definition at line 546 of file kptydevice.cpp.
|
virtual |
- Reimplemented from superclass.
Reimplemented from QIODevice.
Definition at line 552 of file kptydevice.cpp.
|
virtual |
- Reimplemented from superclass.
Reimplemented from QIODevice.
Definition at line 558 of file kptydevice.cpp.
|
virtual |
- Reimplemented from superclass.
Reimplemented from QIODevice.
Definition at line 540 of file kptydevice.cpp.
|
virtual |
Close the pty master/slave pair.
Reimplemented from QIODevice.
Definition at line 520 of file kptydevice.cpp.
|
virtual |
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.
Create a pty master/slave pair.
- Returns
- true if a pty pair was successfully opened
Definition at line 489 of file kptydevice.cpp.
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.
Reimplemented from QIODevice.
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.
|
virtual |
Reimplemented from QIODevice.
Definition at line 570 of file kptydevice.cpp.
|
virtual |
Reimplemented from QIODevice.
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-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:38 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.