-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathparse.h
More file actions
77 lines (63 loc) · 1.21 KB
/
parse.h
File metadata and controls
77 lines (63 loc) · 1.21 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
74
75
76
77
#ifndef PARSE_H
#define PARSE_H
#include <iostream>
#include <string>
#include <vector>
#include "text.h"
#include "date.h"
struct ZoneFile_t {
std::string serverName;
std::string logFile;
std::string logName;
bool proxyPass;
ZoneFile_t()
{
proxyPass = false;
};
};
struct LogFile_t {
uint totalIn;
uint totalOut;
std::string date;
LogFile_t()
{
totalIn = 0;
totalOut = 0;
};
std::string getDate()
{
return date;
};
};
struct RequestData_t {
std::string input;
std::string output;
std::string day;
std::string month;
std::string year;
uint getInput()
{
if (input != "")
{
return atoi(input.c_str());
}
return 0;
};
uint getOutput()
{
if (output != "")
{
return atoi(output.c_str());
}
return 0;
}
std::string getDate()
{
return year + "-" + month + "-" + day;
};
};
ZoneFile_t &parseZone(std::string zoneFileName);
LogFile_t &parseLog(std::string fileName);
void parseLine(std::string line, RequestData_t &reqData);
std::string getMonth(std::string monthStr);
#endif /* PARSE_H */