ff7tk  0.02
Toolkit for making FF7 Tools
IsoArchive Class Reference

#include <IsoArchive.h>

Public Member Functions

 IsoArchive ()
 IsoArchive (const QString &name)
virtual ~IsoArchive ()
virtual bool open (QIODevice::OpenMode mode)
virtual bool isOpen () const
virtual void close ()
QString fileName () const
void setFileName (const QString &fileName)
QString errorString () const
const IsoArchiveIOio () const
bool pack (IsoArchive *destination, ArchiveObserver *control=NULL, IsoDirectory *directory=NULL)
void applyModifications (IsoDirectory *directory)
QByteArray file (const QString &path, quint32 maxSize=0) const
QIODevice * fileDevice (const QString &path) const
QByteArray modifiedFile (const QString &path, quint32 maxSize=0) const
QIODevice * modifiedFileDevice (const QString &path) const
bool extract (const QString &path, const QString &destination, quint32 maxSize=0) const
bool extractDir (const QString &path, const QString &destination) const
void extractAll (const QString &destination) const
qint32 diffCountSectors (const QString &path, quint32 newSize) const
IsoDirectoryrootDirectory () const
Archive::ArchiveError error () const
 Returns the last error status. More...

Protected Member Functions

virtual bool reorganizeModifiedFilesAfter (QMap< quint32, const IsoFile * > &writeToTheMain, QList< const IsoFile * > &writeToTheEnd)
 Used to extend IsoArchive. Called in pack() afer file reorganization. More...
void setError (Archive::ArchiveError error, const QString &errorString=QString())
 Sets the file's error type and text. More...

Private Member Functions

bool openVolumeDescriptor (quint8 num=0)
bool openRootDirectory (quint32 sector, quint32 dataSize=SECTOR_SIZE_DATA)
IsoDirectory_openDirectoryRecord (IsoDirectory *directories, QList< quint32 > &dirVisisted)
QList< IsoFileOrDirectory * > getIntegrity ()
bool getIntegritySetPaddingAfter (IsoFileOrDirectory *prevFile, quint32 fileLocation)
void _extractAll (const QString &destination, IsoDirectory *directories, QString currentInternalDir=QString()) const
void _getIntegrity (QMap< quint32, IsoFileOrDirectory * > &files, IsoDirectory *directory) const
QMap< quint32, IsoFile * > getModifiedFiles (IsoDirectory *directory) const
void getModifiedFiles (QMap< quint32, IsoFile * > &files, IsoDirectory *directory) const
bool writeFile (QIODevice *in, quint32 sectorCount=0, ArchiveObserver *control=NULL)
bool copySectors (IsoArchiveIO *out, qint64 size, ArchiveObserver *control=NULL, bool repair=false)

Static Private Member Functions

static int findPadding (const QList< IsoFileOrDirectory * > &filesWithPadding, quint32 minSectorCount)
static void repairLocationSectors (IsoDirectory *directory, IsoArchive *newIso)

Private Attributes

IsoArchiveIO _io
VolumeDescriptor volume
Archive::ArchiveError _error

Detailed Description

Definition at line 303 of file IsoArchive.h.

Constructor & Destructor Documentation

IsoArchive::IsoArchive ( )

Definition at line 563 of file IsoArchive.cpp.

IsoArchive::IsoArchive ( const QString &  name)

Definition at line 568 of file IsoArchive.cpp.

IsoArchive::~IsoArchive ( )

Definition at line 573 of file IsoArchive.cpp.

References _rootDirectory.

Member Function Documentation

void IsoArchive::_extractAll ( const QString &  destination,
IsoDirectory directories,
QString  currentInternalDir = QString() 
) const
void IsoArchive::_getIntegrity ( QMap< quint32, IsoFileOrDirectory * > &  files,
IsoDirectory directory 
) const
void IsoArchive::close ( )

Definition at line 628 of file IsoArchive.cpp.

References _io, and _rootDirectory.

qint32 IsoArchive::diffCountSectors ( const QString &  path,
quint32  newSize 
) const
Archive::ArchiveError IsoArchive::error ( ) const

Returns the last error status.

See also
unsetError(), errorString()

Definition at line 1449 of file IsoArchive.cpp.

References _error.

Referenced by extractDir(), and setError().

QString IsoArchive::errorString ( ) const

Definition at line 321 of file IsoArchive.h.

bool IsoArchive::extract ( const QString &  path,
const QString &  destination,
quint32  maxSize = 0 
) const

Definition at line 1238 of file IsoArchive.cpp.

References _rootDirectory, IsoFile::extract(), IsoDirectory::file(), and file().

Referenced by _extractAll().

void IsoArchive::extractAll ( const QString &  destination) const

Definition at line 1271 of file IsoArchive.cpp.

References _extractAll(), and _rootDirectory.

bool IsoArchive::extractDir ( const QString &  path,
const QString &  destination 
) const
QByteArray IsoArchive::file ( const QString &  path,
quint32  maxSize = 0 
) const
QIODevice * IsoArchive::fileDevice ( const QString &  path) const

Definition at line 1202 of file IsoArchive.cpp.

References _rootDirectory, IsoFile::file(), IsoDirectory::file(), and file().

QString IsoArchive::fileName ( void  ) const

Definition at line 315 of file IsoArchive.h.

