xrpld
Loading...
Searching...
No Matches
xrpl::detail::FileDirGuard Class Reference

Write a file in a directory and remove when done. More...

#include <FileDirGuard.h>

Inheritance diagram for xrpl::detail::FileDirGuard:
Collaboration diagram for xrpl::detail::FileDirGuard:

Public Member Functions

 FileDirGuard (beast::unit_test::Suite &test, path subDir, path file, std::string const &contents, bool useCounter=true, bool create=true)
 ~FileDirGuard ()
path const & file () const
bool fileExists () const
path const & subdir () const

Protected Types

using path = boost::filesystem::path

Protected Member Functions

auto rmDir (path const &toRm)

Protected Attributes

path const file_
bool created_ = false
beast::unit_test::Suitetest_

Private Attributes

path subDir_
bool rmSubDir_ {false}

Detailed Description

Write a file in a directory and remove when done.

Definition at line 94 of file FileDirGuard.h.

Member Typedef Documentation

◆ path

using xrpl::detail::DirGuard::path = boost::filesystem::path
protectedinherited

Definition at line 19 of file FileDirGuard.h.

Constructor & Destructor Documentation

◆ FileDirGuard()

xrpl::detail::FileDirGuard::FileDirGuard ( beast::unit_test::Suite & test,
path subDir,
path file,
std::string const & contents,
bool useCounter = true,
bool create = true )

Definition at line 101 of file FileDirGuard.h.

◆ ~FileDirGuard()

xrpl::detail::FileDirGuard::~FileDirGuard ( )

Definition at line 125 of file FileDirGuard.h.

Member Function Documentation

◆ file()

path const & xrpl::detail::FileDirGuard::file ( ) const
nodiscard

Definition at line 151 of file FileDirGuard.h.

◆ fileExists()

bool xrpl::detail::FileDirGuard::fileExists ( ) const
nodiscard

Definition at line 157 of file FileDirGuard.h.

◆ rmDir()

auto xrpl::detail::DirGuard::rmDir ( path const & toRm)
protectedinherited

Definition at line 29 of file FileDirGuard.h.

◆ subdir()

path const & xrpl::detail::DirGuard::subdir ( ) const
nodiscardinherited

Definition at line 85 of file FileDirGuard.h.

Member Data Documentation

◆ file_

path const xrpl::detail::FileDirGuard::file_
protected

Definition at line 97 of file FileDirGuard.h.

◆ created_

bool xrpl::detail::FileDirGuard::created_ = false
protected

Definition at line 98 of file FileDirGuard.h.

◆ subDir_

path xrpl::detail::DirGuard::subDir_
privateinherited

Definition at line 22 of file FileDirGuard.h.

◆ rmSubDir_

bool xrpl::detail::DirGuard::rmSubDir_ {false}
privateinherited

Definition at line 23 of file FileDirGuard.h.

◆ test_

beast::unit_test::Suite& xrpl::detail::DirGuard::test_
protectedinherited

Definition at line 26 of file FileDirGuard.h.