mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-03 17:35:51 +00:00
New class TempDirectory in UnitTestUtilities.
This commit is contained in:
committed by
Vinnie Falco
parent
bffb5ef8b4
commit
bd12e2ab95
@@ -99,6 +99,31 @@ public:
|
||||
HeapBlock <char> data;
|
||||
};
|
||||
|
||||
class TempDirectory
|
||||
{
|
||||
public:
|
||||
explicit TempDirectory (std::string const& root)
|
||||
: directory (File::createTempFile (root))
|
||||
{
|
||||
}
|
||||
|
||||
~TempDirectory()
|
||||
{
|
||||
directory.deleteRecursively();
|
||||
}
|
||||
|
||||
String const& getFullPathName() const
|
||||
{
|
||||
return directory.getFullPathName();
|
||||
}
|
||||
|
||||
TempDirectory(const TempDirectory&) = delete;
|
||||
TempDirectory& operator=(const TempDirectory&) = delete;
|
||||
|
||||
private:
|
||||
File const directory;
|
||||
};
|
||||
|
||||
} // UnitTestUtilities
|
||||
} // beast
|
||||
|
||||
|
||||
Reference in New Issue
Block a user