rshell  1.2
Command_Element.h
Go to the documentation of this file.
1 
28 #ifndef RSHELL_COMMAND_ELEMENT_H
29 #define RSHELL_COMMAND_ELEMENT_H
30 
31 #include <vector>
32 #include <string>
33 
34 #include "Parse.h"
35 
36 #define EXIT 3 /* The exit code when Command("exit") is parsed and executed */
37 
38 using namespace std;
39 
40 class Parse;
45 public:
46  virtual int execute() = 0;
47  virtual string str() = 0;
48 };
54 protected:
55  Command_Element* commands;
56  string input;
57 public:
62  Command_List(string s);
67  int execute();
72  string str();
73 };
78 protected:
79  Command_Element* c1;
81  enum connectors{ SEMICOLON, AND, OR } connector;
82 public:
92  int execute();
97  string str();
98 };
102 class Command : public Command_Element{
103 protected:
104  vector<string> parameters;
105 public:
110  Command(string c);
115  int execute();
120  int file_check();
125  int redirect_handler();
130  char** to_char_array(vector<string> cmd);
135  string str();
136 };
137 
138 #endif //RSHELL_COMMAND_ELEMENT_H
connectors
Definition: Command_Element.h:81
Instantiated by Command_Set or Command_List to run user defined single commands.
Definition: Command_Element.h:102
Instantiated by Command_List iff user input is linked commands by && || or ;.
Definition: Command_Element.h:77
Definitions for Parse class and its child classes.
string input
Definition: Command_Element.h:56
Definition: Command_Element.h:53
Base class for Parsing functions not including Parse_Command_Sets.
Definition: Parse.h:41
Command_Element * c2
Definition: Command_Element.h:80
Base class for Command_List, Command_Set and Command.
Definition: Command_Element.h:44