2010-10-12 11:07:06 +02:00
|
|
|
#ifndef SSHREMOTEPROCESSRUNNER_H
|
|
|
|
|
#define SSHREMOTEPROCESSRUNNER_H
|
|
|
|
|
|
|
|
|
|
#include "sshconnection.h"
|
|
|
|
|
#include "sshremoteprocess.h"
|
|
|
|
|
|
2011-02-14 16:34:17 +01:00
|
|
|
namespace Utils {
|
2010-10-12 11:07:06 +02:00
|
|
|
class SshRemoteProcessRunnerPrivate;
|
|
|
|
|
|
|
|
|
|
// Convenience class for running a remote process over an SSH connection.
|
2011-02-14 16:34:17 +01:00
|
|
|
class QTCREATOR_UTILS_EXPORT SshRemoteProcessRunner : public QObject
|
2010-10-12 11:07:06 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
Q_DISABLE_COPY(SshRemoteProcessRunner)
|
|
|
|
|
public:
|
|
|
|
|
typedef QSharedPointer<SshRemoteProcessRunner> Ptr;
|
|
|
|
|
|
2010-10-12 12:51:24 +02:00
|
|
|
static Ptr create(const SshConnectionParameters ¶ms);
|
|
|
|
|
static Ptr create(const SshConnection::Ptr &connection);
|
2010-10-12 11:07:06 +02:00
|
|
|
|
|
|
|
|
void run(const QByteArray &command);
|
|
|
|
|
QByteArray command() const;
|
|
|
|
|
|
|
|
|
|
SshConnection::Ptr connection() const;
|
|
|
|
|
SshRemoteProcess::Ptr process() const;
|
|
|
|
|
|
|
|
|
|
signals:
|
2011-02-14 16:34:17 +01:00
|
|
|
void connectionError(Utils::SshError);
|
2010-10-12 11:07:06 +02:00
|
|
|
void processStarted();
|
|
|
|
|
void processOutputAvailable(const QByteArray &output);
|
|
|
|
|
void processErrorOutputAvailable(const QByteArray &output);
|
|
|
|
|
void processClosed(int exitStatus); // values are of type SshRemoteProcess::ExitStatus
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
SshRemoteProcessRunner(const SshConnectionParameters ¶ms);
|
|
|
|
|
SshRemoteProcessRunner(const SshConnection::Ptr &connection);
|
|
|
|
|
void init();
|
|
|
|
|
|
|
|
|
|
SshRemoteProcessRunnerPrivate *d;
|
|
|
|
|
};
|
|
|
|
|
|
2011-02-14 16:34:17 +01:00
|
|
|
} // namespace Utils
|
2010-10-12 11:07:06 +02:00
|
|
|
|
|
|
|
|
#endif // SSHREMOTEPROCESSRUNNER_H
|