Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::property_tree::basic_ptree< Key, Data, KeyCompare > Singleton Reference

Property tree main structure. More...

#include <ptree_fwd.hpp>

Public Types

typedef Key key_type
 
typedef Data data_type
 
typedef KeyCompare key_compare
 
typedef std::pair< const Key,
self_type
value_type
 
typedef std::size_t size_type
 
typedef path_of< Key >::type path_type
 

Public Member Functions

 basic_ptree ()
 Creates a node with no children and default-constructed data. More...
 
 basic_ptree (const data_type &data)
 Creates a node with no children and a copy of the given data. More...
 
 basic_ptree (const self_type &rhs)
 
 ~basic_ptree ()
 
self_typeoperator= (const self_type &rhs)
 Basic guarantee only. More...
 
void swap (self_type &rhs)
 Swap with other tree. More...
 
size_type size () const
 The number of direct children of this node. More...
 
size_type max_size () const
 
bool empty () const
 Whether there are any direct children. More...
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
value_typefront ()
 
const value_typefront () const
 
value_typeback ()
 
const value_typeback () const
 
iterator insert (iterator where, const value_type &value)
 Insert a copy of the given tree with its key just before the given position in this node. More...
 
template<class It >
void insert (iterator where, It first, It last)
 Range insert. More...
 
iterator erase (iterator where)
 Erase the child pointed at by the iterator. More...
 
iterator erase (iterator first, iterator last)
 Range erase. More...
 
iterator push_front (const value_type &value)
 Equivalent to insert(begin(), value). More...
 
iterator push_back (const value_type &value)
 Equivalent to insert(end(), value). More...
 
void pop_front ()
 Equivalent to erase(begin()). More...
 
void pop_back ()
 Equivalent to erase(boost::prior(end())). More...
 
void reverse ()
 Reverses the order of direct children in the property tree. More...
 
template<class Compare >
void sort (Compare comp)
 Sorts the direct children of this node according to the predicate. More...
 
void sort ()
 Sorts the direct children of this node according to key order. More...
 
bool operator== (const self_type &rhs) const
 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. More...
 
bool operator!= (const self_type &rhs) const
 
assoc_iterator ordered_begin ()
 Returns an iterator to the first child, in key order. More...
 
const_assoc_iterator ordered_begin () const
 Returns an iterator to the first child, in key order. More...
 
assoc_iterator not_found ()
 Returns the not-found iterator. More...
 
const_assoc_iterator not_found () const
 Returns the not-found iterator. More...
 
assoc_iterator find (const key_type &key)
 Find a child with the given key, or not_found() if there is none. More...
 
const_assoc_iterator find (const key_type &key) const
 Find a child with the given key, or not_found() if there is none. More...
 
std::pair< assoc_iterator,
assoc_iterator > 
equal_range (const key_type &key)
 Find the range of children that have the given key. More...
 
std::pair
< const_assoc_iterator,
const_assoc_iterator > 
equal_range (const key_type &key) const
 Find the range of children that have the given key. More...
 
size_type count (const key_type &key) const
 Count the number of direct children with the given key. More...
 
size_type erase (const key_type &key)
 Erase all direct children with the given key and return the count. More...
 
iterator to_iterator (assoc_iterator it)
 Get the iterator that points to the same element as the argument. More...
 
const_iterator to_iterator (const_assoc_iterator it) const
 Get the iterator that points to the same element as the argument. More...
 
data_typedata ()
 Reference to the actual data in this node. More...
 
const data_typedata () const
 Reference to the actual data in this node. More...
 
void clear ()
 Clear this tree completely, of both data and children. More...
 
self_typeget_child (const path_type &path)
 Get the child at the given path, or throw ptree_bad_path. More...
 
const self_typeget_child (const path_type &path) const
 Get the child at the given path, or throw ptree_bad_path. More...
 
self_typeget_child (const path_type &path, self_type &default_value)
 Get the child at the given path, or return default_value. More...
 
