Gamedev Framework (gf)  0.10.0
A C++14 framework for 2D games
Public Member Functions | List of all members
gf::MemoryOutputStream Class Reference

Memory based output stream. More...

#include <gf/Streams.h>

Inheritance diagram for gf::MemoryOutputStream:
Inheritance graph

Public Member Functions

 MemoryOutputStream (BufferRef< uint8_t > memory)
 Constructor. More...
virtual std::size_t write (ArrayRef< uint8_t > buffer) override
 Write data to the stream. More...
- Public Member Functions inherited from gf::OutputStream
 OutputStream ()=default
 Default constructor. More...
 OutputStream (const InputStream &)=delete
 Deleted copy constructor. More...
OutputStreamoperator= (const InputStream &)=delete
 Deleted copy assignment. More...
virtual ~OutputStream ()
 Destructor. More...
std::size_t write (uint8_t byte)
 Write a single byte to the stream. More...

Detailed Description

Memory based output stream.

Constructor & Destructor Documentation

◆ MemoryOutputStream()

gf::MemoryOutputStream::MemoryOutputStream ( BufferRef< uint8_t >  memory)


This class does not own the memory. The user must keep the memory available when the stream is active.

bufferThe destination buffer

Member Function Documentation

◆ write()

virtual std::size_t gf::MemoryOutputStream::write ( ArrayRef< uint8_t >  buffer)

Write data to the stream.

bufferThe buffer to copy to the stream
The number of bytes actually writtent

Implements gf::OutputStream.