Name
basic_istringstream class template — Base class for input string streams
Synopsis
template <class charT, class traits = char_traits<charT>, class Alloc = allocator<charT> > class basic_istringstream: public basic_istream<charT,traits> { public: typedef charT char_type; typedef typename traits::int_type int_type; typedef typename traits::pos_type pos_type; typedef typename traits::off_type off_type; typedef traits traits_type; explicit basic_istringstream(ios_base::openmode which = ios_base::in); explicit basic_istringstream(const basic_string<charT,traits,Alloc>& str, ios_base::openmode which = ios_base::in); basic_stringbuf<charT,traits,Alloc>* rdbuf( ) const; basic_string<charT,traits,Alloc> str( ) const; void str(const basic_string<charT,traits,Alloc>& s); };
The basic_istringstream
class template is the base class for input string streams.
Typically, you would construct an istringstream
with a string argument and
then read from the string stream just as you would from any other
input stream.
The following are the methods of basic_istringstream
:
explicit
basic_istringstream
(ios_base::openmode
which
= ios_base::in)
Initializes an empty input string stream by constructing an internal
basic_stringbuf
object, passingwhich
|
ios_base::in
to that object’s constructor, and passing the address of the string buffer to the base-class constructor forbasic_istream
.explicit
basic_istringstream
(const
basic_string<charT,traits,Alloc>&
str, ios_base::openmode
which
=
ios_base::in)
Initializes ...
Get C++ In a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.