This class implements a standard stream providing operations using bsl::basic_string for modifying or accessing the sequence of characters read from, or written to, the stream.

Synopsis

Declared in <bslstl_stringstream.h>

template<
    class CHAR_TYPE,
    class CHAR_TRAITS = char_traits<CHAR_TYPE>,
    class ALLOCATOR = allocator<CHAR_TYPE>>
class basic_stringstream
    : public std::basic_iostream<CHAR_TYPE, CHAR_TRAITS>

Base Classes

Name

Description

std::basic_iostream<CHAR_TYPE, CHAR_TRAITS>

Template class basic_iostream

Type Aliases

Name

Description

__istream_type

__ostream_type

allocator_type

This typedef is an alias to the (template parameter) ALLOCATOR.

char_type

Alias for the character type of this stream.

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

Name

Description

basic_stringstream [constructor]

Constructors

operator=

Assign to this object the value of the specified rhs, and return a reference providing modifiable access to this object. The contents of rhs are move‐assigned to this object. rhs is left in a valid but unspecified state.

rdbuf

Return an address providing modifiable access to the basic_stringbuf object that is internally used by this stream object to buffer unformatted characters.

str

str overloads

swap

Efficiently exchange the value of this object with the value of the specified other object. This method provides the no‐throw exception‐safety guarantee if *this and other allocators compare equal. The behavior is undefined unless either *this and other allocators compare equal or propagate_on_container_swap is true. Note that this function is only available for C++11 (and later) language standards because it requires that swap be provided on the (platform supplied) base class for this type.

view

Return a view of the internally buffered sequence of characters maintained by this stream object.

Protected Member Functions

Non-Member Functions

Name

Description

swap

Efficiently exchange the values of the specified a and b objects. This method provides the no‐throw exception‐safety guarantee if a and b allocators compare equal. Note that this function is only available for C++11 (and later) language standards.

Created with MrDocs