-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
39 lines (37 loc) · 1.14 KB
/
main.cpp
File metadata and controls
39 lines (37 loc) · 1.14 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
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include "command.h"
#include "blocklist.h"
//to do 在你用完strtok之后字符串就被破换掉了,没有进行考虑
BlockList account_list("AccountList");
BlockList isbn_book_list("ISBN_BookList");
BlockList name_book_list("Name_BookList");
BlockList author_book_list("Author_BookList");
BlockList keyword_book_list("Keyword_BookList");
BlockList work_log_list("WorkList");
extern People *current_account;
extern std::vector<People *> Login;
int main() {
Initialize();
bool running = true;
char *command;
while (running) {
std::string s;
if (getline(std::cin, s)) {
if (s.length() > 1024)std::cout << "Invalid\n";
else {
command = new char[1025];
memset(command, '\0', 1025 * sizeof(char));
std::stringstream ss;
ss.clear();
ss.str(s);
ss.getline(command, 1025);
CommandCarryOut(command, running);
}
} else exit(0);
}
delete command;
return 0;
}