|
libstdc++
|
Public Types | |
| typedef basic_ostream< char_type, traits_type > | __ostream_type |
| typedef basic_string< _CharT, _Traits, _Alloc > | __string_type |
| typedef basic_stringbuf< _CharT, _Traits, _Alloc > | __stringbuf_type |
| typedef _Alloc | allocator_type |
| typedef _CharT | char_type |
| typedef traits_type::int_type | int_type |
| typedef traits_type::off_type | off_type |
| typedef traits_type::pos_type | pos_type |
| typedef _Traits | traits_type |
Public Member Functions | |
| basic_ostringstream () | |
| basic_ostringstream (basic_ostringstream &&__rhs) | |
| basic_ostringstream (const __string_type &__str, ios_base::openmode __mode=ios_base::out) | |
| basic_ostringstream (const basic_ostringstream &)=delete | |
| basic_ostringstream (ios_base::openmode __mode) | |
| ~basic_ostringstream () | |
| basic_ostringstream & | operator= (basic_ostringstream &&__rhs) |
| basic_ostringstream & | operator= (const basic_ostringstream &)=delete |
| __stringbuf_type * | rdbuf () const |
| __string_type | str () const |
| void | str (const __string_type &__s) |
| void | swap (basic_ostringstream &__rhs) |
| basic_string_view< char_type, traits_type > | view () const noexcept |
Controlling output for std::string.
| _CharT | Type of character stream. |
| _Traits | Traits for character type, defaults to char_traits<_CharT>. |
| _Alloc | Allocator type, defaults to allocator<_CharT>. |
This class supports writing to objects of type std::basic_string, using the inherited functions from std::basic_ostream. To control the associated sequence, an instance of std::basic_stringbuf is used, which this page refers to as sb.
|
inline |
Default constructor starts with an empty string buffer.
Initializes sb using mode|out, and passes &sb to the base class initializer. Does not allocate any buffer.
That's a lie. We initialize the base class with NULL, because the string class does its own memory management.
Definition at line 907 of file sstream.
References std::__addressof().
|
inlineexplicit |
Starts with an empty string buffer.
| __mode | Whether the buffer can read, or write, or both. |
ios_base::out is automatically included in mode.
Initializes sb using mode|out, and passes &sb to the base class initializer. Does not allocate any buffer.
That's a lie. We initialize the base class with NULL, because the string class does its own memory management.
Definition at line 924 of file sstream.
References std::__addressof().
|
inlineexplicit |
Starts with an existing string buffer.
| __str | A string to copy as a starting buffer. |
| __mode | Whether the buffer can read, or write, or both. |
ios_base::out is automatically included in mode.
Initializes sb using str and mode|out, and passes &sb to the base class initializer.
That's a lie. We initialize the base class with NULL, because the string class does its own memory management.
Definition at line 942 of file sstream.
References std::__addressof().
|
inline |
|
inline |
Accessing the underlying buffer.
This hides both signatures of std::basic_ios::rdbuf().
Definition at line 1053 of file sstream.
References std::__addressof().
|
inline |
Copying out the string buffer.
rdbuf()->str() Definition at line 1062 of file sstream.
Referenced by std::__detail::operator<<(), and std::operator<<().
|
inline |