18 #include "Utilities.h" 36 void operator()(FILE *pipe) {
42 std::unique_ptr<FILE, PipeClose>
mPipe;
62 std::array<char, 128> buffer{};
64 while (fgets(buffer.data(), buffer.size(), mPipe.get()) !=
nullptr) {
int wait()
Gather the command output and wait for it to exit.
Definition: Command.h:61
Execute a program and gather the output.
Definition: Command.h:26
Command(const char *command)
Constructor.
Definition: Command.h:53
std::string mResult
The output of the command.
Definition: Command.h:28
int statusCode()
Get the command exit status code.
Definition: Command.h:77
Close the pipe and keep the exit status.
Definition: Command.h:33
PipeClose mPipeClose
The pipe closer.
Definition: Command.h:41
std::unique_ptr< FILE, PipeClose > mPipe
The pipe from the command.
Definition: Command.h:42
ToDo: There is an issue that the initial scroll interaction is lost if the click/press lands on a Wid...
Definition: CelestialOverlay.cpp:13
const std::string & result() const
Get the output of the command.
Definition: Command.h:85
int exitStatus
The status code returned by pclose(3)
Definition: Command.h:34