std::basic_istream< _CharT, _Traits > Class Template Reference

Controlling input. More...

Inheritance diagram for std::basic_istream< _CharT, _Traits >:

std::basic_ios< _CharT, _Traits > std::ios_base std::basic_ifstream< _CharT, _Traits > std::basic_iostream< _CharT, _Traits > std::basic_istringstream< _CharT, _Traits, _Alloc > std::basic_fstream< _CharT, _Traits > std::basic_stringstream< _CharT, _Traits, _Alloc > List of all members.

Public Types

typedef _CharT char_type
typedef _Traits::int_type int_type
typedef _Traits::pos_type pos_type
typedef _Traits::off_type off_type
typedef _Traits traits_type
typedef basic_streambuf< _CharT,
_Traits > 
__streambuf_type
typedef basic_ios< _CharT,
_Traits > 
__ios_type
typedef basic_istream< _CharT,
_Traits > 
__istream_type
typedef num_get< _CharT, istreambuf_iterator<
_CharT, _Traits > > 
__num_get_type
typedef ctype< _CharT > __ctype_type

Public Member Functions

 basic_istream (__streambuf_type *__sb)
 Base constructor.
virtual ~basic_istream ()
 Base destructor.
streamsize gcount () const
 Character counting.
__istream_typeoperator>> (__istream_type &(*__pf)(__istream_type &))
 Interface for manipulators.
__istream_typeoperator>> (__ios_type &(*__pf)(__ios_type &))
__istream_typeoperator>> (ios_base &(*__pf)(ios_base &))
Arithmetic Extractors
All the operator>> functions (aka formatted input functions) have some common behavior. Each starts by constructing a temporary object of type std::basic_istream::sentry with the second argument (noskipws) set to false. This has several effects, concluding with the setting of a status flag; see the sentry documentation for more.

If the sentry status is good, the function tries to extract whatever data is appropriate for the type of the argument.

If an exception is thrown during extraction, ios_base::badbit will be turned on in the stream's error state without causing an ios_base::failure to be thrown. The original exception will then be rethrown.

__istream_typeoperator>> (bool &__n)
 Basic arithmetic extractors.
__istream_typeoperator>> (short &__n)
__istream_typeoperator>> (unsigned short &__n)
__istream_typeoperator>> (int &__n)
__istream_typeoperator>> (unsigned int &__n)
__istream_typeoperator>> (long &__n)
__istream_typeoperator>> (unsigned long &__n)
__istream_typeoperator>> (float &__f)
__istream_typeoperator>> (double &__f)
__istream_typeoperator>> (long double &__f)
__istream_typeoperator>> (void *&__p)
__istream_typeoperator>> (__streambuf_type *__sb)
 Extracting into another streambuf.
Unformatted Input Functions
All the unformatted input functions have some common behavior. Each starts by constructing a temporary object of type std::basic_istream::sentry with the second argument (noskipws) set to true. This has several effects, concluding with the setting of a status flag; see the sentry documentation for more.

If the sentry status is good, the function tries to extract whatever data is appropriate for the type of the argument.

The number of characters extracted is stored for later retrieval by gcount().

If an exception is thrown during extraction, ios_base::badbit will be turned on in the stream's error state without causing an ios_base::failure to be thrown. The original exception will then be rethrown.

int_type get ()
 Simple extraction.
__istream_typeget (char_type &__c)
 Simple extraction.
__istream_typeget (char_type *__s, streamsize __n, char_type __delim)
 Simple multiple-character extraction.
__istream_typeget (char_type *__s, streamsize __n)
 Simple multiple-character extraction.
__istream_typeget (__streambuf_type &__sb, char_type __delim)
 Extraction into another streambuf.
__istream_typeget (__streambuf_type &__sb)
 Extraction into another streambuf.
__istream_typegetline (char_type *__s, streamsize __n, char_type __delim)
 String extraction.
__istream_typegetline (char_type *__s, streamsize __n)
 String extraction.
__istream_typeignore ()
 Discarding characters.
