Util: Add class Shell for executing more basic OS shell commands

This commit is contained in:
Riyyi
2021-09-17 12:52:36 +02:00
parent 496e3e4c88
commit 9926849640
3 changed files with 87 additions and 4 deletions
+30
View File
@@ -0,0 +1,30 @@
#ifndef SHELL_H
#define SHELL_H
#include <string>
#include <string_view>
namespace Util {
class Shell {
public:
Shell();
virtual ~Shell() {}
Shell operator()(const char* command);
Shell operator()(std::string command);
Shell operator()(std::string_view command);
std::string output() const { return m_output; }
int status() const { return m_status; }
private:
Shell(std::string output, int status);
std::string m_output;
int m_status { 0 };
};
} // namespace Util
#endif // SHELL_H