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 #include "kdemacros.h"
00025 
00026 class KProcIOPrivate;
00027 class QTextCodec;
00028 
00051 class KProcIO : public KProcess
00052 {
00053   Q_OBJECT
00054 
00055 public:
00059   KProcIO ( QTextCodec *codec = 0 );
00060 
00064   ~KProcIO();
00065 
00073   void setComm (Communication comm);
00074 
00089   bool start (RunMode  runmode = NotifyOnExit, bool includeStderr = false);
00090 
00097   bool writeStdin(const QString &line, bool appendnewline=true);
00098 
00105   bool writeStdin(const QCString &line, bool appendnewline);
00106 
00112   bool writeStdin(const QByteArray &data);
00113 
00114   
00115   
00124   KDE_DEPRECATED bool fputs (const QString &line, bool AppendNewLine=true)
00125     { return writeStdin(line, AppendNewLine); }
00126 
00130   void closeWhenDone();
00131 
00153   int readln (QString &line, bool autoAck=true, bool *partial=0);
00154 
00163   KDE_DEPRECATED int fgets (QString &line, bool autoAck=false)
00164     { return readln (line, autoAck); }
00165 
00169   void resetAll ();
00170 
00180   void ackRead ();
00181 
00188   void enableReadSignals (bool enable);
00189 
00190 signals:
00196   void readReady(KProcIO *pio);
00197 
00198 protected:
00199   QPtrList<QByteArray> outbuffer;
00200   QCString recvbuffer;
00201   QTextCodec *codec;
00202   int rbi;
00203   bool needreadsignal, readsignalon, writeready;
00204 
00205   void controlledEmission ();
00206 
00207 protected slots:
00208   void received (KProcess *proc, char *buffer, int buflen);
00209   void sent (KProcess *);
00210 
00211 protected:
00212   virtual void virtual_hook( int id, void* data );
00213 private:
00214   KProcIOPrivate *d;
00215 };
00216 
00217 #endif
 
This file is part of the documentation for kdecore Library Version 3.2.0.