Sese Framework  2.3.0
A cross-platform framework
Loading...
Searching...
No Matches
sese::res::ResourceStream Class Reference

Static resource stream. More...

#include <ResourceStream.h>

Inheritance diagram for sese::res::ResourceStream:
sese::io::PeekableStream sese::io::InputStream

Public Types

using Ptr = std::unique_ptr<ResourceStream>
 
- Public Types inherited from sese::io::PeekableStream
typedef std::shared_ptr< PeekableStreamPtr
 
- Public Types inherited from sese::io::InputStream
typedef std::shared_ptr< InputStreamPtr
 

Public Member Functions

 ResourceStream (const void *data, size_t size)
 
int64_t read (void *buffer, size_t length) override
 
int64_t peek (void *buffer, size_t length) override
 
int64_t trunc (size_t length) override
 
int64_t getSeek () const
 
int32_t setSeek (int64_t offset, io::Seek seek)
 
int32_t setSeek (int64_t offset, int32_t whence)
 
size_t getSize () const
 
- Public Member Functions inherited from sese::io::PeekableStream
virtual ~PeekableStream ()=default
 
- Public Member Functions inherited from sese::io::InputStream
virtual ~InputStream () noexcept=default
 

Protected Attributes

const void * data {}
 
size_t size {}
 
size_t pos {}
 

Detailed Description

Static resource stream.

Member Typedef Documentation

◆ Ptr

Constructor & Destructor Documentation

◆ ResourceStream()

sese::res::ResourceStream::ResourceStream ( const void * data,
size_t size )

Member Function Documentation

◆ getSeek()

int64_t sese::res::ResourceStream::getSeek ( ) const
nodiscard

◆ getSize()

size_t sese::res::ResourceStream::getSize ( ) const
inlinenodiscard

References size.

◆ peek()

int64_t sese::res::ResourceStream::peek ( void * buffer,
size_t length )
overridevirtual

Read content without stepping

Parameters
bufferBuffer
lengthBuffer size
Returns
Actual size read

Implements sese::io::PeekableStream.

◆ read()

int64_t sese::res::ResourceStream::read ( void * buffer,
size_t length )
overridevirtual

Implements sese::io::InputStream.

◆ setSeek() [1/2]

int32_t sese::res::ResourceStream::setSeek ( int64_t offset,
int32_t whence )

◆ setSeek() [2/2]

int32_t sese::res::ResourceStream::setSeek ( int64_t offset,
io::Seek seek )

◆ trunc()

int64_t sese::res::ResourceStream::trunc ( size_t length)
overridevirtual

Step only, without reading content

Parameters
lengthStep size
Returns
Actual step size

Implements sese::io::PeekableStream.

Member Data Documentation

◆ data

const void* sese::res::ResourceStream::data {}
protected

◆ pos

size_t sese::res::ResourceStream::pos {}
protected

◆ size

size_t sese::res::ResourceStream::size {}
protected

Referenced by getSize().


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