QGIS API Documentation
3.6.0-Noosa (5873452)
|
Class allowing to manage the zip/unzip actions. More...
#include <qgsarchive.h>
Public Member Functions | |
QgsArchive () | |
Constructor. More... | |
QgsArchive (const QgsArchive &other) | |
Copy constructor. More... | |
virtual | ~QgsArchive ()=default |
Destructor. More... | |
void | addFile (const QString &filename) |
Add a new file to this archive. More... | |
void | clear () |
Clear the current content of this archive and create a new temporary directory. More... | |
QString | dir () const |
Returns the current temporary directory. More... | |
QStringList | files () const |
Returns the list of files within this archive. More... | |
QgsArchive & | operator= (const QgsArchive &other) |
bool | removeFile (const QString &filename) |
Remove a file from this archive and from the filesystem. More... | |
virtual bool | unzip (const QString &zipFilename) |
Clear the current content of this archive and unzip. More... | |
bool | zip (const QString &zipFilename) |
Zip the content of this archive. More... | |
Class allowing to manage the zip/unzip actions.
Definition at line 34 of file qgsarchive.h.
QgsArchive::QgsArchive | ( | ) |
Constructor.
Definition at line 28 of file qgsarchive.cpp.
QgsArchive::QgsArchive | ( | const QgsArchive & | other | ) |
Copy constructor.
Definition at line 33 of file qgsarchive.cpp.
|
virtualdefault |
Destructor.
void QgsArchive::addFile | ( | const QString & | filename | ) |
Add a new file to this archive.
During a zip action, this file will be part of the resulting zipped file.
filename | A file to add when zipping this archive |
Definition at line 93 of file qgsarchive.cpp.
void QgsArchive::clear | ( | ) |
Clear the current content of this archive and create a new temporary directory.
Definition at line 52 of file qgsarchive.cpp.
QString QgsArchive::dir | ( | ) | const |
Returns the current temporary directory.
Definition at line 47 of file qgsarchive.cpp.
QStringList QgsArchive::files | ( | ) | const |
Returns the list of files within this archive.
Definition at line 110 of file qgsarchive.cpp.
QgsArchive & QgsArchive::operator= | ( | const QgsArchive & | other | ) |
Definition at line 39 of file qgsarchive.cpp.
bool QgsArchive::removeFile | ( | const QString & | filename | ) |
Remove a file from this archive and from the filesystem.
filename | The path of the file to remove |
Definition at line 98 of file qgsarchive.cpp.
|
virtual |
Clear the current content of this archive and unzip.
Files are unzipped in the temporary directory.
zipFilename | The zip file to unzip |
Reimplemented in QgsProjectArchive.
Definition at line 87 of file qgsarchive.cpp.
bool QgsArchive::zip | ( | const QString & | zipFilename | ) |
Zip the content of this archive.
zipFilename | The name of the zip to generate |
Definition at line 58 of file qgsarchive.cpp.