-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommande.hpp
More file actions
70 lines (62 loc) · 1.81 KB
/
commande.hpp
File metadata and controls
70 lines (62 loc) · 1.81 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#ifndef COMMANDE_H_INCLUDES
#define COMMANDE_H_INCLUDES
#define APPEND "a"
#define CREATE "w"
#define SHELL 0
#define FILLE 2
#include "header.hpp"
class commande{
char *** args;
char ** listePipe;
bool hasPipe ;
int input;
pid_t pid;
int command_pipe[2];
bool hasError;
std::string erro_message;
std::string out_put;
std::string out_put_mod;
std::string in_put;
int in_put_mod;
public:
unsigned int length;
commande();
bool has_liste_Pipe(void);
bool has_error(void);
commande(std::string );
commande(unsigned int ,char ** );
commande(const char * );
bool scan_redirection();
bool execute_pipe();
void cleanup(int );
int command(int , bool , bool );
int calcule_args( );
void affiche(void);
int copy( unsigned int,const char **);
int append(const char* );
int erase(unsigned int);
void clear(void);
void reverse(void);
int replace(unsigned int, unsigned int, const char *);
friend commande operator+ (commande, commande);
friend commande operator+= (commande, commande);
commande& operator= ( const commande &);
int launch();
int execute();
int traitement_etoille();
};
class usCommandes
{
private:
std::vector <std::string> list;
public:
usCommandes();
usCommandes(char **, int );
usCommandes(int,...);
~usCommandes();
void print(void);
size_t length();
std::string get(int );
int is(const char *);
};
#endif