common_util
Loading...
Searching...
No Matches
Public Member Functions | List of all members
cutl::file_guard Class Reference

The file guard class to manage the FILE pointer automatically. file_guard object can close the FILE pointer automatically when his scope is exit. More...

#include <fileutil.h>

Public Member Functions

 file_guard (FILE *file)
 Construct a new file guard object.
 
 ~file_guard ()
 Destroy the file guard object.
 
FILE * getfd () const
 Get the FILE pointer.
 

Detailed Description

The file guard class to manage the FILE pointer automatically. file_guard object can close the FILE pointer automatically when his scope is exit.

Constructor & Destructor Documentation

◆ file_guard()

cutl::file_guard::file_guard ( FILE * file)
explicit

Construct a new file guard object.

Parameters
filethe pointer of the FILE object

Member Function Documentation

◆ getfd()

FILE * cutl::file_guard::getfd ( ) const

Get the FILE pointer.

Returns
FILE*

The documentation for this class was generated from the following file: