#include <basestrm.h>
Inheritance diagram for MemoryStreamCopy:

Public Member Functions | |
| MemoryStreamCopy (tnstream *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. | |
May be useful when the original stream doesn't support seeking, but the consumer needs it.
Definition at line 148 of file basestrm.h.
| MemoryStreamCopy::MemoryStreamCopy | ( | tnstream * | stream | ) |
Definition at line 566 of file basestrm.cpp.
References blocksize, tnstream::devicename, tnstream::getDeviceName(), malloc(), tnstream::readdata(), and red.
| MemoryStreamCopy::~MemoryStreamCopy | ( | ) |
Definition at line 600 of file basestrm.cpp.
| void MemoryStreamCopy::writedata | ( | const void * | buf, | |
| int | size | |||
| ) | [virtual] |
writes data to the stream
| buf | pointer to the buffer | |
| size | the number of bytes which are going to be written |
Implements tnstream.
Definition at line 607 of file basestrm.cpp.
References tnstream::getDeviceName(), tnstream::reading, and tnstream::writing.
| int MemoryStreamCopy::readdata | ( | void * | buf, | |
| int | size, | |||
| bool | excpt = true | |||
| ) | [virtual] |
Reads data from the stream.
| 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. |
Implements tnstream.
Definition at line 612 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 632 of file basestrm.cpp.
References tnstream::getDeviceName().
Referenced by stream_seek().
| int MemoryStreamCopy::getPosition | ( | void | ) | [inline] |
| 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 161 of file basestrm.h.
Referenced by stream_seek().
| 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 595 of file basestrm.cpp.
References tnstream::devicename.
1.5.1