ZIP Archive.
More...
#include <ZipFile.h>
|
| | ZipFile (const QString &fileName) |
| | Constructor.
|
|
| ~ZipFile () |
| | Destructor.
|
| QStringList | fileNames () const |
| | List of files in the zip archive.
|
| QByteArray | extract (qsizetype index) |
| | Content of file in the zip archive.
|
| QByteArray | extract (const QString &fileName) |
| | Content of file in the zip archive.
|
| bool | isValid () const |
| | Validity check.
|
| QString | error () const |
| | Error string.
|
| QStringList | warnings () const |
| | Warnings.
|
|
| static QStringList | mimeTypes () |
| | Mime type for files that can be opened by this class.
|
| static QSharedPointer< QFile > | openFileURL (const QString &fileName) |
| | Open file, file URL or Android content URL.
|
ZIP Archive.
This class reads a ZIP file and allows extracting individual files.
Definition at line 35 of file ZipFile.h.
◆ ZipFile()
| FileFormats::ZipFile::ZipFile |
( |
const QString & | fileName | ) |
|
Constructor.
The constructor opens the ZIP file. The class assumes that the ZIP file remains untouched throughout the life cycle of this instance.
- Parameters
-
| fileName | File name of a zip file. |
◆ extract() [1/2]
| QByteArray FileFormats::ZipFile::extract |
( |
const QString & | fileName | ) |
|
|
nodiscard |
Content of file in the zip archive.
If a file with the given name does not exist in the archive, then the method tries to replace the path separator characters '/' in the file name with windows-style separators '\' and checks if a file with that name exists.
- Parameters
-
- Returns
- Content of file, or a Null array in case of error
◆ extract() [2/2]
| QByteArray FileFormats::ZipFile::extract |
( |
qsizetype | index | ) |
|
|
nodiscard |
Content of file in the zip archive.
- Parameters
-
| index | Index of the file in the list returned by fileNames |
- Returns
- Content of file, or a Null array in case of error.
◆ fileNames()
| QStringList FileFormats::ZipFile::fileNames |
( |
| ) |
const |
|
inlinenodiscard |
List of files in the zip archive.
- Returns
- List of files in the zip archive.
Definition at line 60 of file ZipFile.h.
◆ mimeTypes()
| QStringList FileFormats::ZipFile::mimeTypes |
( |
| ) |
|
|
inlinestaticnodiscard |
Mime type for files that can be opened by this class.
- Returns
- Name of mime type
Definition at line 92 of file ZipFile.h.
The documentation for this class was generated from the following file:
- /home/runner/work/enroute/enroute/src/fileFormats/ZipFile.h