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

Fixed-size byte buffer class. More...

#include <AbstractFixedBuffer.h>

Inheritance diagram for sese::io::AbstractFixedBuffer:
sese::io::Stream sese::io::PeekableStream sese::io::InputStream sese::io::OutputStream sese::io::FixedBuffer sese::io::FixedBuilder

Public Member Functions

 AbstractFixedBuffer (size_t size) noexcept
 
 ~AbstractFixedBuffer () noexcept override
 
 AbstractFixedBuffer (const AbstractFixedBuffer &buffer) noexcept
 
 AbstractFixedBuffer (AbstractFixedBuffer &&buffer) noexcept
 
int64_t read (void *buffer, size_t length) override
 
int64_t write (const void *buffer, size_t length) override
 
int64_t peek (void *buffer, size_t length) override
 
int64_t trunc (size_t length) override
 
virtual void reset () noexcept
 
const char * data () const
 
size_t getSize () const noexcept
 
size_t getReadSize () const noexcept
 
size_t getWriteSize () const noexcept
 
size_t getReadableSize () const noexcept
 
size_t getWriteableSize () const noexcept
 
- Public Member Functions inherited from sese::io::InputStream
virtual ~InputStream () noexcept=default
 
- Public Member Functions inherited from sese::io::OutputStream
virtual ~OutputStream () noexcept=default
 
int64_t write (const std::string_view &buffer)
 
int64_t write (const text::StringView &buffer)
 
template<typename T >
int64_t write (std::vector< T > &buffer)
 
template<typename T , size_t N>
int64_t write (std::array< T, N > &buffer)
 
- Public Member Functions inherited from sese::io::PeekableStream
virtual ~PeekableStream ()=default
 

Protected Attributes

size_t size {}
 
size_t readSize {}
 
size_t writeSize {}
 
char * buffer {}
 

Additional Inherited Members

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

Detailed Description

Fixed-size byte buffer class.

Constructor & Destructor Documentation

◆ AbstractFixedBuffer() [1/3]

sese::io::AbstractFixedBuffer::AbstractFixedBuffer ( size_t size)
explicitnoexcept

◆ ~AbstractFixedBuffer()

sese::io::AbstractFixedBuffer::~AbstractFixedBuffer ( )
overridenoexcept

References buffer.

◆ AbstractFixedBuffer() [2/3]

sese::io::AbstractFixedBuffer::AbstractFixedBuffer ( const AbstractFixedBuffer & buffer)
noexcept

◆ AbstractFixedBuffer() [3/3]

sese::io::AbstractFixedBuffer::AbstractFixedBuffer ( AbstractFixedBuffer && buffer)
noexcept

Member Function Documentation

◆ data()

const char * sese::io::AbstractFixedBuffer::data ( ) const
inlinenodiscard

References buffer.

◆ getReadableSize()

size_t sese::io::AbstractFixedBuffer::getReadableSize ( ) const
inlinenodiscardnoexcept

◆ getReadSize()

size_t sese::io::AbstractFixedBuffer::getReadSize ( ) const
inlinenodiscardnoexcept

References readSize.

◆ getSize()

size_t sese::io::AbstractFixedBuffer::getSize ( ) const
inlinenodiscardnoexcept

References size.

◆ getWriteableSize()

size_t sese::io::AbstractFixedBuffer::getWriteableSize ( ) const
inlinenodiscardnoexcept

References size, and writeSize.

Referenced by sese::io::FixedBuffer::getWriteableSize().

◆ getWriteSize()

size_t sese::io::AbstractFixedBuffer::getWriteSize ( ) const
inlinenodiscardnoexcept

References writeSize.

◆ peek()

int64_t sese::io::AbstractFixedBuffer::peek ( void * buffer,
size_t length )
overridevirtual

Read content without stepping

Parameters
bufferBuffer
lengthBuffer size
Returns
Actual size read

Implements sese::io::PeekableStream.

Reimplemented in sese::io::FixedBuffer.

References read().

Referenced by sese::io::FixedBuffer::peek().

◆ read()

int64_t sese::io::AbstractFixedBuffer::read ( void * buffer,
size_t length )
overridevirtual

Implements sese::io::InputStream.

Reimplemented in sese::io::FixedBuffer.

References read().

Referenced by sese::io::FixedBuffer::read().

◆ reset()

void sese::io::AbstractFixedBuffer::reset ( )
virtualnoexcept

Reimplemented in sese::io::FixedBuffer.

Referenced by sese::io::FixedBuffer::reset().

◆ trunc()

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

Step only, without reading content

Parameters
lengthStep size
Returns
Actual step size

Implements sese::io::PeekableStream.

Reimplemented in sese::io::FixedBuffer.

References read().

Referenced by sese::io::FixedBuffer::trunc().

◆ write()

int64_t sese::io::AbstractFixedBuffer::write ( const void * buffer,
size_t length )
overridevirtual

Implements sese::io::OutputStream.

Reimplemented in sese::io::FixedBuffer.

References write().

Referenced by sese::io::FixedBuffer::write().

Member Data Documentation

◆ buffer

char* sese::io::AbstractFixedBuffer::buffer {}
protected

◆ readSize

size_t sese::io::AbstractFixedBuffer::readSize {}
protected

Referenced by getReadableSize(), and getReadSize().

◆ size

size_t sese::io::AbstractFixedBuffer::size {}
protected

Referenced by getSize(), and getWriteableSize().

◆ writeSize

size_t sese::io::AbstractFixedBuffer::writeSize {}
protected

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