...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::property_tree::json_parser::write_json
// In header: <boost/property_tree/json_parser.hpp> template<typename Ptree> void write_json(const std::string & filename, const Ptree & pt, const std::locale & loc = std::locale(), bool pretty = true);
Translates the property tree to JSON and writes it the given file.
Note | |
---|---|
Any property tree key containing only unnamed subkeys will be rendered as JSON arrays. |
Parameters: |
|
||||||||
Requires: |
pt cannot contain keys that have both subkeys and non-empty data. |
||||||||
Throws: |
json_parser_error In case of error translating the property tree to JSON or writing to the file. |