|
QGroundControl
Ground Control Station for MAVLink Drones
|
#include <QGCDecompressDevice.h>
Inheritance diagram for QGCDecompressDevice:
Collaboration diagram for QGCDecompressDevice:Public Member Functions | |
| QGCDecompressDevice (QIODevice *source, QObject *parent=nullptr) | |
| QGCDecompressDevice (const QString &filePath, QObject *parent=nullptr) | |
| ~QGCDecompressDevice () override=default | |
| bool | open (OpenMode mode) override |
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 wrapper for streaming decompression of single-file formats Supports .gz, .xz, .zst, .bz2, .lz4 compressed data Read-only, sequential access only
Example usage:
Definition at line 23 of file QGCDecompressDevice.h.
|
explicit |
Construct from QIODevice source (streaming)
| source | Compressed data source (must be open and readable) |
| parent | QObject parent |
Definition at line 13 of file QGCDecompressDevice.cc.
|
explicit |
Construct from file path
| filePath | Path to compressed file (or Qt resource path :/) |
| parent | QObject parent |
Definition at line 18 of file QGCDecompressDevice.cc.
|
overridedefault |
|
overrideprotectedvirtual |
Initialize libarchive reader with configured format support Subclasses must override to configure format support before calling base
Implements QGCArchiveDeviceBase.
Definition at line 56 of file QGCDecompressDevice.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 47 of file QGCDecompressDevice.h.
|
override |
Definition at line 27 of file QGCDecompressDevice.cc.
References QGCArchiveDeviceBase::_errorString, QGCArchiveDeviceBase::_filePath, initArchive(), QGCArchiveDeviceBase::initSourceFromPath(), and prepareForReading().
Referenced by QGCFileHelper::computeDecompressedFileHash(), and QGCFileHelper::readFile().
|
overrideprotectedvirtual |
Called after archive is initialized, before reading begins Subclasses override to seek to entry, read headers, etc.
Implements QGCArchiveDeviceBase.
Definition at line 70 of file QGCDecompressDevice.cc.
References QGCArchiveDeviceBase::_archive, QGCArchiveDeviceBase::_errorString, QGCArchiveDeviceBase::_filterName, QGCArchiveDeviceBase::_formatName, and QGCArchiveDeviceBase::captureFormatInfo().
Referenced by open().
|
overrideprotectedvirtual |
Reset all state (called by close())
Reimplemented from QGCArchiveDeviceBase.
Definition at line 90 of file QGCDecompressDevice.cc.
References QGCArchiveDeviceBase::resetState().