Im trying to compress a file using boost library (gzip).
Its a simple task: lets suppose i have the file data.xml and I need to compress it to data.xml.gz. I can even use the default compression values, doesn't matter.
I tryed to look up in google and BOOST pages but with no success.
I have the following:
bool SyncFrequencyHistory::frequencyHistoryCompressFile(void)
{
printf("\r\n===== ACTION: frequencyHistoryCompressFile =====\r\n");
std::ifstream inStream(FREQUENCY_HISTORY_FILE, std::ios_base::in);
std::ofstream outStream(FREQUENCY_HISTORY_FILE_GZIP, std::ios_base::out);
boost::iostreams::filtering_streambuf<:iostreams::output> out;
out.push(boost::iostreams::gzip_compressor());
out.push(outStream);
boost::iostreams::copy(in, out);
return true;
}
FREQUENCY_HISTORY_FILE have the full location of the XML file
FREQUENCY_HISTORY_FILE_GZIP have the full location for the XML.GZ file
I know almost all code is wrong, but i have no idea who to write it the correct way.