Native/C++

istream (Input stream class)

aucd29 2013. 10. 2. 19:01
Input stream class

Standard hierarchy

ios_base
--->
ios
--->
istream
--->
iostream
  --->
ifstream
  --->
istringstream

Public member functions:

istream members:
(constructor) Construct an object
operator>> Perform 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
putback Put the last character back to stream
read Read a block of data
readsome Read a block of data
seekg Set position of the get pointer
sync Syncronize stream's buffer with source of characters
tellg Get position of the get pointer
unget Make last character got from stream available again
(destructor) No-op [virtual]
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

istream provides member functions to assist in reading and interpreting input from a stream buffer. These members can be divided into two main groups:
Formatted input
These member functions extract formatted data that may be interpreted from a sequence of characters to any other type. All formatted input is done using the extraction operator (operator>>).
Unformatted input
Most of the other member functions of istream class are used to perform unformatted input, i.e. no interpretation is made on the characters got form input. These functions can get a dertermined number of characters from the input buffer (get, getline, peek, read, readsome), manipulate the get pointer (ignore, seekg, tellg, unget) or get information of last unformatted input operation (gcount).
  The input buffer may be syncronized with the external source of characters by calling member sync.

  Standard object cin is an instatiation of this class.