changed my file structure to be headers and objects
This commit is contained in:
1
headers/ip_to_geo.h
Normal file
1
headers/ip_to_geo.h
Normal file
@@ -0,0 +1 @@
|
||||
#pragma once
|
||||
34
headers/log_parsing.h
Normal file
34
headers/log_parsing.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#pragma once
|
||||
#include <regex>
|
||||
#include <string>
|
||||
|
||||
struct Entry {
|
||||
std::string ip;
|
||||
std::string timestamp;
|
||||
std::string request;
|
||||
std::string status;
|
||||
std::string bytes;
|
||||
std::string referer;
|
||||
std::string os;
|
||||
std::string browser;
|
||||
};
|
||||
|
||||
class parsed_logs {
|
||||
private:
|
||||
Entry entry;
|
||||
std::vector<Entry> logs;
|
||||
std::string url;
|
||||
public:
|
||||
parsed_logs(std::string url);
|
||||
void parse(const std::smatch& match);
|
||||
|
||||
std::vector<parsed_logs> parse_file(std::string log_url);
|
||||
std::string get_ip();
|
||||
std::string get_timestamp();
|
||||
std::string get_request();
|
||||
std::string get_status();
|
||||
std::string get_bytes();
|
||||
std::string get_referer();
|
||||
std::string get_os();
|
||||
std::string get_browser();
|
||||
};
|
||||
Reference in New Issue
Block a user