/
xdb_edit.h
35 lines (26 loc) · 714 Bytes
/
xdb_edit.h
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
#ifndef XDB_EDIT_H
#define XDB_EDIT_H
#include <list>
#include <string>
struct xdb_node_t {
unsigned int ip1;
unsigned int ip2;
std::string region;
xdb_node_t();
xdb_node_t(char* buf);
bool operator<(const xdb_node_t& rhs) const;
std::string to_string() const;
};
class xdb_edit_t {
public:
xdb_edit_t(const std::string& file_name_old,
const std::string& file_name_new);
private:
void handle_new_file(const std::string& file_name);
void handle_old_file(const std::string& file_name);
void merge();
void write_old_file(const std::string& file_name);
std::list<xdb_node_t> old_regions;
std::list<xdb_node_t> new_regions;
};
#endif