Standard C++ Library Reference ISO/IEC (VERSION3)
initializes sb by calling basic_stringbuf<Elem, Tr, Alloc>(str, mode |
ios_base::in).
basic_istringstream::rdbuf
basic_stringbuf<Elem, Tr, Alloc> *rdbuf() const
The member function returns the address of the stored stream buffer, of type pointer to
basic_stringbuf<Elem, Tr, Alloc>.
basic_istringstream::str
basic_string<Elem, Tr, Alloc> str() const;
void str(const basic_string<Elem, Tr, Alloc>& newstr);
The first member function returns rdbuf()-> str(). The second member function calls
rdbuf()-> str(newstr).
basic_ostringstream
template <class Elem,
class Tr = char_traits<Elem>,
class Alloc = allocator<Elem> >
class basic_ostringstream
: public basic_ostream<Elem, Tr> {
public:
explicit basic_ostringstream(
ios_base::openmode mode = ios_base::out);
explicit basic_ostringstream(
const basic_string<Elem, Tr, Alloc>& str,
ios_base::openmode mode = ios_base::out);
basic_stringbuf<Elem, Tr, Alloc> *rdbuf() const;
basic_string<Elem, Tr, Alloc> str();
void str(const basic_string<Elem, Tr, Alloc>& newstr);
};
The template class describes an object that controls insertion of elements and encoded objects
into a stream buffer of class basic_stringbuf<Elem, Tr, Alloc>, with elements of
type Elem, whose character traits are determined by the class Tr, and whose elements are
allocated by an allocator of class Alloc. The object stores an object of class
basic_stringbuf<Elem, Tr, Alloc>.