-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommand.hh
More file actions
47 lines (35 loc) · 1000 Bytes
/
Copy pathcommand.hh
File metadata and controls
47 lines (35 loc) · 1000 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef command_hh
#define command_hh
#include "simpleCommand.hh"
// Command Data Structure
struct Command {
std::vector<SimpleCommand *> _simpleCommands;
std::string * _outFile;
std::string * _inFile;
std::string * _errFile;
static std::string _lastArg;
static std::string _relativePath;
static std::vector<std::string> fullCommand;
bool _background;
bool _append;
bool _appendErr;
bool _ambiguousRedirect;
static bool _src;
static bool _subshell;
static int _returnCode;
static int _pidBackground;
static int _index;
Command();
void insertSimpleCommand( SimpleCommand * simpleCommand );
void clear();
void print();
void execute();
// Helper functions
std::vector<std::string *> returnArgs(std::vector<std::string *> args, int size);
static void setPID(int newPid);
static void setRelativePath(char *relativePath);
void buildCommand(std::string insert);
void insertHistory();
static SimpleCommand *_currentSimpleCommand;
};
#endif