From: Marcin Kalicinski (kalita_at_[hidden])
Date: 2006-04-21 19:21:51
> My vote on the current property_tree submission is NO. I think it could be
> re-submitted in the future given a clear rationale accurately stating:
> - it's intended use
> - a comparison with similar libraries (have you looked at McObject's
> ExtremeDb as one example)
> - why/why not it's not based on boost.graph libray as a
I believe this rather belongs to a domain of implementation details. What
difference would there be for the users? I have a clear vision of ptree, and
this is std container + extra member functions to make access a snap. I
would not like to expose any boost.graph interface anyway.
> - why would I not just use map< vector<string>, data > along with
> upper/lower bound
Hmm. I think I have an answer below:
// I want to extract an int from some config file
// That's what I've got to do:
typedef std::map< std::vector<std::string>, std::string > Container;
read_xml(..., container); // Note this must be defined somewhere anyway
Container::const_iterator it = container.find(path); // A very inefficient
if (it != container.end())
out_stream << it->second;
in_stream >> i; // Finally got it!
Not a pretty sight, is it? I'd rather download TinyXML. Note that it already
assumes there are parsers implemented somewhere else, which create that
monstrous map. The map solution also does not let you manipulate the
hierarchy in memory - map is a linear structure even though it is internally
implemented as a tree.
I believe any attempt to make the above shorter and more manageable leads
just towards implementing another version of property_tree.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk