std::ostrstream (3) - Linux Manuals
std::ostrstream: std::ostrstream
NAME
std::ostrstream - std::ostrstream
Synopsis
Defined in header <strstream>
class ostrstream : public std::ostream (deprecated in C++98)
The class ostrstream implements output operations on array-backed streams. It essentially wraps a raw array I/O device implementation (std::strstreambuf) into the higher-level interface of std::basic_ostream.
The typical implementation of ostrstream holds only one non-derived data member: an object of type std::strstreambuf.
Notes
After any call to str(), a call to freeze(false) is required to allow the destructor to deallocate the buffer as necessary.
Before any call to str() that uses the result as a C string, the buffer must be null-terminated, typically with std::ends.
ostrstream has been deprecated since C++98, std::ostringstream and boost::iostreams::array_sink are the recommended replacements.
Member functions
constructor (public member function)
destructor destructs a strstream, optionally deallocating the buffer
[virtual]
rdbuf (public member function)
str (public member function)
freeze (public member function)
pcount (public member function)
Inherited from std::basic_ostream
Member functions
Formatted output
operator<< (public member function of std::basic_ostream<CharT,Traits>)
Unformatted output
put (public member function of std::basic_ostream<CharT,Traits>)
write (public member function of std::basic_ostream<CharT,Traits>)
Positioning
tellp (public member function of std::basic_ostream<CharT,Traits>)
seekp (public member function of std::basic_ostream<CharT,Traits>)
Miscellaneous
flush (public member function of std::basic_ostream<CharT,Traits>)
Member classes
sentry (public member class of std::basic_ostream<CharT,Traits>)
Inherited from std::basic_ios
Member types
Member type Definition
char_type CharT
traits_type Traits
int_type Traits::int_type
pos_type Traits::pos_type
off_type Traits::off_type
Member functions
State functions
good (public member function of std::basic_ios<CharT,Traits>)
eof (public member function of std::basic_ios<CharT,Traits>)
fail (public member function of std::basic_ios<CharT,Traits>)
bad (public member function of std::basic_ios<CharT,Traits>)
operator! (public member function of std::basic_ios<CharT,Traits>)
operator_void*
operator_bool checks if no error has occurred (synonym of !fail())
(until C++11)
(since C++11)
rdstate (public member function of std::basic_ios<CharT,Traits>)