Execute a program and gather the output.
More...
#include <Command.h>
Execute a program and gather the output.
◆ Command()
rose::Command::Command |
( |
const char * |
command | ) |
|
|
inlineexplicit |
Constructor.
- Parameters
-
command | The command to execute. See popen() |
The pipe is opened with a call to popen(command,"r"). A call to wait will pause execution and gather the output and the exit status when the command exits.
◆ result()
const std::string& rose::Command::result |
( |
| ) |
const |
|
inline |
Get the output of the command.
- Returns
- A std::string with the command output.
◆ statusCode()
int rose::Command::statusCode |
( |
| ) |
|
|
inline |
Get the command exit status code.
- Returns
- The exit status gathered by pclose().
◆ wait()
int rose::Command::wait |
( |
| ) |
|
|
inline |
Gather the command output and wait for it to exit.
- Returns
- The exit status gathered by pclose().
The documentation for this class was generated from the following file: