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

Inherits SimObject.

Public Member Functions

void close ()
 
bool isEOF ()
 
bool openForAppend (filename)
 
bool openForRead (filename)
 
bool openForWrite (filename)
 
string peekLine ()
 
string readLine ()
 
void writeLine (text)
 
void writeObject (SimObject, object prepend)
 
- 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

void close ( )

Use the close method to close the current file handle. If the file was opened for writing, this flushes the contents of the last write to disk.

Returns
No return value.
See Also
openForAppend, openForRead, openForWrite
bool isEOF ( )

Use the isEOF method to check to see if the end of the current file (opened for read) has been reached.

Returns
Returns true if the end of file has been reached, false otherwise.
See Also
openForRead
bool openForAppend ( filename  )

Use the openForAppend method to open a previously created file for appending. If the file specified by filename does not exist, the file is created first.

Parameters
filenameThe path and filename of the file to open for appending.
Returns
Returns true if the file was successfully opened for appending, false otherwise.
See Also
close, openForRead, openForWrite
bool openForRead ( filename  )

Use the openForRead method to open a previously created file for reading.

Parameters
filenameThe path and filename of the file to open for reading.
Returns
Returns true if the file was successfully opened for reading, false otherwise.
See Also
close, OpenForAppend, OpenForWrite
bool openForWrite ( filename  )

Use the openForWrite method to previously created or a new file for writing. In either case, the file will be overwritten.

Parameters
filenameThe path and filename of the file to open for writing.
Returns
Returns true if the file was successfully opened for writing, false otherwise.
See Also
close, OpenForAppend, openForRead
string peekLine ( )

Read a line from the file without moving the stream position.

string readLine ( )

Use the readLine method to read a single line from a file previously opened for reading. Use isEOF to check for end of file while reading.

Returns
Returns the next line in the file, or a NULL string if the end-of-file has been reached.
See Also
isEOF, openForRead
void writeLine ( text  )

Use the writeLine method to write a value ( text ) into a file that was previously opened for appending or over-writing.

Parameters
textThe value to write to the file.
Returns
No return value.
See Also
openForAppend, openForWrite
void writeObject ( SimObject  ,
object  prepend 
)