#include <InStreams.h>
Inheritance diagram for InMemory:
Public Member Functions | |
InMemory () | |
virtual bool | exists () const |
virtual bool | getEof () const |
Protected Member Functions | |
void | open (const void *mem, unsigned size=0) |
virtual void | readFromStream (void *p, int size) |
virtual void | skipInStream (int size) |
Private Attributes | |
const char * | memory |
const char * | end |
Definition at line 704 of file InStreams.h.
InMemory::InMemory | ( | ) | [inline] |
Default constructor
Definition at line 712 of file InStreams.h.
virtual bool InMemory::exists | ( | ) | const [inline, virtual] |
The function states whether the stream actually exists.
Reimplemented from PhysicalInStream.
Definition at line 718 of file InStreams.h.
References memory.
virtual bool InMemory::getEof | ( | ) | const [inline, virtual] |
The function states whether the end of the file has been reached. It will only work if the correct size of the memory block was specified during the construction of the stream.
Implements PhysicalInStream.
Definition at line 726 of file InStreams.h.
void InMemory::open | ( | const void * | mem, | |
unsigned | size = 0 | |||
) | [inline, protected] |
Opens the stream.
mem | The address of the memory block from which is read. | |
size | The size of the memory block. It is only used to implement the function eof(). If the size is not specified, eof() will always return true, but reading from the stream is still possible. |
Definition at line 738 of file InStreams.h.
Referenced by InBinaryMemory::InBinaryMemory(), InConfigMemory::InConfigMemory(), and InTextMemory::InTextMemory().
void InMemory::readFromStream | ( | void * | p, | |
int | size | |||
) | [protected, virtual] |
The function reads a number of bytes from memory.
p | The address the data is written to. Note that p must point to a memory area that is at least "size" bytes large. | |
size | The number of bytes to be read. |
Implements PhysicalInStream.
Definition at line 147 of file InStreams.cpp.
References memory.
virtual void InMemory::skipInStream | ( | int | size | ) | [inline, protected, virtual] |
The function skips a number of bytes.
size | The number of bytes to be skipped. |
Reimplemented from PhysicalInStream.
Definition at line 754 of file InStreams.h.
References memory.
const char * InMemory::end [private] |
Points to the end of the memory block.
Definition at line 707 of file InStreams.h.
const char* InMemory::memory [private] |
Points to the next byte to read from memory.
Definition at line 707 of file InStreams.h.
Referenced by exists(), getEof(), open(), readFromStream(), and skipInStream().