하나의 아카이브에 여러 파일을 압축하는 데 문제가 있습니다. 부스트 워드 프로세서는이 주제에 대해 매우 제한적이며 몇 시간 동안 웹을 검색했지만 솔루션을 찾을 수 없습니다.boost :: iostream zlib 여러 파일을 하나의 아카이브로 압축
무엇 내가 지금까지 가지고 :
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's where i'm stuck. how to add multiple files to the "some.zip"?
boost::iostreams::copy(ofs, outputArchive);
}
}
catch(boost::iostreams::zlib_error& e){...}
어떻게 내가 우편 아카이브에 파일을 추가하는 방법은 무엇입니까? 제공된 메서드는 분명히 작동하지 않으며 문서 나 헤더 파일의 제목에서 아무 것도 찾을 수 없습니다.