boost::property_tree is seriously outdated/incomplete

Hello, Basically boost::property_tree documention is incomplete and outdated. There is simply no documentation on what a "Translator" is, only by digging the source you are able to understand it can be used to convert fetched values before returning them. Same goes for "stream_translator", still no idea what it's useful for. What's worse is that the documentation contains WRONG ways of doings things, like it says to change the default '.' separator one should use: pt.get<float>('/', "p.a.t.h/t.o/v.a.l.u.e"); But this is actually done like this: pt.get<float>(boost::property_tree::ptree::path_type("p.a.t.h/t.o/v.a.l.u.e", '/')); Then there are all the quickbook formatting bugs there and there, I made a ticket summing all I've found here https://svn.boost.org/trac/boost/ticket/3925 I hope someone will look after this because boost::property_tree has a great potential and it's a shame the documentation discourages people from using it. There's also obvious changes that ought to happen like being able to get the parent of a ptree node. My 0.02$ Philippe

Il 16/02/2010 15:48, Philippe Vaucher ha scritto:
Hello,
Basically boost::property_tree documention is incomplete and outdated.
[...]
I hope someone will look after this because boost::property_tree has a great potential and it's a shame the documentation discourages people from using it. There's also obvious changes that ought to happen like being able to get the parent of a ptree node.
Hi, I'm using property tree for a Qt-based project, and of course documentation is outdated. However, looking at source code can be useful, I find the right way doing that. I think property tree is well-coded so don't worry about outdated documentation. If you have some problem using property tree, please ask, and maybe someone can help you.

Il 16/02/2010 18:49, Philippe Vaucher ha scritto:
I think property tree is well-coded so don't worry about outdated documentation.
Disregarding the fact outdated documentation is bad no matter how well coded it is, what do you think of the design issues I raised?
Philippe _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Sorry Philippe, I delete your mail. Can you repeat me? :-) Really, please sorry, I'm working on degree thesis, and I'm a little bit confused... Thanks in advance, and try to explain the problem with a lot of details because I understand English as I understand dog-languages!

About the basic_ptree design: - I think we'd add basic_ptree::parent(), that looks like an easy & obvious change to me. - I think we'd allow to set the default separator ('.') for the whole ptree (instead of only allowing it in .get() requests) If people agree with those changes, I'll create another ticket on the trac. Philippe

Philippe Vaucher wrote:
About the basic_ptree design:
- I think we'd add basic_ptree::parent(), that looks like an easy & obvious change to me. - I think we'd allow to set the default separator ('.') for the whole ptree (instead of only allowing it in .get() requests)
If people agree with those changes, I'll create another ticket on the trac.
Hi, I'm the PTree maintainer, and I know I'm not giving it nearly enough attention as it needs at this stage. I'll get around to it some day soon. As for your suggestions: parent() is a no-go, I think. I actually suggested it back when the library was first proposed for Boost. I can't remember exactly why the author shot it down, but it was a pretty convincing argument. I'll have to go dig in the archives. Setting the default separator is something I'll have to think about. That you can't supply a different separator for operations other than get() is definitely a bug. Sebastian

I'm the PTree maintainer, and I know I'm not giving it nearly enough attention as it needs at this stage. I'll get around to it some day soon.
Hi! Thanks for your attention. No worries I know it's easy to get all your time eaten by other projects.
As for your suggestions: parent() is a no-go, I think. I actually suggested it back when the library was first proposed for Boost. I can't remember exactly why the author shot it down, but it was a pretty convincing argument. I'll have to go dig in the archives.
Hum I'd like to hear about it, apparently the tree uses boost::multi_index_container as its implementation. I'm not sure how hard it'd be to make it so node creation store a pointer to their parent.
Setting the default separator is something I'll have to think about. That you can't supply a different separator for operations other than get() is definitely a bug.
Hum sorry I probably missexpressed myself. What I meant is that you have to specify the separator for each .get()/.put() etc request. The code gets quickly too verbose: boost::property_tree::ptree tree; tree.put(boost::property_tree::ptree::path_type("foo/bar", '/'), 123); unsigned n = tree.get<unsigned>(boost::property_tree::ptree::path_type("foo/bar", '/')); boost::property_tree::ptree& child = tree.get_child(boost::property_tree::ptree::path_type("foo/bar", '/')); If one could pass the default separator or pass the path_type to boost::property_tree::ptree (instead of it being deduced from the key_type), one could do: boost::property_tree::ptree tree('/'); tree.put("foo/bar", 123); unsigned n = tree.get<unsigned>("foo/bar"); boost::property_tree::ptree& child = tree.get_child("foo/bar"); I think most people want to change from '.' to '/' for ALL operations, not just one specific key... Thanks! Philippe
participants (3)
-
Michele Caini
-
Philippe Vaucher
-
Sebastian Redl