QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
Functions
QgsZipUtils Namespace Reference

Functions

CORE_EXPORT bool isZipFile (const QString &filename)
 Returns true if the file name is a zipped file ( i.e with a '.qgz' extension, false otherwise. More...
 
CORE_EXPORT bool unzip (const QString &zip, const QString &dir, QStringList &files)
 Unzip a zip file in an output directory. More...
 
CORE_EXPORT bool zip (const QString &zip, const QStringList &files)
 Zip the list of files in the zip file. More...
 

Function Documentation

◆ isZipFile()

bool QgsZipUtils::isZipFile ( const QString &  filename)

Returns true if the file name is a zipped file ( i.e with a '.qgz' extension, false otherwise.

Parameters
filenameThe name of the file
Returns
true if the file is zipped, false otherwise

Definition at line 29 of file qgsziputils.cpp.

◆ unzip()

bool QgsZipUtils::unzip ( const QString &  zip,
const QString &  dir,
QStringList &  files 
)

Unzip a zip file in an output directory.

Parameters
zipThe zip filename
dirThe output directory
filesThe absolute path of unzipped files
Returns
false if the zip filename does not exist, the output directory does not exist or is not writable.
Since
QGIS 3.0

Definition at line 34 of file qgsziputils.cpp.

◆ zip()

bool QgsZipUtils::zip ( const QString &  zip,
const QStringList &  files 
)

Zip the list of files in the zip file.

If the zip file already exists or is empty, an error is returned. If an input file does not exist, an error is also returned.

Parameters
zipThe zip filename
filesThe absolute path to files to embed within the zip
Since
QGIS 3.0

Definition at line 132 of file qgsziputils.cpp.