Hotwheels-Cluster 1.2
Creation of Cluster APP for SEA:ME project.
 
Loading...
Searching...
No Matches
SystemCommandExecutor.cpp
Go to the documentation of this file.
1
15
17
24
25QString SystemCommandExecutor::executeCommand(const QString &command) const
26{
27 QProcess process;
28 process.start("sh", {"-c", command});
29 process.waitForFinished();
30 return process.readAllStandardOutput().trimmed();
31}
32
39QString SystemCommandExecutor::readFile(const QString &filePath) const
40{
41 QFile file(filePath);
42 if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
43 QTextStream in(&file);
44 return in.readLine().trimmed();
45 }
46 return "";
47}
Definition of the SystemCommandExecutor class.
QString executeCommand(const QString &command) const override
Executes a system command.
QString readFile(const QString &filePath) const override
Reads a file and returns its contents.