GClasses
GClasses::FileHolder Class Reference

Detailed Description

Closes a file when this object goes out of scope.

#include <GHolders.h>

Public Member Functions

 FileHolder ()
 
 FileHolder (FILE *pFile)
 
 ~FileHolder ()
 Close the file. More...
 
FILE * get ()
 Returns a pointer to the FILE being held. More...
 
FILE * release ()
 Releases the FILE (it is now your job to close it) and sets this holder to hold NULL. More...
 
void reset (FILE *pFile=NULL)
 Close the file and set this holder to hold NULL. More...
 

Constructor & Destructor Documentation

GClasses::FileHolder::FileHolder ( )
inline
GClasses::FileHolder::FileHolder ( FILE *  pFile)
inline
GClasses::FileHolder::~FileHolder ( )
inline

Close the file.

Member Function Documentation

FILE* GClasses::FileHolder::get ( )
inline

Returns a pointer to the FILE being held.

FILE* GClasses::FileHolder::release ( )
inline

Releases the FILE (it is now your job to close it) and sets this holder to hold NULL.

void GClasses::FileHolder::reset ( FILE *  pFile = NULL)

Close the file and set this holder to hold NULL.