Added config load from files(main/service).
[bpdyndnsd] / src / config.h
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
10 #ifndef CONFIG_H
11 #define CONFIG_H
12
13 #include <boost/program_options.hpp>
14 #include <boost/foreach.hpp>
15 #include <boost/filesystem.hpp>
16 #include <boost/regex.hpp>
17
18 #include <string>
19 #include <iostream>
20 #include <fstream>
21
22 #include "service.h"
23
24 #include "dhs.h"
25 #include "ods.h"
26
27 namespace po = boost::program_options;
28 namespace fs = boost::filesystem;
29
30 using namespace std;
31
32 class Config
33 {
34 private:
35     po::options_description *Opt_desc_cmd;
36     po::options_description *Opt_desc_conf_main;
37     po::options_description *Opt_desc_conf_service;
38
39     list<Service*> Services;
40
41     bool Daemon_mode;
42     string Logfile;
43     int Loglevel;
44     bool Syslog;
45
46     Service * create_service(string,string,string,string);
47 public:
48     Config();
49
50     ~Config();
51
52     int parse_cmd_line(int, char **);
53
54     int load_config_from_files(string);
55
56     void print_usage();
57
58     void print_version(string);
59
60     list<Service*> get_services();
61 };
62
63 #endif