-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPipeCommand.hh
More file actions
39 lines (30 loc) · 1.06 KB
/
PipeCommand.hh
File metadata and controls
39 lines (30 loc) · 1.06 KB
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
#ifndef pipecommand_hh
#define pipecommand_hh
#include "Command.hh"
#include "SimpleCommand.hh"
// Command Data Structure
class PipeCommand : public Command {
public:
std::vector<SimpleCommand *> _simpleCommands;
std::string * _outFile;
std::string * _inFile;
std::string * _errFile;
bool _append;
bool _background;
PipeCommand();
void insertSimpleCommand( SimpleCommand * simpleCommand );
void clear();
void print();
void execute();
// Expands environment vars and wildcards of a SimpleCommand and
// returns the arguments to pass to execvp.
std::string subShell(std::string &command);
std::string envExpansion(std::string &command);
std::string tildeExpansion(std::string &command);
std::vector<std::string> wildCards(std::string &command);
void expandWildcards(std::string &prefix, std::string &suffix, std::vector <std::string> &matched_files, bool multilevel);
bool needsWildcardExpansion(std::string &command);
std::string regConvert(std::string s);
char ** expandEnvVarsAndWildcards(SimpleCommand * simpleCommandNumber);
};
#endif