QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
QGCArchiveFile.h
Go to the documentation of this file.
1#pragma once
2
5
7
8#include <QtCore/QDateTime>
22{
23 Q_OBJECT
24
25public:
30 QGCArchiveFile(const QString &archivePath, const QString &entryName, QObject *parent = nullptr);
31
37 QGCArchiveFile(QIODevice *source, const QString &entryName, QObject *parent = nullptr);
38
39 ~QGCArchiveFile() override = default;
40
41 // QIODevice interface
42 bool open(OpenMode mode) override;
43 qint64 size() const override;
44
47 QString entryName() const { return _entryName; }
48
51 qint64 entrySize() const { return _entrySize; }
52
55 bool entryFound() const { return _entryFound; }
56
59 QDateTime entryModified() const { return _entryModified; }
60
61protected:
62 bool initArchive() override;
63 bool prepareForReading() override;
64 bool isReadyToRead() const override { return _entryFound; }
65 void resetState() override;
66
67private:
68 bool seekToEntry();
69
70 QString _entryName;
71 bool _entryFound = false;
72 qint64 _entrySize = -1;
73 QDateTime _entryModified;
74};
Base class for QIODevice wrappers using libarchive.
Base class for QIODevice wrappers that use libarchive for decompression.
QIODevice for reading a single entry from an archive without full extraction.
bool open(OpenMode mode) override
void resetState() override
Reset all state (called by close())
bool isReadyToRead() const override
QDateTime entryModified() const
qint64 entrySize() const
~QGCArchiveFile() override=default
bool entryFound() const
qint64 size() const override
QString entryName() const
bool prepareForReading() override
bool initArchive() override