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

#include <zipObject_ScriptBinding.h>

Inherits SimObject.

Public Member Functions

Boolean addFile (filename, pathInZip, [replace=true]?)
 
void closeArchive ()
 
void closeFile (stream)
 
Boolean deleteFile (pathInZip)
 
Boolean extractFile (pathInZip, filename)
 
String getFileEntry (index)
 
Integer getFileEntryCount ()
 
Boolean openArchive (filename, [accessMode=Read]?)
 
Integer openFileForRead (filename)
 
Integer openFileForWrite (filename)
 
- Public Member Functions inherited from SimObject
void assignFieldsFrom (SimObject)
 
Integer clone ([copyDynamicFields=false]?)
 
void delete ()
 
Integer getId ()
 
void setName (newName)
 
String getName ()
 
String getClassNamespace ()
 
String getSuperClassNamespace ()
 
void setClassNamespace (nameSpace)
 
void setSuperClassNamespace ()
 
Boolean isMethod (string methodName)
 
String call (methodName, [args] *)
 
void dumpClassHierarchy ()
 
void dump ()
 
Boolean isMemberOfClass (string classname)
 
String getClassName ()
 
String getFieldValue (fieldName)
 
Boolean setFieldValue (fieldName, value)
 
Boolean setEditFieldValue (fieldName, value)
 
Integer getDynamicFieldCount ()
 
String getDynamicField (index)
 
Integer getFieldCount ()
 
String getField (int index)
 
void setProgenitorFile (file)
 
String getProgenitorFile ()
 
Integer getType ()
 
String getFieldType (fieldName)
 
void setInternalName (string InternalName)
 
String getInternalName ()
 
Boolean isChildOfGroup (groupID)
 
Integer getGroup ()
 
Boolean startTimer (callbackFunction, float timePeriod, [repeat]?)
 
void stopTimer ()
 
Boolean isTimerActive ()
 
Integer schedule (time, command, [arg] *)
 
void startListening (SimObject)
 
void stopListening (SimObject)
 
void addListener (SimObject)
 
void removeListener (SimObject)
 
void removeAllListeners ()
 
void postEvent (String eventName, String data)
 
Boolean save (fileName, [selectedOnly]?)
 
void addFieldFilter (fieldName)
 
void removeFieldFilter (fieldName)
 

Static Public Attributes

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

Member Function Documentation

◆ addFile()

Boolean 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

◆ closeArchive()

void closeArchive ( )

Close the zip file

Returns
No return value.

◆ closeFile()

void closeFile ( stream  )

Close a file within the zip

Parameters
streamThe file stream ID
Returns
No return value.

◆ deleteFile()

Boolean deleteFile ( pathInZip  )

Delete a file from the zip

Parameters
pathInZipThe full internal path of the file
Returns
Returns true on success and false otherwise.

◆ extractFile()

Boolean 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

◆ getFileEntry()

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

◆ getFileEntryCount()

Integer getFileEntryCount ( )

Get number of files in the zip

Returns
Returns the number of files found in zip

◆ openArchive()

Boolean 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

◆ openFileForRead()

Integer 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.

◆ openFileForWrite()

Integer 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]

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

◆ mode

Zip::ZipArchive::AccessMode mode

◆ strMode

const char* strMode