43 for (
const auto& i : section) {
44 if (i.first ==
"user") {
46 user = i.second.get_value<std::string>(
"user");
51 catch (
const boost::property_tree::ptree_error&) {
55 else if (i.first ==
"group") {
57 group = i.second.get_value<std::string>(
"group");
62 catch (
const boost::property_tree::ptree_error&) {
Configuration file parsing utility.
void addSectionHandler(const std::string §ionName, ConfigSectionHandler subscriber)
Setup notification of configuration file sections.
static void initialize(const std::string &userName, const std::string &groupName)
void setConfigFile(ConfigFile &config)
static void onConfig(const ConfigSection §ion, bool isDryRun, const std::string &)
boost::property_tree::ptree ConfigSection
A configuration file section.