#include <ZipSerialize.h>
Additional Inherited Members |
std::string | path |
Detailed Description
Definition at line 33 of file ZipSerialize.h.
Constructor & Destructor Documentation
digidoc::ZipSerialize::ZipSerialize |
( |
const std::string & |
path | ) |
|
Initializes ZIP file serializer.
- Parameters
-
Definition at line 62 of file ZipSerialize.cpp.
digidoc::ZipSerialize::~ZipSerialize |
( |
| ) |
|
|
virtual |
Desctructs ZIP file serializer.
- Parameters
-
Definition at line 73 of file ZipSerialize.cpp.
Member Function Documentation
void digidoc::ZipSerialize::addFile |
( |
const std::string & |
containerPath, |
|
|
const std::string & |
path |
|
) |
| |
|
virtual |
Add new file to ZIP container. The file is actually archived to ZIP container after save()
method is called.
- Parameters
-
containerPath | file path inside ZIP file. |
path | full path of the file that should be added to ZIP file. |
- See Also
- create()
-
save()
Implements digidoc::ISerialize.
Definition at line 256 of file ZipSerialize.cpp.
References DEBUG.
void digidoc::ZipSerialize::create |
( |
| ) |
|
|
virtual |
std::string digidoc::ZipSerialize::extract |
( |
| ) |
throw (IOException) |
|
virtual |
Extracts all files from ZIP file to a temporary directory on disk.
- Returns
- returns path, where files from ZIP file were extracted.
- Exceptions
-
IOException | throws exception if there were errors during extracting files to disk. |
Implements digidoc::ISerialize.
Definition at line 85 of file ZipSerialize.cpp.
References digidoc::util::File::createTempDirectory(), DEBUG, e, digidoc::util::File::encodeName(), f_string, THROW_IOEXCEPTION, UNZ_END_OF_LIST_OF_FILE, UNZ_OK, unzClose(), unzGoToFirstFile(), unzGoToNextFile(), and unzOpen2().
void digidoc::ZipSerialize::save |
( |
| ) |
throw (IOException) |
|
virtual |
Creates new ZIP file and adds all the added files to the ZIP file.
- Exceptions
-
IOException | throws exception if the file to be added did not exists or creating new ZIP file failed. |
- See Also
- create()
-
addFile(const std::string& containerPath, const std::string& path)
Implements digidoc::ISerialize.
Definition at line 272 of file ZipSerialize.cpp.
References APPEND_STATUS_CREATE, DEBUG, DEF_MEM_LEVEL, digidoc::util::File::encodeName(), f_string, digidoc::util::File::fopen(), digidoc::util::File::modifiedTime(), digidoc::util::File::moveFile(), digidoc::util::File::tempFileName(), THROW_IOEXCEPTION, ZIP_OK, zipClose(), zipCloseFileInZip(), zipOpen2(), zipOpenNewFileInZip4(), and zipWriteInFileInZip().
Member Data Documentation
The documentation for this class was generated from the following files: