/*! \brief Opens zip archive for reading. \param[in] FileName String containing name of zip archive to open. \param[in] Mode Parameter for future functionality. \return Returns dmz::True if the zip archive was successfully opened. */ dmz::Boolean dmz::ReaderZip::open_zip_file (const String &FileName, const UInt32 Mode) { Boolean result (False); close_zip_file (); _state.zf = unzOpen (FileName.get_buffer ()); if (_state.zf) { _state.zipFileName = FileName; result = True; } return result; }
/*! \brief Creates zip archive for writing. \details Will close any open zip archive before opening a new archive. If a zip archive already exists with the same name, it will be overwritten. \param[in] FileName String containing the name of the new zip archive. \param[in] Mode Parameter for future functionality. \return Returns dmz::True if the archive was successfully created. */ dmz::Boolean dmz::WriterZip::open_zip_file (const String &FileName, const UInt32 Mode) { Boolean result (False); close_zip_file (); _state.zf = zipOpen (FileName.get_buffer (), APPEND_STATUS_CREATE); if (_state.zf) { _state.zipFileName = FileName; result = True; } return result; }
//! Destructor. dmz::ReaderZip::~ReaderZip () { close_zip_file (); delete &_state; }
//! Destructor. dmz::WriterZip::~WriterZip () { close_zip_file (); delete &_state; }