Insert property tree in row

It is necessary to transfer the system configuration, which is stored in the ini file over the Internet. I use boost to work with the ini configuration file. How to save the entire property tree to a string?

+5
source share
1 answer

Just write in std::stringstream :

 std::ostringstream oss; boost::property_tree::ini_parser::write_ini(oss, my_ptree); std::string inifile_text = oss.str(); 

Replace wstring / wostringstream with appropriate

+5
source

Source: https://habr.com/ru/post/1208345/


All Articles