Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

Class template basic_settings

boost::log::basic_settings — The class represents settings container.

Synopsis

// In header: <boost/log/utility/setup/settings.hpp>

template<typename CharT> 
class basic_settings : public boost::log::basic_settings_section< CharT > {
public:
  // types
  typedef basic_settings_section< CharT > section;             // Section type. 
  typedef section::property_tree_type     property_tree_type;  // Property tree type. 

  // construct/copy/destruct
  basic_settings();
  basic_settings(basic_settings const &);
  basic_settings(this_type &&);
  explicit basic_settings(property_tree_type const &);
  basic_settings & operator=(basic_settings const &);
  basic_settings & operator=(basic_settings &&);
  ~basic_settings();
};

Description

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.

basic_settings public construct/copy/destruct

  1. basic_settings();

    Default constructor. Creates an empty settings container.

  2. basic_settings(basic_settings const & that);

    Copy constructor.

  3. basic_settings(this_type && that);

    Move constructor.

  4. explicit basic_settings(property_tree_type const & tree);

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

  5. basic_settings & operator=(basic_settings const & that);

    Copy assignment operator.

  6. basic_settings & operator=(basic_settings && that);

    Move assignment operator.

  7. ~basic_settings();

    Destructor


PrevUpHomeNext