BuildCache
Public Member Functions | Private Attributes | List of all members
bcache::file::tmp_file_t Class Reference

A helper class for handling temporary files and directories. More...

#include <file_utils.hpp>

Public Member Functions

 tmp_file_t (const std::string &dir, const std::string &extension)
 Construct a temporary file name. More...
 
 ~tmp_file_t ()
 Remove the temporary file or directory (if any).
 
const std::string & path () const
 

Private Attributes

std::string m_path
 

Detailed Description

A helper class for handling temporary files and directories.

When the temp file object is created, a temporary file name is generated. Once the object goes out of scope, it removes the file or directory from disk.

Constructor & Destructor Documentation

◆ tmp_file_t()

bcache::file::tmp_file_t::tmp_file_t ( const std::string &  dir,
const std::string &  extension 
)

Construct a temporary file name.

Parameters
dirThe base directory in which the temporary file will be located.
extensionThe file name extension (including the leading dot).

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