csDataStream Class Reference
This class can be used as a wrapper around a data buffer for easy stream-like access. More...
#include <datastrm.h>
Public Methods | |
csDataStream (void *buf, int Size, bool DeleteBuffer=true) | |
constructor | |
~csDataStream () | |
destructor | |
int | GetPosition () |
Return the current position. | |
void | SetPosition (int pos) |
Set the current position. | |
int | GetLength () |
Return the length of the stream. | |
bool | Finished () |
Returns true if the stream has finished. | |
void | Skip (int num) |
Skip the given amount of bytes. | |
int | Read (void *buf, int NumBytes) |
Read a buffer of data. Returns the number of bytes actually read. | |
bool | ReadInt8 (int8 &val) |
Read a one-byte value. Returns false on EOF. | |
bool | ReadUInt8 (uint8 &val) |
Read an unsigned one-byte value. Returns false on EOF. | |
bool | ReadInt16 (int16 &val) |
Read a two-byte value. | |
bool | ReadUInt16 (uint16 &val) |
Read an unsigned two-byte value. Returns false on EOF. | |
bool | ReadInt32 (int32 &val) |
Read a four-byte value. | |
bool | ReadUInt32 (uint32 &val) |
Read an unsigned four-byte value. Returns false on EOF. | |
int | GetChar () |
Read a single character. Returns EOF if the stream has finished. | |
int | LookChar () |
Return the next character (or EOF), but don't move forward. | |
bool | GetString (char *buf, int len, bool OmitNewline=true) |
Read a line of text. | |
int | ReadTextInt () |
Read an integer value from the stream that is stored as ASCII. | |
float | ReadTextFloat () |
Read a floating-point value from the stream that is stored as ASCII. | |
void | SkipWhitespace () |
Skip any whitespace characters. |
Detailed Description
This class can be used as a wrapper around a data buffer for easy stream-like access.
Definition at line 28 of file datastrm.h.
Constructor & Destructor Documentation
|
constructor
|
|
destructor
|
Member Function Documentation
|
Returns true if the stream has finished.
|
|
Read a single character. Returns EOF if the stream has finished.
|
|
Return the length of the stream.
|
|
Return the current position.
|
|
Read a line of text. Returns false if the stream has finished. If 'OmitNewline' is true then the newline character will be thrown away. |
|
Return the next character (or EOF), but don't move forward.
|
|
Read a buffer of data. Returns the number of bytes actually read.
|
|
Read a two-byte value.
|
|
Read a four-byte value.
|
|
Read a one-byte value. Returns false on EOF.
|
|
Read a floating-point value from the stream that is stored as ASCII.
|
|
Read an integer value from the stream that is stored as ASCII.
|
|
Read an unsigned two-byte value. Returns false on EOF.
|
|
Read an unsigned four-byte value. Returns false on EOF.
|
|
Read an unsigned one-byte value. Returns false on EOF.
|
|
Set the current position.
|
|
Skip the given amount of bytes.
|
|
Skip any whitespace characters.
|
The documentation for this class was generated from the following file:
- csutil/datastrm.h
Generated for Crystal Space by doxygen 1.2.18