44save(
const std::string& fileName, boost::property_tree::ptree& info)
46 std::ofstream output(fileName);
48 write_info(output, info);
49 }
catch (
const boost::property_tree::info_parser::info_parser_error& error) {
71remove(
const std::string& fileName,
const std::string& section)
73 boost::property_tree::ptree info;
75 info =
load(fileName);
77 catch (
const boost::property_tree::info_parser::info_parser_error& error) {
80 std::size_t pos = section.find_last_of(
".");
81 if (pos == std::string::npos) {
82 info.erase(section.c_str());
85 boost::optional<boost::property_tree::ptree&> child =
86 info.get_child_optional(section.substr(0, pos));
88 child->erase(section.substr(pos + 1));
91 return save(fileName, info);