7 #include <boost/filesystem/path.hpp> 8 #include <boost/filesystem/operations.hpp> 10 #include <fwCore/exceptionmacros.hpp> 12 #include "minizip/unzip.h" 13 #include "fwZip/ReadDirArchive.hpp" 14 #include "fwZip/exception/Read.hpp" 36 FW_RAISE_EXCEPTION_IF(
38 "in archive '" + m_archive.string() +
"' doesn't exist."),
39 !::boost::filesystem::exists(m_archive / path));
41 SPTR(std::ifstream) is = std::make_shared< std::ifstream >();
42 is->open((m_archive / path).
string().c_str(), std::fstream::binary | std::fstream::in);
FWZIP_APIconst::boost::filesystem::path getArchivePath() const override
Returns archive path.
FWZIP_API std::shared_ptr< std::istream > getFile(const ::boost::filesystem::path &path) override
Returns input stream for the file in current archive.
FWZIP_API ReadDirArchive(const ::boost::filesystem::path &archive)
Constructors. Initializes archive path.
The namespace fwZip provides IO for compress/uncompress .zip files using zlib .
FWZIP_API ~ReadDirArchive()
Destructor. Close automatically last input file stream.
This class defines functions to read a file in a file system archive.