vg
tools for working with variation graphs
Classes | Functions | Variables
vg::temp_file Namespace Reference

Classes

struct  Handler
 

Functions

string create (const string &base)
 Create a temporary file starting with the given base name. More...
 
string create ()
 Create a temporary file. More...
 
void remove (const string &filename)
 Remove a temporary file. More...
 
void set_dir (const string &new_temp_dir)
 Set a temp dir, overriding system defaults and environment variables. More...
 
string get_dir ()
 Get the current temp dir. More...
 

Variables

recursive_mutex monitor
 
string temp_dir
 
struct vg::temp_file::Handler handler
 

Detailed Description

Temporary files. Create with create() and remove with remove(). All temporary files will be deleted when the program exits normally or with std::exit(). The files will be created in a directory determined from environment variables, though this can be overridden with set_dir(). The interface is thread-safe.

Function Documentation

◆ create() [1/2]

string vg::temp_file::create ( )

Create a temporary file.

◆ create() [2/2]

string vg::temp_file::create ( const string &  base)

Create a temporary file starting with the given base name.

◆ get_dir()

string vg::temp_file::get_dir ( )

Get the current temp dir.

◆ remove()

void vg::temp_file::remove ( const string &  filename)

Remove a temporary file.

◆ set_dir()

void vg::temp_file::set_dir ( const string &  new_temp_dir)

Set a temp dir, overriding system defaults and environment variables.

Variable Documentation

◆ handler

struct vg::temp_file::Handler vg::temp_file::handler

◆ monitor

recursive_mutex vg::temp_file::monitor

◆ temp_dir

string vg::temp_file::temp_dir