|
QGIS API Documentation 3.99.0-Master (f78f5286a64)
|
Provides utility functions for working with zip files. More...
#include <qgsziputils.h>
Static Public Member Functions | |
| static bool | decodeGzip (const char *bytesIn, std::size_t size, QByteArray &bytesOut) |
Decodes gzip byte stream, returns true on success. | |
| static bool | decodeGzip (const QByteArray &bytesIn, QByteArray &bytesOut) |
Decodes gzip byte stream, returns true on success. | |
| static bool | encodeGzip (const QByteArray &bytesIn, QByteArray &bytesOut) |
Encodes gzip byte stream, returns true on success. | |
| static const QStringList | files (const QString &zip) |
| Returns the list of files within a zip file. | |
| static bool | isZipFile (const QString &filename) |
Returns true if the file name is a zipped file ( i.e with a '.qgz' extension, false otherwise. | |
| static bool | unzip (const QString &zip, const QString &dir, QStringList &files, bool checkConsistency=true) |
| Unzip a zip file in an output directory. | |
| static bool | zip (const QString &zip, const QStringList &files, bool overwrite=false) |
| Zip the list of files in the zip file. | |
Provides utility functions for working with zip files.
Definition at line 28 of file qgsziputils.h.
|
static |
Decodes gzip byte stream, returns true on success.
Useful for reading vector tiles.
Definition at line 214 of file qgsziputils.cpp.
|
static |
Decodes gzip byte stream, returns true on success.
Useful for reading vector tiles.
Definition at line 209 of file qgsziputils.cpp.
|
static |
Encodes gzip byte stream, returns true on success.
Useful for writing vector tiles.
Definition at line 272 of file qgsziputils.cpp.
|
static |
Returns the list of files within a zip file.
Definition at line 314 of file qgsziputils.cpp.
|
static |
Returns true if the file name is a zipped file ( i.e with a '.qgz' extension, false otherwise.
| filename | The name of the file |
true if the file is zipped, false otherwise Definition at line 32 of file qgsziputils.cpp.
|
static |
Unzip a zip file in an output directory.
| zip | The zip filename |
| dir | The output directory |
| files | The absolute path of unzipped files |
| checkConsistency | Perform additional stricter consistency checks on the archive, and error if they fail (since QGIS 3.30) |
false if the zip filename does not exist, the output directory does not exist or is not writable. Definition at line 37 of file qgsziputils.cpp.
|
static |
Zip the list of files in the zip file.
If the zip file already exists (and overwrite is false) or is empty, an error is returned. If an input file does not exist, an error is also returned.
| zip | The zip filename |
| files | The absolute path to files to embed within the zip |
| overwrite | Set to true to allow overwriting existing files (since QGIS 3.44) |
Definition at line 149 of file qgsziputils.cpp.