-
Notifications
You must be signed in to change notification settings - Fork 0
/
Initialize.h
60 lines (54 loc) · 1.42 KB
/
Initialize.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
* File: Initialize.h
* Author: root
*
* Created on 2010年1月10日, 下午7:55
*/
#ifndef _INITIALIZE_H
#define _INITIALIZE_H
#include<stdio.h>
#include<boost/shared_ptr.hpp>
#include<string>
#include<vector>
#include <sys/inotify.h>
#define OPEN_DAEMON 0x01
#define RSYNC_ONCE 0x01<<1
#define SYN_NUM 0x01<<2
#define OTHER_CONFNAME 0x01<<3
#define EXECUTE_SCRIPT 0x01<<5
#define SERSYNC_MODULE 0x01<<6
#define REFRESHCDN_MODULE 0x01<<7
#define HTTP_MODULE 0x01<<8
#define SOCKET_MODULE 0x01<<9
#define COMMAND_MODULE 0x01<<10
struct RemoteServer {
std::string ip;
std::string module;
inline RemoteServer(std::string ip = "", std::string module = "") : ip(ip), module(module) {
}
};
typedef boost::shared_ptr<RemoteServer> ptrRmtServer;
class Initialize {
public:
int exec_flag;
int sync_num;
std::string module;
std::string config_file_name;
std::string hostip;
static std::vector<std::string> filter;
int port;
static bool debug;
bool deleteFlag;
static bool createFile;
static bool createFolder;
static bool xfs;
public:
Initialize(int argc, char *argv[]);
void ConfigInotify();
int XmlParse();
static std::string SplitLastSlash(std::string str);
protected:
int CammandParse(int argc, char *argv[]);
};
typedef boost::shared_ptr<Initialize> ptrInitialize;
#endif /* _INITIALIZE_H */