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

An output streambuf for memory access. More...

#include <memoryStreamBuffer.H>

Inheritance diagram for memorybuf::out_base:
Collaboration diagram for memorybuf::out_base:

Public Member Functions

 out_base ()=default
 Default construct.
 out_base (char *s, std::streamsize n)
 Construct for character array (can be nullptr) and number of bytes.
void resetp (char *s, std::streamsize n)
 Reset put buffer with character data (can be nullptr) and count.
std::streamsize span_tellp () const
 The current buffer put position.
std::streamsize span_capacity () const
 The put buffer capacity.
char * data_bytes () const
 The span data (start of output characters).
std::streamsize size_bytes () const
 The span size (size of output buffer).
bool in_range (std::streampos pos) const
 True if position is within the current output range.
auto view () const
 A string view of the current output region.
auto view (size_t pos, size_t len) const
 A sub-slice string view of the current output region.
void pop_back (int n=1)
 Decrease the put area by 1 or more elements.
void overwrite (std::streampos pos, const char *data, std::streamsize count)
 Overwrite a sub-slice with character content.
void overwrite (std::streampos pos, char c)
 Overwrite a single character.
void info (Ostream &os) const
 Some information about the output buffer position/capacity.

Protected Member Functions

virtual std::streamsize xsputn (const char *s, std::streamsize n)
 Put sequence of characters to 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

An output streambuf for memory access.

Definition at line 422 of file memoryStreamBuffer.H.

Constructor & Destructor Documentation

◆ out_base() [1/2]

out_base ( )
default

Default construct.

◆ out_base() [2/2]

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

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

Definition at line 454 of file memoryStreamBuffer.H.

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

Here is the call graph for this function:

Member Function Documentation

◆ xsputn()

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

Put sequence of characters to a fixed region.

Reimplemented in memorybuf::out_dynamic.

Definition at line 431 of file memoryStreamBuffer.H.

References n, and s().

Here is the call graph for this function:

◆ resetp()

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

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

Sets put pointer to the begin.

Definition at line 470 of file memoryStreamBuffer.H.

References n, and s().

Referenced by out_base(), ospanstream::reset(), ospanstream::reset(), and memorybuf::out_dynamic::sync_pbuffer().

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

◆ span_tellp()

◆ span_capacity()

std::streamsize span_capacity ( ) const
inline

The put buffer capacity.

Definition at line 492 of file memoryStreamBuffer.H.

Referenced by ocharstream::capacity(), ospanstream::capacity(), and info().

Here is the caller graph for this function:

◆ data_bytes()

char * data_bytes ( ) const
inline

The span data (start of output characters).

Definition at line 497 of file memoryStreamBuffer.H.

Referenced by ocharstream::cdata_bytes(), ospanstream::cdata_bytes(), ocharstream::data_bytes(), ospanstream::data_bytes(), ocharstream::list(), ospanstream::list(), overwrite(), overwrite(), ocharstream::str(), ospanstream::str(), view(), and view().

Here is the caller graph for this function:

◆ size_bytes()

std::streamsize size_bytes ( ) const
inline

The span size (size of output buffer).

Definition at line 502 of file memoryStreamBuffer.H.

Referenced by ocharstream::count(), ospanstream::count(), ocharstream::list(), ospanstream::list(), ocharstream::size_bytes(), ospanstream::size_bytes(), ocharstream::str(), ospanstream::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 output range.

Definition at line 507 of file memoryStreamBuffer.H.

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

Referenced by overwrite(), overwrite(), ocharstream::seek(), ospanstream::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 output region.

Definition at line 515 of file memoryStreamBuffer.H.

References data_bytes(), and size_bytes().

Referenced by ocharstream::view(), ocharstream::view(), ospanstream::view(), and ospanstream::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 output region.

Definition at line 523 of file memoryStreamBuffer.H.

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

Here is the call graph for this function:

◆ pop_back()

void pop_back ( int n = 1)
inline

Decrease the put area by 1 or more elements.

Definition at line 551 of file memoryStreamBuffer.H.

References n.

Referenced by ocharstream::pop_back().

Here is the caller graph for this function:

◆ overwrite() [1/2]

void overwrite ( std::streampos pos,
const char * data,
std::streamsize count )
inline

Overwrite a sub-slice with character content.

Definition at line 562 of file memoryStreamBuffer.H.

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

Referenced by ocharstream::overwrite(), ocharstream::overwrite(), ospanstream::overwrite(), and ospanstream::overwrite().

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

◆ overwrite() [2/2]

void overwrite ( std::streampos pos,
char c )
inline

Overwrite a single character.

Definition at line 583 of file memoryStreamBuffer.H.

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

Here is the call graph for this function:

◆ info()

void info ( Ostream & os) const
inline

Some information about the output buffer position/capacity.

Definition at line 594 of file memoryStreamBuffer.H.

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

Here is the call graph for this function:

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