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

Classes

struct  Handler
 

Functions

std::string create (const std::string &base)
 Create a temporary file starting with the given base name. More...
 
std::string create ()
 Create a temporary file. More...
 
void remove (const std::string &filename)
 Remove a temporary file. More...
 
void forget ()
 Forget about all current temporary files and directories without deleting them. More...
 
void set_dir (const std::string &new_temp_dir)
 Set a temp dir, overriding system defaults and environment variables. More...
 
std::string get_dir ()
 Get the current temp dir. More...
 

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]

std::string xg::temp_file::create ( )

Create a temporary file.

◆ create() [2/2]

std::string xg::temp_file::create ( const std::string &  base)

Create a temporary file starting with the given base name.

◆ forget()

void xg::temp_file::forget ( )

Forget about all current temporary files and directories without deleting them.

◆ get_dir()

std::string xg::temp_file::get_dir ( )

Get the current temp dir.

◆ remove()

void xg::temp_file::remove ( const std::string &  filename)

Remove a temporary file.

◆ set_dir()

void xg::temp_file::set_dir ( const std::string &  new_temp_dir)

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