libabigail
|
A temporary file. More...
#include <abg-tools-utils.h>
Public Member Functions | |
const char * | get_path () const |
Return the path to the temporary file. More... | |
std::fstream & | get_stream () |
Get the fstream to the temporary file. More... | |
bool | is_good () const |
Test if the temporary file has been created and is usable. More... | |
Static Public Member Functions | |
static temp_file_sptr | create () |
Create the temporary file and return it if it's usable. More... | |
A temporary file.
This is a helper file around the mkstemp API.
Once the temporary file is created, users can interact with it using an fstream. They can also get the path to the newly created temporary file.
When the instance of temp_file is destroyed, the underlying resources are de-allocated, the underlying temporary file is closed and removed.
Definition at line 182 of file abg-tools-utils.h.
|
static |
Create the temporary file and return it if it's usable.
Definition at line 1554 of file abg-tools-utils.cc.
const char * get_path | ( | ) | const |
Return the path to the temporary file.
Definition at line 1526 of file abg-tools-utils.cc.
std::fstream & get_stream | ( | ) |
Get the fstream to the temporary file.
Note that the current process is aborted if this member function is invoked on an instance of temp_file that is not usable. So please test that the instance is usable by invoking the temp_file::is_good() member function on it first.
Definition at line 1543 of file abg-tools-utils.cc.
bool is_good | ( | ) | const |
Test if the temporary file has been created and is usable.
Definition at line 1518 of file abg-tools-utils.cc.