The Archive class is a device list in a file system or an archive file.
More...
#include <Archive.h>
|
enum | ArchiveError {
NoError,
ReadError,
WriteError,
OpenError,
AbortError,
RemoveError,
RenameError,
PositionError,
ResizeError,
PermissionsError,
CopyError,
InvalidError,
FileNotFoundError
} |
|
The Archive class is a device list in a file system or an archive file.
- See also
- QIODevice
◆ ArchiveError
Enumerator |
---|
NoError | |
ReadError | |
WriteError | |
OpenError | |
AbortError | |
RemoveError | |
RenameError | |
PositionError | |
ResizeError | |
PermissionsError | |
CopyError | |
InvalidError | |
FileNotFoundError | |
◆ Archive() [1/3]
Constructs a new empty archive.
◆ Archive() [2/3]
Archive::Archive |
( |
const QString & |
filename | ) |
|
|
explicit |
Constructs a new archive object to represent the archive with the given filename.
◆ Archive() [3/3]
Archive::Archive |
( |
QFile * |
device | ) |
|
|
explicit |
Constructs a new archive object to represent the archive with the given device.
◆ ~Archive()
Destroys the archive object, closing it if necessary.
◆ addFile()
virtual bool Archive::addFile |
( |
const QString & |
filePath, |
|
|
QIODevice * |
data |
|
) |
| |
|
pure virtual |
◆ addFileData()
bool Archive::addFileData |
( |
const QString & |
filePath, |
|
|
const QByteArray & |
data |
|
) |
| |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Add a new file named filePath with data. Returns false if the file exists; otherwise returns true.
- See also
- addFile()
◆ archiveIO()
QFile* Archive::archiveIO |
( |
| ) |
const |
|
inlineprotected |
◆ clear()
virtual void Archive::clear |
( |
| ) |
|
|
inlinevirtual |
◆ close()
◆ error()
Returns the last error status.
- See also
- unsetError(), errorString()
◆ errorString()
QString Archive::errorString |
( |
| ) |
const |
Returns the last error message.
- See also
- unsetError(), error()
◆ file()
virtual QIODevice* Archive::file |
( |
const QString & |
filePath | ) |
|
|
pure virtual |
◆ fileCount()
virtual int Archive::fileCount |
( |
| ) |
const |
|
pure virtual |
◆ fileData()
QByteArray Archive::fileData |
( |
const QString & |
filePath | ) |
|
◆ fileExists()
virtual bool Archive::fileExists |
( |
const QString & |
filePath | ) |
const |
|
pure virtual |
◆ fileList()
virtual QStringList Archive::fileList |
( |
| ) |
const |
|
pure virtual |
◆ fileName()
QString Archive::fileName |
( |
| ) |
const |
◆ isNameValid()
virtual bool Archive::isNameValid |
( |
const QString & |
filePath | ) |
const |
|
pure virtual |
◆ isOpen()
bool Archive::isOpen |
( |
| ) |
const |
|
virtual |
Returns true if the archive is open; returns false otherwise.
- See also
- open(), close()
◆ modifiedFile()
virtual QIODevice* Archive::modifiedFile |
( |
const QString & |
filePath | ) |
|
|
pure virtual |
◆ modifiedFileData()
QByteArray Archive::modifiedFileData |
( |
const QString & |
filePath | ) |
|
◆ open()
Opens the archive, returning true if successful; otherwise false.
- See also
- isOpen(), close()
◆ openHeader()
virtual bool Archive::openHeader |
( |
| ) |
|
|
protectedpure virtual |
◆ pack()
virtual bool Archive::pack |
( |
const QString & |
destination = QString() , |
|
|
ArchiveObserver * |
observer = nullptr |
|
) |
| |
|
pure virtual |
◆ removeFile()
virtual bool Archive::removeFile |
( |
const QString & |
filePath | ) |
|
|
pure virtual |
◆ renameFile()
virtual bool Archive::renameFile |
( |
const QString & |
filePath, |
|
|
const QString & |
newFilePath |
|
) |
| |
|
pure virtual |
◆ setError()
void Archive::setError |
( |
ArchiveError |
error, |
|
|
const QString & |
errorString = QString() |
|
) |
| |
|
protected |
◆ setErrorString()
void Archive::setErrorString |
( |
const QString & |
errorString | ) |
|
|
inlineprotected |
◆ setFile()
virtual bool Archive::setFile |
( |
const QString & |
filePath, |
|
|
QIODevice * |
data |
|
) |
| |
|
pure virtual |
◆ setFileData()
bool Archive::setFileData |
( |
const QString & |
filePath, |
|
|
const QByteArray & |
data |
|
) |
| |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Change the data for the file named filePath. Returns false if the file doesn't exists; otherwise returns true.
- See also
- setFile()
◆ setFileName()
void Archive::setFileName |
( |
const QString & |
fileName | ) |
|
Sets the name of the file. Do not call this function if the file has already been opened.
- See also
- fileName(), QFile::setFileName()
The documentation for this class was generated from the following files: