#include <system.hh>
Public Member Functions | |
auto_close () | |
auto_close (int fileno) | |
auto_close (FILE *stream) | |
void | close () |
void | detach () |
template<typename T > | |
T | handle () const |
void | reset (int fd) |
void | reset (FILE *stream) |
~auto_close () | |
Private Attributes | |
int | m_fileno |
FILE * | m_stream |
The C++ guard mechanism applied to file descriptors: when destroyed, an auto_close object releases the file descriptor it has been given at construction.
auto_close::auto_close | ( | int | fileno | ) | [explicit] |
auto_close::auto_close | ( | FILE * | stream | ) | [explicit] |
void auto_close::close | ( | ) |
void auto_close::detach | ( | ) |
int utilmm::auto_close::handle< int > | ( | ) | const |
Access to the file descriptor.
std::bad_cast | Raised if the required type is not the right file descriptor type (i.e. if handle<FILE> is calledd on a auto_close object created with an 'int' fd) |
void auto_close::reset | ( | int | fd | ) |
void auto_close::reset | ( | FILE * | stream | ) |
int utilmm::auto_close::m_fileno [private] |
FILE* utilmm::auto_close::m_stream [private] |