mirror of
https://github.com/YACReader/yacreader
synced 2026-04-12 15:49:53 -04:00
Some checks failed
Build / Initialization (push) Has been cancelled
Build / Code Format Validation (push) Has been cancelled
Build / Linux (Qt6) (push) Has been cancelled
Build / Linux (Qt6 + 7zip) (push) Has been cancelled
Build / macOS (Qt6 Universal) (push) Has been cancelled
Build / Windows x64 (Qt6) (push) Has been cancelled
Build / Windows ARM64 (Qt6) (push) Has been cancelled
Build / Docker amd64 Image (push) Has been cancelled
Build / Docker arm64 Image (push) Has been cancelled
Build / Publish Dev Builds (push) Has been cancelled
Build / Publish Release (push) Has been cancelled
Build / Publish YACReader10 Pre-release Builds (push) Has been cancelled
53 lines
1.0 KiB
C++
53 lines
1.0 KiB
C++
#ifndef COMPRESSED_ARCHIVE_H
|
|
#define COMPRESSED_ARCHIVE_H
|
|
|
|
#include <QObject>
|
|
|
|
class ExtractDelegate;
|
|
|
|
class QLibrary;
|
|
#include <QList>
|
|
#include <QMap>
|
|
#include <QString>
|
|
|
|
struct SevenZipInterface;
|
|
|
|
class MyCodecs;
|
|
|
|
class CompressedArchive : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit CompressedArchive(const QString &filePath, QObject *parent = 0);
|
|
~CompressedArchive();
|
|
|
|
signals:
|
|
|
|
public slots:
|
|
int getNumFiles();
|
|
int getNumEntries();
|
|
QList<QByteArray> getAllData(const QVector<quint32> &indexes, ExtractDelegate *delegate = 0);
|
|
QByteArray getRawDataAtIndex(int index);
|
|
QList<QString> getFileNames();
|
|
bool isValid();
|
|
bool toolsLoaded();
|
|
|
|
private:
|
|
SevenZipInterface *szInterface;
|
|
|
|
QLibrary *sevenzLib;
|
|
bool loadFunctions();
|
|
bool tools;
|
|
bool valid;
|
|
QList<QString> files;
|
|
QList<qint32> offsets;
|
|
QMap<qint32, qint32> indexesToPages;
|
|
|
|
void setupFilesNames();
|
|
QVector<quint32> translateIndexes(const QVector<quint32> &indexes);
|
|
|
|
friend class MyCodecs;
|
|
};
|
|
|
|
#endif // COMPRESSED_ARCHIVE_H
|