|
AndroMeta
2.0.0
|
Execute commands controlling standard input and reading from standard output and error as strings. More...
#include <MCommand.h>
Public Member Functions | |
| MCommand (const mstr &command, int mode=0) | |
| ~MCommand () | |
| bool | readOutput (mstr &out, const mtime &timeout) |
| void | matchOutput (const mstr &re, mvec &m) |
| bool | matchOutput (const mstr &re, mvec &m, const mtime &timeout) |
| bool | readError (mstr &err, const mtime &timeout) |
| void | matchError (const mstr &re, mvec &m) |
| bool | matchError (const mstr &re, mvec &m, const mtime &timeout) |
| void | write (const mstr &in) |
| int | await () |
| int | processId () |
| int | status () |
| void | close () |
Static Public Attributes | |
| static const int | Input = 0x01 |
| static const int | Output = 0x02 |
| static const int | Error = 0x04 |
| static const int | Persistent = 0x08 |
Execute commands controlling standard input and reading from standard output and error as strings.
| Meta::MCommand::MCommand | ( | const mstr & | command, |
| int | mode = 0 |
||
| ) |
Constructor.
The mode masks which can be bitwise OR of InputMode, OutputMode, and ErrorMode.
Destructor.
| int Meta::MCommand::await | ( | ) |
Wait for the command to exit and return status.
| void Meta::MCommand::close | ( | ) |
Close the command process.
| void Meta::MCommand::matchError | ( | const mstr & | re, |
| mvec & | m | ||
| ) |
Read from standard error until a regular expression has been matched.
| re | The regular expression to match. |
| m | On output, the matched sub-expressions. |
| bool Meta::MCommand::matchError | ( | const mstr & | re, |
| mvec & | m, | ||
| const mtime & | timeout | ||
| ) |
Read from standard error until a regular expression has been matched with timeout.
| re | The regular expression to match. |
| m | On output, the matched sub-expressions. |
| timeout | Return after timeout if output is not matched. |
| void Meta::MCommand::matchOutput | ( | const mstr & | re, |
| mvec & | m | ||
| ) |
Read from standard output until a regular expression has been matched.
| re | The regular expression to match. |
| m | On output, the matched sub-expressions. |
| bool Meta::MCommand::matchOutput | ( | const mstr & | re, |
| mvec & | m, | ||
| const mtime & | timeout | ||
| ) |
Read from standard output until a regular expression has been matched with timeout.
| re | The regular expression to match. |
| m | On output, the matched sub-expressions. |
| timeout | Return after timeout if output is not matched. |
| int Meta::MCommand::processId | ( | ) |
| bool Meta::MCommand::readError | ( | mstr & | err, |
| const mtime & | timeout | ||
| ) |
Read standard error from the last time clearError() was called.
| bool Meta::MCommand::readOutput | ( | mstr & | out, |
| const mtime & | timeout | ||
| ) |
Read standard output from the last time clearOutput() was called.
| int Meta::MCommand::status | ( | ) |
Check the status of the command.
| void Meta::MCommand::write | ( | const mstr & | in | ) |
Write to standard input.
1.7.6.1