rshell
1.2
|
Instantiated by Command_List iff user input is linked commands by && || or ;. More...
#include <Command_Element.h>
Public Member Functions | |
Command_Set (Command_Element *p, Command_Element *q, string c) | |
Constructor. More... | |
int | execute () |
Executes c1 and then c2 based on the connector. More... | |
string | str () |
Returns a string representing a formatted version of the command line user input. More... | |
Protected Types | |
enum | connectors { SEMICOLON, AND, OR } |
Protected Attributes | |
Command_Element * | c1 |
Command_Element * | c2 |
enum Command_Set::connectors | connector |
Instantiated by Command_List iff user input is linked commands by && || or ;.
|
protected |
Right Command to be executed
Command_Set::Command_Set | ( | Command_Element * | p, |
Command_Element * | q, | ||
string | c | ||
) |
Constructor.
Connection between two commands
s | input string to be parsed |
Constructor to establish relationship between two commands, two command_sets or a command/command_set pair.
|
virtual |
Executes c1 and then c2 based on the connector.
Runs execute for the left command and stores the value. If the command returned and exit value of EXIT (3) then the user commanded the program to exit. If the return code was anything else then use that code (PASS or FAIL) to logically execute the right command.
Implements Command_Element.
|
virtual |
Returns a string representing a formatted version of the command line user input.
Calls the str() function for the left commmand and uses 'connector' to concatenate the str() for the right command. Returns the result.
Implements Command_Element.
|
protected |
Left Command to be executed