|
QGroundControl
Ground Control Station for MAVLink Drones
|
RAII wrapper for libarchive reader with automatic cleanup. More...
#include <QGClibarchive.h>
Public Member Functions | |
| ArchiveReader ()=default | |
| ~ArchiveReader () | |
| ArchiveReader (const ArchiveReader &)=delete | |
| ArchiveReader & | operator= (const ArchiveReader &)=delete |
| bool | open (const QString &path, ReaderMode mode=ReaderMode::AllFormats) |
| bool | open (QIODevice *device, ReaderMode mode=ReaderMode::AllFormats) |
| struct archive * | handle () const |
| Get the underlying archive handle. | |
| struct archive * | release () |
| Release ownership of archive handle (caller must free) | |
| bool | isOpen () const |
| Check if archive is open. | |
| qint64 | dataSize () const |
| QString | formatName () const |
| QString | filterName () const |
RAII wrapper for libarchive reader with automatic cleanup.
Definition at line 48 of file QGClibarchive.h.
|
default |
| QGClibarchive::ArchiveReader::~ArchiveReader | ( | ) |
Definition at line 569 of file QGClibarchive.cc.
|
delete |
| qint64 QGClibarchive::ArchiveReader::dataSize | ( | ) | const |
Get the total data size (for progress reporting)
Definition at line 576 of file QGClibarchive.cc.
Referenced by QGClibarchive::decompressSingleFile(), QGClibarchive::extractAnyArchive(), QGClibarchive::extractArchiveAtomic(), and QGClibarchive::extractWithFilter().
| QString QGClibarchive::ArchiveReader::filterName | ( | ) | const |
Get the detected compression filter name
Definition at line 599 of file QGClibarchive.cc.
| QString QGClibarchive::ArchiveReader::formatName | ( | ) | const |
Get the detected archive format name (after reading first header)
Definition at line 590 of file QGClibarchive.cc.
|
inline |
Get the underlying archive handle.
Definition at line 70 of file QGClibarchive.h.
Referenced by QGClibarchive::decompressDataFromDevice(), QGClibarchive::decompressFromDevice(), QGClibarchive::decompressSingleFile(), QGClibarchive::extractByPattern(), QGClibarchive::extractFileDataFromDevice(), QGClibarchive::extractFileToMemory(), QGClibarchive::extractMultipleFiles(), QGClibarchive::extractSingleFile(), QGClibarchive::extractWithFilter(), QGClibarchive::fileExistsInArchive(), QGClibarchive::getArchiveStats(), QGClibarchive::listArchiveEntries(), QGClibarchive::listArchiveEntriesDetailed(), and QGClibarchive::validateArchive().
|
inline |
Check if archive is open.
Definition at line 76 of file QGClibarchive.h.
| bool QGClibarchive::ArchiveReader::open | ( | const QString & | path, |
| ReaderMode | mode = ReaderMode::AllFormats |
||
| ) |
Open archive for reading (supports Qt resources and regular files)
| path | File path or Qt resource path (:/...) |
| mode | Format support mode (AllFormats or RawFormat) |
Definition at line 616 of file QGClibarchive.cc.
References QGClibarchive::AllFormats, QGClibarchive::openArchiveForReading(), and QGClibarchive::RawFormat.
Referenced by QGClibarchive::decompressDataFromDevice(), QGClibarchive::decompressFromDevice(), QGClibarchive::decompressSingleFile(), QGClibarchive::extractAnyArchive(), QGClibarchive::extractArchiveAtomic(), QGClibarchive::extractByPattern(), QGClibarchive::extractFileDataFromDevice(), QGClibarchive::extractFileToMemory(), QGClibarchive::extractFromDevice(), QGClibarchive::extractMultipleFiles(), QGClibarchive::extractSingleFile(), QGClibarchive::extractWithFilter(), QGClibarchive::fileExistsInArchive(), QGClibarchive::getArchiveStats(), QGClibarchive::listArchiveEntries(), QGClibarchive::listArchiveEntriesDetailed(), and QGClibarchive::validateArchive().
| bool QGClibarchive::ArchiveReader::open | ( | QIODevice * | device, |
| ReaderMode | mode = ReaderMode::AllFormats |
||
| ) |
Open archive for reading from a QIODevice (streaming)
| device | QIODevice to read from (must be open and readable) |
| mode | Format support mode (AllFormats or RawFormat) |
Definition at line 651 of file QGClibarchive.cc.
References QGClibarchive::AllFormats, QGClibarchive::deviceCloseCallback(), QGClibarchive::deviceReadCallback(), QGClibarchive::deviceSeekCallback(), QGClibarchive::deviceSkipCallback(), and QGClibarchive::RawFormat.
|
delete |
|
inline |
Release ownership of archive handle (caller must free)
Definition at line 73 of file QGClibarchive.h.
Referenced by QGClibarchive::extractAnyArchive(), QGClibarchive::extractArchiveAtomic(), and QGClibarchive::extractFromDevice().