diff options
Diffstat (limited to 'ProcessManager.hpp')
| -rw-r--r-- | ProcessManager.hpp | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/ProcessManager.hpp b/ProcessManager.hpp deleted file mode 100644 index 7782cb3..0000000 --- a/ProcessManager.hpp +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef PROCESSMANAGER_HPP -#define PROCESSMANAGER_HPP - -#define DELETE_SAVE(x) if(x != 0) \ -{\ - delete x;\ - x = 0;\ -} - -#include <QObject> -#include <QFile> -#include <QSocketNotifier> - -class ProcessManager : public QObject -{ - Q_OBJECT -public: - explicit ProcessManager(const QString& prefix, const QString& id = "", bool useStdErr = false, QObject *parent = 0); - ~ProcessManager(); - - bool isOk(); - bool isRunning(); - bool start(const QString& program, QStringList args); - - QByteArray readAll(); - QByteArray readLine(); - qint64 write(const QByteArray& data); - bool isWritable(); - bool setWorkingDirectory(const QString& path); - - void kill(); - void exit(); - - void closeProgFifos(); - - QString ID(); - -signals: - void readyRead(); - void stdErrReadyRead(); - void finished(int); - -public slots: - -private slots: - void ctrlOutReadyRead(); - void _stdOutReadyRead(); - void _stdErrReadyRead(); - -private: - QString prefix; - QString id; - - QFile ctrlIn; - QFile ctrlOut; - QFile stdIn; - QFile stdOut; - QFile stdErr; - - QSocketNotifier* ctrlOutNotifier = 0; - QSocketNotifier* stdOutNotifier = 0; - QSocketNotifier* stdErrNotifier = 0; - - bool useStdErr = false; - - bool ok = false; - bool running = false; - - int pid = 0; - int exitCode = 0; - - bool connectToIO(); -}; - -#endif // PROCESSMANAGER_HPP |
