TorqueScript Reference

- Main Page
- Related Pages
- Modules
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

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

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
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)
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]*)
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

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

Add a file to the zip

Parameters

  filename | The name of the file
  pathInZip | The internal (to the zip) path to the file
  replace | Set 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

  stream | The file stream ID

Returns
  No return value.

Boolean deleteFile | ( | pathInZip |  | ) |

Delete a file from the zip

Parameters

  pathInZip | The full internal path of the file

Returns
  Returns true on success and false otherwise.

Boolean extractFile | ( | pathInZip | ,
|  | filename |
| ) |  |

Extract a file from the zip

Parameters

  pathInZip | The internal path of the desired file
  filename | The file's name

Returns
  Returns true on success and false otherwise

String getFileEntry | ( | index |  | ) |

Get file entry.

Parameters

  index | Index to file entry

Returns
  Returns tab separated string containing filename, uncompressed size, compressed size, compression method and CRC32

Integer getFileEntryCount | ( |  | ) |

Get number of files in the zip

Returns
  Returns the number of files found in zip

Boolean openArchive | ( | filename | ,
|  | [accessMode = Read] ? |
| ) |  |

Open a zip file

Parameters

  filename | The file's name
  accessMode | The mode in which to open the file (default Read)

Returns
  Returns true on success, false otherwise

See also
  closeArchive, openFileForRead, openFileForWrite, closeFile

Integer openFileForRead | ( | filename |  | ) |

Open a file within the zip for reading

Parameters

  filename | The file's name to open in current zip file

Returns
  The file stream ID as an integer or zero on failure.

Integer openFileForWrite | ( | filename |  | ) |

Open a file within the zip for writing

Parameters

  filename | The file's name to open in current zip file

Returns
  The file stream ID as an integer or 0 on failure.

## Member Data Documentation

const { ... } 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