Exemple #1
0
	void GenericMolFile::close()
	{
		LineBasedFile::close();

		if (gmf_is_closed_) return;

		if (getOpenMode() == std::ios::in)
		{
			if (input_is_temporary_)
			{
				File::remove(name_);
			}
		}
		else if(compress_output_)
		{
			std::fstream::close();
			std::ifstream unzipped_file(name_.c_str(), ios_base::in);
			boost::iostreams::filtering_streambuf<boost::iostreams::input> in;
			in.push(boost::iostreams::gzip_compressor());
			in.push(unzipped_file);
			std::ofstream zipped_file(zipped_filename_.c_str(), std::ios::out | std::ios_base::binary);
			boost::iostreams::copy(in, zipped_file);
			File::remove(name_);
		}

		gmf_is_closed_ = true;
	}
void QuarterlyIndexFileRetriever::UnzipLocalIndexFile (const fs::path& local_zip_file_name)
{
	std::ifstream zipped_file(local_zip_file_name.string(), std::ios::in | std::ios::binary);
	Poco::Zip::Decompress expander(zipped_file, local_zip_file_name.parent_path().string(), true);

	expander.decompressAllFiles();

}		// -----  end of method QuarterlyIndexFileRetriever::UnzipLocalIndexFile  -----