void write_json(std::basic_ostream<
                     typename Ptree::key_type::value_type
                 > &stream,
                 const Ptree &pt)
 {
     write_json_internal(stream, pt, std::string());
 }
Ejemplo n.º 2
0
 void write_json(std::basic_ostream<
                     typename Ptree::key_type::value_type
                 > &stream,
                 const Ptree &pt,
                 bool pretty = true)
 {
     write_json_internal(stream, pt, std::string(), pretty);
 }
 void write_json(const std::string &filename,
                 const Ptree &pt,
                 const std::locale &loc = std::locale())
 {
     std::basic_ofstream<typename Ptree::key_type::value_type>
         stream(filename.c_str());
     if (!stream)
         BOOST_PROPERTY_TREE_THROW(json_parser_error(
             "cannot open file", filename, 0));
     stream.imbue(loc);
     write_json_internal(stream, pt, filename);
 }
Ejemplo n.º 4
0
 void write_json(const typename Ptree::string_type &filename,
                 const Ptree &pt,
                 const std::locale &loc = std::locale(),
                 bool pretty = true)
 {
     typename Ptree::key_basic_ofstream
         stream(filename.c_str());
     if (!stream)
         BOOST_PROPERTY_TREE_CUSTOM_THROW(json_parser_error<typename Ptree::string_type>(
             "cannot open file", filename, 0));
     stream.imbue(loc);
     write_json_internal(stream, pt, filename, pretty);
 }
Ejemplo n.º 5
0
 void write_json(typename Ptree::for_char<typename Ptree::key_type::value_type>::basic_ostream &stream,
                 const Ptree &pt,
                 bool pretty = true)
 {
     write_json_internal(stream, pt, typename Ptree::string_type(), pretty);
 }