memorybuf::in_base Class Reference

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

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

Public Member Functions

 in_base ()=default
 Default construct. More...
 
 in_base (char *s, std::streamsize n)
 Construct for character array (can be nullptr) and number of bytes. More...
 
void resetg (char *s, std::streamsize n)
 Reset get buffer with character data (can be nullptr) and count. More...
 
std::streamsize span_tellg () const
 The current buffer get position. More...
 
std::streamsize span_capacity () const
 The get buffer capacity. More...
 
std::streamsize span_remaining () const
 The number of characters remaining in the get area. More...
 
char * data_bytes () const
 The span data (start of input characters) More...
 
std::streamsize size_bytes () const
 The span size (number of input characters) More...
 
stdFoam::span< const char > view () const
 
void info (Ostream &os) const
 Some information about the input buffer position/capacity. More...
 

Protected Member Functions

virtual std::streamsize xsgetn (char *s, std::streamsize n)
 Get sequence of characters from a fixed region. More...
 
- 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. More...
 
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. More...
 

Detailed Description

The base input streambuf with memory access.

Definition at line 148 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 180 of file memoryStreamBuffer.H.

References n, memorybuf::in_base::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 157 of file memoryStreamBuffer.H.

References Foam::BitOps::count(), 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 196 of file memoryStreamBuffer.H.

References n, and s.

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

Here is the caller graph for this function:

◆ span_tellg()

std::streamsize span_tellg ( ) const
inline

The current buffer get position.

Definition at line 211 of file memoryStreamBuffer.H.

Referenced by memorybuf::in_base::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 216 of file memoryStreamBuffer.H.

Referenced by icharstream::capacity(), ispanstream::capacity(), and memorybuf::in_base::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 221 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 229 of file memoryStreamBuffer.H.

Referenced by icharstream::list(), ispanstream::list(), icharstream::str(), ispanstream::str(), and memorybuf::in_base::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 234 of file memoryStreamBuffer.H.

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

Here is the caller graph for this function:

◆ view()

stdFoam::span<const char> view ( ) const
inline

Definition at line 242 of file memoryStreamBuffer.H.

References memorybuf::in_base::data_bytes(), and memorybuf::in_base::size_bytes().

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

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

◆ info()

void info ( Ostream os) const
inline

Some information about the input buffer position/capacity.

Definition at line 251 of file memoryStreamBuffer.H.

References os(), memorybuf::in_base::span_capacity(), and memorybuf::in_base::span_tellg().

Here is the call graph for this function:

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