• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KPty

KPtyProcess Class Reference

This class extends KProcess by support for PTYs (pseudo TTYs). More...

#include <kptyprocess.h>

Inheritance diagram for KPtyProcess:
KProcess QProcess

List of all members.

Public Types

enum  PtyChannelFlag {
  NoChannels = 0, StdinChannel = 1, StdoutChannel = 2, StderrChannel = 4,
  AllOutputChannels = 6, AllChannels = 7
}

Public Member Functions

bool isUseUtmp () const
 KPtyProcess (int ptyMasterFd, QObject *parent=0)
 KPtyProcess (QObject *parent=0)
KPtyDevice * pty () const
PtyChannels ptyChannels () const
void setPtyChannels (PtyChannels channels)
void setUseUtmp (bool value)
virtual ~KPtyProcess ()

Protected Member Functions

virtual void setupChildProcess ()

Detailed Description

This class extends KProcess by support for PTYs (pseudo TTYs).

The PTY is opened as soon as the class is instantiated. Verify that it was opened successfully by checking that pty()->masterFd() is not -1.

The PTY is always made the process' controlling TTY. Utmp registration and connecting the stdio handles to the PTY are optional.

No attempt to integrate with QProcess' waitFor*() functions was made, for it is impossible. Note that execute() does not work with the PTY, too. Use the PTY device's waitFor*() functions or use it asynchronously.

Author:
Oswald Buddenhagen <ossi@kde.org>

Definition at line 48 of file kptyprocess.h.


Member Enumeration Documentation

enum KPtyProcess::PtyChannelFlag
Enumerator:
NoChannels 

The PTY is not connected to any channel.

StdinChannel 

Connect PTY to stdin.

StdoutChannel 

Connect PTY to stdout.

StderrChannel 

Connect PTY to stderr.

AllOutputChannels 

Connect PTY to all output channels.

AllChannels 

Connect PTY to all channels.

Definition at line 54 of file kptyprocess.h.


Constructor & Destructor Documentation

KPtyProcess::KPtyProcess ( QObject *  parent = 0  )  [explicit]

Constructor.

Definition at line 54 of file kptyprocess.cpp.

KPtyProcess::KPtyProcess ( int  ptyMasterFd,
QObject *  parent = 0 
)

Construct a process using an open pty master.

Parameters:
ptyMasterFd an open pty master file descriptor. The process does not take ownership of the descriptor; it will not be automatically closed at any point.

Definition at line 65 of file kptyprocess.cpp.

KPtyProcess::~KPtyProcess (  )  [virtual]

Destructor.

Definition at line 76 of file kptyprocess.cpp.


Member Function Documentation

bool KPtyProcess::isUseUtmp (  )  const

Get whether to register the process as a TTY login in utmp.

Returns:
whether to register in utmp

Definition at line 109 of file kptyprocess.cpp.

KPtyDevice * KPtyProcess::pty (  )  const

Get the PTY device of this process.

Returns:
the PTY device

Definition at line 116 of file kptyprocess.cpp.

KPtyProcess::PtyChannels KPtyProcess::ptyChannels (  )  const

Query to which channels the PTY is assigned.

Returns:
the output channel handling mode

Definition at line 95 of file kptyprocess.cpp.

void KPtyProcess::setPtyChannels ( PtyChannels  channels  ) 

Set to which channels the PTY should be assigned.

This function must be called before starting the process.

Parameters:
channels the output channel handling mode

Definition at line 88 of file kptyprocess.cpp.

void KPtyProcess::setupChildProcess (  )  [protected, virtual]
Reimplemented from superclass.

Definition at line 123 of file kptyprocess.cpp.

void KPtyProcess::setUseUtmp ( bool  value  ) 

Set whether to register the process as a TTY login in utmp.

Utmp is disabled by default. It should enabled for interactively fed processes, like terminal emulations.

This function must be called before starting the process.

Parameters:
value whether to register in utmp.

Definition at line 102 of file kptyprocess.cpp.


The documentation for this class was generated from the following files:
  • kptyprocess.h
  • kptyprocess.cpp

KPty

Skip menu "KPty"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal