<classname="ptree_bad_data"><inheritaccess="public">boost::property_tree::ptree_error</inherit><purpose>Error indicating that translation from given value to the property tree data_type (or vice versa) failed. Derives from <classnamealt="boost::property_tree::ptree_error">ptree_error</classname>. </purpose><method-groupname="public member functions">
</template><purpose>Retrieve the data associated with this error. This is the source value that failed to be translated. You need to explicitly specify its type. </purpose></method>
</method-group>
<constructor><template>
<template-type-parametername="T"/>
</template><parametername="what"><paramtype>const std::string &</paramtype><description><para>The message to associate with this error. </para></description></parameter><parametername="data"><paramtype>const T &</paramtype><description><para>The value associated with this error that was the source of the translation failure. </para></description></parameter><purpose>Instantiate a <classnamealt="boost::property_tree::ptree_bad_data">ptree_bad_data</classname> instance with the given message and data. </purpose><description><para>
</para></description></constructor>
<destructor/>
</class><classname="ptree_bad_path"><inheritaccess="public">boost::property_tree::ptree_error</inherit><purpose>Error indicating that specified path does not exist. Derives from <classnamealt="boost::property_tree::ptree_error">ptree_error</classname>. </purpose><method-groupname="public member functions">
</template><purpose>Retrieve the invalid path. You need to explicitly specify the type of path. </purpose></method>
</method-group>
<constructor><template>
<template-type-parametername="T"/>
</template><parametername="what"><paramtype>const std::string &</paramtype><description><para>The message to associate with this error. </para></description></parameter><parametername="path"><paramtype>const T &</paramtype><description><para>The path that could not be found in the property_tree. </para></description></parameter><purpose>Instantiate a <classnamealt="boost::property_tree::ptree_bad_path">ptree_bad_path</classname> with the given message and path data. </purpose><description><para>
</class><classname="ptree_error"><inheritaccess="public">runtime_error</inherit><purpose>Base class for all property tree errors. Derives from <computeroutput>std::runtime_error</computeroutput>. Call member function <computeroutput>what</computeroutput> to get human readable message associated with the error. </purpose><method-groupname="public member functions">
</method-group>
<constructor><parametername="what"><paramtype>const std::string &</paramtype><description><para>The message to associate with this error. </para></description></parameter><purpose>Instantiate a <classnamealt="boost::property_tree::ptree_error">ptree_error</classname> instance with the given message. </purpose><description><para>
</template><specialization><template-arg>T</template-arg><template-arg>T</template-arg></specialization><typedefname="type"><type><classname>id_translator</classname>< T ></type></typedef>
</template><parametername="stream"><paramtype>std::basic_istream< Ch >&</paramtype></parameter><parametername="pt"><paramtype>Ptree &</paramtype></parameter><description><para>Read INFO from a the given stream and translate it to a property tree. <note><para>Replaces the existing contents. Strong exception guarantee. </para>
</para></description><throws><simpara><classname>info_parser_error</classname> If the stream cannot be read, doesn't contain valid INFO, or a conversion fails. </simpara></throws></function>
</template><parametername="stream"><paramtype>std::basic_istream< Ch >&</paramtype></parameter><parametername="pt"><paramtype>Ptree &</paramtype></parameter><parametername="default_ptree"><paramtype>const Ptree &</paramtype><description><para>If parsing fails, pt is set to a copy of this tree. </para></description></parameter><description><para>Read INFO from a the given stream and translate it to a property tree. <note><para>Replaces the existing contents. Strong exception guarantee. </para>
</template><parametername="filename"><paramtype>const std::string &</paramtype></parameter><parametername="pt"><paramtype>Ptree &</paramtype></parameter><parametername="loc"><paramtype>const std::locale &</paramtype><default>std::locale()</default></parameter><description><para>Read INFO from a the given file and translate it to a property tree. The tree's key type must be a string type, i.e. it must have a nested value_type typedef that is a valid parameter for basic_ifstream. <note><para>Replaces the existing contents. Strong exception guarantee. </para>
</para></description><throws><simpara><classname>info_parser_error</classname> If the file cannot be read, doesn't contain valid INFO, or a conversion fails. </simpara></throws></function>
</template><parametername="filename"><paramtype>const std::string &</paramtype></parameter><parametername="pt"><paramtype>Ptree &</paramtype></parameter><parametername="default_ptree"><paramtype>const Ptree &</paramtype><description><para>If parsing fails, pt is set to a copy of this tree. </para></description></parameter><parametername="loc"><paramtype>const std::locale &</paramtype><default>std::locale()</default></parameter><description><para>Read INFO from a the given file and translate it to a property tree. The tree's key type must be a string type, i.e. it must have a nested value_type typedef that is a valid parameter for basic_ifstream. <note><para>Replaces the existing contents. Strong exception guarantee. </para>
</template><parametername="stream"><paramtype>std::basic_ostream< Ch >&</paramtype></parameter><parametername="pt"><paramtype>const Ptree &</paramtype></parameter><parametername="settings"><paramtype>const info_writer_settings< Ch >&</paramtype><default>info_writer_settings< Ch >()</default><description><para>The settings to use when writing the INFO data. </para></description></parameter><description><para>Writes a tree to the stream in INFO format.
</para></description><throws><simpara><classname>info_parser_error</classname> If the stream cannot be written to, or a conversion fails. </simpara></throws></function>
</template><parametername="filename"><paramtype>const std::string &</paramtype></parameter><parametername="pt"><paramtype>const Ptree &</paramtype></parameter><parametername="loc"><paramtype>const std::locale &</paramtype><default>std::locale()</default></parameter><parametername="settings"><paramtype>const info_writer_settings< typename Ptree::key_type::value_type >&</paramtype><default>info_writer_make_settings< typename Ptree::key_type::value_type >()</default><description><para>The settings to use when writing the INFO data. </para></description></parameter><description><para>Writes a tree to the file in INFO format. The tree's key type must be a string type, i.e. it must have a nested value_type typedef that is a valid parameter for basic_ofstream.
</para></description><throws><simpara><classname>info_parser_error</classname> If the file cannot be written to, or a conversion fails. </simpara></throws></function>
</namespace>
</namespace>
</namespace>
</header>
<headername="boost/property_tree/ini_parser.hpp">
<namespacename="boost">
<namespacename="property_tree">
<namespacename="ini_parser">
<classname="ini_parser_error"><inheritaccess="public">file_parser_error</inherit><description><para>Indicates an error parsing INI formatted data. </para></description><method-groupname="public member functions">
</method-group>
<constructor><parametername="message"><paramtype>const std::string &</paramtype><description><para>Message describing the parser error. </para></description></parameter><parametername="filename"><paramtype>const std::string &</paramtype><description><para>The name of the file being parsed containing the error. </para></description></parameter><parametername="line"><paramtype>unsigned long</paramtype><description><para>The line in the given file where an error was encountered. </para></description></parameter><description><para>Construct an <computeroutput><classnamealt="boost::property_tree::ini_parser::ini_parser_error">ini_parser_error</classname></computeroutput>
</para></description></constructor>
</class><functionname="validate_flags"><type>bool</type><parametername="flags"><paramtype>int</paramtype><description><para>value to check for validity as flags to ini_parser. </para></description></parameter><description><para>Determines whether the <computeroutput>flags</computeroutput> are valid for use with the ini_parser.
</template><parametername="stream"><paramtype>std::basic_istream< typename Ptree::key_type::value_type >&</paramtype><description><para>Stream from which to read in the property tree. </para></description></parameter><parametername="pt"><paramtype>Ptree &</paramtype><description><para>The property tree to populate. </para></description></parameter><description><para>Read INI from a the given stream and translate it to a property tree. <note><para>Clears existing contents of property tree. In case of error the property tree is not modified. </para>
</template><parametername="filename"><paramtype>const std::string &</paramtype><description><para>Name of file from which to read in the property tree. </para></description></parameter><parametername="pt"><paramtype>Ptree &</paramtype><description><para>The property tree to populate. </para></description></parameter><parametername="loc"><paramtype>const std::locale &</paramtype><default>std::locale()</default><description><para>The locale to use when reading in the file contents. </para></description></parameter><description><para>Read INI from a the given file and translate it to a property tree. <note><para>Clears existing contents of property tree. In case of error the property tree unmodified. </para>
</para></description><throws><simpara><classname>ini_parser_error</classname> In case of error deserializing the property tree. </simpara></throws></function>
</template><parametername="stream"><paramtype>std::basic_ostream< typename Ptree::key_type::value_type >&</paramtype><description><para>The stream to which to write the INI representation of the property tree. </para></description></parameter><parametername="pt"><paramtype>const Ptree &</paramtype><description><para>The property tree to tranlsate to INI and output. </para></description></parameter><parametername="flags"><paramtype>int</paramtype><default>0</default><description><para>The flags to use when writing the INI file. No flags are currently supported. </para></description></parameter><description><para>Translates the property tree to INI and writes it the given output stream.
</para></description><requires><para><emphasis>pt</emphasis> cannot have data in its root. </para>
</requires><requires><para><emphasis>pt</emphasis> cannot have keys both data and children. </para>
</requires><requires><para><emphasis>pt</emphasis> cannot be deeper than two levels. </para>
</requires><requires><para>There cannot be duplicate keys on any given level of <emphasis>pt</emphasis>. </para>
</requires><throws><simpara><classname>ini_parser_error</classname> In case of error translating the property tree to INI or writing to the output stream. </simpara></throws></function>
</template><parametername="filename"><paramtype>const std::string &</paramtype><description><para>The name of the file to which to write the INI representation of the property tree. </para></description></parameter><parametername="pt"><paramtype>const Ptree &</paramtype><description><para>The property tree to tranlsate to INI and output. </para></description></parameter><parametername="flags"><paramtype>int</paramtype><default>0</default><description><para>The flags to use when writing the INI file. The following flags are supported: <itemizedlist>
<listitem><para><computeroutput>skip_ini_validity_check</computeroutput>– Skip check if ptree is a valid ini. The validity check covers the preconditions but takes <computeroutput>O(n log n)</computeroutput> time. </para>
</para></description></parameter><parametername="loc"><paramtype>const std::locale &</paramtype><default>std::locale()</default><description><para>The locale to use when writing the file. </para></description></parameter><description><para>Translates the property tree to INI and writes it the given file.
</para></description><requires><para><emphasis>pt</emphasis> cannot have data in its root. </para>
</requires><requires><para><emphasis>pt</emphasis> cannot have keys both data and children. </para>
</requires><requires><para><emphasis>pt</emphasis> cannot be deeper than two levels. </para>
</requires><requires><para>There cannot be duplicate keys on any given level of <emphasis>pt</emphasis>. </para>
</requires><throws><simpara><classname>info_parser_error</classname> In case of error translating the property tree to INI or writing to the file. </simpara></throws></function>
</template><parametername="stream"><paramtype>std::basic_istream< typename Ptree::key_type::value_type >&</paramtype><description><para>Stream from which to read in the property tree. </para></description></parameter><parametername="pt"><paramtype>Ptree &</paramtype><description><para>The property tree to populate. </para></description></parameter><description><para>Read JSON from a the given stream and translate it to a property tree. <note><para>Clears existing contents of property tree. In case of error the property tree unmodified. </para>
</note>
<note><para>Items of JSON arrays are translated into ptree keys with empty names. Members of objects are translated into named keys. </para>
</note>
<note><para>JSON data can be a string, a numeric value, or one of literals "null", "true" and "false". During parse, any of the above is copied verbatim into ptree data string. </para>
</para></description><throws><simpara><classname>json_parser_error</classname> In case of error deserializing the property tree. </simpara></throws></function>
</template><parametername="filename"><paramtype>const std::string &</paramtype><description><para>Name of file from which to read in the property tree. </para></description></parameter><parametername="pt"><paramtype>Ptree &</paramtype><description><para>The property tree to populate. </para></description></parameter><parametername="loc"><paramtype>const std::locale &</paramtype><default>std::locale()</default><description><para>The locale to use when reading in the file contents. </para></description></parameter><description><para>Read JSON from a the given file and translate it to a property tree. <note><para>Clears existing contents of property tree. In case of error the property tree unmodified. </para>
</note>
<note><para>Items of JSON arrays are translated into ptree keys with empty names. Members of objects are translated into named keys. </para>
</note>
<note><para>JSON data can be a string, a numeric value, or one of literals "null", "true" and "false". During parse, any of the above is copied verbatim into ptree data string. </para>
</para></description><throws><simpara><classname>json_parser_error</classname> In case of error deserializing the property tree. </simpara></throws></function>
</template><parametername="stream"><paramtype>std::basic_ostream< typename Ptree::key_type::value_type >&</paramtype><description><para>The stream to which to write the JSON representation of the property tree. </para></description></parameter><parametername="pt"><paramtype>const Ptree &</paramtype><description><para>The property tree to tranlsate to JSON and output. </para></description></parameter><parametername="pretty"><paramtype>bool</paramtype><default>true</default><description><para>Whether to pretty-print. Defaults to true for backward compatibility. </para></description></parameter><description><para>Translates the property tree to JSON and writes it the given output stream. <note><para>Any property tree key containing only unnamed subkeys will be rendered as JSON arrays. </para>
</para></description><requires><para><emphasis>pt</emphasis> cannot contain keys that have both subkeys and non-empty data. </para>
</requires><throws><simpara><classname>json_parser_error</classname> In case of error translating the property tree to JSON or writing to the output stream. </simpara></throws></function>
</template><parametername="filename"><paramtype>const std::string &</paramtype><description><para>The name of the file to which to write the JSON representation of the property tree. </para></description></parameter><parametername="pt"><paramtype>const Ptree &</paramtype><description><para>The property tree to translate to JSON and output. </para></description></parameter><parametername="loc"><paramtype>const std::locale &</paramtype><default>std::locale()</default><description><para>The locale to use when writing out to the output file. </para></description></parameter><parametername="pretty"><paramtype>bool</paramtype><default>true</default><description><para>Whether to pretty-print. Defaults to true and last place for backward compatibility. </para></description></parameter><description><para>Translates the property tree to JSON and writes it the given file. <note><para>Any property tree key containing only unnamed subkeys will be rendered as JSON arrays. </para>
</para></description><requires><para><emphasis>pt</emphasis> cannot contain keys that have both subkeys and non-empty data. </para>
</requires><throws><simpara><classname>json_parser_error</classname> In case of error translating the property tree to JSON or writing to the file. </simpara></throws></function>
</template><description><para>Property tree main structure. A property tree is a hierarchical data structure which has one element of type <computeroutput>Data</computeroutput> in each node, as well as an ordered sequence of sub-nodes, which are additionally identified by a non-unique key of type <computeroutput>Key</computeroutput>.</para><para>Key equivalency is defined by <computeroutput>KeyCompare</computeroutput>, a predicate defining a strict weak ordering.</para><para>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. </para></description><method-groupname="public member functions">
<methodname="swap"><type>void</type><parametername="rhs"><paramtype>self_type &</paramtype></parameter><description><para>Swap with other tree. Only constant-time and nothrow if the data type's swap is. </para></description></method>
<methodname="size"cv="const"><type>size_type</type><description><para>The number of direct children of this node. </para></description></method>
<methodname="insert"><type>iterator</type><parametername="where"><paramtype>iterator</paramtype></parameter><parametername="value"><paramtype>const value_type &</paramtype></parameter><description><para>Insert a copy of the given tree with its key just before the given position in this node. This operation invalidates no iterators.
</template><parametername="where"><paramtype>iterator</paramtype></parameter><parametername="first"><paramtype>It</paramtype></parameter><parametername="last"><paramtype>It</paramtype></parameter><description><para>Range insert. Equivalent to: <programlistinglanguage="c++">for(; first != last; ++first) insert(where, *first);
</programlisting></para></description></method>
<methodname="erase"><type>iterator</type><parametername="where"><paramtype>iterator</paramtype></parameter><description><para>Erase the child pointed at by the iterator. This operation invalidates the given iterator, as well as its equivalent assoc_iterator.
<methodname="erase"><type>iterator</type><parametername="first"><paramtype>iterator</paramtype></parameter><parametername="last"><paramtype>iterator</paramtype></parameter><description><para>Range erase. Equivalent to: <programlistinglanguage="c++">while(first != last;) first = erase(first);
</programlisting></para></description></method>
<methodname="push_front"><type>iterator</type><parametername="value"><paramtype>const value_type &</paramtype></parameter><description><para>Equivalent to insert(begin(), value). </para></description></method>
<methodname="push_back"><type>iterator</type><parametername="value"><paramtype>const value_type &</paramtype></parameter><description><para>Equivalent to insert(end(), value). </para></description></method>
<methodname="pop_front"><type>void</type><description><para>Equivalent to erase(begin()). </para></description></method>
<methodname="pop_back"><type>void</type><description><para>Equivalent to erase(boost::prior(end())). </para></description></method>
<methodname="reverse"><type>void</type><description><para>Reverses the order of direct children in the property tree. </para></description></method>
<methodname="sort"><type>void</type><template>
<template-type-parametername="Compare"/>
</template><parametername="comp"><paramtype>Compare</paramtype></parameter><description><para>Sorts the direct children of this node according to the predicate. The predicate is passed the whole pair of key and child. </para></description></method>
<methodname="sort"><type>void</type><description><para>Sorts the direct children of this node according to key order. </para></description></method>
<methodname="operator=="cv="const"><type>bool</type><parametername="rhs"><paramtype>const self_type &</paramtype></parameter><description><para>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. </para></description></method>
<methodname="ordered_begin"><type>assoc_iterator</type><description><para>Returns an iterator to the first child, in key order. </para></description></method>
<methodname="ordered_begin"cv="const"><type>const_assoc_iterator</type><description><para>Returns an iterator to the first child, in key order. </para></description></method>
<methodname="not_found"><type>assoc_iterator</type><description><para>Returns the not-found iterator. Equivalent to end() in a real associative container. </para></description></method>
<methodname="not_found"cv="const"><type>const_assoc_iterator</type><description><para>Returns the not-found iterator. Equivalent to end() in a real associative container. </para></description></method>
<methodname="find"><type>assoc_iterator</type><parametername="key"><paramtype>const key_type &</paramtype></parameter><description><para>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. </para></description></method>
<methodname="find"cv="const"><type>const_assoc_iterator</type><parametername="key"><paramtype>const key_type &</paramtype></parameter><description><para>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. </para></description></method>
<methodname="equal_range"><type>std::pair< assoc_iterator, assoc_iterator ></type><parametername="key"><paramtype>const key_type &</paramtype></parameter><description><para>Find the range of children that have the given key. </para></description></method>
<methodname="equal_range"cv="const"><type>std::pair< const_assoc_iterator, const_assoc_iterator ></type><parametername="key"><paramtype>const key_type &</paramtype></parameter><description><para>Find the range of children that have the given key. </para></description></method>
<methodname="count"cv="const"><type>size_type</type><parametername="key"><paramtype>const key_type &</paramtype></parameter><description><para>Count the number of direct children with the given key. </para></description></method>
<methodname="erase"><type>size_type</type><parametername="key"><paramtype>const key_type &</paramtype></parameter><description><para>Erase all direct children with the given key and return the count. </para></description></method>
<methodname="to_iterator"><type>iterator</type><parametername="it"><paramtype>assoc_iterator</paramtype></parameter><description><para>Get the iterator that points to the same element as the argument. <note><para>A valid assoc_iterator range (a, b) does not imply that (to_iterator(a), to_iterator(b)) is a valid range. </para>
<methodname="to_iterator"cv="const"><type>const_iterator</type><parametername="it"><paramtype>const_assoc_iterator</paramtype></parameter><description><para>Get the iterator that points to the same element as the argument. <note><para>A valid const_assoc_iterator range (a, b) does not imply that (to_iterator(a), to_iterator(b)) is a valid range. </para>
<methodname="data"><type>data_type &</type><description><para>Reference to the actual data in this node. </para></description></method>
<methodname="data"cv="const"><type>const data_type &</type><description><para>Reference to the actual data in this node. </para></description></method>
<methodname="clear"><type>void</type><description><para>Clear this tree completely, of both data and children. </para></description></method>
<methodname="get_child"><type>self_type &</type><parametername="path"><paramtype>const path_type &</paramtype></parameter><description><para>Get the child at the given path, or throw <computeroutput><classnamealt="boost::property_tree::ptree_bad_path">ptree_bad_path</classname></computeroutput>. <note><para>Depending on the path, the result at each level may not be completely deterministic, 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: <programlistinglanguage="c++">a -> b -> c
<methodname="get_child"cv="const"><type>const self_type &</type><parametername="path"><paramtype>const path_type &</paramtype></parameter><description><para>Get the child at the given path, or throw <computeroutput><classnamealt="boost::property_tree::ptree_bad_path">ptree_bad_path</classname></computeroutput>. </para></description></method>
<methodname="get_child"><type>self_type &</type><parametername="path"><paramtype>const path_type &</paramtype></parameter><parametername="default_value"><paramtype>self_type &</paramtype></parameter><description><para>Get the child at the given path, or return <computeroutput>default_value</computeroutput>. </para></description></method>
<methodname="get_child"cv="const"><type>const self_type &</type><parametername="path"><paramtype>const path_type &</paramtype></parameter><parametername="default_value"><paramtype>const self_type &</paramtype></parameter><description><para>Get the child at the given path, or return <computeroutput>default_value</computeroutput>. </para></description></method>
<methodname="get_child_optional"><type>optional< self_type &></type><parametername="path"><paramtype>const path_type &</paramtype></parameter><description><para>Get the child at the given path, or return boost::null. </para></description></method>
<methodname="get_child_optional"cv="const"><type>optional< const self_type &></type><parametername="path"><paramtype>const path_type &</paramtype></parameter><description><para>Get the child at the given path, or return boost::null. </para></description></method>
<methodname="put_child"><type>self_type &</type><parametername="path"><paramtype>const path_type &</paramtype></parameter><parametername="value"><paramtype>const self_type &</paramtype></parameter><description><para>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.
<methodname="add_child"><type>self_type &</type><parametername="path"><paramtype>const path_type &</paramtype><description><para>Path to the child. The last fragment must not have an index. </para></description></parameter><parametername="value"><paramtype>const self_type &</paramtype></parameter><description><para>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.
</template><parametername="tr"><paramtype>Translator</paramtype></parameter><description><para>Take the value of this node and attempt to translate it to a <computeroutput>Type</computeroutput> object using the supplied translator.
</para></description><throws><simpara><classname>ptree_bad_data</classname> if the conversion fails. </simpara></throws></method>
</template><description><para>Take the value of this node and attempt to translate it to a <computeroutput>Type</computeroutput> object using the default translator.
</para></description><throws><simpara><classname>ptree_bad_data</classname> if the conversion fails. </simpara></throws></method>
</template><parametername="default_value"><paramtype>const Type &</paramtype></parameter><parametername="tr"><paramtype>Translator</paramtype></parameter><description><para>Take the value of this node and attempt to translate it to a <computeroutput>Type</computeroutput> object using the supplied translator. Return <computeroutput>default_value</computeroutput> if this fails. </para></description></method>
</template><parametername="default_value"><paramtype>const Ch *</paramtype></parameter><parametername="tr"><paramtype>Translator</paramtype></parameter><description><para>Make get_value do the right thing for string literals. </para></description></method>
</template><parametername="default_value"><paramtype>const Type &</paramtype></parameter><description><para>Take the value of this node and attempt to translate it to a <computeroutput>Type</computeroutput> object using the default translator. Return <computeroutput>default_value</computeroutput> if this fails. </para></description></method>
</template><parametername="default_value"><paramtype>const Ch *</paramtype></parameter><description><para>Make get_value do the right thing for string literals. </para></description></method>
<methodname="get_value_optional"cv="const"><type>optional< Type ></type><template>
<template-type-parametername="Type"/>
<template-type-parametername="Translator"/>
</template><parametername="tr"><paramtype>Translator</paramtype></parameter><description><para>Take the value of this node and attempt to translate it to a <computeroutput>Type</computeroutput> object using the supplied translator. Return boost::null if this fails. </para></description></method>
<methodname="get_value_optional"cv="const"><type>optional< Type ></type><template>
<template-type-parametername="Type"/>
</template><description><para>Take the value of this node and attempt to translate it to a <computeroutput>Type</computeroutput> object using the default translator. Return boost::null if this fails. </para></description></method>
</template><parametername="value"><paramtype>const Type &</paramtype></parameter><parametername="tr"><paramtype>Translator</paramtype></parameter><description><para>Replace the value at this node with the given value, translated to the tree's data type using the supplied translator.
</para></description><throws><simpara><classname>ptree_bad_data</classname> if the conversion fails. </simpara></throws></method>
</template><parametername="value"><paramtype>const Type &</paramtype></parameter><description><para>Replace the value at this node with the given value, translated to the tree's data type using the default translator.
</para></description><throws><simpara><classname>ptree_bad_data</classname> if the conversion fails. </simpara></throws></method>
</template><parametername="path"><paramtype>const path_type &</paramtype></parameter><parametername="default_value"><paramtype>const Type &</paramtype></parameter><parametername="tr"><paramtype>Translator</paramtype></parameter><description><para>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. </para></description></method>
</template><parametername="path"><paramtype>const path_type &</paramtype></parameter><parametername="default_value"><paramtype>const Ch *</paramtype></parameter><parametername="tr"><paramtype>Translator</paramtype></parameter><description><para>Make get do the right thing for string literals. </para></description></method>
</template><parametername="path"><paramtype>const path_type &</paramtype></parameter><parametername="default_value"><paramtype>const Type &</paramtype></parameter><description><para>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. </para></description></method>
</template><parametername="path"><paramtype>const path_type &</paramtype></parameter><parametername="default_value"><paramtype>const Ch *</paramtype></parameter><description><para>Make get do the right thing for string literals. </para></description></method>
<methodname="get_optional"cv="const"><type>optional< Type ></type><template>
</template><parametername="path"><paramtype>const path_type &</paramtype></parameter><parametername="value"><paramtype>const Type &</paramtype></parameter><parametername="tr"><paramtype>Translator</paramtype></parameter><description><para>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.
</template><parametername="path"><paramtype>const path_type &</paramtype></parameter><parametername="value"><paramtype>const Type &</paramtype></parameter><description><para>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.
</template><parametername="path"><paramtype>const path_type &</paramtype><description><para>Path to the child. The last fragment must not have an index. </para></description></parameter><parametername="value"><paramtype>const Type &</paramtype><description><para>The value to add. </para></description></parameter><parametername="tr"><paramtype>Translator</paramtype><description><para>The translator to use. </para></description></parameter><description><para>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.
</template><parametername="path"><paramtype>const path_type &</paramtype><description><para>Path to the child. The last fragment must not have an index. </para></description></parameter><parametername="value"><paramtype>const Type &</paramtype><description><para>The value to add. </para></description></parameter><description><para>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.
<constructor><description><para>Creates a node with no children and default-constructed data. </para></description></constructor>
<constructorspecifiers="explicit"><parametername="data"><paramtype>const data_type &</paramtype></parameter><description><para>Creates a node with no children and a copy of the given data. </para></description></constructor>
</template><purpose>Simple implementation of the Translator concept. It does no translation. </purpose><method-groupname="public member functions">
<methodname="get_value"><type>boost::optional< T ></type><parametername="v"><paramtype>const T &</paramtype></parameter></method>
<methodname="put_value"><type>boost::optional< T ></type><parametername="v"><paramtype>const T &</paramtype></parameter></method>
</method-group>
</struct><structname="path_of"><template>
<template-type-parametername="Key"/>
</template><purpose>If you want to use a custom key type, specialize this struct for it and give it a 'type' typedef that specifies your path type. The path type must conform to the Path concept described in the documentation. This is already specialized for std::basic_string. </purpose></struct><structname="translator_between"><template>
<template-type-parametername="Internal"/>
<template-type-parametername="External"/>
</template><purpose>Specialize this struct to specify a default translator between the data in a tree whose data_type is Internal, and the external data_type specified in a get_value, get, put_value or put operation. This is already specialized for Internal being std::basic_string. </purpose></struct><typedefname="path"><description><para>Implements a path using a std::string as the key. </para></description><type><classname>string_path</classname>< std::string, <classname>id_translator</classname>< std::string >></type></typedef>
<typedefname="ptree"><description><para>A property tree with std::string for key and data, and default comparison. </para></description><type><classname>basic_ptree</classname>< std::string, std::string ></type></typedef>
<typedefname="iptree"><description><para>A property tree with std::string for key and data, and case-insensitive comparison. </para></description><type><emphasis>unspecified</emphasis></type></typedef>
<typedefname="wpath"><description><para>Implements a path using a std::wstring as the key. </para></description><type><classname>string_path</classname>< std::wstring, <classname>id_translator</classname>< std::wstring >></type></typedef>
<typedefname="wptree"><description><para>A property tree with std::wstring for key and data, and default comparison. <note><para>The type only exists if the platform supports <computeroutput>wchar_t</computeroutput>. </para>
<typedefname="wiptree"><description><para>A property tree with std::wstring for key and data, and case-insensitive comparison. <note><para>The type only exists if the platform supports <computeroutput>wchar_t</computeroutput>. </para>
</template><parametername="pt1"><paramtype><classname>basic_ptree</classname>< K, D, C >&</paramtype></parameter><parametername="pt2"><paramtype><classname>basic_ptree</classname>< K, D, C >&</paramtype></parameter><description><para>Swap two property tree instances. </para></description></function>
</template><parametername="ar"><paramtype>Archive &</paramtype><description><para>The archive to which to save the serialized property tree. This archive should conform to the concept laid out by the Boost.Serialization library. </para></description></parameter><parametername="t"><paramtype>const <classname>basic_ptree</classname>< K, D, C >&</paramtype><description><para>The property tree to serialize. </para></description></parameter><parametername="file_version"><paramtype>const unsigned int</paramtype><description><para>file_version for the archive. </para></description></parameter><description><para>Serialize the property tree to the given archive. <note><para>In addition to serializing to regular archives, this supports serializing to archives requiring name-value pairs, e.g. XML archives. However, the output format in the XML archive is not guaranteed to be the same as that when using the Boost.PropertyTree library's <computeroutput>boost::property_tree::xml_parser::write_xml</computeroutput>. </para>
</para></description><postconditions><para><computeroutput>ar</computeroutput> will contain the serialized form of <computeroutput>t</computeroutput>. </para>
</template><parametername="ar"><paramtype>Archive &</paramtype><description><para>The archive from which to load the serialized property tree. This archive should conform to the concept laid out by the Boost.Serialization library. </para></description></parameter><parametername="t"><paramtype><classname>basic_ptree</classname>< K, D, C >&</paramtype><description><para>The property tree to de-serialize. </para></description></parameter><parametername="file_version"><paramtype>const unsigned int</paramtype><description><para>file_version for the archive. </para></description></parameter><description><para>De-serialize the property tree to the given archive. <note><para>In addition to de-serializing from regular archives, this supports loading from archives requiring name-value pairs, e.g. XML archives. The format should be that used by boost::property_tree::save. </para>
</para></description><postconditions><para><computeroutput>t</computeroutput> will contain the de-serialized data from <computeroutput>ar</computeroutput>. </para>
</template><parametername="ar"><paramtype>Archive &</paramtype><description><para>The archive from which to load or save the serialized property tree. The type of this archive will determine whether saving or loading is performed. </para></description></parameter><parametername="t"><paramtype><classname>basic_ptree</classname>< K, D, C >&</paramtype><description><para>The property tree to load or save. </para></description></parameter><parametername="file_version"><paramtype>const unsigned int</paramtype><description><para>file_version for the archive. </para></description></parameter><description><para>Load or store the property tree using the given archive.
</template><purpose>Implementation of Translator that uses the stream overloads. </purpose><typedefname="internal_type"><type>std::basic_string< Ch, Traits, Alloc ></type></typedef>
<methodname="get_value"><type>boost::optional< E ></type><parametername="v"><paramtype>const internal_type &</paramtype></parameter></method>
<methodname="put_value"><type>boost::optional< internal_type ></type><parametername="v"><paramtype>const E &</paramtype></parameter></method>
<template-type-parametername="String"><purpose><para>Any Sequence. If the sequence does not support random- access iteration, concatenation of paths assumes that insertions at the end preserve iterator validity. </para></purpose></template-type-parameter>
<template-type-parametername="Translator"><purpose><para>A translator with internal_type == String. </para></purpose></template-type-parameter>
</template><purpose>Default path class. A path is a sequence of values. Groups of values are separated by the separator value, which defaults to '.' cast to the sequence's value type. The group of values is then passed to the translator to get a key. </purpose><description><para>If instantiated with std::string and <classnamealt="boost::property_tree::id_translator">id_translator</classname><std::string>, it accepts paths of the form "one.two.three.four".</para><para>
<methodname="operator/="><type><classname>string_path</classname>&</type><parametername="o"><paramtype>const <classname>string_path</classname>&</paramtype></parameter><purpose>Append a second path to this one. </purpose><description><para>
<constructorspecifiers="explicit"><parametername="separator"><paramtype>char_type</paramtype><default>char_type('.')</default></parameter><purpose>Create an empty path. </purpose></constructor>
<constructor><parametername="value"><paramtype>const String &</paramtype><description><para>A sequence, possibly with separators, that describes the path, e.g. "one.two.three". </para></description></parameter><parametername="separator"><paramtype>char_type</paramtype><default>char_type('.')</default><description><para>The separator used in parsing. Defaults to '.'. </para></description></parameter><parametername="tr"><paramtype>Translator</paramtype><default>Translator()</default><description><para>The translator used by this path to convert the individual parts to keys. </para></description></parameter><purpose>Create a path by parsing the given string. </purpose><description><para>
</para></description></constructor>
<constructor><parametername="value"><paramtype>const char_type *</paramtype><description><para>A zero-terminated array of values. Only use if zero- termination makes sense for your type, and your sequence supports construction from it. Intended for string literals. </para></description></parameter><parametername="separator"><paramtype>char_type</paramtype><default>char_type('.')</default><description><para>The separator used in parsing. Defaults to '.'. </para></description></parameter><parametername="tr"><paramtype>Translator</paramtype><default>Translator()</default><description><para>The translator used by this path to convert the individual parts to keys. </para></description></parameter><purpose>Create a path by parsing the given string. </purpose><description><para>
</template><parametername="stream"><paramtype>std::basic_istream< typename Ptree::key_type::value_type >&</paramtype><description><para>Stream from which to read in the property tree. </para></description></parameter><parametername="pt"><paramtype>Ptree &</paramtype><description><para>The property tree to populate. </para></description></parameter><parametername="flags"><paramtype>int</paramtype><default>0</default><description><para>Flags controlling the behaviour of the parser. The following flags are supported: <itemizedlist>
<listitem><para><computeroutput>no_concat_text</computeroutput>– Prevents concatenation of text nodes into datastring of property tree. Puts them in separate <computeroutput><xmltext></computeroutput> strings instead. </para>
</listitem>
<listitem><para><computeroutput>no_comments</computeroutput>– Skip XML comments. </para>
</listitem>
<listitem><para><computeroutput>trim_whitespace</computeroutput>– Trim leading and trailing whitespace from text, and collapse sequences of whitespace. </para>
</para></description></parameter><description><para>Reads XML from an input stream and translates it to property tree. <note><para>Clears existing contents of property tree. In case of error the property tree unmodified. </para>
</note>
<note><para>XML attributes are placed under keys named <computeroutput><xmlattr></computeroutput>. </para>
</para></description><throws><simpara><classname>xml_parser_error</classname> In case of error deserializing the property tree. </simpara></throws></function>
</template><parametername="filename"><paramtype>const std::string &</paramtype><description><para>The file from which to read in the property tree. </para></description></parameter><parametername="pt"><paramtype>Ptree &</paramtype><description><para>The property tree to populate. </para></description></parameter><parametername="flags"><paramtype>int</paramtype><default>0</default><description><para>Flags controlling the bahviour of the parser. The following flags are supported: <itemizedlist>
<listitem><para><computeroutput>no_concat_text</computeroutput>– Prevents concatenation of text nodes into datastring of property tree. Puts them in separate <computeroutput><xmltext></computeroutput> strings instead. </para>
</listitem>
<listitem><para><computeroutput>no_comments</computeroutput>– Skip XML comments. </para>
</para></description></parameter><parametername="loc"><paramtype>const std::locale &</paramtype><default>std::locale()</default><description><para>The locale to use when reading in the file contents. </para></description></parameter><description><para>Reads XML from a file using the given locale and translates it to property tree. <note><para>Clears existing contents of property tree. In case of error the property tree unmodified. </para>
</note>
<note><para>XML attributes are placed under keys named <computeroutput><xmlattr></computeroutput>. </para>
</para></description><throws><simpara><classname>xml_parser_error</classname> In case of error deserializing the property tree. </simpara></throws></function>
</template><parametername="stream"><paramtype>std::basic_ostream< typename Ptree::key_type::value_type >&</paramtype><description><para>The stream to which to write the XML representation of the property tree. </para></description></parameter><parametername="pt"><paramtype>const Ptree &</paramtype><description><para>The property tree to tranlsate to XML and output. </para></description></parameter><parametername="settings"><paramtype>const xml_writer_settings< typename Ptree::key_type >&</paramtype><default>xml_writer_settings< typename Ptree::key_type >()</default><description><para>The settings to use when writing out the property tree as XML. </para></description></parameter><description><para>Translates the property tree to XML and writes it the given output stream.
</para></description><throws><simpara><classname>xml_parser_error</classname> In case of error translating the property tree to XML or writing to the output stream. </simpara></throws></function>
</template><parametername="filename"><paramtype>const std::string &</paramtype><description><para>The file to which to write the XML representation of the property tree. </para></description></parameter><parametername="pt"><paramtype>const Ptree &</paramtype><description><para>The property tree to tranlsate to XML and output. </para></description></parameter><parametername="loc"><paramtype>const std::locale &</paramtype><default>std::locale()</default><description><para>The locale to use when writing the output to file. </para></description></parameter><parametername="settings"><paramtype>const xml_writer_settings< typename Ptree::key_type >&</paramtype><default>xml_writer_settings< typename Ptree::key_type >()</default><description><para>The settings to use when writing out the property tree as XML. </para></description></parameter><description><para>Translates the property tree to XML and writes it the given file.
</para></description><throws><simpara><classname>xml_parser_error</classname> In case of error translating the property tree to XML or writing to the output stream. </simpara></throws></function>