StreamObject
Engine/source/core/stream/streamObject.h
Script wrapper for the Stream class.
Private Types
Parent
Public Functions
StreamObject(Stream * stream)
bool
copyFrom(StreamObject * other)
Copy the contents of another stream into this one.
Gets the position in the stream.
Stream *
Get the underlying stream. Used with setStream() to support object reuse.
Gets the size of the stream.
bool
isEOS()
bool
onAdd()
Called when the object is added to the sim.
const char *
readLongString(U32 maxStringLen)
Reads a string that could potentially be more than 255 characters long.
const char *
Reads a string of maximum 255 characters long.
const char *
readSTString(bool casesens)
Reads a string and inserts it into the StringTable.
bool
setPosition(const U32 in_newPosition)
Sets the position of the stream. Returns if the new position is valid or not.
writeLongString(U32 maxStringLen, const char * string)
Writes a string to the stream.
writeString(const char * stringBuf, S32 maxLen)
Writes a string to the stream.
Detailed Description
Script wrapper for the Stream class.
It is not possible to instantiate StreamObject in script. Instead, it is instantiated in C++ code and returned to script.
This was mainly intended to allow the zip code to provide the stream interface to script.
Private Types
typedef SimObject Parent
Protected Attributes
Stream * mStream
Public Functions
StreamObject()
StreamObject(Stream * stream)
~StreamObject()
copyFrom(StreamObject * other)
Copy the contents of another stream into this one.
DECLARE_CONOBJECT(StreamObject )
getPosition()
Gets the position in the stream.
getStatus()
Gets a printable string form of the status.
getStream()
Get the underlying stream. Used with setStream() to support object reuse.
getStreamSize()
Gets the size of the stream.
isEOS()
onAdd()
Reimplemented from: SimObject
Reimplemented by: FileStreamObject
readLine()
Reads a line from the stream.
readLongString(U32 maxStringLen)
Reads a string that could potentially be more than 255 characters long.
Parameters:
maxStringLen | Maximum length to read. If the string is longer than maxStringLen, only maxStringLen bytes will be read. |
stringBuf | buffer where data is read into |
readString()
Reads a string of maximum 255 characters long.
readSTString(bool casesens)
Reads a string and inserts it into the StringTable.
setPosition(const U32 in_newPosition)
Sets the position of the stream. Returns if the new position is valid or not.
setStream(Stream * stream)
Set the stream to allow reuse of the object.
writeLine(U8 * buffer)
Writes a line to the stream.
writeLongString(U32 maxStringLen, const char * string)
Writes a string to the stream.
This function is slightly unstable. Only use this if you have a valid string that is not empty. writeString is safer.
writeString(const char * stringBuf, S32 maxLen)
Writes a string to the stream.