Hugin trunk 0.1
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
vigra_ext::FileRAII Class Reference

Class used for opening files. More...

#include <FileRAII.h>

Public Member Functions

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

Private Member Functions

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

Private Attributes

FILEfile
 

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

◆ FileRAII() [1/2]

vigra_ext::FileRAII::FileRAII ( const char path,
const char mode 
)
inline

Open the specified file.

Parameters
pathpath to a file
modemode as defined by the fopen function

Definition at line 41 of file FileRAII.h.

References file, and threshold().

◆ ~FileRAII()

vigra_ext::FileRAII::~FileRAII ( )
inline

Definition at line 52 of file FileRAII.h.

References file, and threshold().

◆ FileRAII() [2/2]

vigra_ext::FileRAII::FileRAII ( const FileRAII )
private

Member Function Documentation

◆ get()

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

Get pointer to opened file.

Returns
FILE* pointer to the opened file.

Definition at line 79 of file FileRAII.h.

References file.

◆ operator=()

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

Member Data Documentation

◆ file

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: