blob: edbe3c4124efc93175135b1105cc890ee76da044 (
plain)
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
|
#include "config.h"
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/xml_parser.hpp>
namespace pt = boost::property_tree;
void Config::readConfigfile(std::string filename)
{
if (filename == "") {
filename = default_filename;
}
pt::ptree tree;
pt::read_xml(filename, tree);
m_user = tree.get<std::string>("webserver.user");
m_group = tree.get<std::string>("webserver.group1");
}
Config::Config(const std::string& filename)
{
readConfigfile(filename);
}
std::string Config::User() const
{
return m_user;
}
std::string Config::Group() const
{
return m_group;
}
|