vigra_ext::FileRAII Class Reference

Class used for opening files. More...

#include <FileRAII.h>

List of all members.

Public Member Functions

 FileRAII (const char *path, const char *mode)
 Open the specified file.
 ~FileRAII ()
FILE * get ()
 Get pointer to opened file.

Private Member Functions

 FileRAII (const FileRAII &)
FileRAIIoperator= (const FileRAII &)

Private Attributes

FILE * file

Detailed Description

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.

Constructor & Destructor Documentation

vigra_ext::FileRAII::FileRAII ( const char *  path,
const char *  mode 
) [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.

vigra_ext::FileRAII::~FileRAII (  )  [inline]

Definition at line 52 of file FileRAII.h.

References file.

vigra_ext::FileRAII::FileRAII ( const FileRAII  )  [private]

Member Function Documentation

FILE* vigra_ext::FileRAII::get (  )  [inline]

Get pointer to opened file.

FILE* pointer to the opened file.

Definition at line 79 of file FileRAII.h.

References file.

FileRAII& vigra_ext::FileRAII::operator= ( const FileRAII  )  [private]

Member Data Documentation

FILE* vigra_ext::FileRAII::file [private]

Definition at line 85 of file FileRAII.h.

Referenced by FileRAII(), get(), and ~FileRAII().

The documentation for this class was generated from the following file:
Generated on 20 Apr 2018 for Hugintrunk by  doxygen 1.4.7