memorybuf::out_base Class Reference

An output streambuf for memory access. More...

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

Public Member Functions

 out_base ()=default
 Default construct. More...
 
 out_base (char *s, std::streamsize n)
 Construct for character array (can be nullptr) and number of bytes. More...
 
void resetp (char *s, std::streamsize n)
 Reset put buffer with character data (can be nullptr) and count. More...
 
std::streamsize span_tellp () const
 The current buffer put position. More...
 
std::streamsize span_capacity () const
 The put buffer capacity. More...
 
char * data_bytes () const
 The span data (start of output characters) More...
 
std::streamsize size_bytes () const
 The span size (size of output buffer) More...
 
std::string_view view () const
 
void info (Ostream &os) const
 Some information about the output buffer position/capacity. More...
 

Protected Member Functions

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

An output streambuf for memory access.

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

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

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

References n, and s.

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

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 451 of file memoryStreamBuffer.H.

Referenced by ocharstream::capacity(), ospanstream::capacity(), and memorybuf::out_base::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 456 of file memoryStreamBuffer.H.

Referenced by ocharstream::list(), ospanstream::list(), ocharstream::str(), ospanstream::str(), and memorybuf::out_base::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 461 of file memoryStreamBuffer.H.

Referenced by ocharstream::count(), ospanstream::count(), ocharstream::list(), ospanstream::list(), ocharstream::str(), ospanstream::str(), and memorybuf::out_base::view().

Here is the caller graph for this function:

◆ view()

std::string_view view ( ) const
inline

Definition at line 463 of file memoryStreamBuffer.H.

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

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

Definition at line 471 of file memoryStreamBuffer.H.

References os(), memorybuf::out_base::span_capacity(), and memorybuf::out_base::span_tellp().

Here is the call graph for this function:

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