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

A base class for InputStream and OutputStream of a ResourceStream. More...

#include <CeresEngine/Resource/ResourceStream.hpp>

Inheritance diagram for CeresEngine::ResourceStream:
CeresEngine::IStream CeresEngine::IResourceInputStream CeresEngine::IResourceOutputStream CeresEngine::WrappedResourceInputStream CeresEngine::WrappedResourceOutputStream

Public Member Functions

 ResourceStream (ResourceStreamLock &&lock)
 
HResource getResource () const
 Gets the resource to which this stream belongs to.
 
ResourceManagergetResourceManager () const
 Gets the resource manager of the resource that owns the stream.
 
- Public Member Functions inherited from CeresEngine::IStream
 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.
 

Private Attributes

ResourceStreamLock mStreamLock
 A lock acquired for the stream. Must be kept for as long as the stream is open.
 

Additional Inherited Members

- Public Types inherited from CeresEngine::IStream
enum class  Seek { Start = SEEK_SET , Current = SEEK_CUR , End = SEEK_END }
 An enumeration that describes how a data stream should be seeked. More...
 

Detailed Description

A base class for InputStream and OutputStream of a ResourceStream.

Constructor & Destructor Documentation

◆ ResourceStream()

CeresEngine::ResourceStream::ResourceStream ( ResourceStreamLock &&  lock)
inlineexplicit

Member Function Documentation

◆ getResource()

HResource CeresEngine::ResourceStream::getResource ( ) const

Gets the resource to which this stream belongs to.

◆ getResourceManager()

ResourceManager * CeresEngine::ResourceStream::getResourceManager ( ) const

Gets the resource manager of the resource that owns the stream.

Member Data Documentation

◆ mStreamLock

ResourceStreamLock CeresEngine::ResourceStream::mStreamLock
private

A lock acquired for the stream. Must be kept for as long as the stream is open.


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