Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members  

csDataStream Class Reference

This class can be used as a wrapper around a data buffer for easy stream-like access. More...

#include <datastrm.h>

List of all members.

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. More...

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.


Member Function Documentation

bool csDataStream::GetString ( char * buf,
int len,
bool OmitNewline = true )
 

Read a line of text.

Returns false if the stream has finished. If 'OmitNewline' is true then the newline character will be thrown away.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000