__gnu_cxx::stdio_filebuf< _CharT, _Traits > Class Template Reference

Provides a layer of compatibility for C/POSIX. More...

#include <ext/stdio_filebuf.h>

Inheritance diagram for __gnu_cxx::stdio_filebuf< _CharT, _Traits >:

std::basic_filebuf< _CharT, _Traits > std::basic_streambuf< _CharT, _Traits > List of all members.

Public Types

typedef _CharT char_type
typedef _Traits traits_type
typedef traits_type::int_type int_type
typedef traits_type::pos_type pos_type
typedef traits_type::off_type off_type
typedef std::size_t size_t

Public Member Functions

 stdio_filebuf ()
 stdio_filebuf (int __fd, std::ios_base::openmode __mode, size_t __size=static_cast< size_t >(BUFSIZ))
 stdio_filebuf (std::__c_file *__f, std::ios_base::openmode __mode, size_t __size=static_cast< size_t >(BUFSIZ))
virtual ~stdio_filebuf ()
int fd ()
std::__c_filefile ()

Detailed Description

template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
class __gnu_cxx::stdio_filebuf< _CharT, _Traits >

Provides a layer of compatibility for C/POSIX.

This GNU extension provides extensions for working with standard C FILE*'s and POSIX file descriptors. It must be instantiated by the user with the type of character used in the file stream, e.g., stdio_filebuf<char>.

Definition at line 53 of file stdio_filebuf.h.


Member Typedef Documentation

template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
typedef _CharT __gnu_cxx::stdio_filebuf< _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_filebuf< _CharT, _Traits >.

Definition at line 57 of file stdio_filebuf.h.

template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
typedef traits_type::int_type __gnu_cxx::stdio_filebuf< _CharT, _Traits >::int_type
 

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

Definition at line 59 of file stdio_filebuf.h.

template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
typedef traits_type::off_type __gnu_cxx::stdio_filebuf< _CharT, _Traits >::off_type
 

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

Definition at line 61 of file stdio_filebuf.h.

template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
typedef traits_type::pos_type __gnu_cxx::stdio_filebuf< _CharT, _Traits >::pos_type
 

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

Definition at line 60 of file stdio_filebuf.h.

template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
typedef std::size_t __gnu_cxx::stdio_filebuf< _CharT, _Traits >::size_t
 

Definition at line 62 of file stdio_filebuf.h.

template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
typedef _Traits __gnu_cxx::stdio_filebuf< _CharT, _Traits >::traits_type
 

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

Definition at line 58 of file stdio_filebuf.h.


Constructor & Destructor Documentation

template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
__gnu_cxx::stdio_filebuf< _CharT, _Traits >::stdio_filebuf  )  [inline]
 

deferred initialization

Definition at line 68 of file stdio_filebuf.h.

template<typename _CharT, typename _Traits>
__gnu_cxx::stdio_filebuf< _CharT, _Traits >::stdio_filebuf int  __fd,
std::ios_base::openmode  __mode,
size_t  __size = static_cast< size_t >(BUFSIZ)
 

Parameters:
fd An open file descriptor.
mode Same meaning as in a standard filebuf.
size Optimal or preferred size of internal buffer, in chars.
This constructor associates a file stream buffer with an open POSIX file descriptor. The file descriptor will be automatically closed when the stdio_filebuf is closed/destroyed.

Definition at line 130 of file stdio_filebuf.h.

References std::basic_filebuf< _CharT, _Traits >::_M_allocate_internal_buffer(), std::basic_filebuf< _CharT, _Traits >::_M_set_buffer(), std::basic_filebuf< _CharT, _Traits >::is_open(), and std::ios_base::openmode.

template<typename _CharT, typename _Traits>
__gnu_cxx::stdio_filebuf< _CharT, _Traits >::stdio_filebuf std::__c_file __f,
std::ios_base::openmode  __mode,
size_t  __size = static_cast< size_t >(BUFSIZ)
 

Parameters:
f An open FILE*.
mode Same meaning as in a standard filebuf.
size Optimal or preferred size of internal buffer, in chars. Defaults to system's BUFSIZ.
This constructor associates a file stream buffer with an open C FILE*. The FILE* will not be automatically closed when the stdio_filebuf is closed/destroyed.

Definition at line 146 of file stdio_filebuf.h.

References std::__c_file, std::basic_filebuf< _CharT, _Traits >::_M_allocate_internal_buffer(), std::basic_filebuf< _CharT, _Traits >::_M_set_buffer(), std::basic_filebuf< _CharT, _Traits >::is_open(), and std::ios_base::openmode.

template<typename _CharT, typename _Traits>
__gnu_cxx::stdio_filebuf< _CharT, _Traits >::~stdio_filebuf  )  [virtual]
 

Closes the external data stream if the file descriptor constructor was used.

Definition at line 125 of file stdio_filebuf.h.


Member Function Documentation

template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
int __gnu_cxx::stdio_filebuf< _CharT, _Traits >::fd  )  [inline]
 

Returns:
The underlying file descriptor.
Once associated with an external data stream, this function can be used to access the underlying POSIX file descriptor. Note that there is no way for the library to track what you do with the descriptor, so be careful.

Definition at line 111 of file stdio_filebuf.h.

template<typename _CharT, typename _Traits = std::char_traits<_CharT>>
std::__c_file* __gnu_cxx::stdio_filebuf< _CharT, _Traits >::file  )  [inline]
 

Returns:
The underlying FILE*.
This function can be used to access the underlying "C" file pointer. Note that there is no way for the library to track what you do with the file, so be careful.

Definition at line 121 of file stdio_filebuf.h.


The documentation for this class was generated from the following file:
Generated on Tue Jan 30 17:32:03 2007 for GNU C++ STL by doxygen 1.3.6