CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

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

 ~csDataStream ()
 destructor. More...

int GetPosition ()
 Return the current position. More...

void SetPosition (int pos)
 Set the current position. More...

int GetLength ()
 Return the length of the stream. More...

bool Finished ()
 Returns true if the stream has finished. More...

void Skip (int num)
 Skip the given amount of bytes. More...

int Read (void *buf, int NumBytes)
 Read a buffer of data. Returns the number of bytes actually read. More...

bool ReadInt8 (int8 &val)
 Read a one-byte value. Returns false on EOF. More...

bool ReadUInt8 (uint8 &val)
 Read an unsigned one-byte value. Returns false on EOF. More...

bool ReadInt16 (int16 &val)
 Read a two-byte value. More...

bool ReadUInt16 (uint16 &val)
 Read an unsigned two-byte value. Returns false on EOF. More...

bool ReadInt32 (int32 &val)
 Read a four-byte value. More...

bool ReadUInt32 (uint32 &val)
 Read an unsigned four-byte value. Returns false on EOF. More...

int GetChar ()
 Read a single character. Returns EOF if the stream has finished. More...

int LookChar ()
 Return the next character (or EOF), but don't move forward. More...

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

float ReadTextFloat ()
 Read a floating-point value from the stream that is stored as ASCII. More...

void SkipWhitespace ()
 Skip any whitespace characters. More...


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

csDataStream::csDataStream void *    buf,
int    Size,
bool    DeleteBuffer = true
 

constructor.

csDataStream::~csDataStream  
 

destructor.


Member Function Documentation

bool csDataStream::Finished  
 

Returns true if the stream has finished.

int csDataStream::GetChar  
 

Read a single character. Returns EOF if the stream has finished.

int csDataStream::GetLength  
 

Return the length of the stream.

int csDataStream::GetPosition  
 

Return the current position.

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.

int csDataStream::LookChar  
 

Return the next character (or EOF), but don't move forward.

int csDataStream::Read void *    buf,
int    NumBytes
 

Read a buffer of data. Returns the number of bytes actually read.

bool csDataStream::ReadInt16 int16   val
 

Read a two-byte value.

bool csDataStream::ReadInt32 int32   val
 

Read a four-byte value.

bool csDataStream::ReadInt8 int8   val
 

Read a one-byte value. Returns false on EOF.

float csDataStream::ReadTextFloat  
 

Read a floating-point value from the stream that is stored as ASCII.

int csDataStream::ReadTextInt  
 

Read an integer value from the stream that is stored as ASCII.

bool csDataStream::ReadUInt16 uint16   val
 

Read an unsigned two-byte value. Returns false on EOF.

bool csDataStream::ReadUInt32 uint32   val
 

Read an unsigned four-byte value. Returns false on EOF.

bool csDataStream::ReadUInt8 uint8   val
 

Read an unsigned one-byte value. Returns false on EOF.

void csDataStream::SetPosition int    pos
 

Set the current position.

void csDataStream::Skip int    num
 

Skip the given amount of bytes.

void csDataStream::SkipWhitespace  
 

Skip any whitespace characters.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.14