|
QGroundControl
Ground Control Station for MAVLink Drones
|
#include <QGCArchiveFile.h>
Inheritance diagram for QGCArchiveFile:
Collaboration diagram for QGCArchiveFile:Public Member Functions | |
| QGCArchiveFile (const QString &archivePath, const QString &entryName, QObject *parent=nullptr) | |
| QGCArchiveFile (QIODevice *source, const QString &entryName, QObject *parent=nullptr) | |
| ~QGCArchiveFile () override=default | |
| bool | open (OpenMode mode) override |
| qint64 | size () const override |
| QString | entryName () const |
| qint64 | entrySize () const |
| bool | entryFound () const |
| QDateTime | entryModified () const |
Public Member Functions inherited from QGCArchiveDeviceBase | |
| ~QGCArchiveDeviceBase () override | |
| void | close () override |
| bool | isSequential () const override |
| qint64 | bytesAvailable () const override |
| QString | errorString () const |
| QString | formatName () const |
| QString | filterName () const |
Protected Member Functions | |
| bool | initArchive () override |
| bool | prepareForReading () override |
| bool | isReadyToRead () const override |
| void | resetState () override |
| Reset all state (called by close()) | |
Protected Member Functions inherited from QGCArchiveDeviceBase | |
| QGCArchiveDeviceBase (const QString &filePath, QObject *parent=nullptr) | |
| QGCArchiveDeviceBase (QIODevice *source, QObject *parent=nullptr) | |
| qint64 | readData (char *data, qint64 maxSize) override |
| qint64 | writeData (const char *data, qint64 maxSize) override |
| bool | initSourceFromPath () |
| void | configureArchiveFormats (bool allFormats) |
| bool | openArchive () |
| bool | fillBuffer () |
| void | captureFormatInfo () |
| Capture format info from the archive after first header read. | |
Additional Inherited Members | |
Protected Attributes inherited from QGCArchiveDeviceBase | |
| QString | _filePath |
| QIODevice * | _sourceDevice = nullptr |
| bool | _ownsSource = false |
| std::unique_ptr< QIODevice > | _ownedSource |
| struct archive * | _archive = nullptr |
| QByteArray | _resourceData |
| bool | _eof = false |
| QByteArray | _buffer |
| QString | _errorString |
| QString | _formatName |
| QString | _filterName |
QIODevice for reading a single entry from an archive without full extraction Supports ZIP, TAR, 7z, and other libarchive-supported formats Read-only, sequential access only
Example usage:
Definition at line 23 of file QGCArchiveFile.h.
| QGCArchiveFile::QGCArchiveFile | ( | const QString & | archivePath, |
| const QString & | entryName, | ||
| QObject * | parent = nullptr |
||
| ) |
Construct from archive file path
| archivePath | Path to archive file (or Qt resource path :/) |
| entryName | Name of entry to read within the archive |
| parent | QObject parent |
Definition at line 13 of file QGCArchiveFile.cc.
| QGCArchiveFile::QGCArchiveFile | ( | QIODevice * | source, |
| const QString & | entryName, | ||
| QObject * | parent = nullptr |
||
| ) |
Construct from QIODevice source (streaming)
| source | Archive data source (must be open and readable) |
| entryName | Name of entry to read within the archive |
| parent | QObject parent |
Definition at line 19 of file QGCArchiveFile.cc.
|
overridedefault |
|
inline |
Check if entry was found in archive (available after open)
Definition at line 57 of file QGCArchiveFile.h.
|
inline |
Get entry modification time (available after open)
Definition at line 61 of file QGCArchiveFile.h.
|
inline |
Get entry name being read
Definition at line 49 of file QGCArchiveFile.h.
|
inline |
Get entry size (available after open)
Definition at line 53 of file QGCArchiveFile.h.
|
overrideprotectedvirtual |
Initialize libarchive reader with configured format support Subclasses must override to configure format support before calling base
Implements QGCArchiveDeviceBase.
Definition at line 68 of file QGCArchiveFile.cc.
References QGCArchiveDeviceBase::_archive, QGCArchiveDeviceBase::_errorString, QGCArchiveDeviceBase::configureArchiveFormats(), and QGCArchiveDeviceBase::openArchive().
Referenced by open().
|
inlineoverrideprotectedvirtual |
Check if ready to read data
Implements QGCArchiveDeviceBase.
Definition at line 66 of file QGCArchiveFile.h.
|
override |
Definition at line 29 of file QGCArchiveFile.cc.
References QGCArchiveDeviceBase::_errorString, QGCArchiveDeviceBase::_filePath, initArchive(), QGCArchiveDeviceBase::initSourceFromPath(), and prepareForReading().
|
overrideprotectedvirtual |
Called after archive is initialized, before reading begins Subclasses override to seek to entry, read headers, etc.
Implements QGCArchiveDeviceBase.
Definition at line 82 of file QGCArchiveFile.cc.
Referenced by open().
|
overrideprotectedvirtual |
Reset all state (called by close())
Reimplemented from QGCArchiveDeviceBase.
Definition at line 87 of file QGCArchiveFile.cc.
References QGCArchiveDeviceBase::resetState().
|
override |
Definition at line 59 of file QGCArchiveFile.cc.