__istream_typeignore (streamsize __n)
__istream_typeignore (streamsize __n, int_type __delim)
int_type peek ()
 Looking ahead in the stream.
__istream_typeread (char_type *__s, streamsize __n)
 Extraction without delimiters.
streamsize readsome (char_type *__s, streamsize __n)
 Extraction until the buffer is exhausted, but no more.
__istream_typeputback (char_type __c)
 Unextracting a single character.
__istream_typeunget ()
 Unextracting the previous character.
int sync ()
 Synchronizing the stream buffer.
pos_type tellg ()
 Getting the current read position.
__istream_typeseekg (pos_type)
 Changing the current read position.
__istream_typeseekg (off_type, ios_base::seekdir)
 Changing the current read position.

Protected Member Functions

 basic_istream ()

Protected Attributes

streamsize _M_gcount

Friends

class sentry
template<typename _CharT2, typename _Traits2>
basic_istream< _CharT2, _Traits2 > & operator>> (basic_istream< _CharT2, _Traits2 > &, _CharT2 &)
template<typename _CharT2, typename _Traits2>
basic_istream< _CharT2, _Traits2 > & operator>> (basic_istream< _CharT2, _Traits2 > &, _CharT2 *)

Classes

class  sentry
 Performs setup work for input streams. More...

Detailed Description

template<typename _CharT, typename _Traits>
class std::basic_istream< _CharT, _Traits >

Controlling input.

This is the base class for all input streams. It provides text formatting of all builtin types, and communicates with any class derived from basic_streambuf to do the actual input.

Definition at line 58 of file istream.


Member Typedef Documentation

template<typename _CharT, typename _Traits>
typedef ctype<_CharT> std::basic_istream< _CharT, _Traits >::__ctype_type

Reimplemented from std::basic_ios< _CharT, _Traits >.

Definition at line 74 of file istream.

template<typename _CharT, typename _Traits>
typedef basic_ios<_CharT, _Traits> std::basic_istream< _CharT, _Traits >::__ios_type

Reimplemented in std::basic_fstream< _CharT, _Traits >.

Definition at line 70 of file istream.

template<typename _CharT, typename _Traits>
typedef basic_istream<_CharT, _Traits> std::basic_istream< _CharT, _Traits >::__istream_type

Reimplemented in std::basic_ifstream< _CharT, _Traits >, std::basic_iostream< _CharT, _Traits >, std::basic_istringstream< _CharT, _Traits, _Alloc >, and std::basic_iostream< char >.

Definition at line 71 of file istream.

template<typename _CharT, typename _Traits>
typedef num_get<_CharT, istreambuf_iterator<_CharT, _Traits> > std::basic_istream< _CharT, _Traits >::__num_get_type

Reimplemented from std::basic_ios< _CharT, _Traits >.

Definition at line 73 of file istream.

template<typename _CharT, typename _Traits>
typedef basic_streambuf<_CharT, _Traits> std::basic_istream< _CharT, _Traits >::__streambuf_type

Definition at line 69 of file istream.

template<typename _CharT, typename _Traits>
typedef _CharT std::basic_istream< _CharT, _Traits >::char_type

These are standard types. They permit a standardized way of referring to names of (or names dependant on) the template parameters, which are specific to the implementation.

Reimplemented from std::basic_ios< _CharT, _Traits >.

Reimplemented in std::strstream, std::basic_ifstream< _CharT, _Traits >, std::basic_fstream< _CharT, _Traits >, std::basic_iostream< _CharT, _Traits >, std::basic_istringstream< _CharT, _Traits, _Alloc >, std::basic_stringstream< _CharT, _Traits, _Alloc >, and std::basic_iostream< char >.

Definition at line 62 of file istream.

template<typename _CharT, typename _Traits>
typedef _Traits::int_type std::basic_istream< _CharT, _Traits >::int_type

Reimplemented from std::basic_ios< _CharT, _Traits >.

Reimplemented in std::strstream, std::basic_ifstream< _CharT, _Traits >, std::basic_fstream< _CharT, _Traits >, std::basic_iostream< _CharT, _Traits >, std::basic_istringstream< _CharT, _Traits, _Alloc >, std::basic_stringstream< _CharT, _Traits, _Alloc >, and std::basic_iostream< char >.

