본문 바로가기

Native/C++

stringstream (Input/output string stream class)

Input/output string stream class

Standard hierarchy

ios_base
--->
ios
--->
istream
--->
iostream
--->
stringstream
  --->
ostream
--->  

Public member functions:

stringstream members:
(constructor) Construct an object and optionally initizalize string content.
rdbuf Get the stringbuf object associated with the stream.
str Get/set string value.
members inherited from istream:
operator>> Performs a formatted input operation (extraction)
gcount Get number of characters extracted by last unformatted input operation
get Extract unformatted data from stream
getline Get a line from stream
ignore Extract and discard characters
peek Peek next character
read Read a block of data
readsome Read a block of data
putback Put the last character back to stream
unget Make last character got from stream available again
tellg Get position of the get pointer
seekg Set position of the get pointer
sync Syncronize stream's buffer with source of characters
members inherited from ostream:
operator<< Perform a formatted output operation (insertion).
flush Flush buffer.
put Put a single character into output stream.
seekp Set position of put pointer.
tellp Get position of put pointer.
write Write a sequence of characters.
members inherited from ios:
operator void * Convert stream to pointer.
operator ! evaluate stream object.
bad Check if an unrecoverable error has occurred.
clear Set control states.
copyfmt Copy formatting information.
eof Check if End-Of-File has been reached.
exceptions Get/set the exception mask.
fail Check if failure has occurred.
fill Get/set the fill character.
good Check if stream is good for i/o operations.
imbue Imbue locale.
narrow Narrow character.
rdbuf Get/set the associated streambuf object.
rdstate Get control state.
setstate Set control state.
tie Get/set the tied stream.
widen Widen character.
members inherited from ios_base:
flags Get/set format flags.
getloc Get current locale.
imbue Imbue locale.
iword Get reference to a long element of the internal extensible array.
precision Get/set floating-point decimal presision.
pword Get reference to a void* element of the internal extensible array.
register_callback Register event callback function.
setf Set some format flags.
sync_with_stdio Activates / Deactivates synchronization with cstdio functions. [static]
unsetf Clear format flag.
width Get/set field width.
xalloc Return a new index for the internal extensible array. [static]

Description

  stringstream class provides an interface to manipulate strings as if they were input/output streams.
  The objects of this class mantain internally a pointer to a stringbuf object that can be obtained/modified by calling member rdbuf. This streambuf-derived object stores a sequence of characters (string) that can be obtained/modified by calling member str.