TorqueScript Reference
Public Member Functions | List of all members
StreamObject Class Reference

#include <streamObject_ScriptBinding.h>

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

Member Function Documentation

◆ copyFrom()

Boolean copyFrom ( StreamObject  other)

Copies stream contents from current position

Parameters
otherThe StreamObject from which to copy
Returns
Returns true on success, and false otherwise.

◆ getPosition()

Integer getPosition ( )
Returns
Returns the current position in the stream as an integer or zero if failed

◆ getStatus()

const char * getStatus ( )

Gets the current status of the StreamObject

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

◆ getStreamSize()

Integer getStreamSize ( )

Get the size of the stream

Returns
The size of the stream as an integer

◆ isEOF()

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

◆ isEOS()

Boolean isEOS ( )

Test for end of stream

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

◆ readLine()

const char * readLine ( )

Read the stream until '\' or EOS

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

◆ readLongString()

const char * readLongString ( maxLength  )

Reads a string of provided length from the stream buffer.

Parameters
Themaximum length to read in
Returns
The requested string

◆ readString()

const char * readString ( )

Reads a string from a stream buffer

Returns
The string or an empty string if failed.

◆ readSTString()

const char * readSTString ( )

Read a String and insert it into a StringTable

Parameters
caseSensitiveA boolean representing whether the parser should ignore case or not (default false)
Returns
Returns the string, or empty string if failed

◆ setPosition()

Boolean setPosition ( newPosition  )

Resets the current stream position

Parameters
Thedesired index
Returns
Returns true if succeeded, flase otherwise

◆ writeLine()

void writeLine ( line  )

Writes a line of text to the stream buffer

Parameters
Theline to write
Returns
No return value.

◆ writeLongString()

void writeLongString ( maxLength  ,
string   
)

Writes a string to buffer or provided length

Parameters
maxLengthThe maximum length to write
stringThe string to write
Returns
No return value

◆ writeString()

void writeString ( string  )

Write a string to the stream buffer

Parameters
stringThe string to write
maxLengthThe maximum length to write (default 255).
Returns
No return value.