__gnu_cxx::stdio_filebuf< _CharT, _Traits > Class Template Reference
Provides a layer of compatibility for C/POSIX.
More...
#include <ext/stdio_filebuf.h>
List of all members.
|
Public Member Functions |
| stdio_filebuf (int __fd, std::ios_base::openmode __mode, bool __del, int_type __size) |
| stdio_filebuf (std::__c_file *__f, std::ios_base::openmode __mode, int_type __size=static_cast< int_type >(BUFSIZ)) |
virtual | ~stdio_filebuf () |
int | fd () |
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 52 of file stdio_filebuf.h.
Constructor & Destructor Documentation
|
- Parameters:
-
| fd | An open file descriptor. |
| mode | Same meaning as in a standard filebuf. |
| del | Whether to close the file on destruction. |
| size | Optimal or preferred size of internal buffer, in bytes. |
This constructor associates a file stream buffer with an open POSIX file descriptor. Iff del is true, then the associated file will be closed when the stdio_filebuf is closed/destroyed.
Definition at line 119 of file stdio_filebuf.h. |
template<typename _CharT, typename _Traits> |
__gnu_cxx::stdio_filebuf< _CharT, _Traits >::stdio_filebuf |
( |
std::__c_file * |
__f, |
|
|
std::ios_base::openmode |
__mode, |
|
|
int_type |
__size = static_cast< int_type >(BUFSIZ) |
|
) |
|
|
|
- Parameters:
-
| f | An open FILE* . |
| mode | Same meaning as in a standard filebuf. |
| size | Optimal or preferred size of internal buffer, in bytes. 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 144 of file stdio_filebuf.h. |
|
Possibly closes the external data stream, in the case of the file descriptor constructor and del == true .
Definition at line 114 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 109 of file stdio_filebuf.h. |
The documentation for this class was generated from the following file:
Generated on Wed Sep 29 13:54:56 2004 for libstdc++-v3 Source by
1.3.7