I had a problem packing multiple files into one archive. accelerated documents are very limited on this topic, and I searched the website several times, but I cannot find a solution.
What I still have:
boost::filesystem::ofstream ofsArchive("some.zip"); boost::iostreams::filtering_ostreambuf outFilter; boost::iostreams::zlib_params zparam(boost::iostreams::zlib::default_compression); try { // set up the filter outFilter.strict_sync(); outFilter.push(boost::iostreams::zlib_compressor(zparam)); outFilter.push(ofsArchive); for(each object of some kind) { // create a binary serialized file boost::filesystem::ofstream ofs(filename, std::ios_base::binary); boost::archive::binary_oarchive bin_oa( ofs ); bin_oa << crazyObject; // here where i'm stuck. how to add multiple files to the "some.zip"? boost::iostreams::copy(ofs, outputArchive); } } catch(boost::iostreams::zlib_error& e){...}
How to add files to a zip archive? the provided method obviously does not work, I just can not find anything on this subject in the documents or header files
c ++ boost serialization compression zlib
cppanda
source share