xrpld
Loading...
Searching...
No Matches
beast::TempDir Class Reference

RAII temporary directory. More...

#include <temp_dir.h>

Public Member Functions

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

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 14 of file temp_dir.h.

Constructor & Destructor Documentation

◆ TempDir()

beast::TempDir::TempDir ( )

Construct a temporary directory.

Definition at line 26 of file temp_dir.h.

◆ ~TempDir()

beast::TempDir::~TempDir ( )

Destroy a temporary directory.

Definition at line 37 of file temp_dir.h.

Member Function Documentation

◆ path()

std::string beast::TempDir::path ( ) const
nodiscard

Get the native path for the temporary directory.

Definition at line 47 of file temp_dir.h.

◆ file()

std::string beast::TempDir::file ( std::string const & name) const
nodiscard

Get the native path for the a file.

The file does not need to exist.

Definition at line 57 of file temp_dir.h.

Member Data Documentation

◆ path_

boost::filesystem::path beast::TempDir::path_
private

Definition at line 16 of file temp_dir.h.