-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmain.cpp
More file actions
48 lines (37 loc) · 1.15 KB
/
main.cpp
File metadata and controls
48 lines (37 loc) · 1.15 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
#include "packet_analyzer.h"
using namespace std;
PacketAnalyzer analyzer;
void addTracesFromFolderList(string fl){
ifstream traceList(fl.c_str());
string s;
while (getline(traceList, s)) {
analyzer.addTrace(s);
}
traceList.close();
}
string trimNameFormat(string fdr){
const char* strfdr=fdr.c_str();
int pos=strlen(strfdr)-1;
while (strfdr[pos]=='/' && pos>=0) pos--;
return fdr.substr(0,pos+1);
}
int main(int argc, char **argv) {
// string traceList("/home/alfred/Project/TMobile/Facebook/tracelist");
//ls -d $PWD/*
if (argc<=2){
printf("Wrong input! Input should have 2 arguments!\n");
printf("correct input format:\n ./qoetranalyzer <trace list file name> <output file folder name>\n");
printf("Example: ./qoetranalyzer ./sampledata/traceList ./sampledata/output/\n");
return -1;
}
string tracelist(argv[1]);
string outputfolder(argv[2]);
// cout<<tracelist<<endl;
// cout<<outputfolder<<endl;
addTracesFromFolderList(tracelist);
// analyzer.setTraceListFileName(traceList);
analyzer.init();
analyzer.setOutputFileFolder(trimNameFormat(outputfolder));
analyzer.run();
return 0;
}