Functions | |
template<class Ptree > | |
void | read_xml (std::basic_istream< typename Ptree::key_type::value_type > &stream, Ptree &pt, int flags=0) |
Reads XML from an input stream and translates it to property tree. More... | |
template<class Ptree > | |
void | read_xml (const std::string &filename, Ptree &pt, int flags=0, const std::locale &loc=std::locale()) |
Reads XML from a file using the given locale and translates it to property tree. More... | |
template<class Ptree > | |
void | write_xml (std::basic_ostream< typename Ptree::key_type::value_type > &stream, const Ptree &pt, const xml_writer_settings< typename Ptree::key_type > &settings=xml_writer_settings< typename Ptree::key_type >()) |
Translates the property tree to XML and writes it the given output stream. More... | |
template<class Ptree > | |
void | write_xml (const std::string &filename, const Ptree &pt, const std::locale &loc=std::locale(), const xml_writer_settings< typename Ptree::key_type > &settings=xml_writer_settings< typename Ptree::key_type >()) |
Translates the property tree to XML and writes it the given file. More... | |
void boost::property_tree::xml_parser::read_xml | ( | std::basic_istream< typename Ptree::key_type::value_type > & | stream, |
Ptree & | pt, | ||
int | flags = 0 |
||
) |
Reads XML from an input stream and translates it to property tree.
<xmlattr>
. xml_parser_error | In case of error deserializing the property tree. |
stream | Stream from which to read in the property tree. | |
[out] | pt | The property tree to populate. |
flags | Flags controlling the behaviour of the parser. The following flags are supported:
|
References boost::expressions::stream.
void boost::property_tree::xml_parser::read_xml | ( | const std::string & | filename, |
Ptree & | pt, | ||
int | flags = 0 , |
||
const std::locale & | loc = std::locale() |
||
) |
Reads XML from a file using the given locale and translates it to property tree.
<xmlattr>
. xml_parser_error | In case of error deserializing the property tree. |
filename | The file from which to read in the property tree. | |
[out] | pt | The property tree to populate. |
flags | Flags controlling the bahviour of the parser. The following flags are supported:
| |
loc | The locale to use when reading in the file contents. |
References BOOST_ASSERT, BOOST_PROPERTY_TREE_THROW, boost::expressions::stream, and boost::property_tree::ini_parser::validate_flags().
void boost::property_tree::xml_parser::write_xml | ( | std::basic_ostream< typename Ptree::key_type::value_type > & | stream, |
const Ptree & | pt, | ||
const xml_writer_settings< typename Ptree::key_type > & | settings = xml_writer_settings< typename Ptree::key_type>() |
||
) |
Translates the property tree to XML and writes it the given output stream.
xml_parser_error | In case of error translating the property tree to XML or writing to the output stream. |
stream | The stream to which to write the XML representation of the property tree. |
pt | The property tree to tranlsate to XML and output. |
settings | The settings to use when writing out the property tree as XML. |
References boost::expressions::stream.
void boost::property_tree::xml_parser::write_xml | ( | const std::string & | filename, |
const Ptree & | pt, | ||
const std::locale & | loc = std::locale() , |
||
const xml_writer_settings< typename Ptree::key_type > & | settings = xml_writer_settings<typename Ptree::key_type>() |
||
) |
Translates the property tree to XML and writes it the given file.
xml_parser_error | In case of error translating the property tree to XML or writing to the output stream. |
filename | The file to which to write the XML representation of the property tree. |
pt | The property tree to tranlsate to XML and output. |
loc | The locale to use when writing the output to file. |
settings | The settings to use when writing out the property tree as XML. |
References BOOST_PROPERTY_TREE_THROW, and boost::expressions::stream.