http://www.cplusplus.com/reference/sstream/stringstream/

std::stringstream

http://www.cplusplus.com/reference/sstream/stringstream/

typedef basic_stringstream<char> stringstream;
Input/output string stream

 

 


Stream class to operate on strings.

Objects of this class use a string buffer that contains a sequence of characters. This sequence of characters can be accessed directly as a string object, using member str.

Characters can be inserted and/or extracted from the stream using any operation allowed on both input and output streams.

This is an instantiation of basic_stringstream with the following template parameters:
template parameterdefinitioncomments
charT char Aliased as member char_type
traits char_traits<char> Aliased as member traits_type
Alloc allocator<char> Aliased as member allocator_type

Apart from the internal string buffer, objects of these classes keep a set of internal fields inherited from ios_baseios and istream:

 fieldmember functionsdescription
Formatting format flags flags
setf
unsetf
A set of internal flags that affect how certain input/output operations are interpreted or generated.
See member type fmtflags.
field width width Width of the next formatted element to insert.
display precision precision Decimal precision for the next floating-point value inserted.
locale getloc
imbue
The locale object used by the function for formatted input/output operations affected by localization properties.
fill character fill Character to pad a formatted field up to the field width (width).
State error state rdstate
setstate
clear
The current error state of the stream.
Individual values may be obtained by calling goodeoffail and bad.
See member type iostate.
exception mask exceptions The state flags for which a failure exception is thrown.
See member type iostate.
Other callback stack register_callback Stack of pointers to functions that are called when certain events occur.
extensible arrays iword
pword
xalloc
Internal arrays to store objects of type long and void*.
tied stream tie Pointer to output stream that is flushed before each i/o operation on this stream.
stream buffer rdbuf Pointer to the associated streambuf object, which is charge of all input/output operations.
character count gcount Count of characters read by last unformatted input operation.

Member types

The class declares the following member types:
member typedefinition
char_type char
traits_type char_traits<char>
allocator_type allocator<char>
int_type int
pos_type streampos
off_type streamoff
These member types are inherited from its base classes istreamostream and ios_base:

Public member functions


Public member functions inherited from istream


Public member functions inherited from ostream


Public member functions inherited from ios


Public member functions inherited from ios_base


Non-member function overloads

 

 
 
posted @ 2021-02-24 09:41  py2020  阅读(159)  评论(4)    收藏  举报