现在的位置: 首页 > 综合 > 正文

propertytree parser ini file

2012年07月27日 ⁄ 综合 ⁄ 共 388字 ⁄ 字号 评论关闭

c++ - How to parse ini file with Boost - Stack Overflow

ou can also use Boost.PropertyTree to read .ini files:

#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/ini_parser.hpp>

...

boost::property_tree::ptree pt;
boost::property_tree::ini_parser::read_ini("config.ini", pt);
std::cout << pt.get<std::string>("Section1.Value1") << std::endl;
std::cout << pt.get<std::string>("Section1.Value2") << std::endl;

抱歉!评论已关闭.