45 virtual void Write(
const void* ptr,
Size numBytes);
51 virtual bool Eof()
const;
Implements a stream class which writes to and reads from system RAM.
Definition memorystream.h:19
virtual void * MemoryMap()
map for direct memory-access
Definition memorystream.cc:333
virtual void * Map()
map for direct memory-access
Definition memorystream.cc:320
unsigned char * buffer
Definition memorystream.h:73
virtual void Close()
close the stream
Definition memorystream.cc:150
virtual ~MemoryStream()
destructor
Definition memorystream.cc:28
void Realloc(Size s)
re-allocate the memory buffer
Definition memorystream.cc:262
Position position
Definition memorystream.h:72
bool HasRoom(Size numBytes) const
return true if there's enough space for n more bytes
Definition memorystream.cc:251
void MakeRoom(Size numBytes)
make room for at least n more bytes
Definition memorystream.cc:290
virtual void Unmap()
unmap a mapped stream
Definition memorystream.cc:343
__DeclareClass(MemoryStream)
virtual Position GetPosition() const
get the current position of the read/write cursor
Definition memorystream.cc:106
virtual bool CanWrite() const
memory streams support writing
Definition memorystream.cc:57
Size capacity
Definition memorystream.h:70
static const Size InitialSize
Definition memorystream.h:69
virtual bool Eof() const
return true if end-of-stream reached
Definition memorystream.cc:239
virtual bool CanBeMapped() const
memory streams are mappable
Definition memorystream.cc:75
virtual bool CanSeek() const
memory streams support seeking
Definition memorystream.cc:66
virtual Size GetSize() const
get the size of the stream in bytes
Definition memorystream.cc:97
Size size
Definition memorystream.h:71
virtual Size Read(void *ptr, Size numBytes)
directly read from the stream
Definition memorystream.cc:191
virtual bool Open()
open the stream
Definition memorystream.cc:117
virtual void Seek(Offset offset, SeekOrigin origin)
seek in stream
Definition memorystream.cc:213
virtual bool CanRead() const
memory streams support reading
Definition memorystream.cc:48
MemoryStream()
constructor
Definition memorystream.cc:16
void * GetRawPointer() const
get a direct "raw" pointer to the data
Definition memorystream.cc:357
virtual void SetSize(Size s)
set new size of the stream in bytes
Definition memorystream.cc:84
Offers an abstract interface for read/write access to a sequence of bytes.
Definition stream.h:28
SeekOrigin
seek origins
Definition stream.h:54
int64_t Offset
Definition stream.h:33
int64_t Position
typedefs
Definition stream.h:32
int64_t Size
Definition stream.h:34
Instances of wrapped stream classes.
Definition orientation.cc:10
@ Write
Definition filewatcher.h:47