stdio_filebuf Class Template Reference

#include <ext/stdio_filebuf.h>

List of all members.


Detailed Description

template<typename CharT, typename Traits = std::char_traits<CharT>>
class __gnu_cxx::stdio_filebuf< CharT, Traits >

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.

Public Types

Public Member Functions


Constructor & Destructor Documentation

stdio_filebuf  )  [inline]
 

deferred initialization

Definition at line 68 of file stdio_filebuf.h.

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 ios_base::openmode.

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.

~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

int 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.

std::c_file* 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 Sun Jul 25 00:12:38 2004 for libstdc++ source by doxygen 1.3.7