rippled
Public Member Functions | Private Attributes | List of all members
beast::temp_dir Class Reference

RAII temporary directory. More...

Public Member Functions

 temp_dir ()
 Construct a temporary directory. More...
 
 ~temp_dir ()
 Destroy a temporary directory. More...
 
std::string path () const
 Get the native path for the temporary directory. More...
 
std::string file (std::string const &name) const
 Get the native path for the a file. More...
 

Private Attributes

boost::filesystem::path path_
 

Detailed Description

RAII temporary directory.

The directory and all its contents are deleted when the instance of temp_dir is destroyed.

Definition at line 33 of file temp_dir.h.

Constructor & Destructor Documentation

◆ temp_dir()

beast::temp_dir::temp_dir ( )

Construct a temporary directory.

Definition at line 45 of file temp_dir.h.

◆ ~temp_dir()

beast::temp_dir::~temp_dir ( )

Destroy a temporary directory.

Definition at line 56 of file temp_dir.h.

Member Function Documentation

◆ path()

std::string beast::temp_dir::path ( ) const

Get the native path for the temporary directory.

Definition at line 66 of file temp_dir.h.

◆ file()

std::string beast::temp_dir::file ( std::string const &  name) const

Get the native path for the a file.

The file does not need to exist.

Definition at line 76 of file temp_dir.h.

Member Data Documentation

◆ path_

boost::filesystem::path beast::temp_dir::path_
private

Definition at line 35 of file temp_dir.h.