#include <ptree.hpp>
Classes | |
class | assoc_iterator |
class | const_assoc_iterator |
class | const_iterator |
class | const_reverse_iterator |
class | iterator |
class | reverse_iterator |
struct | subs |
Public Types | |
typedef Data | data_type |
typedef KeyCompare | key_compare |
typedef Key | key_type |
typedef path_of< Key >::type | path_type |
typedef std::size_t | size_type |
typedef std::pair< const Key, self_type > | value_type |
Public Member Functions | |
template<class Type > | |
self_type & | add (const path_type &path, const Type &value) |
template<class Type > | |
basic_ptree< K, D, C > & | add (const path_type &path, const Type &value) |
template<class Type , class Translator > | |
self_type & | add (const path_type &path, const Type &value, Translator tr) |
template<class Type , typename Translator > | |
basic_ptree< K, D, C > & | add (const path_type &path, const Type &value, Translator tr) |
self_type & | add_child (const path_type &path, const self_type &value) |
value_type & | back () |
const value_type & | back () const |
basic_ptree () | |
basic_ptree (const data_type &data) | |
basic_ptree (const self_type &rhs) | |
iterator | begin () |
const_iterator | begin () const |
void | clear () |
size_type | count (const key_type &key) const |
data_type & | data () |
const data_type & | data () const |
bool | empty () const |
iterator | end () |
const_iterator | end () const |
std::pair< assoc_iterator, assoc_iterator > | equal_range (const key_type &key) |
std::pair< const_assoc_iterator, const_assoc_iterator > | equal_range (const key_type &key) const |
size_type | erase (const key_type &key) |
iterator | erase (iterator first, iterator last) |
iterator | erase (iterator where) |
assoc_iterator | find (const key_type &key) |
const_assoc_iterator | find (const key_type &key) const |
value_type & | front () |
const value_type & | front () const |
template<class Type > | |
Type | get (const path_type &path) const |
template<class Ch > | |
boost::enable_if< detail::is_character< Ch >, std::basic_string< Ch > >::type | get (const path_type &path, const Ch *default_value) const |
template<class Ch , class Translator > | |
boost::enable_if< detail::is_character< Ch >, std::basic_string< Ch > >::type | get (const path_type &path, const Ch *default_value, Translator tr) const |
template<class Type > | |
boost::disable_if< detail::is_translator< Type >, Type >::type | get (const path_type &path, const Type &default_value) const |
template<class Type , class Translator > | |
Type | get (const path_type &path, const Type &default_value, Translator tr) const |
template<class Type , class Translator > | |
boost::enable_if< detail::is_translator< Translator >, Type >::type | get (const path_type &path, Translator tr) const |
self_type & | get_child (const path_type &path) |
const self_type & | get_child (const path_type &path) const |
const self_type & | get_child (const path_type &path, const self_type &default_value) const |
self_type & | get_child (const path_type &path, self_type &default_value) |
optional< self_type & > | get_child_optional (const path_type &path) |
optional< const self_type & > | get_child_optional (const path_type &path) const |
template<class Type > | |
optional< Type > | get_optional (const path_type &path) const |
template<class Type , class Translator > | |
optional< Type > | get_optional (const path_type &path, Translator tr) const |
template<class Type > | |
Type | get_value () const |
template<class Ch > | |
boost::enable_if< detail::is_character< Ch >, std::basic_string< Ch > >::type | get_value (const Ch *default_value) const |
template<class Ch , class Translator > | |
boost::enable_if< detail::is_character< Ch >, std::basic_string< Ch > >::type | get_value (const Ch *default_value, Translator tr) const |
template<class Type > | |
boost::disable_if< detail::is_translator< Type >, Type >::type | get_value (const Type &default_value) const |
template<class Type , class Translator > | |
Type | get_value (const Type &default_value, Translator tr) const |
template<class Type , class Translator > | |
boost::enable_if< detail::is_translator< Translator >, Type >::type | get_value (Translator tr) const |
template<class Type > | |
optional< Type > | get_value_optional () const |
template<class Type , class Translator > | |
optional< Type > | get_value_optional (Translator tr) const |
iterator | insert (iterator where, const value_type &value) |
template<class It > | |
void | insert (iterator where, It first, It last) |
size_type | max_size () const |
assoc_iterator | not_found () |
const_assoc_iterator | not_found () const |
bool | operator!= (const self_type &rhs) const |
self_type & | operator= (const self_type &rhs) |
bool | operator== (const self_type &rhs) const |
assoc_iterator | ordered_begin () |
const_assoc_iterator | ordered_begin () const |
void | pop_back () |
void | pop_front () |
iterator | push_back (const value_type &value) |
iterator | push_front (const value_type &value) |
template<class Type > | |
self_type & | put (const path_type &path, const Type &value) |
template<class Type > | |
basic_ptree< K, D, C > & | put (const path_type &path, const Type &value) |
template<class Type , class Translator > | |
self_type & | put (const path_type &path, const Type &value, Translator tr) |
template<class Type , typename Translator > | |
basic_ptree< K, D, C > & | put (const path_type &path, const Type &value, Translator tr) |
self_type & | put_child (const path_type &path, const self_type &value) |
template<class Type > | |
void | put_value (const Type &value) |
template<class Type , class Translator > | |
void | put_value (const Type &value, Translator tr) |
reverse_iterator | rbegin () |
const_reverse_iterator | rbegin () const |
reverse_iterator | rend () |
const_reverse_iterator | rend () const |
void | reverse () |
size_type | size () const |
void | sort () |
template<class Compare > | |
void | sort (Compare comp) |
void | swap (self_type &rhs) |
iterator | to_iterator (assoc_iterator it) |
const_iterator | to_iterator (const_assoc_iterator it) const |
~basic_ptree () | |
Private Types | |
typedef basic_ptree< Key, Data, KeyCompare > | self_type |
Private Member Functions | |
self_type & | force_path (path_type &p) |
self_type * | walk_path (path_type &p) const |
Private Attributes | |
void * | m_children |
data_type | m_data |
Friends | |
class | const_iterator |
class | const_reverse_iterator |
class | iterator |
class | reverse_iterator |
struct | subs |
Property tree main structure. A property tree is a hierarchical data structure which has one element of type Data
in each node, as well as an ordered sequence of sub-nodes, which are additionally identified by a non-unique key of type Key
.
Key equivalency is defined by KeyCompare
, a predicate defining a strict weak ordering.
Property tree defines a Container-like interface to the (key-node) pairs of its direct sub-nodes. The iterators are bidirectional. The sequence of nodes is held in insertion order, not key order.
typedef Data boost::property_tree::basic_ptree< Key, Data, KeyCompare >::data_type |
typedef KeyCompare boost::property_tree::basic_ptree< Key, Data, KeyCompare >::key_compare |
typedef Key boost::property_tree::basic_ptree< Key, Data, KeyCompare >::key_type |
typedef path_of<Key>::type boost::property_tree::basic_ptree< Key, Data, KeyCompare >::path_type |
|
private |
Simpler way to refer to this basic_ptree<C,K,P,A> type. Note that this is private, and made public only for doxygen.
typedef std::size_t boost::property_tree::basic_ptree< Key, Data, KeyCompare >::size_type |
typedef std::pair<const Key, self_type> boost::property_tree::basic_ptree< Key, Data, KeyCompare >::value_type |
|
inline |
Creates a node with no children and default-constructed data.
Definition at line 179 of file ptree_implementation.hpp.
|
inlineexplicit |
Creates a node with no children and a copy of the given data.
Definition at line 185 of file ptree_implementation.hpp.
boost::property_tree::basic_ptree< Key, Data, KeyCompare >::basic_ptree | ( | const self_type & | rhs | ) |
boost::property_tree::basic_ptree< K, D, C >::~basic_ptree |
Definition at line 206 of file ptree_implementation.hpp.
self_type& boost::property_tree::basic_ptree< Key, Data, KeyCompare >::add | ( | const path_type & | path, |
const Type & | value | ||
) |
If the node identified by the path does not exist, create it, including all its missing parents. If the node already exists, add a sibling with the same key. Set the newly created node's value to the given paremeter, translated with the supplied translator.
path | Path to the child. The last fragment must not have an index. |
value | The value to add. |
ptree_bad_data | if the conversion fails. |
|
inline |
Definition at line 875 of file ptree_implementation.hpp.
self_type& boost::property_tree::basic_ptree< Key, Data, KeyCompare >::add | ( | const path_type & | path, |
const Type & | value, | ||
Translator | tr | ||
) |
If the node identified by the path does not exist, create it, including all its missing parents. If the node already exists, add a sibling with the same key. Set the newly created node's value to the given paremeter, translated with the supplied translator.
path | Path to the child. The last fragment must not have an index. |
value | The value to add. |
tr | The translator to use. |
ptree_bad_data | if the conversion fails. |
|
inline |
Definition at line 865 of file ptree_implementation.hpp.
basic_ptree< K, D, C > & boost::property_tree::basic_ptree< K, D, C >::add_child | ( | const path_type & | path, |
const self_type & | value | ||
) |
Add the node at the given path. Create any missing parents. If there already is a node at the path, add another one with the same key.
path | Path to the child. The last fragment must not have an index. |
Definition at line 652 of file ptree_implementation.hpp.
|
inline |
Definition at line 313 of file ptree_implementation.hpp.
const value_type& boost::property_tree::basic_ptree< Key, Data, KeyCompare >::back | ( | ) | const |
|
inline |
Definition at line 243 of file ptree_implementation.hpp.
const_iterator boost::property_tree::basic_ptree< Key, Data, KeyCompare >::begin | ( | ) | const |
|
inline |
Clear this tree completely, of both data and children.
Definition at line 563 of file ptree_implementation.hpp.
|
inline |
Count the number of direct children with the given key.
Definition at line 518 of file ptree_implementation.hpp.
|
inline |
Reference to the actual data in this node.
Definition at line 550 of file ptree_implementation.hpp.
const data_type& boost::property_tree::basic_ptree< Key, Data, KeyCompare >::data | ( | ) | const |
Reference to the actual data in this node.
|
inline |
Whether there are any direct children.
Definition at line 236 of file ptree_implementation.hpp.
|
inline |
Definition at line 257 of file ptree_implementation.hpp.
const_iterator boost::property_tree::basic_ptree< Key, Data, KeyCompare >::end | ( | ) | const |
|
inline |
Find the range of children that have the given key.
Definition at line 494 of file ptree_implementation.hpp.
|
inline |
Find the range of children that have the given key.
Definition at line 507 of file ptree_implementation.hpp.
|
inline |
Erase all direct children with the given key and return the count.
Definition at line 525 of file ptree_implementation.hpp.
|
inline |
Range erase. Equivalent to:
Definition at line 348 of file ptree_implementation.hpp.
|
inline |
Erase the child pointed at by the iterator. This operation invalidates the given iterator, as well as its equivalent assoc_iterator.
Definition at line 341 of file ptree_implementation.hpp.
|
inline |
Find a child with the given key, or not_found() if there is none. There is no guarantee about which child is returned if multiple have the same key.
Definition at line 478 of file ptree_implementation.hpp.
|
inline |
Find a child with the given key, or not_found() if there is none. There is no guarantee about which child is returned if multiple have the same key.
Definition at line 485 of file ptree_implementation.hpp.
|
private |
Definition at line 903 of file ptree_implementation.hpp.
|
inline |
Definition at line 299 of file ptree_implementation.hpp.
const value_type& boost::property_tree::basic_ptree< Key, Data, KeyCompare >::front | ( | ) | const |
|
inline |
Shorthand for get_child(path).get_value<Type>().
Definition at line 749 of file ptree_implementation.hpp.
boost::enable_if< detail::is_character< Ch >, std::basic_string< Ch > >::type boost::property_tree::basic_ptree< K, D, C >::get | ( | const path_type & | path, |
const Ch * | default_value | ||
) | const |
Make get do the right thing for string literals.
Definition at line 790 of file ptree_implementation.hpp.
boost::enable_if< detail::is_character< Ch >, std::basic_string< Ch > >::type boost::property_tree::basic_ptree< K, D, C >::get | ( | const path_type & | path, |
const Ch * | default_value, | ||
Translator | tr | ||
) | const |
Make get do the right thing for string literals.
Definition at line 769 of file ptree_implementation.hpp.
|
inline |
Shorthand for get_child(path, empty_ptree()) .get_value(default_value). That is, return the translated value if possible, and the default value if the node doesn't exist or conversion fails.
Definition at line 778 of file ptree_implementation.hpp.
|
inline |
Shorthand for get_child(path, empty_ptree()) .get_value(default_value, tr). That is, return the translated value if possible, and the default value if the node doesn't exist or conversion fails.
Definition at line 756 of file ptree_implementation.hpp.
|
inline |
Shorthand for get_child(path).get_value(tr).
Definition at line 741 of file ptree_implementation.hpp.
basic_ptree< K, D, C > & boost::property_tree::basic_ptree< K, D, C >::get_child | ( | const path_type & | path | ) |
Get the child at the given path, or throw ptree_bad_path
.
Definition at line 571 of file ptree_implementation.hpp.
|
inline |
Get the child at the given path, or throw ptree_bad_path
.
Definition at line 583 of file ptree_implementation.hpp.
|
inline |
Get the child at the given path, or return default_value
.
Definition at line 600 of file ptree_implementation.hpp.
|
inline |
Get the child at the given path, or return default_value
.
Definition at line 590 of file ptree_implementation.hpp.
optional< basic_ptree< K, D, C > & > boost::property_tree::basic_ptree< K, D, C >::get_child_optional | ( | const path_type & | path | ) |
Get the child at the given path, or return boost::null.
Definition at line 610 of file ptree_implementation.hpp.
optional< const basic_ptree< K, D, C > & > boost::property_tree::basic_ptree< K, D, C >::get_child_optional | ( | const path_type & | path | ) | const |
Get the child at the given path, or return boost::null.
Definition at line 622 of file ptree_implementation.hpp.
optional< Type > boost::property_tree::basic_ptree< K, D, C >::get_optional | ( | const path_type & | path | ) | const |
Shorthand for:
That is, return the value if it exists and can be converted, or nil.
Definition at line 810 of file ptree_implementation.hpp.
optional< Type > boost::property_tree::basic_ptree< K, D, C >::get_optional | ( | const path_type & | path, |
Translator | tr | ||
) | const |
Shorthand for:
That is, return the value if it exists and can be converted, or nil.
Definition at line 798 of file ptree_implementation.hpp.
|
inline |
Take the value of this node and attempt to translate it to a Type
object using the default translator.
ptree_bad_data | if the conversion fails. |
Definition at line 677 of file ptree_implementation.hpp.
boost::enable_if< detail::is_character< Ch >, std::basic_string< Ch > >::type boost::property_tree::basic_ptree< K, D, C >::get_value | ( | const Ch * | default_value | ) | const |
Make get_value do the right thing for string literals.
Definition at line 717 of file ptree_implementation.hpp.
boost::enable_if< detail::is_character< Ch >, std::basic_string< Ch > >::type boost::property_tree::basic_ptree< K, D, C >::get_value | ( | const Ch * | default_value, |
Translator | tr | ||
) | const |
Make get_value do the right thing for string literals.
Definition at line 697 of file ptree_implementation.hpp.
|
inline |
Take the value of this node and attempt to translate it to a Type
object using the default translator. Return default_value
if this fails.
Definition at line 705 of file ptree_implementation.hpp.
|
inline |
Take the value of this node and attempt to translate it to a Type
object using the supplied translator. Return default_value
if this fails.
Definition at line 685 of file ptree_implementation.hpp.
boost::enable_if< detail::is_translator< Translator >, Type >::type boost::property_tree::basic_ptree< K, D, C >::get_value | ( | Translator | tr | ) | const |
Take the value of this node and attempt to translate it to a Type
object using the supplied translator.
ptree_bad_data | if the conversion fails. |
Definition at line 665 of file ptree_implementation.hpp.
|
inline |
Take the value of this node and attempt to translate it to a Type
object using the default translator. Return boost::null if this fails.
Definition at line 732 of file ptree_implementation.hpp.
|
inline |
Take the value of this node and attempt to translate it to a Type
object using the supplied translator. Return boost::null if this fails.
Definition at line 724 of file ptree_implementation.hpp.
|
inline |
Insert a copy of the given tree with its key just before the given position in this node. This operation invalidates no iterators.
Definition at line 327 of file ptree_implementation.hpp.
|
inline |
Range insert. Equivalent to:
Definition at line 334 of file ptree_implementation.hpp.
|
inline |
Definition at line 230 of file ptree_implementation.hpp.
|
inline |
Returns the not-found iterator. Equivalent to end() in a real associative container.
Definition at line 464 of file ptree_implementation.hpp.
const_assoc_iterator boost::property_tree::basic_ptree< Key, Data, KeyCompare >::not_found | ( | ) | const |
Returns the not-found iterator. Equivalent to end() in a real associative container.
|
inline |
Definition at line 440 of file ptree_implementation.hpp.
basic_ptree< K, D, C > & boost::property_tree::basic_ptree< K, D, C >::operator= | ( | const self_type & | rhs | ) |
Basic guarantee only.
Definition at line 199 of file ptree_implementation.hpp.
|
inline |
Two property trees are the same if they have the same data, the keys and order of their children are the same, and the children compare equal, recursively.
Definition at line 431 of file ptree_implementation.hpp.
|
inline |
Returns an iterator to the first child, in key order.
Definition at line 450 of file ptree_implementation.hpp.
const_assoc_iterator boost::property_tree::basic_ptree< Key, Data, KeyCompare >::ordered_begin | ( | ) | const |
Returns an iterator to the first child, in key order.
|
inline |
Equivalent to erase(boost::prior(end())).
Definition at line 374 of file ptree_implementation.hpp.
|
inline |
Equivalent to erase(begin()).
Definition at line 368 of file ptree_implementation.hpp.
|
inline |
Equivalent to insert(end(), value).
Definition at line 362 of file ptree_implementation.hpp.
|
inline |
Equivalent to insert(begin(), value).
Definition at line 355 of file ptree_implementation.hpp.
self_type& boost::property_tree::basic_ptree< Key, Data, KeyCompare >::put | ( | const path_type & | path, |
const Type & | value | ||
) |
Set the value of the node at the given path to the supplied value, translated to the tree's data type. If the node doesn't exist, it is created, including all its missing parents.
ptree_bad_data | if the conversion fails. |
|
inline |
Definition at line 856 of file ptree_implementation.hpp.
self_type& boost::property_tree::basic_ptree< Key, Data, KeyCompare >::put | ( | const path_type & | path, |
const Type & | value, | ||
Translator | tr | ||
) |
Set the value of the node at the given path to the supplied value, translated to the tree's data type. If the node doesn't exist, it is created, including all its missing parents.
ptree_bad_data | if the conversion fails. |
basic_ptree<K, D, C>& boost::property_tree::basic_ptree< Key, Data, KeyCompare >::put | ( | const path_type & | path, |
const Type & | value, | ||
Translator | tr | ||
) |
Definition at line 841 of file ptree_implementation.hpp.
basic_ptree< K, D, C > & boost::property_tree::basic_ptree< K, D, C >::put_child | ( | const path_type & | path, |
const self_type & | value | ||
) |
Set the node at the given path to the given value. Create any missing parents. If the node at the path already exists, replace it.
Definition at line 634 of file ptree_implementation.hpp.
|
inline |
Replace the value at this node with the given value, translated to the tree's data type using the default translator.
ptree_bad_data | if the conversion fails. |
Definition at line 834 of file ptree_implementation.hpp.
void boost::property_tree::basic_ptree< K, D, C >::put_value | ( | const Type & | value, |
Translator | tr | ||
) |
Replace the value at this node with the given value, translated to the tree's data type using the supplied translator.
ptree_bad_data | if the conversion fails. |
Definition at line 821 of file ptree_implementation.hpp.
|
inline |
Definition at line 271 of file ptree_implementation.hpp.
const_reverse_iterator boost::property_tree::basic_ptree< Key, Data, KeyCompare >::rbegin | ( | ) | const |
|
inline |
Definition at line 285 of file ptree_implementation.hpp.
const_reverse_iterator boost::property_tree::basic_ptree< Key, Data, KeyCompare >::rend | ( | ) | const |
|
inline |
Reverses the order of direct children in the property tree.
Definition at line 380 of file ptree_implementation.hpp.
|
inline |
The number of direct children of this node.
Definition at line 223 of file ptree_implementation.hpp.
|
inline |
Sorts the direct children of this node according to key order.
Definition at line 416 of file ptree_implementation.hpp.
|
inline |
Sorts the direct children of this node according to the predicate. The predicate is passed the whole pair of key and child.
Definition at line 423 of file ptree_implementation.hpp.
|
inline |
Swap with other tree. Only constant-time and nothrow if the data type's swap is.
Definition at line 212 of file ptree_implementation.hpp.
|
inline |
Get the iterator that points to the same element as the argument.
Definition at line 532 of file ptree_implementation.hpp.
|
inline |
Get the iterator that points to the same element as the argument.
Definition at line 540 of file ptree_implementation.hpp.
|
private |
Definition at line 885 of file ptree_implementation.hpp.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
private |
|
private |