
Typical usage:
void foo() { FILE* in = fopen(...); if (0 == in) { ... } // error handling CloseFile guard(in); ... // do something that might throw guard.release(); // take responsibility to close `in' in.close(); }
Definition at line 69 of file osbfileutil.h.
| OSB_LIB::CloseFile::CloseFile | ( | FILE * | file, | |
| bool | doClose = true | |||
| ) |
Constructor with file to protected and closure flag.
| OSB_LIB::CloseFile::CloseFile | ( | const CloseFile & | ) | [private] |
Prevent copying: not implemented.
| OSB_LIB::CloseFile::~CloseFile | ( | ) |
| bool OSB_LIB::CloseFile::doClose | ( | ) | const [inline] |
| bool OSB_LIB::CloseFile::release | ( | ) |
bool OSB_LIB::CloseFile::doClose_ [private] |
FILE* OSB_LIB::CloseFile::file_ [private] |
1.4.7