diff options
| author | Markus Mittendrein <git@maxmitti.tk> | 2015-09-09 19:00:56 +0200 |
|---|---|---|
| committer | Markus Mittendrein <git@maxmitti.tk> | 2015-09-09 19:02:23 +0200 |
| commit | 8a6d4b06f2291c363f3dea17837ed20893852453 (patch) | |
| tree | c091375499e35eaa1810586454e0834c06e6c9b2 /ProcessManager.hpp | |
| parent | f554a27046f203e56a07baaf214d90834942e3f5 (diff) | |
| download | manager-8a6d4b06f2291c363f3dea17837ed20893852453.tar.gz manager-8a6d4b06f2291c363f3dea17837ed20893852453.zip | |
Cleanup repo with some directories
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 |
