Commit | Line | Data |
---|---|---|
5c460c94 BS |
1 | /** @file |
2 | * @brief Config class header. This class represents the actual configuration. | |
3 | * | |
4 | * | |
5 | * | |
6 | * @copyright Intra2net AG | |
7 | * @license GPLv2 | |
8 | */ | |
9 | ||
4545a371 BS |
10 | #ifndef CONFIG_H |
11 | #define CONFIG_H | |
12 | ||
13 | #include <boost/program_options.hpp> | |
b3b71635 | 14 | #include <boost/foreach.hpp> |
7ec77cf1 | 15 | #include <boost/filesystem.hpp> |
0680036d | 16 | #include <boost/regex.hpp> |
7ec77cf1 | 17 | |
4545a371 BS |
18 | #include <string> |
19 | #include <iostream> | |
b3b71635 | 20 | #include <fstream> |
4545a371 BS |
21 | |
22 | #include "service.h" | |
23 | ||
24 | #include "dhs.h" | |
25 | #include "ods.h" | |
26 | ||
27 | namespace po = boost::program_options; | |
7ec77cf1 BS |
28 | namespace fs = boost::filesystem; |
29 | ||
4545a371 BS |
30 | using namespace std; |
31 | ||
4248e8ca TJ |
32 | class Config |
33 | { | |
4545a371 | 34 | private: |
5c460c94 BS |
35 | po::options_description *Opt_desc_cmd; |
36 | po::options_description *Opt_desc_conf_main; | |
37 | po::options_description *Opt_desc_conf_service; | |
4545a371 | 38 | |
5c460c94 | 39 | list<Service*> Services; |
4545a371 | 40 | |
5c460c94 BS |
41 | bool Daemon_mode; |
42 | string Logfile; | |
43 | int Loglevel; | |
44 | bool Syslog; | |
0680036d BS |
45 | |
46 | Service * create_service(string,string,string,string); | |
4545a371 BS |
47 | public: |
48 | Config(); | |
49 | ||
50 | ~Config(); | |
51 | ||
52 | int parse_cmd_line(int, char **); | |
53 | ||
b3b71635 | 54 | int load_config_from_files(string); |
4545a371 BS |
55 | |
56 | void print_usage(); | |
57 | ||
58 | void print_version(string); | |
59 | ||
60 | list<Service*> get_services(); | |
61 | }; | |
62 | ||
63 | #endif |