rshell  1.2
Command_Set Class Reference

Instantiated by Command_List iff user input is linked commands by && || or ;. More...

#include <Command_Element.h>

Inheritance diagram for Command_Set:
Command_Element

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_Elementc1
 
Command_Elementc2
 
enum Command_Set::connectors connector
 

Detailed Description

Instantiated by Command_List iff user input is linked commands by && || or ;.

Member Enumeration Documentation

enum Command_Set::connectors
protected

Right Command to be executed

Constructor & Destructor Documentation

Command_Set::Command_Set ( Command_Element p,
Command_Element q,
string  c 
)

Constructor.

Connection between two commands

Parameters
sinput string to be parsed

Constructor to establish relationship between two commands, two command_sets or a command/command_set pair.

Member Function Documentation

int Command_Set::execute ( )
virtual

Executes c1 and then c2 based on the connector.

Returns
exit code

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.

string Command_Set::str ( )
virtual

Returns a string representing a formatted version of the command line user input.

Returns
string representing the command line data structure

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.

Member Data Documentation

Command_Element* Command_Set::c2
protected

Left Command to be executed


The documentation for this class was generated from the following files: