-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcmd.h
49 lines (41 loc) · 870 Bytes
/
cmd.h
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
48
49
#ifndef __CMD_H__
#define __CMD_H__
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <vector>
#include <sys/wait.h>
#include <sys/types.h>
#include <unistd.h>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <vector>
#include <string>
#include <stdlib.h>
#include <sys/stat.h>
#include <fcntl.h>
using namespace std;
class CMD{
protected:
string str;
bool alreadyRun;
public:
CMD(): str(""), alreadyRun(false) {}
virtual bool execute(bool& itr) = 0 ;
virtual string type() = 0;
string showString();
};
class Exec : public CMD {
public:
Exec(string name);
bool execute(bool& itr);
string type();
};
class Con : public CMD {
public:
Con(string name);
bool execute(bool& itr);
string type();
};
#endif