Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

ZResFileWriter Class Reference

class to create a resource file. More...

#include <ZResource.h>

List of all members.

Public Methods

 ZResFileWriter ()
 constructor. More...

 ZResFileWriter (const QString &fileName)
 constructor taking an output file name. More...

void setFileName (const QString &fileName)
 set the output filename. More...

const QString& fileName () const
 get the current filename being written to. More...

void reset ()
 throw away all data and start at the beginning. More...

void add (const QString &ID, const QByteArray &data)
 add a block of data to the resource file. More...

bool write ()
 write the resource file. More...


Protected Methods

void init (const QString &fullFileName)
bool createTables ()
bool writeHeader (QFile &)
bool writeIDs (QFile &)
bool writeStartBlock (QFile &)
bool writeHashTable (QFile &)
bool writeData (QFile &)
bool deleteTables ()
bool hash (const QString &ID, const QByteArray &inData)

Protected Attributes

QString m_fileName
 file name that we're writing to. More...

QSortedList<ZResEntry> list
 list of resources before they're written to disk. More...

unsigned int hashTableSize
ZResHTEntry* hashTable
int nextLabelOffset
int nextDataOffset


Detailed Description

class to create a resource file.


Constructor & Destructor Documentation

ZResFileWriter::ZResFileWriter ( )
 

constructor.

ZResFileWriter::ZResFileWriter ( const QString & fileName )
 

constructor taking an output file name.


Member Function Documentation

void ZResFileWriter::add ( const QString & ID,
const QByteArray & data )
 

add a block of data to the resource file.

Parameters:
ID   resource ID of data to add
data   QByteArray of the data to add

bool ZResFileWriter::createTables ( ) [protected]
 

bool ZResFileWriter::deleteTables ( ) [protected]
 

const QString & ZResFileWriter::fileName ( ) const
 

get the current filename being written to.

Returns:
reference to the filename being written to

bool ZResFileWriter::hash ( const QString & ID,
const QByteArray & inData ) [protected]
 

void ZResFileWriter::init ( const QString & fullFileName ) [protected]
 

void ZResFileWriter::reset ( )
 

throw away all data and start at the beginning.

void ZResFileWriter::setFileName ( const QString & fileName )
 

set the output filename.

Parameters:
fileName   name of the file to write

bool ZResFileWriter::write ( )
 

write the resource file.

Returns:
true if write succeeded

bool ZResFileWriter::writeData ( QFile & ) [protected]
 

bool ZResFileWriter::writeHashTable ( QFile & ) [protected]
 

bool ZResFileWriter::writeHeader ( QFile & ) [protected]
 

bool ZResFileWriter::writeIDs ( QFile & ) [protected]
 

bool ZResFileWriter::writeStartBlock ( QFile & ) [protected]
 


Member Data Documentation

ZResHTEntry * ZResFileWriter::hashTable [protected]
 

unsigned int ZResFileWriter::hashTableSize [protected]
 

QSortedList< ZResEntry > ZResFileWriter::list<ZResEntry> [protected]
 

list of resources before they're written to disk.

QString ZResFileWriter::m_fileName [protected]
 

file name that we're writing to.

int ZResFileWriter::nextDataOffset [protected]
 

int ZResFileWriter::nextLabelOffset [protected]
 


The documentation for this class was generated from the following file:
Generated at Wed Mar 3 13:23:06 2004 by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001