Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::basic_settings< CharT > Class Template Reference

The class represents settings container. More...

#include <settings.hpp>

Inheritance diagram for boost::basic_settings< CharT >:
Collaboration diagram for boost::basic_settings< CharT >:

Public Types

typedef basic_settings_section
< CharT > 
section
 Section type. More...
 
typedef section::property_tree_type property_tree_type
 Property tree type. More...
 
typedef CharT char_type
 Character type. More...
 
typedef std::basic_string
< char_type
string_type
 String type. More...
 
typedef
property_tree_type::path_type 
path_type
 Property tree path type. More...
 
typedef ref< true > const_reference
 
typedef ref< false > reference
 
typedef iter< true > const_iterator
 
typedef iter< false > iterator
 
typedef std::reverse_iterator
< const_iterator
const_reverse_iterator
 
typedef std::reverse_iterator
< iterator
reverse_iterator
 

Public Member Functions

 basic_settings ()
 Default constructor. More...
 
 basic_settings (basic_settings const &that)
 Copy constructor. More...
 
 basic_settings (BOOST_RV_REF(this_type) that)
 Move constructor. More...
 
 basic_settings (property_tree_type const &tree)
 Initializing constructor. More...
 
 ~basic_settings ()
 Destructor. More...
 
basic_settingsoperator= (BOOST_COPY_ASSIGN_REF(basic_settings) that)
 Copy assignment operator. More...
 
basic_settingsoperator= (BOOST_RV_REF(basic_settings) that)
 Move assignment operator. More...
 
bool operator! () const BOOST_NOEXCEPT
 Checks if the section refers to the container. More...
 
iterator begin ()
 Returns an iterator over the nested subsections and parameters. More...
 
const_iterator begin () const
 Returns an iterator over the nested subsections and parameters. More...
 
iterator end ()
 Returns an iterator over the nested subsections and parameters. More...
 
const_iterator end () const
 Returns an iterator over the nested subsections and parameters. More...
 
reverse_iterator rbegin ()
 Returns a reverse iterator over the nested subsections and parameters. More...
 
const_reverse_iterator rbegin () const
 Returns a reverse iterator over the nested subsections and parameters. More...
 
reverse_iterator rend ()
 Returns a reverse iterator over the nested subsections and parameters. More...
 
const_reverse_iterator rend () const
 Returns a reverse iterator over the nested subsections and parameters. More...
 
