]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/property_tree/doc/intro.qbk
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / property_tree / doc / intro.qbk
CommitLineData
7c673cae
FG
1[/
2 / Copyright (c) 2008 Marcin Kalicinski (kalita <at> poczta dot onet dot pl)
3 / Copyright (c) 2009 Sebastian Redl (sebastian dot redl <at> getdesigned dot at)
4 /
5 / Distributed under the Boost Software License, Version 1.0. (See accompanying
6 / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 /]
8[template ptree2codeImage[] [$images/ptree2code.png]]
9[section:intro What is Property Tree?]
10The Property Tree library provides a data structure that stores an arbitrarily
11deeply nested tree of values, indexed at each level by some key. Each node of
12the tree stores its own value, plus an ordered list of its subnodes and their
13keys. The tree allows easy access to any of its nodes by means of a path, which
14is a concatenation of multiple keys.
15
16In addition, the library provides parsers and generators for a number of data
17formats that can be represented by such a tree, including XML, INI, and JSON.
18
19Property trees are versatile data structures, but are particularly suited for
20holding configuration data. The tree provides its own, tree-specific interface,
21and each node is also an STL-compatible Sequence for its child nodes.
22
23Conceptually, then, a node can be thought of as the following structure:
24
25 struct ptree
26 {
27 data_type data; // data associated with the node
28 list< pair<key_type, ptree> > children; // ordered list of named children
29 };
30
31Both key_type and data_type are configurable to some extent, but will usually be
32std::string or std::wstring, and the parsers only work with this kind of tree.
33
34Many software projects develop a similar tool at some point of their lifetime,
35and property tree originated the same way. We hope the library can save many
36from reinventing the wheel.
37[endsect] [/intro]