Skip to content

Instantly share code, notes, and snippets.

@usagi
Created January 16, 2014 10:40
Show Gist options
  • Select an option

  • Save usagi/8452857 to your computer and use it in GitHub Desktop.

Select an option

Save usagi/8452857 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <boost/property_tree/ini_parser.hpp>
int main()
{
using std::cout;
using boost::property_tree::ptree;
using boost::property_tree::write_ini;
ptree p;
p.put("hoge", 123);
p.put("pi.float" , 3.14159265358979323846264338327950288f);
p.put("pi.double" , 3.14159265358979323846264338327950288 );
p.put("pi.long double", 3.14159265358979323846264338327950288l);
p.put("紅茶.アッサム" , "インド");
p.put("紅茶.ダージリン", "インド");
p.put("紅茶.ニルギリ" , "インド");
p.put("青茶.金萱" , "台湾");
p.put("青茶.鉄観音" , "中国");
p.put("緑茶.八女" , "日本");
p.put("緑茶.龍井" , "中国");
write_ini(cout, p);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment