11 #include <ff7tkformats_export.h>
42 explicit Archive(
const QString &filename);
43 explicit Archive(QFile *device);
48 virtual bool fileExists(
const QString &filePath)
const = 0;
49 virtual QIODevice *
file(
const QString &filePath) = 0;
50 QByteArray fileData(
const QString &filePath);
52 QByteArray modifiedFileData(
const QString &filePath);
53 virtual bool setFile(
const QString &filePath, QIODevice *data) = 0;
54 bool setFileData(
const QString &filePath,
const QByteArray &data);
55 virtual bool addFile(
const QString &filePath, QIODevice *data) = 0;
56 bool addFileData(
const QString &filePath,
const QByteArray &data);
59 virtual bool renameFile(
const QString &filePath,
const QString &newFilePath) = 0;
61 virtual bool isOpen()
const;
63 QString fileName()
const;
64 void setFileName(
const QString &fileName);
67 QString errorString()
const;
72 _errorString = errorString;
74 void setError(ArchiveError error,
const QString &errorString = QString());
The Archive class is a device list in a file system or an archive file.
Definition: Archive.h:23
ArchiveError
Definition: Archive.h:25
@ ReadError
Definition: Archive.h:27
@ AbortError
Definition: Archive.h:30
@ RenameError
Definition: Archive.h:32
@ NoError
Definition: Archive.h:26
@ OpenError
Definition: Archive.h:29
@ CopyError
Definition: Archive.h:36
@ RemoveError
Definition: Archive.h:31
@ ResizeError
Definition: Archive.h:34
@ InvalidError
Definition: Archive.h:37
@ WriteError
Definition: Archive.h:28
@ PositionError
Definition: Archive.h:33
@ PermissionsError
Definition: Archive.h:35
virtual bool addFile(const QString &filePath, QIODevice *data)=0
QFile * archiveIO() const
Definition: Archive.h:75
void setErrorString(const QString &errorString)
Definition: Archive.h:70
virtual bool openHeader()=0
virtual bool isNameValid(const QString &filePath) const =0
virtual QStringList fileList() const =0
virtual int fileCount() const =0
virtual bool fileExists(const QString &filePath) const =0
virtual QIODevice * modifiedFile(const QString &filePath)=0
virtual QIODevice * file(const QString &filePath)=0
virtual bool removeFile(const QString &filePath)=0
virtual bool pack(const QString &destination=QString(), ArchiveObserver *observer=nullptr)=0
virtual void clear()
Definition: Archive.h:45
virtual bool renameFile(const QString &filePath, const QString &newFilePath)=0
virtual bool setFile(const QString &filePath, QIODevice *data)=0
virtual bool observerWasCanceled() const =0
virtual bool observerRetry(const QString &message)=0
ArchiveObserver()
Definition: Archive.h:14
virtual void setObserverMaximum(unsigned int max)=0
virtual void setObserverValue(int value)=0