I love the way of how Boost property_tree
parsing certain types of files. But my file is kind of different
/*--------------------------------*- C++ -*----------------------------------*\
| WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW |
\*---------------------------------------------------------------------------*/
INFORMATION
{
version 2.0;
format ascii;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
school
{
"(boys|girls)"
{
hair red;
legs short;
nose long;
mood good;
}
workers
{
hair green;
legs long;
nose abnormal;
mood bad;
}
}
// ************************************************************************* //
I hope it can be used in this way
string myMood = pt.get<std::string>("school.boys.mood");
cout<< "\tmyMood is = " << myMood << endl;
Which is very clean and straightforward.
But it seems currently the boost ptree INFO parser cannot handle comments and "(boys|girls)"
type.
Any solution?