kprocio.h
/* This file is part of the KDE libraries
Copyright (C) 1997 David Sweet <dsweet@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KPROCIO_H_
#define KPROCIO_H_
#include <qstring.h>
#include <kprocess.h>
#include <qstrlist.h>
#include "kdelibs_export.h"
class KProcIOPrivate;
class QTextCodec;
class KDECORE_EXPORT KProcIO : public KProcess
{
Q_OBJECT
public:
KProcIO ( QTextCodec *codec = 0 );
~KProcIO();
void setComm (Communication comm);
bool start (RunMode runmode = NotifyOnExit, bool includeStderr = false);
bool writeStdin(const QString &line, bool appendnewline=true);
bool writeStdin(const QCString &line, bool appendnewline);
bool writeStdin(const QByteArray &data);
//I like fputs better -- it's the same as writeStdin
//inline
KDE_DEPRECATED bool fputs (const QString &line, bool AppendNewLine=true)
{ return writeStdin(line, AppendNewLine); }
void closeWhenDone();
int readln (QString &line, bool autoAck=true, bool *partial=0);
KDE_DEPRECATED int fgets (QString &line, bool autoAck=false)
{ return readln (line, autoAck); }
void resetAll ();
void ackRead ();
void enableReadSignals (bool enable);
signals:
void readReady(KProcIO *pio);
protected:
QPtrList<QByteArray> outbuffer;
QCString recvbuffer;
QTextCodec *codec;
int rbi;
bool needreadsignal, readsignalon, writeready;
void controlledEmission ();
protected slots:
void received (KProcess *proc, char *buffer, int buflen);
void sent (KProcess *);
protected:
virtual void virtual_hook( int id, void* data );
private:
KProcIOPrivate *d;
};
#endif // KPROCIO_H_
KProcess
Child process invocation, monitoring and control.
Definition: kprocess.h:125
KProcess::start
virtual bool start(RunMode runmode=NotifyOnExit, Communication comm=NoCommunication)
Starts the process.
Definition: kprocess.cpp:298
KProcIO::fgets
KDE_DEPRECATED int fgets(QString &line, bool autoAck=false)
This function calls readln().
Definition: kprocio.h:162
KProcess::writeStdin
bool writeStdin(const char *buffer, int buflen)
Transmit data to the child process' stdin.
Definition: kprocess.cpp:628
KProcIO::fputs
KDE_DEPRECATED bool fputs(const QString &line, bool AppendNewLine=true)
This function just calls writeStdin().
Definition: kprocio.h:123
KProcess::Communication
Communication
Modes in which the communication channel can be opened.
Definition: kprocess.h:152
KProcIO
KProcIO.
Definition: kprocio.h:50
KProcess::RunMode
RunMode
Run-modes for a child process.
Definition: kprocess.h:164

KDE Home | KDE Accessibility Home | Description of Access Keys