Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

MemoryStreamCopy Class Reference

#include <basestrm.h>

Inheritance diagram for MemoryStreamCopy:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 MemoryStreamCopy (pnstream stream)
 ~MemoryStreamCopy ()
void writedata (const void *buf, int size)
 writes data to the stream
int readdata (void *buf, int size, bool excpt=true)
 Reads data from the stream.
void seek (int newpos)
 Sets the stream pointer to a new location. An exception is thrown if the stream does not support seeking.
int getPosition (void)
int getSize (void)
 returns the size of the stream or -1 if the stream does not have a size
ASCString getLocation ()
 returns the location of the stream.

Constructor & Destructor Documentation

MemoryStreamCopy::MemoryStreamCopy pnstream  stream  ) 
 

Definition at line 569 of file basestrm.cpp.

References blocksize, tnstream::devicename, tnstream::getDeviceName(), malloc(), tnstream::readdata(), and red.

MemoryStreamCopy::~MemoryStreamCopy  ) 
 

Definition at line 603 of file basestrm.cpp.


Member Function Documentation

ASCString MemoryStreamCopy::getLocation  )  [virtual]
 

returns the location of the stream.

This may be a complete english sentence describing how the stream (usually a file) can be found. Should only be used for informing the user.

Reimplemented from tnstream.

Definition at line 598 of file basestrm.cpp.

References tnstream::devicename.

int MemoryStreamCopy::getPosition void   )  [inline]
 

Definition at line 176 of file basestrm.h.

Referenced by stream_seek().

int MemoryStreamCopy::getSize void   )  [inline, virtual]
 

returns the size of the stream or -1 if the stream does not have a size

Reimplemented from tnstream.

Definition at line 177 of file basestrm.h.

Referenced by stream_seek().

int MemoryStreamCopy::readdata void *  buf,
int  size,
bool  excpt = true
[virtual]
 

Reads data from the stream.

Parameters:
buf the buffer which the data is written to
size the number of bytes which should be read
excpt If true the operation will throw an exception if the desired number of bytes cannot be read.
Returns:
the number of bytes which were read.

Implements tnstream.

Definition at line 615 of file basestrm.cpp.

References tnstream::getDeviceName(), and PolygonTriangulationLibrary::tr.

Referenced by stream_read().

void MemoryStreamCopy::seek int  newpos  )  [virtual]
 

Sets the stream pointer to a new location. An exception is thrown if the stream does not support seeking.

Reimplemented from tnstream.

Definition at line 635 of file basestrm.cpp.

References tnstream::getDeviceName().

Referenced by stream_seek().

void MemoryStreamCopy::writedata const void *  buf,
int  size
[virtual]
 

writes data to the stream

Parameters:
buf pointer to the buffer
size the number of bytes which are going to be written

Implements tnstream.

Definition at line 610 of file basestrm.cpp.

References tnstream::getDeviceName(), tnstream::reading, and tnstream::writing.


The documentation for this class was generated from the following files:
Generated on Tue Jun 24 02:18:18 2008 for Advanced Strategic Command by  doxygen 1.4.2