jaulib v1.4.0-2-g788cf73
Jau Support Library (C++, Java, ..)
Loading...
Searching...
No Matches
jau::io::impl::RewindBuffer Class Reference

Rewind buffer support for mark/setMark, read and reset/seekMark. More...

#include <byte_stream.hpp>

Collaboration diagram for jau::io::impl::RewindBuffer:

Public Types

typedef jau::function< size_t(void *out, size_t length)> DataProvider
 
using size_type = jau::io::ByteStream::size_type
 

Public Member Functions

 RewindBuffer () noexcept
 
constexpr size_type capacity () const noexcept
 
constexpr bool covered (const size_type m, size_type o) const noexcept
 
constexpr size_type end () const noexcept
 
size_t read (size_type &m, size_type &o, DataProvider newData, void *out, const size_t length) noexcept
 
bool setMark (const size_type m, size_type o, size_type readLimit) noexcept
 
std::string toString () const noexcept
 

Detailed Description

Rewind buffer support for mark/setMark, read and reset/seekMark.

m - m_mark (stream space) o - m_offset (stream space) p - m_offset (stream space)

g - got bytes (relative)

q - m_offset - m_mark (buffer space, relative stream) r - m_end (buffer space, relative stream)

          <-- q = o-m  ->
                <- g ->

stream [0 ... m ... p ... o) buffer [0 ... q ... r)

Definition at line 866 of file byte_stream.hpp.

Member Typedef Documentation

◆ size_type

◆ DataProvider

typedef jau::function<size_t(void* out, size_t length)> jau::io::impl::RewindBuffer::DataProvider

Definition at line 874 of file byte_stream.hpp.

Constructor & Destructor Documentation

◆ RewindBuffer()

jau::io::impl::RewindBuffer::RewindBuffer ( )
inlinenoexcept

Definition at line 876 of file byte_stream.hpp.

Member Function Documentation

◆ covered()

bool jau::io::impl::RewindBuffer::covered ( const size_type m,
size_type o ) const
inlineconstexprnoexcept

Definition at line 878 of file byte_stream.hpp.

Here is the caller graph for this function:

◆ capacity()

size_type jau::io::impl::RewindBuffer::capacity ( ) const
inlineconstexprnoexcept

Definition at line 882 of file byte_stream.hpp.

Here is the caller graph for this function:

◆ end()

size_type jau::io::impl::RewindBuffer::end ( ) const
inlineconstexprnoexcept

Definition at line 883 of file byte_stream.hpp.

Here is the caller graph for this function:

◆ toString()

std::string jau::io::impl::RewindBuffer::toString ( ) const
inlinenoexcept

Definition at line 884 of file byte_stream.hpp.

◆ setMark()

bool jau::io::impl::RewindBuffer::setMark ( const size_type m,
size_type o,
size_type readLimit )
inlinenoexcept

Definition at line 888 of file byte_stream.hpp.

◆ read()

size_t jau::io::impl::RewindBuffer::read ( size_type & m,
size_type & o,
DataProvider newData,
void * out,
const size_t length )
inlinenoexcept

Definition at line 912 of file byte_stream.hpp.


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