Opened 13 years ago

Last modified 9 years ago

#3925 new Tasks

Property tree documentation is seriously out of date

Reported by: anonymous Owned by: Sebastian Redl
Milestone: Boost 1.43.0 Component: property_tree
Version: Boost 1.42.0 Severity: Cosmetic
Keywords: Cc:

Description

At http://www.boost.org/doc/libs/1_42_0/doc/html/boost_propertytree/parsers.html, the end page notes contains stuffs like "[include cmd_line_parser.qbk]", this is unlikely what the author wants.

At http://www.boost.org/doc/libs/1_42_0/doc/html/boost_propertytree/accessing.html, the 2nd code is like "double pi = boost::lexical_cast<double>(it->second._ptree_data());", _ptree_data is just wrong. Same for the last code "pt.ptree_put_own(3.14f);"

I'm pretty sure I could find much more errors like this, someone should take the time to read the documentation accuratly.

Change History (8)

in reply to:  description comment:1 by anonymous, 13 years ago

There's also http://www.boost.org/doc/libs/1_42_0/doc/html/boost_propertytree/accessing.html which is just plain wrong on access like:

pt.get<float>('/', "p.a.t.h/t.o/v.a.l.u.e");

This is actually done like this:

pt.get<float>(ptree::path_type("p.a.t.h/t.o/v.a.l.u.e", '/'));

comment:2 by anonymous, 13 years ago

Summary: Property tree documentation has a lot of formatting bugsProperty tree documentation is seriously out of date

comment:3 by Rob Stewart <robert.stewart@…>, 12 years ago

These problems persist in 1.45. accessing.html also mentions __ptree_put_own__ on the last line. (I think it should be put_value instead.)

comment:4 by Sebastian Redl, 11 years ago

Big improvements in r71994, but still work to do.

comment:5 by anonymous, 11 years ago

In: http://www.boost.org/doc/libs/1_46_1/libs/property_tree/examples/debug_settings.cpp

This probably shouldn't be a comment. It works works fine on the example input, and if it throws an exception there is a comment above explaining why.

    //BOOST_FOREACH(ptree::value_type &v, pt.get_child("debug.modules"))
    //    m_modules.insert(v.second.data());

In: http://www.boost.org/doc/libs/1_46_1/doc/html/boost/property_tree/basic_ptree.html

The documentation for

template<typename Type> 
  self_type & add(const path_type & path, const Type & value);

says Set the newly created node's value to the given paremeter, translated with the supplied translator, but there is no translator argument. Replace with translated using the default translator or translated to the tree's data type or something like that. Also fix the paremeter typos.

The comment for

template<typename Type, typename Translator> 
  self_type & put(const path_type & path, const Type & value, Translator tr)

should probably say translated with the supplied translator to distinguish this method from the default translator version.

Remove the quoting of < and > in the code explaining the get_optional() methods.

if(optional\<const self_type&\> node = get_child_optional(path))

In: http://www.boost.org/doc/libs/1_46_1/doc/html/boost_propertytree/parsers.html#boost_propertytree.parsers.json_parser

There is a bad trailing comma in this line of the example:

{"value": "Open", "onclick": "OpenDoc()"},

comment:6 by monsta@…, 11 years ago

The description of translators is still basically non-existent as of Boost 1.47. I've managed to figure out most of the internal mechanics by scrutinizing id_translator.hpp and stream_translator.hpp, but I guess that's not acceptable for everyone.

comment:7 by anonymous, 11 years ago

Still the same as of Boost 1.49.

comment:8 by anonymous, 9 years ago

Hey, still the same in Boost 1.55. Is there a maintainer? Should we elect a new one?

Note: See TracTickets for help on using tickets.