Classes | |
class | xml_parser_error |
Xml parser error. More... | |
class | xml_writer_settings |
Xml writer settings. The default settings lead to no pretty printing. More... | |
Functions | |
template<class Str > | |
Str | condense (const Str &s) |
template<class Str > | |
Str | decode_char_entities (const Str &s) |
template<class Str > | |
Str | encode_char_entities (const Str &s) |
template<class Ptree > | |
void | read_xml (const std::string &filename, Ptree &pt, int flags=0, const std::locale &loc=std::locale()) |
template<class Ptree > | |
void | read_xml (std::basic_istream< typename Ptree::key_type::value_type > &stream, Ptree &pt, int flags=0) |
template<class Ptree > | |
void | read_xml_internal (std::basic_istream< typename Ptree::key_type::value_type > &stream, Ptree &pt, int flags, const std::string &filename) |
template<class Ptree , class Ch > | |
void | read_xml_node (detail::rapidxml::xml_node< Ch > *node, Ptree &pt, int flags) |
bool | validate_flags (int flags) |
template<class Str > | |
Str | widen (const char *text) |
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 >()) |
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 >()) |
template<class Str > | |
void | write_xml_comment (std::basic_ostream< typename Str::value_type > &stream, const Str &s, int indent, bool separate_line, const xml_writer_settings< Str > &settings) |
template<class Ptree > | |
void | write_xml_element (std::basic_ostream< typename Ptree::key_type::value_type > &stream, const typename Ptree::key_type &key, const Ptree &pt, int indent, const xml_writer_settings< typename Ptree::key_type > &settings) |
template<class Str > | |
void | write_xml_indent (std::basic_ostream< typename Str::value_type > &stream, int indent, const xml_writer_settings< Str > &settings) |
template<class Ptree > | |
void | write_xml_internal (std::basic_ostream< typename Ptree::key_type::value_type > &stream, const Ptree &pt, const std::string &filename, const xml_writer_settings< typename Ptree::key_type > &settings) |
template<class Str > | |
void | write_xml_text (std::basic_ostream< typename Str::value_type > &stream, const Str &s, int indent, bool separate_line, const xml_writer_settings< Str > &settings) |
template<class Str > | |
xml_writer_settings< Str > | xml_writer_make_settings (typename Str::value_type indent_char=(typename Str::value_type)(' '), typename Str::size_type indent_count=0, const Str &encoding=widen< Str >("utf-8")) |
template<class Str > | |
const Str & | xmlattr () |
template<class Str > | |
const Str & | xmlcomment () |
template<class Str > | |
const Str & | xmldecl () |
template<class Str > | |
const Str & | xmltext () |
Variables | |
static const int | no_comments = 0x2 |
Comments should be omitted. More... | |
static const int | no_concat_text = 0x1 |
static const int | trim_whitespace = 0x4 |
Whitespace should be collapsed and trimmed. More... | |
Str boost::property_tree::xml_parser::condense | ( | const Str & | s | ) |
Definition at line 24 of file xml_parser_utils.hpp.
Str boost::property_tree::xml_parser::decode_char_entities | ( | const Str & | s | ) |
Definition at line 81 of file xml_parser_utils.hpp.
Str boost::property_tree::xml_parser::encode_char_entities | ( | const Str & | s | ) |
Definition at line 47 of file xml_parser_utils.hpp.
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. |
Definition at line 73 of file xml_parser.hpp.
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:
|
Definition at line 46 of file xml_parser.hpp.
void boost::property_tree::xml_parser::read_xml_internal | ( | std::basic_istream< typename Ptree::key_type::value_type > & | stream, |
Ptree & | pt, | ||
int | flags, | ||
const std::string & | filename | ||
) |
Definition at line 86 of file xml_parser_read_rapidxml.hpp.
void boost::property_tree::xml_parser::read_xml_node | ( | detail::rapidxml::xml_node< Ch > * | node, |
Ptree & | pt, | ||
int | flags | ||
) |
Definition at line 24 of file xml_parser_read_rapidxml.hpp.
|
inline |
Definition at line 24 of file xml_parser_flags.hpp.
Str boost::property_tree::xml_parser::widen | ( | const char * | text | ) |
Definition at line 22 of file xml_parser_writer_settings.hpp.
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. |
Definition at line 124 of file xml_parser.hpp.
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. |
Definition at line 100 of file xml_parser.hpp.
void boost::property_tree::xml_parser::write_xml_comment | ( | std::basic_ostream< typename Str::value_type > & | stream, |
const Str & | s, | ||
int | indent, | ||
bool | separate_line, | ||
const xml_writer_settings< Str > & | settings | ||
) |
Definition at line 32 of file xml_parser_write.hpp.
void boost::property_tree::xml_parser::write_xml_element | ( | std::basic_ostream< typename Ptree::key_type::value_type > & | stream, |
const typename Ptree::key_type & | key, | ||
const Ptree & | pt, | ||
int | indent, | ||
const xml_writer_settings< typename Ptree::key_type > & | settings | ||
) |
Definition at line 66 of file xml_parser_write.hpp.
void boost::property_tree::xml_parser::write_xml_indent | ( | std::basic_ostream< typename Str::value_type > & | stream, |
int | indent, | ||
const xml_writer_settings< Str > & | settings | ||
) |
Definition at line 23 of file xml_parser_write.hpp.
void boost::property_tree::xml_parser::write_xml_internal | ( | std::basic_ostream< typename Ptree::key_type::value_type > & | stream, |
const Ptree & | pt, | ||
const std::string & | filename, | ||
const xml_writer_settings< typename Ptree::key_type > & | settings | ||
) |
Definition at line 179 of file xml_parser_write.hpp.
void boost::property_tree::xml_parser::write_xml_text | ( | std::basic_ostream< typename Str::value_type > & | stream, |
const Str & | s, | ||
int | indent, | ||
bool | separate_line, | ||
const xml_writer_settings< Str > & | settings | ||
) |
Definition at line 50 of file xml_parser_write.hpp.
xml_writer_settings<Str> boost::property_tree::xml_parser::xml_writer_make_settings | ( | typename Str::value_type | indent_char = (typename Str::value_type)(' ') , |
typename Str::size_type | indent_count = 0 , |
||
const Str & | encoding = widen<Str>("utf-8") |
||
) |
Definition at line 55 of file xml_parser_writer_settings.hpp.
const Str& boost::property_tree::xml_parser::xmlattr | ( | ) |
Definition at line 117 of file xml_parser_utils.hpp.
const Str& boost::property_tree::xml_parser::xmlcomment | ( | ) |
Definition at line 124 of file xml_parser_utils.hpp.
const Str& boost::property_tree::xml_parser::xmldecl | ( | ) |
Definition at line 110 of file xml_parser_utils.hpp.
const Str& boost::property_tree::xml_parser::xmltext | ( | ) |
Definition at line 131 of file xml_parser_utils.hpp.
|
static |
Comments should be omitted.
Definition at line 20 of file xml_parser_flags.hpp.
|
static |
Text elements should be put in separate keys, not concatenated in parent data.
Definition at line 18 of file xml_parser_flags.hpp.
|
static |
Whitespace should be collapsed and trimmed.
Definition at line 22 of file xml_parser_flags.hpp.