Hi Fokes:

Ok, I’ve got a standard windows-stle ini file.

I can check that a section exists, and then get that section, using it->second, where it is declared as:

boost::property_tree::ptree::const_assoc_iterator it;

I’ve then assigned the it->second variable to a new property_tree. What I now need to do is iterate though the tree I’ve just assigned and get all the section keys/values.

I’m using the following code to add them all to a map:

std::map<string, string> SectionProps;

BOOST_FOREACH(boost::property_tree::ptree::value_type &v, SectionTree)

       {

Key =v.first;

Value =v.second;

SectionProps.insert(std::make_pair(Key, Value));

       }

It seems that even though thwe values in the ini file will be strings, of the vorm

Key1=valu1 as normal, I am still getting another ptree as my second argument of the pair. How do I obtain the value from this? There are never any sub sections.

Any help appreciated.

Cheers

Sean.