Definition at line 63 of file istream.

template<typename _CharT, typename _Traits>
typedef _Traits::off_type std::basic_istream< _CharT, _Traits >::off_type

Reimplemented from std::basic_ios< _CharT, _Traits >.

Reimplemented in std::strstream, std::basic_ifstream< _CharT, _Traits >, std::basic_fstream< _CharT, _Traits >, std::basic_iostream< _CharT, _Traits >, std::basic_istringstream< _CharT, _Traits, _Alloc >, std::basic_stringstream< _CharT, _Traits, _Alloc >, and std::basic_iostream< char >.

Definition at line 65 of file istream.

template<typename _CharT, typename _Traits>
typedef _Traits::pos_type std::basic_istream< _CharT, _Traits >::pos_type

Reimplemented from std::basic_ios< _CharT, _Traits >.

Reimplemented in std::strstream, std::basic_ifstream< _CharT, _Traits >, std::basic_fstream< _CharT, _Traits >, std::basic_iostream< _CharT, _Traits >, std::basic_istringstream< _CharT, _Traits, _Alloc >, std::basic_stringstream< _CharT, _Traits, _Alloc >, and std::basic_iostream< char >.

Definition at line 64 of file istream.

template<typename _CharT, typename _Traits>
typedef _Traits std::basic_istream< _CharT, _Traits >::traits_type

Reimplemented from std::basic_ios< _CharT, _Traits >.

Reimplemented in std::basic_ifstream< _CharT, _Traits >, std::basic_fstream< _CharT, _Traits >, std::basic_iostream< _CharT, _Traits >, std::basic_istringstream< _CharT, _Traits, _Alloc >, std::basic_stringstream< _CharT, _Traits, _Alloc >, and std::basic_iostream< char >.

Definition at line 66 of file istream.


Constructor & Destructor Documentation

template<typename _CharT, typename _Traits>
std::basic_istream< _CharT, _Traits >::basic_istream ( __streambuf_type __sb  )  [inline, explicit]

Base constructor.

This ctor is almost never called by the user directly, rather from derived classes' initialization lists, which pass a pointer to their own stream buffer.

Definition at line 104 of file istream.

template<typename _CharT, typename _Traits>
virtual std::basic_istream< _CharT, _Traits >::~basic_istream (  )  [inline, virtual]

Base destructor.

This does very little apart from providing a virtual base dtor.

Definition at line 113 of file istream.

template<typename _CharT, typename _Traits>
std::basic_istream< _CharT, _Traits >::basic_istream (  )  [inline, explicit, protected]

Definition at line 574 of file istream.


Member Function Documentation

template<typename _CharT, typename _Traits>
streamsize std::basic_istream< _CharT, _Traits >::gcount (  )  const [inline]

Character counting.

Returns:
The number of characters extracted by the previous unformatted input function dispatched for this stream.

Definition at line 240 of file istream.

template<typename _CharT, typename _Traits>
__istream_type& std::basic_istream< _CharT, _Traits >::get ( __streambuf_type __sb  )  [inline]

Extraction into another streambuf.

