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

Buffered output stream class. More...

#include <BufferedOutputStream.h>

Inheritance diagram for sese::io::BufferedOutputStream:
sese::io::OutputStream

Public Types

using Ptr = std::shared_ptr<BufferedOutputStream>
 
- Public Types inherited from sese::io::OutputStream
typedef std::shared_ptr< OutputStreamPtr
 

Public Member Functions

 BufferedOutputStream (const OutputStream::Ptr &source, size_t buffer_size=STREAM_BYTE_STREAM_SIZE_FACTOR)
 
 ~BufferedOutputStream () noexcept override
 
int64_t write (const void *buffer, size_t length) override
 
int64_t flush () noexcept
 
size_t getPosition () const
 
size_t getLength () const
 
size_t getCapacity () const
 
- 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)
 

Private Attributes

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

Detailed Description

Buffered output stream class.

Member Typedef Documentation

◆ Ptr

Constructor & Destructor Documentation

◆ BufferedOutputStream()

BufferedOutputStream::BufferedOutputStream ( const OutputStream::Ptr & source,
size_t buffer_size = STREAM_BYTE_STREAM_SIZE_FACTOR )
explicit

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

◆ ~BufferedOutputStream()

BufferedOutputStream::~BufferedOutputStream ( )
overridenoexcept

References buffer, and free().

Member Function Documentation

◆ flush()

int64_t BufferedOutputStream::flush ( )
noexcept

References buffer, len, pos, and source.

Referenced by write().

◆ getCapacity()

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

References cap.

◆ getLength()

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

References len.

◆ getPosition()

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

References pos.

◆ write()

int64_t BufferedOutputStream::write ( const void * buffer,
size_t length )
overridevirtual

Implements sese::io::OutputStream.

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

Member Data Documentation

◆ buffer

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

◆ cap

size_t sese::io::BufferedOutputStream::cap
private

◆ len

size_t sese::io::BufferedOutputStream::len
private

◆ pos

size_t sese::io::BufferedOutputStream::pos
private

◆ source

OutputStream::Ptr sese::io::BufferedOutputStream::source
private

Referenced by BufferedOutputStream(), flush(), and write().


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