ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

Common::MemoryReadWriteStream Class Reference

MemoryStream based on RingBuffer. More...

#include <memstream.h>

Inheritance diagram for Common::MemoryReadWriteStream:
Collaboration diagram for Common::MemoryReadWriteStream:

List of all members.

Public Member Functions

 MemoryReadWriteStream (DisposeAfterUse::Flag disposeMemory)
 ~MemoryReadWriteStream ()
uint32 write (const void *dataPtr, uint32 dataSize)
 Write data into the stream.
virtual uint32 read (void *dataPtr, uint32 dataSize)
int32 pos () const
 Obtains the current value of the stream position indicator of the stream.
int32 size () const
bool seek (int32, int)
bool eos () const
void clearErr ()
 Reset the I/O error status as returned by err().
bytegetData ()

Private Member Functions

void ensureCapacity (uint32 new_len)

Private Attributes

uint32 _capacity
uint32 _size
byte_data
uint32 _writePos
uint32 _readPos
uint32 _pos
uint32 _length
DisposeAfterUse::Flag _disposeMemory
bool _eos

Detailed Description

MemoryStream based on RingBuffer.

Grows if has insufficient buffer size.

Definition at line 215 of file memstream.h.


Constructor & Destructor Documentation

Common::MemoryReadWriteStream::MemoryReadWriteStream ( DisposeAfterUse::Flag  disposeMemory  )  [inline, explicit]

Definition at line 250 of file memstream.h.

Common::MemoryReadWriteStream::~MemoryReadWriteStream (  )  [inline]

Definition at line 252 of file memstream.h.


Member Function Documentation

void Common::MemoryReadWriteStream::clearErr (  )  [inline, virtual]

Reset the I/O error status as returned by err().

For a ReadStream, also reset the end-of-stream status returned by eos().

Note:
The semantics of any implementation of this method are supposed to match those of ISO C clearerr().

Reimplemented from Common::Stream.

Definition at line 296 of file memstream.h.

void Common::MemoryReadWriteStream::ensureCapacity ( uint32  new_len  )  [inline, private]

Definition at line 224 of file memstream.h.

bool Common::MemoryReadWriteStream::eos (  )  const [inline]

Definition at line 295 of file memstream.h.

byte* Common::MemoryReadWriteStream::getData (  )  [inline]

Definition at line 298 of file memstream.h.

int32 Common::MemoryReadWriteStream::pos (  )  const [inline, virtual]

Obtains the current value of the stream position indicator of the stream.

Returns:
the current position indicator, or -1 if an error occurred.

Implements Common::WriteStream.

Definition at line 292 of file memstream.h.

virtual uint32 Common::MemoryReadWriteStream::read ( void *  dataPtr,
uint32  dataSize 
) [inline, virtual]

Definition at line 274 of file memstream.h.

bool Common::MemoryReadWriteStream::seek ( int32  ,
int   
) [inline]

Definition at line 294 of file memstream.h.

int32 Common::MemoryReadWriteStream::size (  )  const [inline]

Definition at line 293 of file memstream.h.

uint32 Common::MemoryReadWriteStream::write ( const void *  dataPtr,
uint32  dataSize 
) [inline, virtual]

Write data into the stream.

Subclasses must implement this method; all other write methods are implemented using it.

Note:
The semantics of any implementation of this method are supposed to match those of ISO C fwrite().
Parameters:
dataPtr pointer to the data to be written
dataSize number of bytes to be written
Returns:
the number of bytes which were actually written.

Implements Common::WriteStream.

Definition at line 257 of file memstream.h.


Member Data Documentation

Definition at line 217 of file memstream.h.

Definition at line 219 of file memstream.h.

Definition at line 222 of file memstream.h.

Definition at line 220 of file memstream.h.

Definition at line 220 of file memstream.h.

Definition at line 220 of file memstream.h.

Definition at line 218 of file memstream.h.

Definition at line 220 of file memstream.h.


The documentation for this class was generated from the following file:


Generated on Sat Jan 19 2019 05:05:55 for ResidualVM by doxygen 1.7.1
curved edge   curved edge