bool empty () const
 Checks if the container is empty (i.e. More...
 
reference operator[] (std::string const &section_name)
 Accessor to a single parameter. More...
 
const_reference operator[] (std::string const &section_name) const
 Accessor to a single parameter. More...
 
reference operator[] (const char *section_name)
 Accessor to a single parameter. More...
 
const_reference operator[] (const char *section_name) const
 Accessor to a single parameter. More...
 
property_tree_type const & property_tree () const
 Accessor for the embedded property tree. More...
 
property_tree_typeproperty_tree ()
 Accessor for the embedded property tree. More...
 
bool has_section (string_type const &section_name) const
 Checks if the specified section is present in the container. More...
 
bool has_parameter (string_type const &section_name, string_type const &param_name) const
 Checks if the specified parameter is present in the container. More...
 
void swap (basic_settings_section &that)
 Swaps two references to settings sections. More...
 

Protected Attributes

property_tree_typem_ptree
 Parameters. More...
 

Detailed Description

template<typename CharT>
class boost::basic_settings< CharT >

The class represents settings container.

All settings are presented as a number of named parameters divided into named sections. The parameters values are stored as strings. Individual parameters may be queried via subscript operators, like this:

optional< string > param = settings["Section1"]["Param1"]; // reads parameter "Param1" in section "Section1"
                                                           // returns an empty value if no such parameter exists
settings["Section2"]["Param2"] = 10; // sets the parameter "Param2" in section "Section2"
                                     // to value "10"

There are also other methods to work with parameters.

Member Typedef Documentation

template<typename CharT>
typedef CharT boost::basic_settings_section< CharT >::char_type
inherited

Character type.

template<typename CharT>
typedef iter< true > boost::basic_settings_section< CharT >::const_iterator
inherited
template<typename CharT>
typedef ref< true > boost::basic_settings_section< CharT >::const_reference
inherited
template<typename CharT>
typedef std::reverse_iterator< const_iterator > boost::basic_settings_section< CharT >::const_reverse_iterator
inherited
template<typename CharT>
typedef iter< false > boost::basic_settings_section< CharT >::iterator
inherited
template<typename CharT>
typedef property_tree_type::path_type boost::basic_settings_section< CharT >::path_type
inherited

Property tree path type.

template<typename CharT >
typedef section::property_tree_type boost::basic_settings< CharT >::property_tree_type

Property tree type.

template<typename CharT>
typedef ref< false > boost::basic_settings_section< CharT >::reference
inherited
template<typename CharT>
typedef std::reverse_iterator< iterator > boost::basic_settings_section< CharT >::reverse_iterator
inherited
template<typename CharT >
typedef basic_settings_section< CharT > boost::basic_settings< CharT >::section

Section type.

template<typename CharT>
typedef std::basic_string< char_type > boost::basic_settings_section< CharT >::string_type
inherited

String type.

Constructor & Destructor Documentation

template<typename CharT >
boost::basic_settings< CharT >::basic_settings ( )
inline

Default constructor.

Creates an empty settings container.

template<typename CharT >
boost::basic_settings< CharT >::basic_settings ( basic_settings< CharT > const &  that)
inline

Copy constructor.

template<typename CharT >
boost::basic_settings< CharT >::basic_settings ( BOOST_RV_REF(this_type that)
inline

Move constructor.

References boost::basic_settings_section< CharT >::swap().

template<typename CharT >
boost::basic_settings< CharT >::basic_settings ( property_tree_type const &  tree)
inlineexplicit

Initializing constructor.

Creates a settings container with the copy of the specified property tree.

template<typename CharT >
boost::basic_settings< CharT >::~basic_settings ( )
inline

Member Function Documentation

template<typename CharT>
iterator boost::basic_settings_section< CharT >::begin ( void  )
inlineinherited

Returns an iterator over the nested subsections and parameters.

References boost::property_tree::basic_ptree< Key, Data, KeyCompare >::begin().

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

template<typename CharT>
const_iterator boost::basic_settings_section< CharT >::begin ( void  ) const
inlineinherited

Returns an iterator over the nested subsections and parameters.

References boost::property_tree::basic_ptree< Key, Data, KeyCompare >::begin().

template<typename CharT>
bool boost::basic_settings_section< CharT >::empty ( void  ) const
inlineinherited

Checks if the container is empty (i.e.

contains no sections and parameters).

References boost::property_tree::basic_ptree< Key, Data, KeyCompare >::empty().

template<typename CharT>
iterator boost::basic_settings_section< CharT >::end ( void  )
inlineinherited

Returns an iterator over the nested subsections and parameters.

References boost::property_tree::basic_ptree< Key, Data, KeyCompare >::end().

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

template<typename CharT>
const_iterator boost::basic_settings_section< CharT >::end ( void  ) const
inlineinherited

Returns an iterator over the nested subsections and parameters.

References boost::property_tree::basic_ptree< Key, Data, KeyCompare >::end().

template<typename CharT>
bool boost::basic_settings_section< CharT >::has_parameter ( string_type const &  section_name,
string_type const &  param_name 
) const
inlineinherited

Checks if the specified parameter is present in the container.

Parameters
section_nameThe name of the section in which the parameter resides
param_nameThe name of the parameter

References boost::property_tree::basic_ptree< Key, Data, KeyCompare >::get_child_optional().

template<typename CharT>
bool boost::basic_settings_section< CharT >::has_section ( string_type const &  section_name) const
inlineinherited

Checks if the specified section is present in the container.

Parameters
section_nameThe name of the section

References boost::property_tree::basic_ptree< Key, Data, KeyCompare >::get_child_optional().

template<typename CharT>
bool boost::basic_settings_section< CharT >::operator! ( ) const
inlineinherited

Checks if the section refers to the container.

Checks if the section refers to the container.

References boost::basic_settings_section< CharT >::m_ptree.

template<typename CharT >
basic_settings& boost::basic_settings< CharT >::operator= ( BOOST_COPY_ASSIGN_REF(basic_settings< CharT >)  that)
inline

Copy assignment operator.

References boost::basic_settings_section< CharT >::swap().

template<typename CharT >
basic_settings& boost::basic_settings< CharT >::operator= ( BOOST_RV_REF(basic_settings< CharT >)  that)
inline

Move assignment operator.

References boost::basic_settings_section< CharT >::swap().

template<typename CharT>
reference boost::basic_settings_section< CharT >::operator[] ( std::string const &  section_name)
inlineinherited

Accessor to a single parameter.

This operator should be used in conjunction with the subsequent subscript operator that designates the parameter name.

Parameters
section_nameThe name of the section in which the parameter resides
Returns
An unspecified reference type that can be used for parameter name specifying
template<typename CharT>
const_reference boost::basic_settings_section< CharT >::operator[] ( std::string const &  section_name) const
inlineinherited

Accessor to a single parameter.

This operator should be used in conjunction with the subsequent subscript operator that designates the parameter name.

Parameters
section_nameThe name of the section in which the parameter resides
Returns
An unspecified reference type that can be used for parameter name specifying
template<typename CharT>
reference boost::basic_settings_section< CharT >::operator[] ( const char *  section_name)
inlineinherited

Accessor to a single parameter.

This operator should be used in conjunction with the subsequent subscript operator that designates the parameter name.

Parameters
section_nameThe name of the section in which the parameter resides
Returns
An unspecified reference type that can be used for parameter name specifying
template<typename CharT>
const_reference boost::basic_settings_section< CharT >::operator[] ( const char *  section_name) const
inlineinherited

Accessor to a single parameter.

This operator should be used in conjunction with the subsequent subscript operator that designates the parameter name.

Parameters
section_nameThe name of the section in which the parameter resides
Returns
An unspecified reference type that can be used for parameter name specifying
template<typename CharT>
property_tree_type const& boost::basic_settings_section< CharT >::property_tree ( ) const
inlineinherited

Accessor for the embedded property tree.

References boost::basic_settings_section< CharT >::m_ptree.

template<typename CharT>
property_tree_type& boost::basic_settings_section< CharT >::property_tree ( )
inlineinherited

Accessor for the embedded property tree.

References boost::basic_settings_section< CharT >::m_ptree.

template<typename CharT>
reverse_iterator boost::basic_settings_section< CharT >::rbegin ( )
inlineinherited

Returns a reverse iterator over the nested subsections and parameters.

References boost::basic_settings_section< CharT >::begin().

template<typename CharT>
const_reverse_iterator boost::basic_settings_section< CharT >::rbegin ( ) const
inlineinherited

Returns a reverse iterator over the nested subsections and parameters.

References boost::basic_settings_section< CharT >::begin().

template<typename CharT>
reverse_iterator boost::basic_settings_section< CharT >::rend ( )
inlineinherited

Returns a reverse iterator over the nested subsections and parameters.

References boost::basic_settings_section< CharT >::end().

template<typename CharT>
const_reverse_iterator boost::basic_settings_section< CharT >::rend ( ) const
inlineinherited

Returns a reverse iterator over the nested subsections and parameters.

References boost::basic_settings_section< CharT >::end().

template<typename CharT>
void boost::basic_settings_section< CharT >::swap ( basic_settings_section< CharT > &  that)
inlineinherited

Member Data Documentation


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