const self_typeget_child (const path_type &path, const self_type &default_value) const
 Get the child at the given path, or return default_value. More...
 
optional< self_type & > get_child_optional (const path_type &path)
 Get the child at the given path, or return boost::null. More...
 
optional< const self_type & > get_child_optional (const path_type &path) const
 Get the child at the given path, or return boost::null. More...
 
self_typeput_child (const path_type &path, const self_type &value)
 Set the node at the given path to the given value. More...
 
self_typeadd_child (const path_type &path, const self_type &value)
 Add the node at the given path. More...
 
template<class Type , class Translator >
boost::enable_if
< detail::is_translator
< Translator >, Type >::type 
get_value (Translator tr) const
 Take the value of this node and attempt to translate it to a Type object using the supplied translator. More...
 
template<class Type >
Type get_value () const
 Take the value of this node and attempt to translate it to a Type object using the default translator. More...
 
template<class Type , class Translator >
Type get_value (const Type &default_value, Translator tr) const
 Take the value of this node and attempt to translate it to a Type object using the supplied translator. More...
 
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
 Make get_value do the right thing for string literals. More...
 
template<class Type >
boost::disable_if
< detail::is_translator< Type >
, Type >::type 
get_value (const Type &default_value) const
 Take the value of this node and attempt to translate it to a Type object using the default translator. More...
 
template<class Ch >
boost::enable_if
< detail::is_character< Ch >
, std::basic_string< Ch >
>::type 
get_value (const Ch *default_value) const
 Make get_value do the right thing for string literals. More...
 
template<class Type , class Translator >
optional< Type > get_value_optional (Translator tr) const
 Take the value of this node and attempt to translate it to a Type object using the supplied translator. More...
 
template<class Type >
optional< Type > get_value_optional () const
 Take the value of this node and attempt to translate it to a Type object using the default translator. More...
 
template<class Type , class Translator >
void 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. More...
 
template<class Type >
void put_value (const Type &value)
 Replace the value at this node with the given value, translated to the tree's data type using the default translator. More...
 
template<class Type , class Translator >
boost::enable_if
< detail::is_translator
< Translator >, Type >::type 
get (const path_type &path, Translator tr) const
 Shorthand for get_child(path).get_value(tr). More...
 
template<class Type >
Type get (const path_type &path) const
 Shorthand for get_child(path).get_value<Type>(). More...
 
template<class Type , class Translator >
Type get (const path_type &path, const Type &default_value, Translator tr) const
 Shorthand for get_child(path, empty_ptree()) .get_value(default_value, tr). More...
 
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
 Make get do the right thing for string literals. More...
 
template<class Type >
boost::disable_if
< detail::is_translator< Type >
, Type >::type 
get (const path_type &path, const Type &default_value) const
 Shorthand for get_child(path, empty_ptree()) .get_value(default_value). More...
 
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
 Make get do the right thing for string literals. More...
 
template<class Type , class Translator >
optional< Type > get_optional (const path_type &path, Translator tr) const
 Shorthand for: More...
 
template<class Type >
optional< Type > get_optional (const path_type &path) const
 Shorthand for: More...
 
