TorqueScript Reference

- Main Page
- Related Pages
- Modules
- Classes

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

Public Member Functions | List of all members
StreamObject Class Reference

Inherits SimObject.

Inherited by FileStreamObject.

## Public Member Functions
Boolean | copyFrom (StreamObject other)
Integer | getPosition ()
const char * | getStatus ()
Integer | getStreamSize ()
Boolean | isEOF ()
Boolean | isEOS ()
const char * | readLine ()
const char * | readLongString (maxLength)
const char * | readString ()
const char * | readSTString ([caseSensitive=false])
Boolean | setPosition (newPosition)
void | writeLine (line)
void | writeLongString (maxLength, string)
void | writeString (string, [maxLength=255])
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)

## Member Function Documentation

Boolean copyFrom | ( | StreamObject | other | ) |

Copies stream contents from current position

Parameters

  other | The StreamObject from which to copy

Returns
  Returns true on success, and false otherwise.

Integer getPosition | ( |  | ) |

Returns
  Returns the current position in the stream as an integer or zero if failed

const char* getStatus | ( |  | ) |

Gets the current status of the StreamObject

Returns
  The current status as a string (Ok, IOError, EOS, IllegalCall, Closed, UnknownError, Invalid)

Integer getStreamSize | ( |  | ) |

Get the size of the stream

Returns
  The size of the stream as an integer

Boolean isEOF | ( |  | ) |

Test for end of file stream (identical to isEOS()

Returns
  Returns true if at the end of the stream, false otherwise.

See also
  isEOS

Boolean isEOS | ( |  | ) |

Test for end of stream

Returns
  Returns true if at the end of the stream, false otherwise.

const char* readLine | ( |  | ) |

Read the stream until '\' or EOS

Returns
  A string containing the read line or an empty string if failed

const char* readLongString | ( | maxLength |  | ) |

Reads a string of provided length from the stream buffer.

Parameters

  The | maximum length to read in

Returns
  The requested string

const char* readString | ( |  | ) |

Reads a string from a stream buffer

Returns
  The string or an empty string if failed.

const char* readSTString | ( |  | ) |

Read a String and insert it into a StringTable

Parameters

  caseSensitive | A boolean representing whether the parser should ignore case or not (default false)

Returns
  Returns the string, or empty string if failed

Boolean setPosition | ( | newPosition |  | ) |

Resets the current stream position

Parameters

  The | desired index

Returns
  Returns true if succeeded, flase otherwise

void writeLine | ( | line |  | ) |

Writes a line of text to the stream buffer

Parameters

  The | line to write

Returns
  No return value.

void writeLongString | ( | maxLength | ,
|  | string |
| ) |  |

Writes a string to buffer or provided length

Parameters

  maxLength | The maximum length to write
  string | The string to write

Returns
  No return value

void writeString | ( | string |  | ) |

Write a string to the stream buffer

Parameters

  string | The string to write
  maxLength | The maximum length to write (default 255).

Returns
  No return value.