|
Boost Users : |
From: Aljaz (aljaz.fajmut_at_[hidden])
Date: 2007-04-13 20:44:38
> 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
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net