SLProject  4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
ZipUtils.h
Go to the documentation of this file.
1 /**
2  * \file ZipUtils.h
3  * \authors Luc Girod
4  * \date 2020
5  * \copyright http://opensource.org/licenses/GPL-3.0
6  * \remarks Please use clangformat to format the code. See more code style on
7  * https://github.com/cpvrlab/SLProject4/wiki/SLProject-Coding-Style
8 */
9 
10 #ifndef CPLVRLAB_ZIP_UTILS_H
11 #define CPLVRLAB_ZIP_UTILS_H
12 
13 #include <string>
14 #include <functional>
15 
16 //! ZipUtils provides compressing & decompressing files and folders
17 namespace ZipUtils
18 {
19 bool zip(string path, string zipname = "");
20 
21 bool unzip(string zipfile,
22  function<bool(string path, string filename)> processFile,
23  function<bool(const char* data, size_t len)> writeChunk,
24  function<bool(string path)> processDir,
25  function<int(int currentFile, int totalFiles)> progress = nullptr);
26 
27 bool unzip(string path,
28  string dest = "",
29  bool override = true,
30  function<int(int currentFile, int totalFiles)> progress = nullptr);
31 }
32 #endif
ZipUtils provides compressing & decompressing files and folders.
Definition: ZipUtils.cpp:19
bool zip(string path, string zipname)
Definition: ZipUtils.cpp:255
bool unzip(string zipfile, function< bool(string path, string filename)> processFile, function< bool(const char *data, size_t len)> writeChunk, function< bool(string path)> processDir, function< int(int currentFile, int totalFiles)> progress=nullptr)
Definition: ZipUtils.cpp:150