bsl::basic_stringbuf

Standard stream buffer backed by a character string.

Synopsis

Declared in <bslstl_stringbuf.h>

template<
    class CHAR_TYPE,
    class CHAR_TRAITS = char_traits<CHAR_TYPE>,
    class ALLOCATOR = allocator<CHAR_TYPE>>
class basic_stringbuf
    : public std::basic_streambuf<CHAR_TYPE, CHAR_TRAITS>

Description

This class implements a standard stream buffer providing an unformatted character input sequence and an unformatted character output sequence that may be initialized or accessed using a string value.

Base Classes

NameDescription
std::basic_streambuf<CHAR_TYPE, CHAR_TRAITS>The actual work of input and output (interface).

Type Aliases

NameDescription
__streambuf_type @{ This is a non-standard type.
allocator_type This typedef is an alias to the (template parameter) ALLOCATOR.
char_type This typedef is an alias to the (template parameter) CHAR_TYPE.
int_type This typedef is an alias to traits_type::int_type.
off_type This typedef is an alias to traits_type::off_type.
pos_type This typedef is an alias to traits_type::pos_type.
traits_type This typedef is an alias to the (template parameter) CHAR_TRAITS.

Member Functions

NameDescription
basic_stringbuf [constructor]Constructors
~basic_stringbuf [destructor]Destroy this object.
operator= Move-assign from the specified rhs.
get_allocator Return the allocator used by the underlying string to supply memory.
getloc Locale access.
in_avail Looking ahead into the stream.
pubimbue Entry point for imbue().
pubseekoff Alters the stream position.
pubseekpos Alters the stream position.
pubsetbuf Entry points for derived buffer functions.
pubsync Calls virtual sync function.
sbumpc Getting the next character.
sgetc Getting the next character.
sgetn Entry point for xsgetn.
snextc Getting the next character.
sputbackc Pushing characters back into the input stream.
sputc Entry point for all single-character output functions.
sputn Entry point for all single-character output functions.
str str overloads
sungetc Moving backwards in the input stream.
swap Efficiently exchange the value of this object with other.
view Return a view of the currently buffered sequence of characters.

Using Declarations

NameDescription
getloc Return the currently imbued locale (inherited).
in_avail Return how many characters are available in the get area (inherited).
pubimbue Imbue this buffer with a locale and return the previous locale (inherited).
pubseekoff Seek to a relative position in the controlled sequences (inherited).
pubseekpos Seek to an absolute position in the controlled sequences (inherited).
pubsetbuf Offer a character array as the controlled sequence (inherited).
pubsync Synchronize the put and/or get area with the underlying sequence (inherited).
sbumpc Return the current get character and advance the get pointer (inherited).
sgetc Return the current get character without advancing (inherited).
sgetn Read characters into a buffer (inherited).
snextc Advance the get pointer and return the next character (inherited).
sputbackc Put a character back into the input sequence (inherited).
sputc Append a character to the output sequence (inherited).
sputn Append characters to the output sequence (inherited).
sungetc Move the get pointer back by one character (inherited).

Protected Member Functions

NameDescription
operator=
__safe_gbump
__safe_pbump
eback Access to the get area.
egptr
epptr
gbump Moving the read position.
gptr
imbue [virtual]Changes translations.
overflow overflow overloads
pbackfail pbackfail overloads
pbase Access to the put area.
pbump Moving the write position.
pptr
seekoff seekoff overloads
seekpos seekpos overloads
setbuf [virtual]Manipulates the buffer.
setg Setting the three read area pointers.
setp Setting the three write area pointers.
showmanyc [virtual]Investigating the data available.
swap
sync [virtual]Synchronizes the buffer arrays with the controlled sequences.
uflow [virtual]Return the character at the current get position and advance past it.
underflow [virtual]Return the character at the current get position, if any.
xsgetn xsgetn overloads
xsputn xsputn overloads

Protected Data Members

NameDescription
_M_buf_locale Current locale setting.
_M_in_beg Start of get area.
_M_in_cur Current read area.
_M_in_end End of get area.
_M_out_beg Start of put area.
_M_out_cur Current put area.
_M_out_end End of put area.

Protected Using Declarations

NameDescription
eback Return the start of the get area (inherited).
egptr Return the end of the get area (inherited).
epptr Return the end of the put area (inherited).
gbump Advance the get pointer by the specified number of characters (inherited).
gptr Return the current get pointer (inherited).
imbue Imbue this stream buffer with a locale (inherited).
operator= Assign the get/put pointers and locale from a base stream buffer (inherited).
pbase Return the start of the put area (inherited).
pbump Advance the put pointer by the specified number of characters (inherited).
pptr Return the current put pointer (inherited).
setbuf Offer a character array as the controlled sequence (inherited).
setg Set the beginning, next, and end pointers of the get area (inherited).
setp Set the beginning and end pointers of the put area (inherited).
showmanyc Estimate how many characters can be extracted (inherited).
swap Exchange get/put pointers and locale with another stream buffer (inherited).
sync Synchronize the controlled sequences with the character sequence (inherited).

Non-Member Functions

NameDescription
swapEfficiently exchange the values of the specified a and b objects.