You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
508 B
30 lines
508 B
#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(const std::string& output, int status); |
|
|
|
std::string m_output; |
|
int m_status { 0 }; |
|
}; |
|
|
|
} // namespace Util |
|
|
|
#endif // SHELL_H
|
|
|