PNTK
Public Member Functions | List of all members
pntk::gui_stream Class Referenceabstract

#include <gui_stream.h>

Inheritance diagram for pntk::gui_stream:
pntk::gui_stream_file pntk::gui_stream_memory

Public Member Functions

virtual long int seek (long int offset, int origin)
 
virtual bool eof ()
 
template<typename T >
long int read (T &object)
 
std::string readstring (long int size)
 
virtual long int read (void *buffer, long int size)=0
 
virtual long int seek (long int position)=0
 
virtual long int tell ()=0
 
virtual long int size ()=0
 

Detailed Description

A portable stream abstraction class.

Member Function Documentation

◆ eof()

virtual bool pntk::gui_stream::eof ( )
virtual

Returns whether the stream has ended or not, based on abstract size() and tell() unless otherwise overriden.

Reimplemented in pntk::gui_stream_file, and pntk::gui_stream_memory.

◆ read() [1/2]

template<typename T >
long int pntk::gui_stream::read ( T &  object)
inline

Reads a type as binary data without swizzling, based on abstract read().

◆ read() [2/2]

virtual long int pntk::gui_stream::read ( void *  buffer,
long int  size 
)
pure virtual

Abstract reading which should be implemented by gui_stream derivatives. Returns number of bytes read.

Implemented in pntk::gui_stream_file, and pntk::gui_stream_memory.

◆ readstring()

std::string pntk::gui_stream::readstring ( long int  size)

Reads a string as binary data, based on abstract read().

◆ seek() [1/2]

virtual long int pntk::gui_stream::seek ( long int  offset,
int  origin 
)
virtual

Seeks the stream, which just wraps the abstract seek() unless otherwise overriden.

◆ seek() [2/2]

virtual long int pntk::gui_stream::seek ( long int  position)
pure virtual

Abstract seeking which should be implemented by gui_stream derivatives. Returns new absolute location in bytes.

Implemented in pntk::gui_stream_file, and pntk::gui_stream_memory.

◆ size()

virtual long int pntk::gui_stream::size ( )
pure virtual

Abstract size which should be implemented by gui_stream derivatives. Returns size of buffer in bytes.

Implemented in pntk::gui_stream_file, and pntk::gui_stream_memory.

◆ tell()

virtual long int pntk::gui_stream::tell ( )
pure virtual

Abstract read which should be implemented by gui_stream derivatives. Returns absolutely location in bytes.

Implemented in pntk::gui_stream_file, and pntk::gui_stream_memory.


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