ff7tk
1.2.0.13
Work with Final Fantasy 7 game data
|
#include <Lgp.h>
Public Types | |
enum | LgpError { NoError, ReadError, WriteError, OpenError, OpenTempError, AbortError, RemoveError, RenameError, PositionError, ResizeError, PermissionsError, CopyError, InvalidError, FileNotFoundError } |
Public Types inherited from Archive | |
enum | ArchiveError { NoError, ReadError, WriteError, OpenError, AbortError, RemoveError, RenameError, PositionError, ResizeError, PermissionsError, CopyError, InvalidError, FileNotFoundError } |
Public Member Functions | |
Lgp () | |
Lgp (const QString &name) | |
Lgp (QFile *device) | |
virtual | ~Lgp () override |
void | clear () override |
QStringList | fileList () const override |
int | fileCount () const override |
LgpIterator | iterator () |
bool | fileExists (const QString &filePath) const override |
QIODevice * | file (const QString &filePath) override |
QIODevice * | modifiedFile (const QString &filePath) override |
bool | setFile (const QString &filePath, QIODevice *data) override |
bool | addFile (const QString &filePath, QIODevice *data) override |
bool | removeFile (const QString &filePath) override |
bool | isNameValid (const QString &filePath) const override |
bool | renameFile (const QString &filePath, const QString &newFilePath) override |
const QString & | companyName () |
void | setCompanyName (const QString &companyName) |
const QString & | productName () |
void | setProductName (const QString &productName) |
bool | pack (const QString &destination=QString(), ArchiveObserver *observer=nullptr) override |
LgpError | error () const |
void | unsetError () |
Public Member Functions inherited from Archive | |
Archive () | |
Archive (const QString &filename) | |
Archive (QFile *device) | |
virtual | ~Archive () |
QByteArray | fileData (const QString &filePath) |
QByteArray | modifiedFileData (const QString &filePath) |
bool | setFileData (const QString &filePath, const QByteArray &data) |
bool | addFileData (const QString &filePath, const QByteArray &data) |
virtual bool | open () |
virtual bool | isOpen () const |
virtual void | close () |
QString | fileName () const |
void | setFileName (const QString &fileName) |
ArchiveError | error () const |
QString | errorString () const |
Friends | |
class | LgpIterator |
Additional Inherited Members | |
Protected Member Functions inherited from Archive | |
void | setErrorString (const QString &errorString) |
void | setError (ArchiveError error, const QString &errorString=QString()) |
QFile * | archiveIO () const |
enum Lgp::LgpError |
Lgp::Lgp | ( | ) |
Constructs a new empty lgp archive.
|
explicit |
Constructs a new lgp archive object to represent the lgp archive with the given name.
|
explicit |
Constructs a new lgp archive object to represent the lgp archive with the given device.
|
overridevirtual |
Destroys the lgp archive object, closing it if necessary.
|
overridevirtual |
Add a new file named filePath with data. Returns false if the file exists; otherwise returns true.
Implements Archive.
|
overridevirtual |
Clears the contents of the lgp.
Reimplemented from Archive.
const QString & Lgp::companyName | ( | ) |
Returns the company name (like "SQUARESOFT") or a null string if there is an error.
Lgp::LgpError Lgp::error | ( | ) | const |
Returns the last error status.
|
overridevirtual |
Returns the data for the file named filePath.
Implements Archive.
|
overridevirtual |
Returns the number of files in the archive, or -1 if there is an error.
Implements Archive.
|
overridevirtual |
Returns true if the file named filePath exists; otherwise false.
Implements Archive.
|
overridevirtual |
Returns a list of file paths sorted by file position.
Implements Archive.
|
overridevirtual |
Check if the filePath is a valid name. Returns true if filePath is a valid name, false otherwise.
Implements Archive.
LgpIterator Lgp::iterator | ( | ) |
Returns an iterator to iterate over the files. You can not know if there is an error or not.
|
overridevirtual |
Returns the data, modified by setData if modified, for the file named filePath.
Implements Archive.
|
overridevirtual |
Save the lgp into destination (or overwrite the current archive if destination is empty). The archive is closed after this operation. observer is used to notify the progression of the save. It can be nullptr.
Implements Archive.
const QString & Lgp::productName | ( | ) |
Returns the product name (like "FINAL FANTASY7") or a null string if there is an error.
|
overridevirtual |
Remove the file named filePath. Returns true if the file is successfully removed.
Implements Archive.
|
overridevirtual |
Rename the file named filePath by newFilePath. Returns true if the file is successfully renamed.
Implements Archive.
void Lgp::setCompanyName | ( | const QString & | companyName | ) |
Change the company name.
|
overridevirtual |
Change the data for the file named filePath. Returns false if the file doesn't exists; otherwise returns true.
Implements Archive.
void Lgp::setProductName | ( | const QString & | productName | ) |
Change the product name.
void Lgp::unsetError | ( | ) |
Sets the file's error to Lgp::NoError.
|
friend |