|
| basic_ifstream () |
|
| basic_ifstream (basic_ifstream &&__rhs) |
|
template<typename _Path , typename _Require = _If_fs_path<_Path>> |
| basic_ifstream (const _Path &__s, ios_base::openmode __mode=ios_base::in) |
|
| basic_ifstream (const basic_ifstream &)=delete |
|
| basic_ifstream (const char *__s, ios_base::openmode __mode=ios_base::in) |
|
| basic_ifstream (const std::string &__s, ios_base::openmode __mode=ios_base::in) |
|
| ~basic_ifstream () |
|
template<typename _ValueT > |
basic_istream< _CharT, _Traits > & | _M_extract (_ValueT &__v) |
|
void | close () |
|
streamsize | gcount () const |
|
basic_istream< char > & | getline (char_type *__s, streamsize __n, char_type __delim) |
|
basic_istream< wchar_t > & | getline (char_type *__s, streamsize __n, char_type __delim) |
|
basic_istream< char > & | ignore (streamsize __n) |
|
basic_istream< wchar_t > & | ignore (streamsize __n) |
|
basic_istream< char > & | ignore (streamsize __n, int_type __delim) |
|
basic_istream< wchar_t > & | ignore (streamsize __n, int_type __delim) |
|
bool | is_open () |
|
bool | is_open () const |
|
template<typename _Path > |
_If_fs_path< _Path, void > | open (const _Path &__s, ios_base::openmode __mode=ios_base::in) |
|
void | open (const char *__s, ios_base::openmode __mode=ios_base::in) |
|
void | open (const std::string &__s, ios_base::openmode __mode=ios_base::in) |
|
basic_ifstream & | operator= (basic_ifstream &&__rhs) |
|
basic_ifstream & | operator= (const basic_ifstream &)=delete |
|
__istream_type & | operator>> (__streambuf_type *__sb) |
|
__istream_type & | operator>> (void *&__p) |
|
__filebuf_type * | rdbuf () const |
|
void | swap (basic_ifstream &__rhs) |
|
|
__istream_type & | operator>> (__istream_type &(*__pf)(__istream_type &)) |
|
__istream_type & | operator>> (__ios_type &(*__pf)(__ios_type &)) |
|
__istream_type & | operator>> (ios_base &(*__pf)(ios_base &)) |
|
|
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) and the original exception will be rethrown if badbit is set in the exceptions mask.
|
__istream_type & | operator>> (bool &__n) |
|
__istream_type & | operator>> (short &__n) |
|
__istream_type & | operator>> (unsigned short &__n) |
|
__istream_type & | operator>> (int &__n) |
|
__istream_type & | operator>> (unsigned int &__n) |
|
__istream_type & | operator>> (long &__n) |
|
__istream_type & | operator>> (unsigned long &__n) |
|
__istream_type & | operator>> (long long &__n) |
|
__istream_type & | operator>> (unsigned long long &__n) |
|
|
__istream_type & | operator>> (float &__f) |
|
__istream_type & | operator>> (double &__f) |
|
__istream_type & | operator>> (long double &__f) |
|
|
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) and the original exception will be rethrown if badbit is set in the exceptions mask.
|
int_type | get () |
|
__istream_type & | get (char_type &__c) |
|
__istream_type & | get (char_type *__s, streamsize __n, char_type __delim) |
|
__istream_type & | get (char_type *__s, streamsize __n) |
|
__istream_type & | get (__streambuf_type &__sb, char_type __delim) |
|
__istream_type & | get (__streambuf_type &__sb) |
|
__istream_type & | getline (char_type *__s, streamsize __n, char_type __delim) |
|
__istream_type & | getline (char_type *__s, streamsize __n) |
|
__istream_type & | ignore (streamsize __n, int_type __delim) |
|
__istream_type & | ignore (streamsize __n) |
|
__istream_type & | ignore () |
|
int_type | peek () |
|
__istream_type & | read (char_type *__s, streamsize __n) |
|
streamsize | readsome (char_type *__s, streamsize __n) |
|
__istream_type & | putback (char_type __c) |
|
__istream_type & | unget () |
|
int | sync () |
|
pos_type | tellg () |
|
__istream_type & | seekg (pos_type) |
|
__istream_type & | seekg (off_type, ios_base::seekdir) |
|
|
__istream_type & | operator>> (__istream_type &(*__pf)(__istream_type &)) |
|
__istream_type & | operator>> (__ios_type &(*__pf)(__ios_type &)) |
|
__istream_type & | operator>> (ios_base &(*__pf)(ios_base &)) |
|
|
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) and the original exception will be rethrown if badbit is set in the exceptions mask.
|
__istream_type & | operator>> (bool &__n) |
|
__istream_type & | operator>> (short &__n) |
|
__istream_type & | operator>> (unsigned short &__n) |
|
__istream_type & | operator>> (int &__n) |
|
__istream_type & | operator>> (unsigned int &__n) |
|
__istream_type & | operator>> (long &__n) |
|
__istream_type & | operator>> (unsigned long &__n) |
|
__istream_type & | operator>> (long long &__n) |
|
__istream_type & | operator>> (unsigned long long &__n) |
|
|
__istream_type & | operator>> (float &__f) |
|
__istream_type & | operator>> (double &__f) |
|
__istream_type & | operator>> (long double &__f) |
|
|
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) and the original exception will be rethrown if badbit is set in the exceptions mask.
|
int_type | get () |
|
__istream_type & | get (char_type &__c) |
|
__istream_type & | get (char_type *__s, streamsize __n, char_type __delim) |
|
__istream_type & | get (char_type *__s, streamsize __n) |
|
__istream_type & | get (__streambuf_type &__sb, char_type __delim) |
|
__istream_type & | get (__streambuf_type &__sb) |
|
__istream_type & | getline (char_type *__s, streamsize __n, char_type __delim) |
|
__istream_type & | getline (char_type *__s, streamsize __n) |
|
__istream_type & | ignore (streamsize __n, int_type __delim) |
|
__istream_type & | ignore (streamsize __n) |
|
__istream_type & | ignore () |
|
int_type | peek () |
|
__istream_type & | read (char_type *__s, streamsize __n) |
|
streamsize | readsome (char_type *__s, streamsize __n) |
|
__istream_type & | putback (char_type __c) |
|
__istream_type & | unget () |
|
int | sync () |
|
pos_type | tellg () |
|
__istream_type & | seekg (pos_type) |
|
__istream_type & | seekg (off_type, ios_base::seekdir) |
|
template<typename _CharT, typename _Traits>
class std::basic_ifstream< _CharT, _Traits >
Controlling input for files.
- Template Parameters
-
_CharT | Type of character stream. |
_Traits | Traits for character type, defaults to char_traits<_CharT>. |
This class supports reading from named files, using the inherited functions from std::basic_istream. To control the associated sequence, an instance of std::basic_filebuf is used, which this page refers to as sb
.
Definition at line 497 of file fstream.
template<typename _CharT , typename _Traits >
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:
- the input stream reaches end-of-file,
- insertion into the output buffer fails (in this case, the character that would have been inserted is not extracted), or
- an exception occurs (and in this case is caught)
If the function inserts no characters, failbit is set.
Definition at line 212 of file istream.tcc.