SynchronousProcess: Change exit code interpreter to function object

Change-Id: Ic48d4f5810f171c070f0980581fb6e45f6fe6b4a
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Eike Ziller
2016-04-25 14:40:42 +02:00
parent cb08a44e7e
commit 967177d3d8
14 changed files with 54 additions and 126 deletions

View File

@@ -27,6 +27,8 @@
#include "utils_global.h"
#include "synchronousprocess.h"
#include <QObject>
#include <functional>
@@ -43,13 +45,8 @@ class QFuture;
QT_END_NAMESPACE
namespace Utils {
struct SynchronousProcessResponse;
class ExitCodeInterpreter;
class FileName;
}
namespace Utils {
namespace Internal { class ShellCommandPrivate; }
class QTCREATOR_UTILS_EXPORT ProgressParser
@@ -115,9 +112,9 @@ public:
void setDisplayName(const QString &name);
void addJob(const FileName &binary, const QStringList &arguments,
const QString &workingDirectory = QString(), ExitCodeInterpreter *interpreter = 0);
const QString &workingDirectory = QString(), const ExitCodeInterpreter &interpreter = defaultExitCodeInterpreter);
void addJob(const FileName &binary, const QStringList &arguments, int timeoutS,
const QString &workingDirectory = QString(), ExitCodeInterpreter *interpreter = 0);
const QString &workingDirectory = QString(), const ExitCodeInterpreter &interpreter = defaultExitCodeInterpreter);
void execute();
void abort();
bool lastExecutionSuccess() const;
@@ -146,7 +143,7 @@ public:
virtual SynchronousProcessResponse runCommand(const FileName &binary, const QStringList &arguments,
int timeoutS,
const QString &workingDirectory = QString(),
ExitCodeInterpreter *interpreter = 0);
const ExitCodeInterpreter &interpreter = defaultExitCodeInterpreter);
// Make sure to not pass through the event loop at all:
virtual bool runFullySynchronous(const FileName &binary, const QStringList &arguments,
int timeoutS, QByteArray *outputData, QByteArray *errorData,
@@ -172,7 +169,7 @@ private:
void run(QFutureInterface<void> &future);
SynchronousProcessResponse runSynchronous(const FileName &binary, const QStringList &arguments,
int timeoutS, const QString &workingDirectory,
ExitCodeInterpreter *interpreter = 0);
const ExitCodeInterpreter &interpreter = defaultExitCodeInterpreter);
class Internal::ShellCommandPrivate *const d;
};