E-MailRelay
|
A structure representing an external program, holding a path and a set of arguments. More...
#include <gexecutablecommand.h>
Public Member Functions | |
ExecutableCommand (const std::string &command_line={}) | |
Constructor taking a complete command-line. More... | |
ExecutableCommand (const G::Path &exe, const StringArray &args) | |
Constructor taking the executable and arguments explicitly. More... | |
Path | exe () const |
Returns the executable. More... | |
StringArray | args () const |
Returns the command-line arguments. More... | |
void | add (const std::string &arg) |
Adds a command-line argument. More... | |
void | insert (const G::StringArray &) |
Inserts at the front of the command-line. More... | |
std::string | displayString () const |
Returns a printable representation for logging and diagnostics. More... | |
A structure representing an external program, holding a path and a set of arguments.
The constructor takes a complete command-line and splits it up into the executable part and a list of command-line parameters. If the command-line starts with a script then the contructed command-line may be for the appropriate interpreter (depending on the o/s).
Definition at line 44 of file gexecutablecommand.h.
|
explicit |
Constructor taking a complete command-line.
The command-line is split up on unescaped-and-unquoted space characters. Uses G::Arg::parse() in its implementation.
Definition at line 29 of file gexecutablecommand.cpp.
G::ExecutableCommand::ExecutableCommand | ( | const G::Path & | exe, |
const StringArray & | args | ||
) |
Constructor taking the executable and arguments explicitly.
Definition at line 41 of file gexecutablecommand.cpp.
void G::ExecutableCommand::add | ( | const std::string & | arg | ) |
Adds a command-line argument.
Definition at line 65 of file gexecutablecommand.cpp.
G::StringArray G::ExecutableCommand::args | ( | ) | const |
Returns the command-line arguments.
Definition at line 52 of file gexecutablecommand.cpp.
std::string G::ExecutableCommand::displayString | ( | ) | const |
Returns a printable representation for logging and diagnostics.
Definition at line 57 of file gexecutablecommand.cpp.
G::Path G::ExecutableCommand::exe | ( | ) | const |
Returns the executable.
Definition at line 47 of file gexecutablecommand.cpp.
void G::ExecutableCommand::insert | ( | const G::StringArray & | array | ) |
Inserts at the front of the command-line.
The first element becomes the new executable.
Definition at line 71 of file gexecutablecommand.cpp.