Parameters:
sb A streambuf in which to store data.
Returns:
*this
Returns get(sb,widen('
')).

Definition at line 357 of file istream.

template<typename _CharT, typename _Traits>
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::get ( __streambuf_type __sb,
char_type  __delim 
)

Extraction into another streambuf.

Parameters:
sb A streambuf in which to store data.
delim A "stop" character.
Returns:
*this
Characters are extracted and inserted into sb until one of the following happens:

If no characters are stored, failbit is set in the stream's error state.

Definition at line 550 of file istream.tcc.

References std::basic_istream< _CharT, _Traits >::_M_gcount, std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_ios< _CharT, _Traits >::setstate(), std::basic_streambuf< _CharT, _Traits >::sgetc(), std::basic_streambuf< _CharT, _Traits >::snextc(), and std::basic_streambuf< _CharT, _Traits >::sputc().

template<typename _CharT, typename _Traits>
__istream_type& std::basic_istream< _CharT, _Traits >::get ( char_type __s,
streamsize  __n 
) [inline]

Simple multiple-character extraction.

Parameters:
s Pointer to an array.
n Maximum number of characters to store in s.
Returns:
*this
Returns get(s,n,widen('
')).

Definition at line 324 of file istream.

template<typename _CharT, typename _Traits>
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::get ( char_type __s,
streamsize  __n,
char_type  __delim 
)

Simple multiple-character extraction.

Parameters:
s Pointer to an array.
n Maximum number of characters to store in s.
delim A "stop" character.
Returns:
*this
Characters are extracted and stored into s until one of the following happens:

If no characters are stored, failbit is set in the stream's error state.

In any case, a null character is stored into the next location in the array.

Note:
This function is not overloaded on signed char and unsigned char.

Definition at line 508 of file istream.tcc.

References std::basic_istream< _CharT, _Traits >::_M_gcount, std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_ios< _CharT, _Traits >::setstate(), std::basic_streambuf< _CharT, _Traits >::sgetc(), and std::basic_streambuf< _CharT, _Traits >::snextc().

template<typename _CharT, typename _Traits>
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::get ( char_type __c  ) 

Simple extraction.

Parameters:
c The character in which to store data.
Returns:
*this
Tries to extract a character and store it in c. If none are available, sets failbit and returns traits::eof().

Note:
This function is not overloaded on signed char and unsigned char.

Definition at line 476 of file istream.tcc.

References std::basic_istream< _CharT, _Traits >::_M_gcount, std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().

template<typename _CharT, typename _Traits>
basic_istream< _CharT, _Traits >::int_type std::basic_istream< _CharT, _Traits >::get (  ) 

Simple extraction.

Returns:
A character, or eof().
Tries to extract a character. If none are available, sets failbit and returns traits::eof().

Definition at line 445 of file istream.tcc.

References std::basic_istream< _CharT, _Traits >::_M_gcount, std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().

Referenced by std::basic_istream< char >::get().

template<typename _CharT, typename _Traits>
__istream_type& std::basic_istream< _CharT, _Traits >::getline ( char_type __s,
streamsize  __n 
) [inline]

String extraction.

Parameters:
s A character array in which to store the data.
n Maximum number of characters to extract.
Returns:
*this
Returns getline(s,n,widen('
')).

Definition at line 397 of file istream.

template<typename _CharT, typename _Traits>
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::getline ( char_type __s,
streamsize  __n,
char_type  __delim 
)

String extraction.

Parameters:
s A character array in which to store the data.
n Maximum number of characters to extract.
delim A "stop" character.
Returns:
*this
Extracts and stores characters into s until one of the following happens. Note that these criteria are required to be tested in the order listed here, to allow an input line to exactly fill the s array without setting failbit.

  1. the input sequence reaches end-of-file, in which case eofbit is set in the stream error state
  2. the next character equals delim, in which case the character is extracted (and therefore counted in gcount()) but not stored
  3. n-1 characters are stored, in which case failbit is set in the stream error state

If no characters are extracted, failbit is set. (An empty line of input should therefore not cause failbit to be set.)

In any case, a null character is stored in the next location in the array.

Definition at line 589 of file istream.tcc.

References std::basic_istream< _CharT, _Traits >::_M_gcount, std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_streambuf< _CharT, _Traits >::sbumpc(), std::basic_ios< _CharT, _Traits >::setstate(), std::basic_streambuf< _CharT, _Traits >::sgetc(), and std::basic_streambuf< _CharT, _Traits >::snextc().

Referenced by std::basic_istream< char >::getline().

template<typename _CharT, typename _Traits>
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::ignore ( streamsize  __n,
int_type  __delim 
)

Definition at line 728 of file istream.tcc.

References std::basic_istream< _CharT, _Traits >::_M_gcount, std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::goodbit, std::max(), std::min(), std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_streambuf< _CharT, _Traits >::sbumpc(), std::basic_ios< _CharT, _Traits >::setstate(), std::basic_streambuf< _CharT, _Traits >::sgetc(), and std::basic_streambuf< _CharT, _Traits >::snextc().

template<typename _CharT, typename _Traits>
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::ignore ( streamsize  __n  ) 

Definition at line 672 of file istream.tcc.

References std::basic_istream< _CharT, _Traits >::_M_gcount, std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::goodbit, std::max(), std::min(), std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_ios< _CharT, _Traits >::setstate(), std::basic_streambuf< _CharT, _Traits >::sgetc(), and std::basic_streambuf< _CharT, _Traits >::snextc().

template<typename _CharT, typename _Traits>
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::ignore (  ) 

Discarding characters.

Parameters:
n Number of characters to discard.
delim A "stop" character.
Returns:
*this
Extracts characters and throws them away until one of the following happens:

NB: Provide three overloads, instead of the single function (with defaults) mandated by the Standard: this leads to a better performing implementation, while still conforming to the Standard.

Definition at line 644 of file istream.tcc.

References std::basic_istream< _CharT, _Traits >::_M_gcount, std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_streambuf< _CharT, _Traits >::sbumpc(), and std::basic_ios< _CharT, _Traits >::setstate().

template<typename _CharT, typename _Traits>
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::operator>> ( __streambuf_type __sb  ) 

Extracting into another streambuf.

Parameters:
sb A pointer to a streambuf
This function behaves like one of the basic arithmetic extractors, in that it also constructs a sentry object and has the same error handling behavior.

If sb is NULL, the stream will set failbit in its error state.

Characters are extracted from this stream and inserted into the sb streambuf until one of the following occurs:

If the function inserts no characters, failbit is set.

Definition at line 421 of file istream.tcc.

References std::__copy_streambufs(), std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::failbit, std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::setstate().

template<typename _CharT, typename _Traits>
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::operator>> ( void *&  __p  ) 

Definition at line 399 of file istream.tcc.

References std::__check_facet(), std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::num_get< _CharT, _InIter >::get(), std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::setstate().

template<typename _CharT, typename _Traits>
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::operator>> ( long double &  __f  ) 

Definition at line 377 of file istream.tcc.

References std::__check_facet(), std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::num_get< _CharT, _InIter >::get(), std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::setstate().

template<typename _CharT, typename _Traits>
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::operator>> ( double &  __f  ) 

Definition at line 355 of file istream.tcc.

References std::__check_facet(), std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::num_get< _CharT, _InIter >::get(), std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::setstate().

template<typename _CharT, typename _Traits>
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::operator>> ( float &  __f  ) 

Definition at line 333 of file istream.tcc.

References std::__check_facet(), std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::num_get< _CharT, _InIter >::get(), std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::setstate().

template<typename _CharT, typename _Traits>
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::operator>> ( unsigned long &  __n  ) 

Definition at line 265 of file istream.tcc.

References std::__check_facet(), std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::num_get< _CharT, _InIter >::get(), std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::setstate().

template<typename _CharT, typename _Traits>
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::operator>> ( long &  __n  ) 

Definition at line 243 of file istream.tcc.

References std::__check_facet(), std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::num_get< _CharT, _InIter >::get(), std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::setstate().

template<typename _CharT, typename _Traits>
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::operator>> ( unsigned int &  __n  ) 

Definition at line 221 of file istream.tcc.

References std::__check_facet(), std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::num_get< _CharT, _InIter >::get(), std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::setstate().

template<typename _CharT, typename _Traits>
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::operator>> ( int &  __n  ) 

Definition at line 190 of file istream.tcc.

References std::__check_facet(), std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::failbit, std::num_get< _CharT, _InIter >::get(), std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::setstate().

template<typename _CharT, typename _Traits>
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::operator>> ( unsigned short &  __n  ) 

Definition at line 168 of file istream.tcc.

References std::__check_facet(), std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::num_get< _CharT, _InIter >::get(), std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::setstate().

template<typename _CharT, typename _Traits>
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::operator>> ( short &  __n  ) 

Definition at line 137 of file istream.tcc.

References std::__check_facet(), std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::failbit, std::num_get< _CharT, _InIter >::get(), std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::setstate().

template<typename _CharT, typename _Traits>
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::operator>> ( bool &  __n  ) 

Basic arithmetic extractors.

Parameters:
A variable of builtin type.
Returns:
*this if successful
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.

Definition at line 115 of file istream.tcc.

References std::__check_facet(), std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::num_get< _CharT, _InIter >::get(), std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::setstate().

template<typename _CharT, typename _Traits>
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::operator>> ( ios_base &(*)(ios_base &)  __pf  )  [inline]

Definition at line 106 of file istream.tcc.

template<typename _CharT, typename _Traits>
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::operator>> ( __ios_type &(*)(__ios_type &)  __pf  )  [inline]

Definition at line 97 of file istream.tcc.

template<typename _CharT, typename _Traits>
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::operator>> ( __istream_type &(*)(__istream_type &)  __pf  )  [inline]

Interface for manipulators.

Manuipulators such as std::ws and std::dec use these functions in constructs like "std::cin >> std::ws". For more information, see the iomanip header.

Definition at line 91 of file istream.tcc.

template<typename _CharT, typename _Traits>
basic_istream< _CharT, _Traits >::int_type std::basic_istream< _CharT, _Traits >::peek (  ) 

Looking ahead in the stream.

Returns:
The next character, or eof().
If, after constructing the sentry object, good() is false, returns traits::eof(). Otherwise reads but does not extract the next input character.

Definition at line 786 of file istream.tcc.

References std::basic_istream< _CharT, _Traits >::_M_gcount, std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().

template<typename _CharT, typename _Traits>
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::putback ( char_type  __c  ) 

Unextracting a single character.

Parameters:
c The character to push back into the input stream.
Returns:
*this
If rdbuf() is not null, calls rdbuf()->sputbackc(c).

If rdbuf() is null or if sputbackc() fails, sets badbit in the error state.

Note:
Since no characters are extracted, the next call to gcount() will return 0, as required by DR 60.

Definition at line 862 of file istream.tcc.

References std::basic_istream< _CharT, _Traits >::_M_gcount, std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_ios< _CharT, _Traits >::setstate(), and std::basic_streambuf< _CharT, _Traits >::sputbackc().

Referenced by std::operator>>().

template<typename _CharT, typename _Traits>
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::read ( char_type __s,
streamsize  __n 
)

Extraction without delimiters.

Parameters:
s A character array.
n Maximum number of characters to store.
Returns:
*this
If the stream state is good(), extracts characters and stores them into s until one of the following happens:

Note:
This function is not overloaded on signed char and unsigned char.

Definition at line 811 of file istream.tcc.

References std::basic_istream< _CharT, _Traits >::_M_gcount, std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().

template<typename _CharT, typename _Traits>
streamsize std::basic_istream< _CharT, _Traits >::readsome ( char_type __s,
streamsize  __n 
)

Extraction until the buffer is exhausted, but no more.

Parameters:
s A character array.
n Maximum number of characters to store.
Returns:
The number of characters extracted.
Extracts characters and stores them into s depending on the number of characters remaining in the streambuf's buffer, rdbuf()->in_avail(), called A here:

The goal is to empty the current buffer, and to not request any more from the external input sequence controlled by the streambuf.

Definition at line 835 of file istream.tcc.

References std::basic_istream< _CharT, _Traits >::_M_gcount, std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::goodbit, std::min(), std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().

template<typename _CharT, typename _Traits>
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::seekg ( off_type  ,
ios_base::seekdir   
)

Changing the current read position.

Parameters:
off A file offset object.
dir The direction in which to seek.
Returns:
*this
If fail() is not true, calls rdbuf()->pubseekoff(off,dir). If that function fails, sets failbit.

Note:
This function does not count the number of characters extracted, if any, and therefore does not affect the next call to gcount().

Definition at line 995 of file istream.tcc.

References std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::failbit, std::ios_base::goodbit, std::ios_base::in, and std::basic_ios< _CharT, _Traits >::setstate().

template<typename _CharT, typename _Traits>
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::seekg ( pos_type   ) 

Changing the current read position.

Parameters:
pos A file position object.
Returns:
*this
If fail() is not true, calls rdbuf()->pubseekpos(pos). If that function fails, sets failbit.

Note:
This function does not count the number of characters extracted, if any, and therefore does not affect the next call to gcount().

Definition at line 967 of file istream.tcc.

References std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::failbit, std::ios_base::goodbit, std::ios_base::in, and std::basic_ios< _CharT, _Traits >::setstate().

template<typename _CharT, typename _Traits>
int std::basic_istream< _CharT, _Traits >::sync (  ) 

Synchronizing the stream buffer.

Returns:
0 on success, -1 on failure
If rdbuf() is a null pointer, returns -1.

Otherwise, calls rdbuf()->pubsync(), and if that returns -1, sets badbit and returns -1.

Otherwise, returns 0.

Note:
This function does not count the number of characters extracted, if any, and therefore does not affect the next call to gcount().

Definition at line 918 of file istream.tcc.

References std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::goodbit, std::basic_streambuf< _CharT, _Traits >::pubsync(), std::basic_ios< _CharT, _Traits >::rdbuf(), and std::basic_ios< _CharT, _Traits >::setstate().

template<typename _CharT, typename _Traits>
basic_istream< _CharT, _Traits >::pos_type std::basic_istream< _CharT, _Traits >::tellg (  ) 

Getting the current read position.

Returns:
A file position object.
If fail() is not false, returns pos_type(-1) to indicate failure. Otherwise returns rdbuf()->pubseekoff(0,cur,in).

Note:
This function does not count the number of characters extracted, if any, and therefore does not affect the next call to gcount().

Definition at line 949 of file istream.tcc.

References std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::cur, and std::ios_base::in.

template<typename _CharT, typename _Traits>
basic_istream< _CharT, _Traits > & std::basic_istream< _CharT, _Traits >::unget (  ) 

Unextracting the previous character.

Returns:
*this
If rdbuf() is not null, calls rdbuf()->sungetc(c).

If rdbuf() is null or if sungetc() fails, sets badbit in the error state.

Note:
Since no characters are extracted, the next call to gcount() will return 0, as required by DR 60.

Definition at line 890 of file istream.tcc.

References std::basic_istream< _CharT, _Traits >::_M_gcount, std::basic_ios< _CharT, _Traits >::_M_setstate(), std::ios_base::badbit, std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_ios< _CharT, _Traits >::setstate(), and std::basic_streambuf< _CharT, _Traits >::sungetc().


Friends And Related Function Documentation

template<typename _CharT, typename _Traits>
template<typename _CharT2, typename _Traits2>
basic_istream<_CharT2, _Traits2>& operator>> ( basic_istream< _CharT2, _Traits2 > &  ,
_CharT2 *   
) [friend]

template<typename _CharT, typename _Traits>
template<typename _CharT2, typename _Traits2>
basic_istream<_CharT2, _Traits2>& operator>> ( basic_istream< _CharT2, _Traits2 > &  ,
_CharT2 &   
) [friend]

template<typename _CharT, typename _Traits>
friend class sentry [friend]

Definition at line 117 of file istream.


Member Data Documentation

template<typename _CharT, typename _Traits>
streamsize std::basic_istream< _CharT, _Traits >::_M_gcount [protected]

Definition at line 92 of file istream.

Referenced by std::basic_istream< char >::gcount(), std::basic_istream< _CharT, _Traits >::get(), std::basic_istream< _CharT, _Traits >::getline(), std::basic_istream< _CharT, _Traits >::ignore(), std::basic_istream< _CharT, _Traits >::peek(), std::basic_istream< _CharT, _Traits >::putback(), std::basic_istream< _CharT, _Traits >::read(), std::basic_istream< _CharT, _Traits >::readsome(), std::basic_istream< _CharT, _Traits >::unget(), and std::basic_istream< char >::~basic_istream().


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 16:59:27 2010 for GNU C++ STL by  doxygen 1.4.7