CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::IStream Class Reference

An interface that all data streams must implement. More...

#include <CeresEngine/Foundation/IO/Stream.hpp>

Inheritance diagram for CeresEngine::IStream:
CeresEngine::IInputStream CeresEngine::IOutputStream CeresEngine::PipeStream CeresEngine::ResourceStream CeresEngine::FilteredInputStream CeresEngine::IDataStream CeresEngine::IResourceInputStream CeresEngine::PipeInputStream CeresEngine::FilteredOutputStream CeresEngine::IDataStream CeresEngine::IResourceOutputStream CeresEngine::PipeOutputStream CeresEngine::PipeInputStream CeresEngine::PipeOutputStream CeresEngine::IResourceInputStream CeresEngine::IResourceOutputStream

Public Types

enum class  Seek { Start = SEEK_SET , Current = SEEK_CUR , End = SEEK_END }
 An enumeration that describes how a data stream should be seeked. More...
 

Public Member Functions

 IStream ()=default
 
 IStream (const IStream &) noexcept=delete
 
IStreamoperator= (const IStream &) noexcept=delete
 
 IStream (IStream &&) noexcept=default
 
IStreamoperator= (IStream &&) noexcept=default
 
virtual ~IStream () noexcept=default
 
virtual bool isSeekable (Seek mode=Seek::Start) const noexcept
 Checks if the stream is seekable.
 
virtual void seek (std::streamsize position, Seek mode=Seek::Start)
 Changes the position of the data stream.
 
void skip (const size_t n)
 Skips n bytes from the data stream.
 
virtual bool isTellable () const noexcept
 Checks if the stream knows it's current absolute position.
 
virtual size_t tell ()
 Gets the absolute stream position, in bytes.
 
virtual bool isSizeKnown () const noexcept
 Checks if the stream knows the size of the data.
 
virtual size_t size ()
 Gets the number of bytes available on the stream.
 

Detailed Description

An interface that all data streams must implement.

This class’s interface is common to all stream classes, including its subclasses InputStream and OutputStream.

Stream objects provide an easy way to read and write data to and from a variety of media in a device-independent way. You can create stream objects for data located in memory, in a file, or on a network (using sockets), and you can use stream objects without loading all of the data into memory at once.

By default, Stream instances that aren’t file-based are non-seekable, one-way streams (although custom seekable subclasses are possible). After you provide or consume data, you can’t retrieve the data from the stream.

Member Enumeration Documentation

◆ Seek

An enumeration that describes how a data stream should be seeked.

Enumerator
Start 
Current 
End 

Constructor & Destructor Documentation

◆ IStream() [1/3]

CeresEngine::IStream::IStream ( )
default

◆ IStream() [2/3]

CeresEngine::IStream::IStream ( const IStream )
deletenoexcept

◆ IStream() [3/3]

CeresEngine::IStream::IStream ( IStream &&  )
defaultnoexcept

◆ ~IStream()

virtual CeresEngine::IStream::~IStream ( )
virtualdefaultnoexcept

Member Function Documentation

◆ isSeekable()

◆ isSizeKnown()

◆ isTellable()

◆ operator=() [1/2]

IStream & CeresEngine::IStream::operator= ( const IStream )
deletenoexcept

◆ operator=() [2/2]

IStream & CeresEngine::IStream::operator= ( IStream &&  )
defaultnoexcept

◆ seek()

virtual void CeresEngine::IStream::seek ( std::streamsize  position,
Seek  mode = Seek::Start 
)
virtual

◆ size()

◆ skip()

void CeresEngine::IStream::skip ( const size_t  n)
inline

Skips n bytes from the data stream.

◆ tell()


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