Public Member Functions | |
| CommandShell () | |
| constructor | |
| ~CommandShell () | |
| destructor | |
| CommandShell & | operator<< (const char *string) |
| adds string to unixCommand | |
| CommandShell & | operator<< (CommandShell &(*f)(CommandShell &)) |
| allows passing of the flush function to the shell using << | |
| CommandShell & | flush () |
| "flushes" the shell; i.e. executes the unixCommand | |
| void | asynch_flag (const bool flag) |
| set the asynchFlag | |
| bool | asynch_flag () const |
| get the asynchFlag | |
| void | suppress_output_flag (const bool flag) |
| set the suppressOutputFlag | |
| bool | suppress_output_flag () const |
| get the suppressOutputFlag | |
Private Attributes | |
| String | unixCommand |
| insertions and then executed by flush | |
| bool | asynchFlag |
| flags nonblocking operation (background system calls) | |
| bool | suppressOutputFlag |
| flags suppression of shell output (no command echo) | |
The CommandShell class wraps the C system() utility and defines convenience operators for building a command string and then passing it to the shell.
| CommandShell & flush | ( | ) |
"flushes" the shell; i.e. executes the unixCommand
Executes the unixCommand by passing it to system(). Appends an "&" if asynchFlag is set (background system call) and echos the unixCommand to Cout if suppressOutputFlag is not set.
1.5.1