将属性树提升为字符串

vic*_*ico 7 c++ boost

需要通过Internet传输存储在ini文件中的系统配置.我正在使用boost来处理配置ini文件.如何将整个属性树保存到字符串?

seh*_*ehe 7

只要写一个std::stringstream:

std::ostringstream oss;
boost::property_tree::ini_parser::write_ini(oss, my_ptree);

std::string inifile_text = oss.str();
Run Code Online (Sandbox Code Playgroud)

替换为wstring/ wostringstream适当