property_tree/doc/property_tree.qbk
2015-01-23 16:01:53 +01:00

119 lines
5.5 KiB
Plaintext

[/
/ Copyright (c) 2008 Marcin Kalicinski (kalita <at> poczta dot onet dot pl)
/ Copyright (c) 2009 Sebastian Redl (sebastian dot redl <at> getdesigned dot at)
/
/ Distributed under the Boost Software License, Version 1.0. (See accompanying
/ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
/]
[library Boost.PropertyTree
[quickbook 1.6]
[copyright 2008-2010 Marcin Kalicinski]
[copyright 2010-2013 Sebastian Redl]
[purpose Property Tree library]
[license
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
[@http://www.boost.org/LICENSE_1_0.txt])
]
[authors [Kalicinski, Marcin], [Redl, Sebastian]]
[id property_tree]
[dirname property_tree]
[category container]
[category template]
]
[/ Tried to use templates here but got errors expanding them in [classref ...] etc.]
[/ types]
[def __ptree__ [classref boost::property_tree::ptree ptree]]
[def __ptree_value_type__ [classref boost::property_tree::basic_ptree::value_type value_type]]
[def __ptree_data_type__ [classref boost::property_tree::basic_ptree::data_type data_type]]
[def __ptree_iterator__ [classref boost::property_tree::basic_ptree::iterator iterator]]
[def __ptree_const_iterator__ [classref boost::property_tree::basic_ptree::const_iterator const_iterator]]
[def __ptree_assoc_iterator__ [classref boost::property_tree::basic_ptree::assoc_iterator assoc_iterator]]
[def __ptree_const_assoc_iterator__ [classref boost::property_tree::basic_ptree::const_assoc_iterator const_assoc_iterator]]
[def __path__ [classref boost::property_tree::string_path path]]
[def __ptree_error__ [classref boost::property_tree::ptree_error ptree_error]]
[def __ptree_bad_data__ [classref boost::property_tree::ptree_bad_data ptree_bad_data]]
[def __ptree_bad_path__ [classref boost::property_tree::ptree_bad_path ptree_bad_path]]
[/ members]
[def __ptree_data__ [memberref boost::property_tree::basic_ptree::data data]]
[def __ptree_find__ [memberref boost::property_tree::basic_ptree::find find]]
[def __ptree_insert__ [memberref boost::property_tree::basic_ptree::insert insert]]
[def __ptree_push_front__ [memberref boost::property_tree::basic_ptree::push_front push_front]]
[def __ptree_push_back__ [memberref boost::property_tree::basic_ptree::push_back push_back]]
[def __ptree_erase__ [memberref boost::property_tree::basic_ptree::erase erase]]
[def __ptree_sort__ [memberref boost::property_tree::basic_ptree::sort sort]]
[def __ptree_get__ [memberref boost::property_tree::basic_ptree::get get]]
[/ XXX: Don't know how to specify overloads]
[def __ptree_get_defaulted__ [memberref boost::property_tree::basic_ptree::get get]]
[def __ptree_get_optional__ [memberref boost::property_tree::basic_ptree::get_optional get_optional]]
[def __ptree_get_value__ [memberref boost::property_tree::basic_ptree::get_value get_value]]
[/ XXX: Don't know how to specify overloads]
[def __ptree_get_value_defaulted__ [memberref boost::property_tree::basic_ptree::get_value get_value]]
[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_add__ [memberref boost::property_tree::basic_ptree::add add]]
[def __ptree_put_value__ [memberref boost::property_tree::basic_ptree::put_value put_value]]
[/ free-functions]
[def __read_xml__ [funcref boost::property_tree::xml_parser::read_xml read_xml]]
[def __write_xml__ [funcref boost::property_tree::xml_parser::write_xml write_xml]]
[include intro.qbk]
[include tutorial.qbk]
[include container.qbk]
[include synopsis.qbk]
[include parsers.qbk]
[include accessing.qbk]
[section Appendices]
[heading Compatibility]
Property tree uses partial class template specialization. There has been no
attempt to work around lack of support for this. The library will therefore
most probably not work with Visual C++ 7.0 or earlier, or gcc 2.x.
Property tree has been tested (regressions successfully compiled and run)
with the following compilers:
* Visual C++ 8.0
* gcc 3.4.2 (MinGW)
* gcc 3.3.5 (Linux)
* gcc 3.4.4 (Linux)
* gcc 4.3.3 (Linux)
* Intel C++ 9.0 (Linux)
[heading Rationale]
# [*Why are there 3 versions of __ptree_get__? Couldn't there be just one?]
The three versions reflect experience gathered during several of years of using
property tree in several different applications. During that time I tried hard
to come up with one, proper form of the get function, and failed. I know of
these three basic patterns of usage:
* ['Just get the data and I do not care if it cannot be done.] This is used
when the programmer is fairly sure that data exists. Or in homework
assignments. Or when tomorrow is final deadline for your project.
* ['Get the data and revert to default value if it cannot be done.] Used when
you want to allow omitting the key in question. Implemented by some similar
tools (windows INI file access functions).
* ['Get the data, but I care more whether you succeeded than I do for the data
itself.] Used when you want to vary control flow depending on get
success/failure. Or to check for presence of a key.
[heading Future Development]
* More parsers: YAML, environment strings.
* More robust XML parser.
* Mathematical relations: ptree difference, union, intersection.
Useful for finding configuration file changes etc.
[endsect] [/ Appendices]
[xinclude autodoc.xml]