#include<boost/property_tree/ptree.hpp>
#include<boost/property_tree/xml_parser.hpp>
#include<string>
#include<set>
#include<iostream>
namespace pt = boost::property_tree;
struct debug_settings
{
std::string m_file;
int m_level;
std::set<std::string> m_modules;
void load(const std::string& file_name);
void save(const std::string& file_name);
};
void debug_settings::load(const std::string& file_name)
{
pt::ptree tree;
pt::read_xml(file_name, tree);
m_file = tree.get<std::string>("debug.file_name");
m_level = tree.get("debug.level", 0);
boost property tree读写xml和ini
最新推荐文章于 2024-08-22 16:06:07 发布