std::stringstream (3) - Linux Manuals
std::stringstream: std::basic_stringstream
NAME
std::basic_stringstream - std::basic_stringstream
Synopsis
Defined in header <sstream>
template<
class CharT, (until C++11)
class Traits = std::char_traits<CharT>
> class basic_stringstream;
template<
class CharT,
class Traits = std::char_traits<CharT>, (since C++11)
class Allocator = std::allocator<CharT>
> class basic_stringstream;
The class template std::basic_stringstream implements input/output operations on memory (std::basic_string) based streams. It essentially wraps a raw string device implementation (std::basic_stringbuf) into a higher-level interface (std::basic_iostream). The complete interface to unique std::basic_stringbuf members is provided.
std-basic stringstream-inheritance.svg
Inheritance diagram
Two specializations for common character types are also defined:
Defined in header <sstream>
Type Definition
stringstream basic_stringstream<char>
wstringstream basic_stringstream<wchar_t>
Member types
Member type Definition
char_type CharT
traits_type Traits; the program is ill-formed if Traits::char_type is not CharT.
int_type Traits::int_type
pos_type Traits::pos_type
off_type Traits::off_type
allocator_type Allocator (since C++11)
Member functions
constructor (public member function)
operator= moves the string stream
(C++11)
swap swaps two string streams
(C++11)
rdbuf (public member function)
String operations
str (public member function)
Non-member functions
std::swap(std::basic_istringstream) specializes the std::swap algorithm
(C++11)
Inherited from std::basic_istream
Member functions
Formatted input
operator>> (public member function of std::basic_istream<CharT,Traits>)
Unformatted input
get (public member function of std::basic_istream<CharT,Traits>)
peek (public member function of std::basic_istream<CharT,Traits>)
unget (public member function of std::basic_istream<CharT,Traits>)
putback (public member function of std::basic_istream<CharT,Traits>)
getline (public member function of std::basic_istream<CharT,Traits>)
ignore (public member function of std::basic_istream<CharT,Traits>)
read (public member function of std::basic_istream<CharT,Traits>)
readsome (public member function of std::basic_istream<CharT,Traits>)
gcount (public member function of std::basic_istream<CharT,Traits>)
Positioning
tellg (public member function of std::basic_istream<CharT,Traits>)
seekg (public member function of std::basic_istream<CharT,Traits>)
Miscellaneous
sync (public member function of std::basic_istream<CharT,Traits>)
Member classes
sentry (public member class of std::basic_istream<CharT,Traits>)
Inherited from std::basic_ostream
Member functions
Formatted output