Go to the documentation of this file.
22 #ifndef ZIP_CONTAINER_H
23 #define ZIP_CONTAINER_H
39 struct ZipErrorT :
public zip_error_t
63 ZipFileWrapper(zip_file_t *zFile);
66 operator zip_file_t*();
69 zip_file_t *_zFile =
nullptr;
75 static constexpr zip_uint64_t BuffCopySize = 1024;
98 ZipContainer(
const std::string &path,
bool readOnly,
bool saveOnDestruct);
144 bool _saveOnDesctruct =
false;
153 static zip_t *createZip(
const void *data, zip_uint64_t length);
162 static zip_t *openZipArchive(
const std::string &path,
bool readOnly);
170 static void addZipToZip(zip_t *dest, zip_t *src);
175 #endif // ZIP_CONTAINER_H
void saveToDestination(const std::string &dest) const
Save Archive to storage.
Definition: zip_container.cpp:276
std::vector< uint8_t > getCompressedData() const
Get zip archive's compressed data.
Definition: zip_container.cpp:186
void extractZipFiles(std::string path) const
Extract Zip Files and store them under path.
Definition: zip_container.cpp:217
ZipContainer(std::string &&data)
Constructor. Takes a string argument. This is mainly used for Pistache data receiving.
Definition: zip_container.cpp:115
static ZipContainer compressPath(const std::filesystem::path &path, bool keepRelDirStruct=false)
Compress files and directories under path.
Definition: zip_container.cpp:151
~ZipContainer() noexcept
Destructor. Will save zip archive if requested.
Definition: zip_container.cpp:128
Zip Container Structure. Based on libzip.
Definition: zip_container.h:33