Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r61615 - in trunk/libs/property_tree: doc examples
From: sebastian.redl_at_[hidden]
Date: 2010-04-27 08:23:58


Author: cornedbee
Date: 2010-04-27 08:23:56 EDT (Tue, 27 Apr 2010)
New Revision: 61615
URL: http://svn.boost.org/trac/boost/changeset/61615

Log:
Update tutorial and an example to the new functions. Fixes bug 3929.
Text files modified:
   trunk/libs/property_tree/doc/property_tree.qbk | 1 +
   trunk/libs/property_tree/doc/tutorial.qbk | 2 +-
   trunk/libs/property_tree/examples/debug_settings.cpp | 12 ++++++------
   3 files changed, 8 insertions(+), 7 deletions(-)

Modified: trunk/libs/property_tree/doc/property_tree.qbk
==============================================================================
--- trunk/libs/property_tree/doc/property_tree.qbk (original)
+++ trunk/libs/property_tree/doc/property_tree.qbk 2010-04-27 08:23:56 EDT (Tue, 27 Apr 2010)
@@ -53,6 +53,7 @@
 [def __ptree_get_value_optional__ [memberref boost::property_tree::basic_ptree::get_value_optional get_value_optional]]
 [def __ptree_get_child__ [memberref boost::property_tree::basic_ptree::get_child get_child]]
 [def __ptree_put__ [memberref boost::property_tree::basic_ptree::put put]]
+[def __ptree_put__ [memberref boost::property_tree::basic_ptree::add add]]
 [def __ptree_put_value__ [memberref boost::property_tree::basic_ptree::put_value put_value]]
 
 [/ free-functions]

Modified: trunk/libs/property_tree/doc/tutorial.qbk
==============================================================================
--- trunk/libs/property_tree/doc/tutorial.qbk (original)
+++ trunk/libs/property_tree/doc/tutorial.qbk 2010-04-27 08:23:56 EDT (Tue, 27 Apr 2010)
@@ -106,7 +106,7 @@
       // be achieved using a combination of the insert and put_own
       // functions.
       BOOST_FOREACH(const std::string &name, m_modules)
- pt.__ptree_put__("debug.modules.module", name, true);
+ pt.__ptree_add__("debug.modules.module", name);
 
       // Write the property tree to the XML file.
       __write_xml__(filename, pt);

Modified: trunk/libs/property_tree/examples/debug_settings.cpp
==============================================================================
--- trunk/libs/property_tree/examples/debug_settings.cpp (original)
+++ trunk/libs/property_tree/examples/debug_settings.cpp 2010-04-27 08:23:56 EDT (Tue, 27 Apr 2010)
@@ -10,7 +10,7 @@
 
 #include <boost/property_tree/ptree.hpp>
 #include <boost/property_tree/xml_parser.hpp>
-//#include <boost/foreach.hpp>
+#include <boost/foreach.hpp>
 #include <string>
 #include <set>
 #include <exception>
@@ -77,15 +77,15 @@
     // Put debug level in property tree
     pt.put("debug.level", m_level);
 
- // Iterate over modules in set and put them in property
- // tree. Note that put function places new key at the
+ // Iterate over modules in set and put them in property
+ // tree. Note that the add function places new key at the
     // end of list of keys. This is fine in most of the
     // situations. If you want to place item at some other
     // place (i.e. at front or somewhere in the middle),
- // this can be achieved using combination of insert
+ // this can be achieved using a combination of the insert
     // and put_value functions
- //BOOST_FOREACH(const std::string &name, m_modules)
- // pt.put("debug.modules.module", name, true);
+ BOOST_FOREACH(const std::string &name, m_modules)
+ pt.add("debug.modules.module", name);
     
     // Write property tree to XML file
     write_xml(filename, pt);


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk