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>
9#include <QtCore/QLoggingCategory>
10
11Q_DECLARE_LOGGING_CATEGORY(QGCArchiveFileLog)
12
13
24{
25 Q_OBJECT
26
27public:
32 QGCArchiveFile(const QString &archivePath, const QString &entryName, QObject *parent = nullptr);
33
39 QGCArchiveFile(QIODevice *source, const QString &entryName, QObject *parent = nullptr);
40
41 ~QGCArchiveFile() override = default;
42
43 // QIODevice interface
44 bool open(OpenMode mode) override;
45 qint64 size() const override;
46
49 QString entryName() const { return _entryName; }
50
53 qint64 entrySize() const { return _entrySize; }
54
57 bool entryFound() const { return _entryFound; }
58
61 QDateTime entryModified() const { return _entryModified; }
62
63protected:
64 bool initArchive() override;
65 bool prepareForReading() override;
66 bool isReadyToRead() const override { return _entryFound; }
67 void resetState() override;
68
69private:
70 bool seekToEntry();
71
72 QString _entryName;
73 bool _entryFound = false;
74 qint64 _entrySize = -1;
75 QDateTime _entryModified;
76};
Q_DECLARE_LOGGING_CATEGORY(AndroidSerialLog)
Base class for QIODevice wrappers using libarchive.
bool isReadyToRead() const override
QDateTime entryModified() const
qint64 entrySize() const
~QGCArchiveFile() override=default
bool entryFound() const
QString entryName() const