Skip to content

Instantly share code, notes, and snippets.

@autosquid
Created May 8, 2014 03:02
Show Gist options
  • Save autosquid/536faad4435558037436 to your computer and use it in GitHub Desktop.
Save autosquid/536faad4435558037436 to your computer and use it in GitHub Desktop.
parse ini with boost property tree (ptree)
#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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment