An output streambuf for memory access. More...


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... | |
| bool | in_range (std::streampos pos) const |
| True if position is within the current output range. More... | |
| auto | view () const |
| A string view of the current output region. More... | |
| auto | view (size_t pos, size_t len) const |
| A sub-slice string view of the current output region. More... | |
| void | pop_back (int n=1) |
| Decrease the put area by 1 or more elements. More... | |
| void | overwrite (std::streampos pos, const char *data, std::streamsize count) |
| Overwrite a sub-slice with character content. More... | |
| void | overwrite (std::streampos pos, char c) |
| Overwrite a single character. More... | |
| 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... | |
An output streambuf for memory access.
Definition at line 422 of file memoryStreamBuffer.H.
|
default |
Default construct.
|
inline |
Construct for character array (can be nullptr) and number of bytes.
Definition at line 454 of file memoryStreamBuffer.H.
References n, memorybuf::out_base::resetp(), and s.

|
inlineprotectedvirtual |
Put sequence of characters to a fixed region.
Reimplemented in memorybuf::out_dynamic.
Definition at line 431 of file memoryStreamBuffer.H.
References Foam::BitOps::count(), n, and s.

|
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.
Referenced by memorybuf::out_base::out_base(), ospanstream::reset(), and memorybuf::out_dynamic::sync_pbuffer().

|
inline |
The current buffer put position.
Definition at line 487 of file memoryStreamBuffer.H.
Referenced by memorybuf::out_dynamic::extend(), memorybuf::out_dynamic::extend_exact(), memorybuf::out_base::in_range(), memorybuf::out_base::info(), ocharstream::output_pos(), ospanstream::output_pos(), memorybuf::out_base::overwrite(), memorybuf::out_dynamic::release(), memorybuf::out_dynamic::reserve(), memorybuf::out_dynamic::reserve_exact(), memorybuf::out_dynamic::shrink_to_fit(), and memorybuf::out_dynamic::swap().

|
inline |
The put buffer capacity.
Definition at line 492 of file memoryStreamBuffer.H.
Referenced by ocharstream::capacity(), ospanstream::capacity(), and memorybuf::out_base::info().

|
inline |
The span data (start of output characters)
Definition at line 497 of file memoryStreamBuffer.H.
Referenced by ospanstream::cdata_bytes(), ocharstream::cdata_bytes(), ospanstream::data_bytes(), ocharstream::data_bytes(), ospanstream::list(), ocharstream::list(), memorybuf::out_base::overwrite(), ospanstream::str(), ocharstream::str(), and memorybuf::out_base::view().

|
inline |
The span size (size of output buffer)
Definition at line 502 of file memoryStreamBuffer.H.
Referenced by ocharstream::count(), ospanstream::count(), ospanstream::list(), ocharstream::list(), ospanstream::size_bytes(), ocharstream::size_bytes(), ospanstream::str(), ocharstream::str(), and memorybuf::out_base::view().

|
inline |
True if position is within the current output range.
Definition at line 507 of file memoryStreamBuffer.H.
References Foam::pos(), and memorybuf::out_base::span_tellp().
Referenced by memorybuf::out_base::overwrite(), ospanstream::seek(), ocharstream::seek(), and memorybuf::out_base::view().


|
inline |
A string view of the current output region.
Definition at line 515 of file memoryStreamBuffer.H.
References memorybuf::out_base::data_bytes(), and memorybuf::out_base::size_bytes().
Referenced by ospanstream::view(), and ocharstream::view().


|
inline |
A sub-slice string view of the current output region.
Definition at line 523 of file memoryStreamBuffer.H.
References memorybuf::out_base::data_bytes(), memorybuf::out_base::in_range(), Foam::pos(), and memorybuf::out_base::size_bytes().

|
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().

|
inline |
Overwrite a sub-slice with character content.
Definition at line 563 of file memoryStreamBuffer.H.
References Foam::BitOps::count(), memorybuf::out_base::data_bytes(), memorybuf::out_base::in_range(), Foam::pos(), and memorybuf::out_base::span_tellp().
Referenced by ospanstream::overwrite(), and ocharstream::overwrite().


|
inline |
Overwrite a single character.
Definition at line 583 of file memoryStreamBuffer.H.
References Foam::constant::universal::c, memorybuf::out_base::data_bytes(), memorybuf::out_base::in_range(), and Foam::pos().

|
inline |
Some information about the output buffer position/capacity.
Definition at line 594 of file memoryStreamBuffer.H.
References memorybuf::out_base::span_capacity(), and memorybuf::out_base::span_tellp().
