Hugintrunk
0.1
|
Class used for opening files. More...
#include <FileRAII.h>
Public Member Functions | |
FileRAII (const char *path, const char *mode) | |
Open the specified file. More... | |
~FileRAII () | |
FILE * | get () |
Get pointer to opened file. More... | |
Private Member Functions | |
FileRAII (const FileRAII &) | |
FileRAII & | operator= (const FileRAII &) |
Private Attributes | |
FILE * | file |
Class used for opening files.
File class using RAII (Resource Acquisition Is Initialization) technique. This ensures that the file is properly close even when an exception occurs.
Definition at line 33 of file FileRAII.h.
|
inline |
Open the specified file.
path | path to a file |
mode | mode as defined by the fopen function |
Definition at line 41 of file FileRAII.h.
References file.
|
inline |
Definition at line 52 of file FileRAII.h.
References file.
|
private |
|
inline |
Get pointer to opened file.
Definition at line 79 of file FileRAII.h.
References file.
|
private |
Definition at line 85 of file FileRAII.h.
Referenced by FileRAII(), get(), and ~FileRAII().