-
Notifications
You must be signed in to change notification settings - Fork 0
/
process.h
38 lines (31 loc) · 903 Bytes
/
process.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright 2022-present Contributors to the jobman project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/mikaelsundell/jobman
#pragma once
#include <QObject>
class ProcessPrivate;
class Process : public QObject {
Q_OBJECT
public:
enum Status {
Normal,
Crash
};
Q_ENUM(Status)
public:
Process();
virtual ~Process();
void run(const QString& command, const QStringList& arguments, const QString& startin = QString());
bool wait();
bool exists(const QString& command);
void kill();
int pid() const;
QString standardOutput() const;
QString standardError() const;
int exitCode() const;
Status exitStatus() const;
public:
static void kill(int pid);
private:
QScopedPointer<ProcessPrivate> p;
};