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

Inherits SimObject.

Public Member Functions

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

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 copyFrom ( StreamObject  other)

Copies stream contents from current position

Parameters
otherThe StreamObject from which to copy
Returns
Returns true on success, and false otherwise.
int 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)
int getStreamSize ( )

Get the size of the stream

Returns
The size of the stream as an integer
bool 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
bool 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
Themaximum 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
caseSensitiveA boolean representing whether the parser should ignore case or not (default false)
Returns
Returns the string, or empty string if failed
bool setPosition ( newPosition  )

Resets the current stream position

Parameters
Thedesired index
Returns
Returns true if succeeded, flase otherwise
void writeLine ( line  )

Writes a line of text to the stream buffer

Parameters
Theline to write
Returns
No return value.
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
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.