TorqueScript Reference
Public Member Functions | Static Public Attributes | List of all members
ZipObject Class Reference

Inherits SimObject.

Public Member Functions

bool addFile (filename, pathInZip,[replace=true]?)
 
void closeArchive ()
 
void closeFile (stream)
 
bool deleteFile (pathInZip)
 
bool extractFile (pathInZip, filename)
 
string getFileEntry (index)
 
int getFileEntryCount ()
 
bool openArchive (filename,[accessMode=Read]?)
 
int openFileForRead (filename)
 
int openFileForWrite (filename)
 
- Public Member Functions inherited from SimObject
string call (functionName,[args]*)
 
int clone ([bool copyDynamicFields?=false]?)
 
void delete ()
 
void dump ()
 
void dumpClassHierarchy ()
 
const char * getClassName ()
 
string getClassNamespace ()
 
string getDynamicField (index)
 
int getDynamicFieldCount ()
 
string getField (int index)
 
int getFieldCount ()
 
const char * getFieldType (fieldName)
 
const char * getFieldValue (fieldName)
 
int getGroup ()
 
int getId ()
 
string getInternalName ()
 
const char * getName ()
 
string getProgenitorFile ()
 
string getSuperClassNamespace ()
 
int getType ()
 
bool isChildOfGroup ()
 
bool isMemberOfClass (string classname)
 
bool isMethod (const char *methodName)
 
bool isMethod (string method name)
 
bool isTimerActive ()
 
bool save (fileName,[selectedOnly]?)
 
int schedule (time, command,[arg]*)
 
void setClassNamespace ()
 
bool setFieldValue (fieldName, value)
 
void setInternalName (string InternalName)
 
void setName (newName)
 
void setProgenitorFile (file)
 
void setSuperClassNamespace ()
 
bool startTimer (callbackFunction, float timePeriod,[repeat]?)
 
void stopTimer ()
 

Static Public Attributes

struct {
   Zip::ZipArchive::AccessMode   mode
 
   const char *   strMode
 
gModeMap []
 

Additional Inherited Members

- Static Public Member Functions inherited from SimObject
static S32 QSORT_CALLBACK compareFields (const void *a, const void *b)
 

Member Function Documentation

bool addFile ( filename  ,
pathInZip  ,
[replace = true] ?   
)

Add a file to the zip

Parameters
filenameThe name of the file
pathInZipThe internal (to the zip) path to the file
replaceSet whether to replace the file if one already exists with the name in the path (default true)
Returns
Returns true on success and false otherwise
void closeArchive ( )

Close the zip file

Returns
No return value.
void closeFile ( stream  )

Close a file within the zip

Parameters
streamThe file stream ID
Returns
No return value.
bool deleteFile ( pathInZip  )

Delete a file from the zip

Parameters
pathInZipThe full internal path of the file
Returns
Returns true on success and false otherwise.
bool extractFile ( pathInZip  ,
filename   
)

Extract a file from the zip

Parameters
pathInZipThe internal path of the desired file
filenameThe file's name
Returns
Returns true on success and false otherwise
string getFileEntry ( index  )

Get file entry.

Parameters
indexIndex to file entry
Returns
Returns tab separated string containing filename, uncompressed size, compressed size, compression method and CRC32
int getFileEntryCount ( )

Get number of files in the zip

Returns
Returns the number of files found in zip
bool openArchive ( filename  ,
[accessMode = Read] ?   
)

Open a zip file

Parameters
filenameThe file's name
accessModeThe mode in which to open the file (default Read)
Returns
Returns true on success, false otherwise
See Also
closeArchive, openFileForRead, openFileForWrite, closeFile
int openFileForRead ( filename  )

Open a file within the zip for reading

Parameters
filenameThe file's name to open in current zip file
Returns
The file stream ID as an integer or zero on failure.
int openFileForWrite ( filename  )

Open a file within the zip for writing

Parameters
filenameThe file's name to open in current zip file
Returns
The file stream ID as an integer or 0 on failure.

Member Data Documentation

struct { ... } gModeMap[]
Initial value:
=
{
{ "read", Zip::ZipArchive::Read },
{ "write", Zip::ZipArchive::Write },
{ "readwrite", Zip::ZipArchive::ReadWrite },
{ NULL, (Zip::ZipArchive::AccessMode)0 }
}
Zip::ZipArchive::AccessMode mode
const char* strMode