Files
yacreader/compressed_archive/libarchive/compressed_archive.h
luisangelsm 3709b6e737
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
Format includes using clang-format
2026-03-13 18:21:38 +01:00

45 lines
985 B
C++

#ifndef COMPRESSED_ARCHIVE_H
#define COMPRESSED_ARCHIVE_H
#include "extract_delegate.h"
#include <QDebug>
#include <QObject>
extern "C" {
#include <archive.h>
#include <archive_entry.h>
}
class CompressedArchive : public QObject
{
Q_OBJECT
public:
explicit CompressedArchive(const QString &filePath, QObject *parent = nullptr);
~CompressedArchive() override;
public slots:
void getAllData(const QVector<quint32> &indexes, ExtractDelegate *delegate = nullptr);
QByteArray getRawDataAtIndex(int index);
int getNumFiles() { return num_entries; }
QList<QString> getFileNames() { return entries; }
bool isValid() { return valid; }
bool toolsLoaded() { return true; }
private:
archive *a;
QStringList entries;
int num_entries;
bool valid;
quint32 idx;
QString filename;
bool open_archive();
void close_archive();
bool archive_seek(quint32 index);
QByteArray read_entry();
};
#endif // COMPRESSED_ARCHIVE_H