kprocio.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef KPROCIO_H_
00019 #define KPROCIO_H_
00020
00021 #include <qstring.h>
00022 #include <kprocess.h>
00023 #include <qstrlist.h>
00024
00025 class KProcIOPrivate;
00026 class QTextCodec;
00027
00050 class KProcIO : public KProcess
00051 {
00052 Q_OBJECT
00053 public:
00054 KProcIO ( QTextCodec *codec = 0 );
00055
00056 ~KProcIO();
00057
00072 bool start (RunMode runmode = NotifyOnExit, bool includeStderr = false);
00073
00080 bool writeStdin(const QString &line, bool appendnewline=TRUE);
00081
00088 bool writeStdin(const QCString &line, bool appendnewline);
00089
00095 bool writeStdin(const QByteArray &data);
00096
00097
00098
00107 bool fputs (const QString &line, bool AppendNewLine=TRUE)
00108 { return writeStdin(line, AppendNewLine); }
00109
00113 void closeWhenDone();
00114
00136 int readln (QString &line, bool autoAck=true, bool *partial=0);
00137
00148 int fgets (QString &line, bool autoAck=false)
00149 { return readln (line, autoAck); }
00150
00154 void resetAll ();
00155
00165 void ackRead ();
00166
00173 void enableReadSignals (bool enable);
00174
00175 signals:
00181 void readReady(KProcIO *pio);
00182
00183 protected:
00184 QPtrList<QByteArray> outbuffer;
00185 QCString recvbuffer;
00186 QTextCodec *codec;
00187 int rbi;
00188 bool needreadsignal, readsignalon, writeready;
00189
00190 void controlledEmission ();
00191
00192 protected slots:
00193 void received (KProcess *proc, char *buffer, int buflen);
00194 void sent (KProcess *);
00195
00196 protected:
00197 virtual void virtual_hook( int id, void* data );
00198 private:
00199 KProcIOPrivate *d;
00200 };
00201
00202 #endif
This file is part of the documentation for kdelibs Version 3.1.4.