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

An output streambuf for memory access. More...

#include <memoryStreamBuffer.H>

Inheritance diagram for memorybuf::in_dynamic:
Collaboration diagram for memorybuf::in_dynamic:

Public Member Functions

 in_dynamic ()=default
 Default construct - empty.
 in_dynamic (const char *s, std::streamsize n)
 Copy construct from content.
 in_dynamic (::Foam::List< char > &&buffer)
 Move construct from List.
template<int SizeMin>
 in_dynamic (::Foam::DynamicList< char, SizeMin > &&buffer)
 Move construct from DynamicList (added length only).
void sync_gbuffer ()
 Sync get buffer pointers to agree with list dimensions.
void reset (const char *s, std::streamsize n)
 Reset content (copy).
void swap (List< char > &other)
 Exchange buffer content and parameter contents, reset positions.
template<int SizeMin>
void swap (DynamicList< char, SizeMin > &other)
 Exchange buffer content and parameter contents, reset positions.
DynamicList< char > release ()
 Reset buffer and return contents. The list size and capacity are identical.
Public Member Functions inherited from memorybuf::in_base
 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.

Additional Inherited Members

Protected Member Functions inherited from memorybuf::in_base
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

An output streambuf for memory access.

Definition at line 298 of file memoryStreamBuffer.H.

Constructor & Destructor Documentation

◆ in_dynamic() [1/4]

in_dynamic ( )
default

Default construct - empty.

◆ in_dynamic() [2/4]

in_dynamic ( const char * s,
std::streamsize n )
inline

Copy construct from content.

Definition at line 322 of file memoryStreamBuffer.H.

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

Here is the call graph for this function:

◆ in_dynamic() [3/4]

in_dynamic ( ::Foam::List< char > && buffer)
inline

Move construct from List.

Definition at line 335 of file memoryStreamBuffer.H.

References sync_gbuffer().

Here is the call graph for this function:

◆ in_dynamic() [4/4]

template<int SizeMin>
in_dynamic ( ::Foam::DynamicList< char, SizeMin > && buffer)
inline

Move construct from DynamicList (added length only).

Definition at line 346 of file memoryStreamBuffer.H.

References sync_gbuffer().

Here is the call graph for this function:

Member Function Documentation

◆ sync_gbuffer()

void sync_gbuffer ( )
inline

Sync get buffer pointers to agree with list dimensions.

Sets get pointer to the begin (rewind).

Definition at line 360 of file memoryStreamBuffer.H.

References memorybuf::in_base::resetg().

Referenced by in_dynamic(), in_dynamic(), in_dynamic(), release(), reset(), swap(), and swap().

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

◆ reset()

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

Reset content (copy).

Definition at line 368 of file memoryStreamBuffer.H.

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

Referenced by icharstream::reset().

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

◆ swap() [1/2]

void swap ( List< char > & other)
inline

Exchange buffer content and parameter contents, reset positions.

Definition at line 385 of file memoryStreamBuffer.H.

References UList< T >::swap(), and sync_gbuffer().

Referenced by icharstream::swap(), and icharstream::swap().

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

◆ swap() [2/2]

template<int SizeMin>
void swap ( DynamicList< char, SizeMin > & other)
inline

Exchange buffer content and parameter contents, reset positions.

Definition at line 395 of file memoryStreamBuffer.H.

References DynamicList< T, SizeMin >::swap(), and sync_gbuffer().

Here is the call graph for this function:

◆ release()

DynamicList< char > release ( )
inline

Reset buffer and return contents. The list size and capacity are identical.

Definition at line 406 of file memoryStreamBuffer.H.

References sync_gbuffer().

Referenced by icharstream::release().

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

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