template<class Type , class Translator >
self_typeput (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. More...
 
template<class Type >
self_typeput (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. More...
 
template<class Type , class Translator >
self_typeadd (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. More...
 
template<class Type >
self_typeadd (const path_type &path, const Type &value)
 If the node identified by the path does not exist, create it, including all its missing parents. More...
 

Friends

struct subs
 
class iterator
 
class const_iterator
 
class reverse_iterator
 
class const_reverse_iterator
 

Detailed Description

template<class Key, class Data, class KeyCompare>
singleton boost::property_tree::basic_ptree< Key, Data, KeyCompare >

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.

Member Typedef Documentation

template<class Key, class Data, class KeyCompare>
typedef Data boost::property_tree::basic_ptree< Key, Data, KeyCompare >::data_type
template<class Key, class Data, class KeyCompare>
typedef KeyCompare boost::property_tree::basic_ptree< Key, Data, KeyCompare >::key_compare
template<class Key, class Data, class KeyCompare>
typedef Key boost::property_tree::basic_ptree< Key, Data, KeyCompare >::key_type
template<class Key, class Data, class KeyCompare>
typedef path_of<Key>::type boost::property_tree::basic_ptree< Key, Data, KeyCompare >::path_type
template<class Key, class Data, class KeyCompare>
typedef std::size_t boost::property_tree::basic_ptree< Key, Data, KeyCompare >::size_type
template<class Key, class Data, class KeyCompare>
typedef std::pair<const Key, self_type> boost::property_tree::basic_ptree< Key, Data, KeyCompare >::value_type

Constructor & Destructor Documentation

template<class Key, class Data, class KeyCompare>
boost::property_tree::basic_ptree< Key, Data, KeyCompare >::basic_ptree ( )

Creates a node with no children and default-constructed data.

template<class Key, class Data, class KeyCompare>
boost::property_tree::basic_ptree< Key, Data, KeyCompare >::basic_ptree ( const data_type data)
explicit

Creates a node with no children and a copy of the given data.

template<class Key, class Data, class KeyCompare>
boost::property_tree::basic_ptree< Key, Data, KeyCompare >::basic_ptree ( const self_type rhs)
template<class Key, class Data, class KeyCompare>
boost::property_tree::basic_ptree< Key, Data, KeyCompare >::~basic_ptree ( )

Member Function Documentation

template<class Key, class Data, class KeyCompare>
template<class Type , class Translator >
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.

Parameters
pathPath to the child. The last fragment must not have an index.
valueThe value to add.
trThe translator to use.
Returns
The node that was added.
Exceptions
ptree_bad_dataif the conversion fails.
template<class Key, class Data, class KeyCompare>
template<class Type >
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.

Parameters
pathPath to the child. The last fragment must not have an index.
valueThe value to add.
Returns
The node that was added.
Exceptions
ptree_bad_dataif the conversion fails.
template<class Key, class Data, class KeyCompare>
self_type& boost::property_tree::basic_ptree< Key, Data, KeyCompare >::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.

Parameters
pathPath to the child. The last fragment must not have an index.
Returns
A reference to the inserted subtree.
Note
Because of the way paths work, it is not generally guaranteed that a node newly created can be accessed using the same path.
template<class Key, class Data, class KeyCompare>
value_type& boost::property_tree::basic_ptree< Key, Data, KeyCompare >::back ( )
template<class Key, class Data, class KeyCompare>
const value_type& boost::property_tree::basic_ptree< Key, Data, KeyCompare >::back ( ) const
template<class Key, class Data, class KeyCompare>
iterator boost::property_tree::basic_ptree< Key, Data, KeyCompare >::begin ( )
template<class Key, class Data, class KeyCompare>
const_iterator boost::property_tree::basic_ptree< Key, Data, KeyCompare >::begin ( ) const
template<class Key, class Data, class KeyCompare>
void boost::property_tree::basic_ptree< Key, Data, KeyCompare >::clear ( )

Clear this tree completely, of both data and children.

template<class Key, class Data, class KeyCompare>
size_type boost::property_tree::basic_ptree< Key, Data, KeyCompare >::count ( const key_type key) const

Count the number of direct children with the given key.

template<class Key, class Data, class KeyCompare>
data_type& boost::property_tree::basic_ptree< Key, Data, KeyCompare >::data ( )

Reference to the actual data in this node.

Referenced by boost::property_tree::load(), and boost::property_tree::save().

template<class Key, class Data, class KeyCompare>
const data_type& boost::property_tree::basic_ptree< Key, Data, KeyCompare >::data ( ) const

Reference to the actual data in this node.

template<class Key, class Data, class KeyCompare>
bool boost::property_tree::basic_ptree< Key, Data, KeyCompare >::empty ( ) const

Whether there are any direct children.

Referenced by boost::basic_settings_section< CharT >::empty().

template<class Key, class Data, class KeyCompare>
iterator boost::property_tree::basic_ptree< Key, Data, KeyCompare >::end ( )
template<class Key, class Data, class KeyCompare>
const_iterator boost::property_tree::basic_ptree< Key, Data, KeyCompare >::end ( ) const
template<class Key, class Data, class KeyCompare>
std::pair<assoc_iterator, assoc_iterator> boost::property_tree::basic_ptree< Key, Data, KeyCompare >::equal_range ( const key_type key)

Find the range of children that have the given key.

template<class Key, class Data, class KeyCompare>
std::pair<const_assoc_iterator, const_assoc_iterator> boost::property_tree::basic_ptree< Key, Data, KeyCompare >::equal_range ( const key_type key) const

Find the range of children that have the given key.

template<class Key, class Data, class KeyCompare>
iterator boost::property_tree::basic_ptree< Key, Data, KeyCompare >::erase ( iterator  where)

Erase the child pointed at by the iterator.

This operation invalidates the given iterator, as well as its equivalent assoc_iterator.

Returns
A valid iterator pointing to the element after the erased.
template<class Key, class Data, class KeyCompare>
iterator boost::property_tree::basic_ptree< Key, Data, KeyCompare >::erase ( iterator  first,
iterator  last 
)

Range erase.

Equivalent to:

while(first != last;) first = erase(first);
template<class Key, class Data, class KeyCompare>
size_type boost::property_tree::basic_ptree< Key, Data, KeyCompare >::erase ( const key_type key)

Erase all direct children with the given key and return the count.

template<class Key, class Data, class KeyCompare>
assoc_iterator boost::property_tree::basic_ptree< Key, Data, KeyCompare >::find ( const key_type key)

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.

template<class Key, class Data, class KeyCompare>
const_assoc_iterator boost::property_tree::basic_ptree< Key, Data, KeyCompare >::find ( const key_type key) const

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.

template<class Key, class Data, class KeyCompare>
value_type& boost::property_tree::basic_ptree< Key, Data, KeyCompare >::front ( )
template<class Key, class Data, class KeyCompare>
const value_type& boost::property_tree::basic_ptree< Key, Data, KeyCompare >::front ( ) const
template<class Key, class Data, class KeyCompare>
template<class Type , class Translator >
boost::enable_if<detail::is_translator<Translator>, Type>::type boost::property_tree::basic_ptree< Key, Data, KeyCompare >::get ( const path_type path,
Translator  tr 
) const

Shorthand for get_child(path).get_value(tr).

template<class Key, class Data, class KeyCompare>
template<class Type >
Type boost::property_tree::basic_ptree< Key, Data, KeyCompare >::get ( const path_type path) const

Shorthand for get_child(path).get_value<Type>().

template<class Key, class Data, class KeyCompare>
template<class Type , class Translator >
Type boost::property_tree::basic_ptree< Key, Data, KeyCompare >::get ( const path_type path,
const Type &  default_value,
Translator  tr 
) const

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.

template<class Key, class Data, class KeyCompare>
template<class Ch , class Translator >
boost::enable_if< detail::is_character<Ch>, std::basic_string<Ch> >::type boost::property_tree::basic_ptree< Key, Data, KeyCompare >::get ( const path_type path,
const Ch *  default_value,
Translator  tr 
) const

Make get do the right thing for string literals.

template<class Key, class Data, class KeyCompare>
template<class Type >
boost::disable_if<detail::is_translator<Type>, Type>::type boost::property_tree::basic_ptree< Key, Data, KeyCompare >::get ( const path_type path,
const Type &  default_value 
) const

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.

template<class Key, class Data, class KeyCompare>
template<class Ch >
boost::enable_if< detail::is_character<Ch>, std::basic_string<Ch> >::type boost::property_tree::basic_ptree< Key, Data, KeyCompare >::get ( const path_type path,
const Ch *  default_value 
) const

Make get do the right thing for string literals.

template<class Key, class Data, class KeyCompare>
self_type& boost::property_tree::basic_ptree< Key, Data, KeyCompare >::get_child ( const path_type path)

Get the child at the given path, or throw ptree_bad_path.

Note
Depending on the path, the result at each level may not be completely determinate, i.e. if the same key appears multiple times, which child is chosen is not specified. This can lead to the path not being resolved even though there is a descendant with this path. Example:
a -> b -> c
-> b
The path "a.b.c" will succeed if the resolution of "b" chooses the first such node, but fail if it chooses the second.
template<class Key, class Data, class KeyCompare>
const self_type& boost::property_tree::basic_ptree< Key, Data, KeyCompare >::get_child ( const path_type path) const

Get the child at the given path, or throw ptree_bad_path.

template<class Key, class Data, class KeyCompare>
self_type& boost::property_tree::basic_ptree< Key, Data, KeyCompare >::get_child ( const path_type path,
self_type default_value 
)

Get the child at the given path, or return default_value.

template<class Key, class Data, class KeyCompare>
const self_type& boost::property_tree::basic_ptree< Key, Data, KeyCompare >::get_child ( const path_type path,
const self_type default_value 
) const

Get the child at the given path, or return default_value.

template<class Key, class Data, class KeyCompare>
optional<self_type &> boost::property_tree::basic_ptree< Key, Data, KeyCompare >::get_child_optional ( const path_type path)

Get the child at the given path, or return boost::null.

Referenced by boost::basic_settings_section< CharT >::has_parameter(), and boost::basic_settings_section< CharT >::has_section().

template<class Key, class Data, class KeyCompare>
optional<const self_type &> boost::property_tree::basic_ptree< Key, Data, KeyCompare >::get_child_optional ( const path_type path) const

Get the child at the given path, or return boost::null.

template<class Key, class Data, class KeyCompare>
template<class Type , class Translator >
optional<Type> boost::property_tree::basic_ptree< Key, Data, KeyCompare >::get_optional ( const path_type path,
Translator  tr 
) const

Shorthand for:

return node->get_value_optional(tr);
return boost::null;

That is, return the value if it exists and can be converted, or nil.

template<class Key, class Data, class KeyCompare>
template<class Type >
optional<Type> boost::property_tree::basic_ptree< Key, Data, KeyCompare >::get_optional ( const path_type path) const

Shorthand for:

return node->get_value_optional();
return boost::null;

That is, return the value if it exists and can be converted, or nil.

template<class Key, class Data, class KeyCompare>
template<class Type , class Translator >
boost::enable_if<detail::is_translator<Translator>, Type>::type boost::property_tree::basic_ptree< Key, Data, KeyCompare >::get_value ( Translator  tr) const

Take the value of this node and attempt to translate it to a Type object using the supplied translator.

Exceptions
ptree_bad_dataif the conversion fails.
template<class Key, class Data, class KeyCompare>
template<class Type >
Type boost::property_tree::basic_ptree< Key, Data, KeyCompare >::get_value ( ) const

Take the value of this node and attempt to translate it to a Type object using the default translator.

Exceptions
ptree_bad_dataif the conversion fails.
template<class Key, class Data, class KeyCompare>
template<class Type , class Translator >
Type boost::property_tree::basic_ptree< Key, Data, KeyCompare >::get_value ( const Type &  default_value,
Translator  tr 
) const

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.

template<class Key, class Data, class KeyCompare>
template<class Ch , class Translator >
boost::enable_if< detail::is_character<Ch>, std::basic_string<Ch> >::type boost::property_tree::basic_ptree< Key, Data, KeyCompare >::get_value ( const Ch *  default_value,
Translator  tr 
) const

Make get_value do the right thing for string literals.

template<class Key, class Data, class KeyCompare>
template<class Type >
boost::disable_if<detail::is_translator<Type>, Type>::type boost::property_tree::basic_ptree< Key, Data, KeyCompare >::get_value ( const Type &  default_value) const

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.

template<class Key, class Data, class KeyCompare>
template<class Ch >
boost::enable_if< detail::is_character<Ch>, std::basic_string<Ch> >::type boost::property_tree::basic_ptree< Key, Data, KeyCompare >::get_value ( const Ch *  default_value) const

Make get_value do the right thing for string literals.

template<class Key, class Data, class KeyCompare>
template<class Type , class Translator >
optional<Type> boost::property_tree::basic_ptree< Key, Data, KeyCompare >::get_value_optional ( Translator  tr) const

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.

template<class Key, class Data, class KeyCompare>
template<class Type >
optional<Type> boost::property_tree::basic_ptree< Key, Data, KeyCompare >::get_value_optional ( ) const

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.

template<class Key, class Data, class KeyCompare>
iterator boost::property_tree::basic_ptree< Key, Data, KeyCompare >::insert ( iterator  where,
const value_type value 
)

Insert a copy of the given tree with its key just before the given position in this node.

This operation invalidates no iterators.

Returns
An iterator to the newly created child.
template<class Key, class Data, class KeyCompare>
template<class It >
void boost::property_tree::basic_ptree< Key, Data, KeyCompare >::insert ( iterator  where,
It  first,
It  last 
)

Range insert.

Equivalent to:

for(; first != last; ++first) insert(where, *first);
template<class Key, class Data, class KeyCompare>
size_type boost::property_tree::basic_ptree< Key, Data, KeyCompare >::max_size ( ) const
template<class Key, class Data, class KeyCompare>
assoc_iterator boost::property_tree::basic_ptree< Key, Data, KeyCompare >::not_found ( )

Returns the not-found iterator.

Equivalent to end() in a real associative container.

template<class Key, class Data, class KeyCompare>
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.

template<class Key, class Data, class KeyCompare>
bool boost::property_tree::basic_ptree< Key, Data, KeyCompare >::operator!= ( const self_type rhs) const
template<class Key, class Data, class KeyCompare>
self_type& boost::property_tree::basic_ptree< Key, Data, KeyCompare >::operator= ( const self_type rhs)

Basic guarantee only.

template<class Key, class Data, class KeyCompare>
bool boost::property_tree::basic_ptree< Key, Data, KeyCompare >::operator== ( const self_type rhs) const

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.

template<class Key, class Data, class KeyCompare>
assoc_iterator boost::property_tree::basic_ptree< Key, Data, KeyCompare >::ordered_begin ( )

Returns an iterator to the first child, in key order.

template<class Key, class Data, class KeyCompare>
const_assoc_iterator boost::property_tree::basic_ptree< Key, Data, KeyCompare >::ordered_begin ( ) const

Returns an iterator to the first child, in key order.

template<class Key, class Data, class KeyCompare>
void boost::property_tree::basic_ptree< Key, Data, KeyCompare >::pop_back ( )

Equivalent to erase(boost::prior(end())).

template<class Key, class Data, class KeyCompare>
void boost::property_tree::basic_ptree< Key, Data, KeyCompare >::pop_front ( )

Equivalent to erase(begin()).

template<class Key, class Data, class KeyCompare>
iterator boost::property_tree::basic_ptree< Key, Data, KeyCompare >::push_back ( const value_type value)

Equivalent to insert(end(), value).

template<class Key, class Data, class KeyCompare>
iterator boost::property_tree::basic_ptree< Key, Data, KeyCompare >::push_front ( const value_type value)

Equivalent to insert(begin(), value).

template<class Key, class Data, class KeyCompare>
template<class Type , class Translator >
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.

Returns
The node that had its value changed.
Exceptions
ptree_bad_dataif the conversion fails.
template<class Key, class Data, class KeyCompare>
template<class Type >
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.

Returns
The node that had its value changed.
Exceptions
ptree_bad_dataif the conversion fails.
template<class Key, class Data, class KeyCompare>
self_type& boost::property_tree::basic_ptree< Key, Data, KeyCompare >::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.

Returns
A reference to the inserted subtree.
Note
Because of the way paths work, it is not generally guaranteed that a node newly created can be accessed using the same path.
If the path could refer to multiple nodes, it is unspecified which one gets replaced.
template<class Key, class Data, class KeyCompare>
template<class Type , class Translator >
void boost::property_tree::basic_ptree< Key, Data, KeyCompare >::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.

Exceptions
ptree_bad_dataif the conversion fails.
template<class Key, class Data, class KeyCompare>
template<class Type >
void boost::property_tree::basic_ptree< Key, Data, KeyCompare >::put_value ( const Type &  value)

Replace the value at this node with the given value, translated to the tree's data type using the default translator.

Exceptions
ptree_bad_dataif the conversion fails.
template<class Key, class Data, class KeyCompare>
reverse_iterator boost::property_tree::basic_ptree< Key, Data, KeyCompare >::rbegin ( )
template<class Key, class Data, class KeyCompare>
const_reverse_iterator boost::property_tree::basic_ptree< Key, Data, KeyCompare >::rbegin ( ) const
template<class Key, class Data, class KeyCompare>
reverse_iterator boost::property_tree::basic_ptree< Key, Data, KeyCompare >::rend ( )
template<class Key, class Data, class KeyCompare>
const_reverse_iterator boost::property_tree::basic_ptree< Key, Data, KeyCompare >::rend ( ) const
template<class Key, class Data, class KeyCompare>
void boost::property_tree::basic_ptree< Key, Data, KeyCompare >::reverse ( )

Reverses the order of direct children in the property tree.

template<class Key, class Data, class KeyCompare>
size_type boost::property_tree::basic_ptree< Key, Data, KeyCompare >::size ( ) const

The number of direct children of this node.

template<class Key, class Data, class KeyCompare>
template<class Compare >
void boost::property_tree::basic_ptree< Key, Data, KeyCompare >::sort ( Compare  comp)

Sorts the direct children of this node according to the predicate.

The predicate is passed the whole pair of key and child.

template<class Key, class Data, class KeyCompare>
void boost::property_tree::basic_ptree< Key, Data, KeyCompare >::sort ( )

Sorts the direct children of this node according to key order.

template<class Key, class Data, class KeyCompare>
void boost::property_tree::basic_ptree< Key, Data, KeyCompare >::swap ( self_type rhs)

Swap with other tree.

Only constant-time and nothrow if the data type's swap is.

template<class Key, class Data, class KeyCompare>
iterator boost::property_tree::basic_ptree< Key, Data, KeyCompare >::to_iterator ( assoc_iterator  it)

Get the iterator that points to the same element as the argument.

Note
A valid assoc_iterator range (a, b) does not imply that (to_iterator(a), to_iterator(b)) is a valid range.
template<class Key, class Data, class KeyCompare>
const_iterator boost::property_tree::basic_ptree< Key, Data, KeyCompare >::to_iterator ( const_assoc_iterator  it) const

Get the iterator that points to the same element as the argument.

Note
A valid const_assoc_iterator range (a, b) does not imply that (to_iterator(a), to_iterator(b)) is a valid range.

Friends And Related Function Documentation

template<class Key, class Data, class KeyCompare>
friend class const_iterator
friend
template<class Key, class Data, class KeyCompare>
friend class const_reverse_iterator
friend
template<class Key, class Data, class KeyCompare>
friend class iterator
friend
template<class Key, class Data, class KeyCompare>
friend class reverse_iterator
friend
template<class Key, class Data, class KeyCompare>
friend struct subs
friend

The documentation for this singleton was generated from the following file: