Sese Framework  2.3.0
A cross-platform framework
Loading...
Searching...
No Matches
sese::io::InputBufferWrapper Class Referencefinal

Input buffer wrapper. More...

#include <InputBufferWrapper.h>

Inheritance diagram for sese::io::InputBufferWrapper:
sese::io::InputStream sese::io::PeekableStream

Public Member Functions

 InputBufferWrapper (const char *buffer, size_t cap)
 
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
 
void reset () noexcept
 
const char * getBuffer () const
 
size_t getLength () const
 
size_t getCapacity () const
 
- Public Member Functions inherited from sese::io::InputStream
virtual ~InputStream () noexcept=default
 
- Public Member Functions inherited from sese::io::PeekableStream
virtual ~PeekableStream ()=default
 

Protected Attributes

const char * buffer = nullptr
 
size_t pos = 0
 
size_t cap = 0
 

Additional Inherited Members

- Public Types inherited from sese::io::InputStream
typedef std::shared_ptr< InputStreamPtr
 
- Public Types inherited from sese::io::PeekableStream
typedef std::shared_ptr< PeekableStreamPtr
 

Detailed Description

Input buffer wrapper.

Constructor & Destructor Documentation

◆ InputBufferWrapper()

sese::io::InputBufferWrapper::InputBufferWrapper ( const char * buffer,
size_t cap )

References buffer, and cap.

Member Function Documentation

◆ getBuffer()

const char * sese::io::InputBufferWrapper::getBuffer ( ) const
nodiscard

◆ getCapacity()

size_t sese::io::InputBufferWrapper::getCapacity ( ) const
nodiscard

◆ getLength()

size_t sese::io::InputBufferWrapper::getLength ( ) const
nodiscard

◆ peek()

int64_t sese::io::InputBufferWrapper::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::io::InputBufferWrapper::read ( void * buffer,
size_t length )
overridevirtual

Implements sese::io::InputStream.

◆ reset()

void sese::io::InputBufferWrapper::reset ( )
noexcept

◆ trunc()

int64_t sese::io::InputBufferWrapper::trunc ( size_t length)
overridevirtual

Step only, without reading content

Parameters
lengthStep size
Returns
Actual step size

Implements sese::io::PeekableStream.

Member Data Documentation

◆ buffer

const char* sese::io::InputBufferWrapper::buffer = nullptr
protected

Referenced by InputBufferWrapper().

◆ cap

size_t sese::io::InputBufferWrapper::cap = 0
protected

Referenced by InputBufferWrapper().

◆ pos

size_t sese::io::InputBufferWrapper::pos = 0
protected

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