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

Buffered input stream class. More...

#include <BufferedInputStream.h>

Inheritance diagram for sese::io::BufferedInputStream:
sese::io::InputStream

Public Types

using Ptr = std::shared_ptr<BufferedInputStream>
 
- Public Types inherited from sese::io::InputStream
typedef std::shared_ptr< InputStreamPtr
 

Public Member Functions

 BufferedInputStream (const InputStream::Ptr &source, size_t buffer_size=STREAM_BYTE_STREAM_SIZE_FACTOR)
 
 ~BufferedInputStream () noexcept override
 
int64_t read (void *buffer, size_t length) override
 
size_t getPosition () const
 
size_t getLength () const
 
size_t getCapacity () const
 
- Public Member Functions inherited from sese::io::InputStream
virtual ~InputStream () noexcept=default
 

Private Member Functions

int64_t preRead () noexcept
 

Private Attributes

InputStream::Ptr source
 
void * buffer = nullptr
 
size_t pos
 
size_t len
 
size_t cap
 

Detailed Description

Buffered input stream class.

Member Typedef Documentation

◆ Ptr

Constructor & Destructor Documentation

◆ BufferedInputStream()

BufferedInputStream::BufferedInputStream ( const InputStream::Ptr & source,
size_t buffer_size = STREAM_BYTE_STREAM_SIZE_FACTOR )
explicit

References buffer, cap, len, pos, and source.

◆ ~BufferedInputStream()

BufferedInputStream::~BufferedInputStream ( )
overridenoexcept

References buffer, and free().

Member Function Documentation

◆ getCapacity()

size_t sese::io::BufferedInputStream::getCapacity ( ) const
inlinenodiscard

References cap.

◆ getLength()

size_t sese::io::BufferedInputStream::getLength ( ) const
inlinenodiscard

References len.

◆ getPosition()

size_t sese::io::BufferedInputStream::getPosition ( ) const
inlinenodiscard

References pos.

◆ preRead()

int64_t BufferedInputStream::preRead ( )
inlineprivatenoexcept

References buffer, cap, len, pos, read(), and source.

Referenced by read().

◆ read()

int64_t BufferedInputStream::read ( void * buffer,
size_t length )
overridevirtual

Implements sese::io::InputStream.

References buffer, cap, len, pos, preRead(), read(), and source.

Referenced by preRead(), and read().

Member Data Documentation

◆ buffer

void* sese::io::BufferedInputStream::buffer = nullptr
private

◆ cap

size_t sese::io::BufferedInputStream::cap
private

◆ len

size_t sese::io::BufferedInputStream::len
private

◆ pos

size_t sese::io::BufferedInputStream::pos
private

◆ source

InputStream::Ptr sese::io::BufferedInputStream::source
private

Referenced by BufferedInputStream(), preRead(), and read().


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