Skip to content

Commit

Permalink
Boost ptree OK
Browse files Browse the repository at this point in the history
  • Loading branch information
vintagewang committed May 29, 2012
1 parent 853c216 commit 9a1c24c
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/jwrapper.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
#include "stdafx.h"

#include <iostream>
#include <string>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/xml_parser.hpp>
#include <boost/typeof/std/utility.hpp>
using namespace boost::property_tree;
using std::cout;
using std::endl;
using std::string;

void test_ptree()
{
ptree pt;
read_xml("jwrapper.xml", pt);
cout << pt.get<string>("java.javahome") << endl;
cout << pt.get<string>("java.mainclass") << endl;

BOOST_AUTO(child, pt.get_child("java.classpaths"));
for (BOOST_AUTO(pos, child.begin());
pos != child.end();
++pos)
{
cout << pos->second.data()<< ",";
}
}

int main(int argc, char** argv)
Expand Down

0 comments on commit 9a1c24c

Please sign in to comment.