# std::basic_fstream< _CharT, _Traits > Class Template Reference

List of all members.

## Public Methods

| basic_fstream ()
| basic_fstream (const char *__s, ios_base::openmode __mode=ios_base::in|ios_base::out)
| Create an input/output stream. More...
__filebuf_type * | rdbuf () const
| Get a pointer to the file stream's buffer. More...
bool | is_open ()
| Query to see if file stream is open. More...
void | open (const char *__s, ios_base::openmode __mode=ios_base::in|ios_base::out)
| Specify a file to open for input and/or output. More...
void | close ()

## Detailed Description

### template<typename _CharT, typename _Traits>
class std::basic_fstream< _CharT, _Traits >

Derivation of general input/output streams, specific to files.

Definition at line 464 of file fstream.

## Constructor & Destructor Documentation

template<typename _CharT, typename _Traits>
std::basic_fstream< _CharT, _Traits >::basic_fstream | ( |  | ) | `[inline]`

| Default constructor. Create a file stream. Definition at line 485 of file fstream.

template<typename _CharT, typename _Traits>
std::basic_fstream< _CharT, _Traits >::basic_fstream | ( | const char * | __s,
|  | ios_base::openmode | __mode = ios_base::in | ios_base::out
| ) | `[inline, explicit]`

Create an input/output stream.

Parameters:

  s | Null terminated string specifying filename.
  mode | Open file in specified mode (see std::ios_base).

Tip: When using std::string to hold the filename, you must use .c_str() before passing it to this constructor.

Definition at line 498 of file fstream.

References std::basic_fstream< _CharT, _Traits >::open().

## Member Function Documentation

template<typename _CharT, typename _Traits>
void std::basic_fstream< _CharT, _Traits >::close | ( |  | ) | `[inline]`

| Close the file stream. Definition at line 543 of file fstream.

template<typename _CharT, typename _Traits>
bool std::basic_fstream< _CharT, _Traits >::is_open | ( |  | ) | `[inline]`

Query to see if file stream is open.

Returns:
  True if stream is open.

Definition at line 523 of file fstream.

template<typename _CharT, typename _Traits>
void std::basic_fstream< _CharT, _Traits >::open | ( | const char * | __s,
|  | ios_base::openmode | __mode = ios_base::in | ios_base::out
| ) | `[inline]`

Specify a file to open for input and/or output.

Parameters:

  s | Null terminated string specifying filename.
  mode | Mode in which to open file (see std::ios_base).

Tip: When using std::string to hold the filename, you must use .c_str() before passing it to this constructor.

Definition at line 534 of file fstream.

Referenced by std::basic_fstream< _CharT, _Traits >::basic_fstream().

template<typename _CharT, typename _Traits>
__filebuf_type* std::basic_fstream< _CharT, _Traits >::rdbuf | ( |  | ) | const`[inline]`

Get a pointer to the file stream's buffer.

Returns:
  Pointer to basic_filebuf.

Definition at line 515 of file fstream.

The documentation for this class was generated from the following file:

- fstream