int IsoArchive::findPadding ( const QList< IsoFileOrDirectory * > &  filesWithPadding,
quint32  minSectorCount 

Definition at line 637 of file IsoArchive.cpp.

References IsoFileOrDirectory::paddingAfter().

Referenced by pack().

QList< IsoFileOrDirectory * > IsoArchive::getIntegrity ( )
bool IsoArchive::getIntegritySetPaddingAfter ( IsoFileOrDirectory prevFile,
quint32  fileLocation 
QMap< quint32, IsoFile * > IsoArchive::getModifiedFiles ( IsoDirectory directory) const

Definition at line 1415 of file IsoArchive.cpp.

Referenced by getModifiedFiles(), and pack().

void IsoArchive::getModifiedFiles ( QMap< quint32, IsoFile * > &  files,
IsoDirectory directory 
) const
const IsoArchiveIO& IsoArchive::io ( ) const

Definition at line 324 of file IsoArchive.h.


virtual bool IsoArchive::isOpen ( ) const

Definition at line 311 of file IsoArchive.h.

QByteArray IsoArchive::modifiedFile ( const QString &  path,
quint32  maxSize = 0 
) const

Definition at line 1214 of file IsoArchive.cpp.

References _rootDirectory, IsoDirectory::file(), file(), and IsoFile::modifiedData().

QIODevice * IsoArchive::modifiedFileDevice ( const QString &  path) const

Definition at line 1226 of file IsoArchive.cpp.

References _rootDirectory, IsoDirectory::file(), file(), and IsoFile::modifiedFile().

bool IsoArchive::openRootDirectory ( quint32  sector,
quint32  dataSize = SECTOR_SIZE_DATA 

Definition at line 1066 of file IsoArchive.cpp.

References _openDirectoryRecord(), and _rootDirectory.

Referenced by open().

bool IsoArchive::reorganizeModifiedFilesAfter ( QMap< quint32, const IsoFile * > &  writeToTheMain,
QList< const IsoFile * > &  writeToTheEnd 

Used to extend IsoArchive. Called in pack() afer file reorganization.

false to cancel pack()

Definition at line 655 of file IsoArchive.cpp.

Referenced by pack().

IsoDirectory * IsoArchive::rootDirectory ( ) const

Definition at line 994 of file IsoArchive.cpp.

References _rootDirectory.

void IsoArchive::setError ( Archive::ArchiveError  error,
const QString &  errorString = QString() 

Sets the file's error type and text.

See also
error(), errorString()

Definition at line 1458 of file IsoArchive.cpp.

References _error, _io, VolumeDescriptor2::abstract_file_id, VolumeDescriptor2::application_data, VolumeDescriptor2::application_id, VolumeDescriptor2::bibliographic_file_id, VolumeDescriptor2::copyright_file_id, VolumeDescriptor2::creation_date, DirectoryRecordHead::data_length, DirectoryRecordHead::data_length2, IsoTime::day, DirectoryRecordHead::day, VolumeDescriptor::dr, DirectoryRecord::drh, error(), PathTable::extended_attr_record_length, DirectoryRecord::extended_attr_record_length, DirectoryRecordHead::file_flags, VolumeDescriptor2::file_structure_version, DirectoryRecordHead::file_unit_size, IsoTime::GMT, DirectoryRecordHead::GMT, IsoTime::hour, DirectoryRecordHead::hour, VolumeDescriptor1::id, DirectoryRecordHead::interleave_grap_size, PathTable::length_di, DirectoryRecord::length_dr, DirectoryRecordHead::length_fi, PathTable::location_extent, DirectoryRecordHead::location_extent, DirectoryRecordHead::location_extent2, VolumeDescriptor1::logical_block_size, VolumeDescriptor1::logical_block_size2, IsoTime::millis, IsoTime::minute, DirectoryRecordHead::minute, IsoTime::month, DirectoryRecordHead::month, PathTable::name, DirectoryRecord::name, VolumeDescriptor1::opt_type_path_table, VolumeDescriptor1::opt_type_path_table2, PathTable::parent_directory_number, VolumeDescriptor1::path_table_size, VolumeDescriptor1::path_table_size2, VolumeDescriptor2::preparer_id, VolumeDescriptor2::publisher_id, IsoTime::second, DirectoryRecordHead::second, VolumeDescriptor1::system_id, VolumeDescriptor1::type, VolumeDescriptor1::type_path_table, VolumeDescriptor1::type_path_table2, VolumeDescriptor::vd1, VolumeDescriptor::vd2, VolumeDescriptor1::version, VolumeDescriptor1::volume_id, DirectoryRecordHead::volume_sequence_number, VolumeDescriptor1::volume_sequence_number, DirectoryRecordHead::volume_sequence_number2, VolumeDescriptor1::volume_sequence_number2, VolumeDescriptor2::volume_set_id, VolumeDescriptor1::volume_set_size, VolumeDescriptor1::volume_set_size2, VolumeDescriptor1::volume_space_size, VolumeDescriptor1::volume_space_size2, IsoTime::year, and DirectoryRecordHead::year.

Referenced by copySectors(), pack(), and writeFile().

void IsoArchive::setFileName ( const QString &  fileName)

Definition at line 318 of file IsoArchive.h.

bool IsoArchive::writeFile ( QIODevice *  in,
quint32  sectorCount = 0,
ArchiveObserver control = NULL 

Member Data Documentation

Archive::ArchiveError IsoArchive::_error

Definition at line 374 of file IsoArchive.h.

Referenced by error(), and setError().

VolumeDescriptor IsoArchive::volume

Definition at line 372 of file IsoArchive.h.

Referenced by open(), and openVolumeDescriptor().

The documentation for this class was generated from the following files: