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

Compressed input stream. More...

#include <gf/Streams.h>

Inheritance diagram for gf::CompressedInputStream:
Inheritance graph
[legend]

Public Member Functions

 CompressedInputStream (InputStream &compressed)
 Constructor. More...
 
virtual ~CompressedInputStream ()
 Destructor. More...
 
virtual std::size_t read (BufferRef< uint8_t > buffer) override
 Read data from the stream. More...
 
virtual void seek (std::ptrdiff_t position) override
 Change the current reading position. More...
 
virtual void skip (std::ptrdiff_t position) override
 Change the current reading position. More...
 
virtual bool isFinished () override
 Tell if the stream is at the end. More...
 
- Public Member Functions inherited from gf::InputStream
 InputStream ()=default
 Default constructor. More...
 
 InputStream (const InputStream &)=delete
 Deleted copy constructor. More...
 
InputStreamoperator= (const InputStream &)=delete
 Deleted copy assignment. More...
 
virtual ~InputStream ()
 Destructor. More...
 
std::size_t read (uint8_t &byte)
 Read a single byte from the stream. More...
 

Detailed Description

Compressed input stream.

Constructor & Destructor Documentation

◆ CompressedInputStream()

gf::CompressedInputStream::CompressedInputStream ( InputStream compressed)
explicit

Constructor.

Parameters
compressedThe compressed original stream

◆ ~CompressedInputStream()

virtual gf::CompressedInputStream::~CompressedInputStream ( )
virtual

Destructor.

Member Function Documentation

◆ isFinished()

virtual bool gf::CompressedInputStream::isFinished ( )
overridevirtual

Tell if the stream is at the end.

Returns
A boolean indicating the end of the stream

Implements gf::InputStream.

◆ read()

virtual std::size_t gf::CompressedInputStream::read ( BufferRef< uint8_t >  buffer)
overridevirtual

Read data from the stream.

After reading, the stream's reading position must be advanced by the amount of bytes read.

Parameters
bufferThe buffer where to copy the read data
Returns
The number of bytes actually read

Implements gf::InputStream.

◆ seek()

virtual void gf::CompressedInputStream::seek ( std::ptrdiff_t  position)
overridevirtual

Change the current reading position.

Parameters
positionThe position to seek to, from the beginning

Implements gf::InputStream.

◆ skip()

virtual void gf::CompressedInputStream::skip ( std::ptrdiff_t  position)
overridevirtual

Change the current reading position.

Parameters
positionThe position to seek to, from the current position

Implements gf::InputStream.