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

RAII temporary directory. More...

#include <FileUtilities.h>

Collaboration diagram for xrpl::TempDir:

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 a file.

Private Attributes

std::filesystem::path path_

Detailed Description

RAII temporary directory.

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

Definition at line 43 of file FileUtilities.h.

Constructor & Destructor Documentation

◆ TempDir()

xrpl::TempDir::TempDir ( )

Construct a temporary directory.

Definition at line 110 of file libxrpl/basics/FileUtilities.cpp.

◆ ~TempDir()

xrpl::TempDir::~TempDir ( )

Destroy a temporary directory.

Definition at line 115 of file libxrpl/basics/FileUtilities.cpp.

Member Function Documentation

◆ path()

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

Get the native path for the temporary directory.

Definition at line 128 of file libxrpl/basics/FileUtilities.cpp.

◆ file()

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

Get the native path for a file.

The file does not need to exist.

Definition at line 134 of file libxrpl/basics/FileUtilities.cpp.

Member Data Documentation

◆ path_

std::filesystem::path xrpl::TempDir::path_
private

Definition at line 45 of file FileUtilities.h.