Loading...
Searching...
No Matches
memorybuf::in_base Class Reference

The base input streambuf with memory access. More...

#include <memoryStreamBuffer.H>

Inheritance diagram for memorybuf::in_base:
Collaboration diagram for memorybuf::in_base:

Public Member Functions

 in_base ()=default
 Default construct.
 in_base (char *s, std::streamsize n)
 Construct for character array (can be nullptr) and number of bytes.
void resetg (char *s, std::streamsize n)
 Reset get buffer with character data (can be nullptr) and count.
std::streamsize span_tellg () const
 The current buffer get position.
std::streamsize span_capacity () const
 The get buffer capacity.
std::streamsize span_remaining () const
 The number of characters remaining in the get area.
char * data_bytes () const
 The span data (start of input characters).
std::streamsize size_bytes () const
 The span size (number of input characters).
bool in_range (std::streampos pos) const
 True if position is within the current input range.
auto view () const
 A string view of the current input region.
auto view (size_t pos, size_t len) const
 A sub-slice string view of the current input region.
void info (Ostream &os) const
 Some information about the input buffer position/capacity.

Protected Member Functions

virtual std::streamsize xsgetn (char *s, std::streamsize n)
 Get sequence of characters from a fixed region.
Protected Member Functions inherited from memorybuf
virtual std::streampos seekoff (std::streamoff off, std::ios_base::seekdir way, std::ios_base::openmode which=std::ios_base::in|std::ios_base::out)
 Set position pointer to relative position.
virtual std::streampos seekpos (std::streampos pos, std::ios_base::openmode which=std::ios_base::in|std::ios_base::out)
 Set position pointer to absolute position.

Detailed Description

The base input streambuf with memory access.

Definition at line 149 of file memoryStreamBuffer.H.

Constructor & Destructor Documentation

◆ in_base() [1/2]

in_base ( )
default

Default construct.

◆ in_base() [2/2]

in_base ( char * s,
std::streamsize n )
inline

Construct for character array (can be nullptr) and number of bytes.

Definition at line 181 of file memoryStreamBuffer.H.

References n, resetg(), and s().

Here is the call graph for this function:

Member Function Documentation

◆ xsgetn()

virtual std::streamsize xsgetn ( char * s,
std::streamsize n )
inlineprotectedvirtual

Get sequence of characters from a fixed region.

Definition at line 158 of file memoryStreamBuffer.H.

References n, and s().

Here is the call graph for this function:

◆ resetg()

void resetg ( char * s,
std::streamsize n )
inline

Reset get buffer with character data (can be nullptr) and count.

Sets get pointer to the begin.

Definition at line 197 of file memoryStreamBuffer.H.

References n, and s().

Referenced by in_base(), ispanstream::reset(), ispanstream::reset(), ispanstream::reset(), and memorybuf::in_dynamic::sync_gbuffer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ span_tellg()

std::streamsize span_tellg ( ) const
inline

The current buffer get position.

Definition at line 212 of file memoryStreamBuffer.H.

Referenced by info(), icharstream::input_pos(), and ispanstream::input_pos().

Here is the caller graph for this function:

◆ span_capacity()

std::streamsize span_capacity ( ) const
inline

The get buffer capacity.

Definition at line 217 of file memoryStreamBuffer.H.

Referenced by icharstream::capacity(), ispanstream::capacity(), in_range(), and info().

Here is the caller graph for this function:

◆ span_remaining()

std::streamsize span_remaining ( ) const
inline

The number of characters remaining in the get area.

Definition at line 222 of file memoryStreamBuffer.H.

Referenced by icharstream::remaining(), and ispanstream::remaining().

Here is the caller graph for this function:

◆ data_bytes()

char * data_bytes ( ) const
inline

The span data (start of input characters).

Definition at line 230 of file memoryStreamBuffer.H.

Referenced by icharstream::list(), ispanstream::list(), icharstream::str(), ispanstream::str(), view(), and view().

Here is the caller graph for this function:

◆ size_bytes()

std::streamsize size_bytes ( ) const
inline

The span size (number of input characters).

Definition at line 235 of file memoryStreamBuffer.H.

Referenced by icharstream::list(), ispanstream::list(), icharstream::str(), ispanstream::str(), view(), and view().

Here is the caller graph for this function:

◆ in_range()

bool in_range ( std::streampos pos) const
inline

True if position is within the current input range.

Definition at line 240 of file memoryStreamBuffer.H.

References Foam::pos(), and span_capacity().

Referenced by icharstream::seek(), ispanstream::seek(), and view().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ view() [1/2]

auto view ( ) const
inline

A string view of the current input region.

Definition at line 248 of file memoryStreamBuffer.H.

References data_bytes(), and size_bytes().

Referenced by icharstream::view(), icharstream::view(), ispanstream::view(), and ispanstream::view().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ view() [2/2]

auto view ( size_t pos,
size_t len ) const
inline

A sub-slice string view of the current input region.

Definition at line 256 of file memoryStreamBuffer.H.

References data_bytes(), in_range(), Foam::pos(), and size_bytes().

Here is the call graph for this function:

◆ info()

void info ( Ostream & os) const
inline

Some information about the input buffer position/capacity.

Definition at line 284 of file memoryStreamBuffer.H.

References os(), span_capacity(), and span_tellg().

Here is the call graph for this function:

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