JugiMap Framework
BinaryBufferStreamReader Class Reference

Extended BinaryStreamReader class which reads from a memory buffer. More...

#include <jmStreams.h>

Inherits BinaryStreamReader.

Inherited by BinaryFileStreamReaderCC.

Public Member Functions

 BinaryBufferStreamReader (unsigned char *_buff, int _size, bool _ownedBuffer)
 Constructor. More...
 
bool IsOpen () override
 Returns true if the stream of this object is open for reading; if not it returns false. More...
 
int Pos () override
 Returns the current reading position of the stream. More...
 
void Seek (int _pos) override
 Set the current reading position of the stream. More...
 
int Size () override
 Returns the size of the stream. More...
 
void Close () override
 Close the stream. More...
 
unsigned char ReadByte () override
 Read and returns the byte number. More...
 
int ReadInt () override
 Read and returns the integer number (4 bytes). More...
 
float ReadFloat () override
 Read and returns the float number (4 bytes). More...
 
std::string ReadString () override
 Read and returns the string. The length of string is written as the integer at the start. More...
 
- Public Member Functions inherited from BinaryStreamReader
virtual ~BinaryStreamReader ()
 Destructor. More...
 

Detailed Description

Extended BinaryStreamReader class which reads from a memory buffer.

Constructor & Destructor Documentation

◆ BinaryBufferStreamReader()

BinaryBufferStreamReader ( unsigned char *  _buff,
int  _size,
bool  _ownedBuffer 
)
inline

Constructor.

Creates a new BinaryBufferStreamReader object with the given memory buffer *_buff* of the size *_size*. If parameter *_ownedBuffer* is true the reader takes ownership of the buffer and will delete it on destruction.

Member Function Documentation

◆ IsOpen()

bool IsOpen ( )
inlineoverridevirtual

Returns true if the stream of this object is open for reading; if not it returns false.

Implements BinaryStreamReader.

◆ Pos()

int Pos ( )
inlineoverridevirtual

Returns the current reading position of the stream.

Implements BinaryStreamReader.

◆ Seek()

void Seek ( int  _pos)
inlineoverridevirtual

Set the current reading position of the stream.

Implements BinaryStreamReader.

◆ Size()

int Size ( )
inlineoverridevirtual

Returns the size of the stream.

Implements BinaryStreamReader.

◆ Close()

void Close ( )
inlineoverridevirtual

Close the stream.

Implements BinaryStreamReader.

◆ ReadByte()

unsigned char ReadByte ( )
inlineoverridevirtual

Read and returns the byte number.

Implements BinaryStreamReader.

◆ ReadInt()

int ReadInt ( )
inlineoverridevirtual

Read and returns the integer number (4 bytes).

Implements BinaryStreamReader.

◆ ReadFloat()

float ReadFloat ( )
inlineoverridevirtual

Read and returns the float number (4 bytes).

Implements BinaryStreamReader.

◆ ReadString()

std::string ReadString ( )
inlineoverridevirtual

Read and returns the string. The length of string is written as the integer at the start.

Implements BinaryStreamReader.


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