
14 Apr
2007
14 Apr
'07
12:44 a.m.
Here is how you can do the former, when saving:
std::ofstream ofs(file_name); boost::iostreams::filtering_ostream out; boost::iostreams::zlib_params zp(boost::iostreams::zlib::best_speed); out.push(boost::iostreams::zlib_compressor(zp)); out.push(ofs); Archive oa(out); oa << BOOST_SERIALIZATION_NVP(message_request);
Hey I tried doing std::stringstream ofs; boost::iostreams::filtering_ostream out; boost::iostreams::zlib_params zp(boost::iostreams::zlib::best_speed); out.push(boost::iostreams::zlib_compressor(zp)); out.push(ofs); ofs << "some test"; but it seems like it doesnt work when I run the program the size of ofs.str().size() is 0. What am I doing wrong? Thanks for help Regards