-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefine.h
More file actions
73 lines (66 loc) · 1.58 KB
/
define.h
File metadata and controls
73 lines (66 loc) · 1.58 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
71
72
73
//
// Created by thienvu on 5/30/18.
//
#include <string>
#ifndef FTPCLIENT_DEFINE_H
#define FTPCLIENT_DEFINE_H
enum COMMANDS {
OPEN = 0,
USER,
LIST,
PUT,
MPUT,
GET,
MGET,
CD,
LCD,
DELETE,
MDELETE,
MKDIR,
RMDIR,
PWD,
PASSIVE,
QUIT,
HELP,
VERBOSE,
NOT_CMD
};
struct Command {
string cmd;
int argCount;
vector<string> argList;
explicit Command(const string &cmd, int argCount = 0, vector<string> argList = {}) {
this->cmd = cmd;
this->argCount = argCount;
this->argList = std::move(argList);
}
};
struct Request {
COMMANDS command;
vector<string> arg;
};
vector<Command> COMMAND_LIST = {
Command("open", 1, {"Hostname: ", "Port: "}),
Command("user", 1, {"User name: "}),
Command("ls"),
Command("dir"),
Command("put", 1, {"(local-file)", "(remote-file)"}),
Command("mput", 1, {"(local-file)", "(remote-file)"}),
Command("get", 1, {"(remote-file)", "(local-file)"}),
Command("mget", 1, {"(remote-file)", "(local-file)"}),
Command("cd", 1, {"(remote-directory)"}),
Command("lcd"),
Command("delete", 1, {"(remote-file)"}),
Command("mdelete", 1, {"(remote-file)"}),
Command("mkdir", 1, {"(directory-name)"}),
Command("rmdir", 1, {"(directory-name)"}),
Command("pwd"),
Command("help"),
Command("?"),
Command("quit"),
Command("exit"),
Command("!"),
Command("passive"),
Command("verbose")
};
#endif //FTPCLIENT_DEFINE_H