-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathmain.cpp
More file actions
40 lines (39 loc) · 890 Bytes
/
main.cpp
File metadata and controls
40 lines (39 loc) · 890 Bytes
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
#include "common.h"
#include "file_rw.h"
#include "msgid_rw.h"
using namespace std;
int main(int argc, char *argv[]){
if(argc != 5){
cout<<"please input the correct args"<<endl;
exit(0);
}
else if(!strcmp("cpp", argv[1])){
File_RW filerw(argv[2], argv[3], argv[4]);
if(!mkdir("CPP", 0777)){
cout<<"create dir CPP"<<endl;
}
cout<<"proc file "<<argv[3]<<endl;
filerw.readFile();
filerw.write_to_h();
filerw.write_to_cpp();
}
else if(!strcmp("js", argv[1])){
File_RW filerw(argv[2], argv[3], argv[4]);
if(!mkdir("JS", 0777)){
cout<<"create dir JS"<<endl;
}
cout<<"proc file "<<argv[3]<<endl;
filerw.readFile();
filerw.write_to_js();
}
else if(!strcmp("msg", argv[1])){
MsgId_RW msgidrw(argv[2], argv[3], argv[4]);
msgidrw.readFile();
//msgidrw.write_to_h();
msgidrw.write_to_js();
}
else{
cout<<"Mode match error"<<endl;
}
return 0;
}